public class DefaultWebSocketHandshaker extends Object implements WebSocketHandshaker
WebSocketHandshaker.| Constructor and Description |
|---|
DefaultWebSocketHandshaker(io.netty.channel.ChannelHandlerContext ctx,
ServerConnectorFuture connectorFuture,
io.netty.handler.codec.http.FullHttpRequest httpRequest) |
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.ChannelFuture |
cancelHandshake(int statusCode,
String closeReason)
Cancel the handshake with HTTP response.
|
String |
getChannelId()
Retrieve the Channel ID of the connection.
|
HttpCarbonRequest |
getHttpCarbonRequest()
Get the HttpCarbonRequest received from the client to perform the handshake.
|
String |
getTarget()
Retrieve the target of the application as a String.
|
WebSocketConnection |
getWebSocketConnection()
Retrieve the session of the connection.
|
ServerHandshakeFuture |
handshake()
Complete the handshake of a given request.
|
ServerHandshakeFuture |
handshake(String[] subProtocols)
Complete the handshake of a given request.
|
ServerHandshakeFuture |
handshake(String[] subProtocols,
int idleTimeout)
Complete the handshake of a given request.
|
ServerHandshakeFuture |
handshake(String[] subProtocols,
int idleTimeout,
io.netty.handler.codec.http.HttpHeaders responseHeaders)
Complete the handshake of a given request.
|
ServerHandshakeFuture |
handshake(String[] subProtocols,
int idleTimeout,
io.netty.handler.codec.http.HttpHeaders responseHeaders,
int maxFramePayloadLength)
Complete the handshake of a given request.
|
boolean |
isCancelled()
Check whether the handshake is cancelled in someplace or not.
|
boolean |
isHandshakeStarted()
Check whether the handshake has been started or not.
|
boolean |
isSecure()
Check whether the connection is secure or not.
|
boolean |
isServerMessage()
Check whether the message is coming from server connector or client connector.
|
void |
setHttpCarbonRequest(HttpCarbonRequest request) |
public DefaultWebSocketHandshaker(io.netty.channel.ChannelHandlerContext ctx,
ServerConnectorFuture connectorFuture,
io.netty.handler.codec.http.FullHttpRequest httpRequest)
public String getTarget()
WebSocketMessagegetTarget in interface WebSocketMessagepublic ServerHandshakeFuture handshake()
WebSocketHandshakerhandshake in interface WebSocketHandshakerpublic ServerHandshakeFuture handshake(String[] subProtocols)
WebSocketHandshakerhandshake in interface WebSocketHandshakersubProtocols - Sub-Protocols which are allowed by the service.public ServerHandshakeFuture handshake(String[] subProtocols, int idleTimeout)
WebSocketHandshakerhandshake in interface WebSocketHandshakersubProtocols - Sub-Protocols which are allowed by the service.idleTimeout - Idle timeout in milli-seconds for WebSocket connection.public ServerHandshakeFuture handshake(String[] subProtocols, int idleTimeout, io.netty.handler.codec.http.HttpHeaders responseHeaders)
WebSocketHandshakerhandshake in interface WebSocketHandshakersubProtocols - Sub-Protocols which are allowed by the service.idleTimeout - Idle timeout in milli-seconds for WebSocket connection.responseHeaders - Extra headers to add to the handshake response or null if no extra headers should
be addedpublic ServerHandshakeFuture handshake(String[] subProtocols, int idleTimeout, io.netty.handler.codec.http.HttpHeaders responseHeaders, int maxFramePayloadLength)
WebSocketHandshakerhandshake in interface WebSocketHandshakersubProtocols - Sub-Protocols which are allowed by the service.idleTimeout - Idle timeout in milli-seconds for WebSocket connection.responseHeaders - Extra headers to add to the handshake response or null if no extra
headers should
be added.maxFramePayloadLength - Maximum allowable frame payload length. Setting this value to your application's
requirement may reduce denial of service attacks using long data frames.public io.netty.channel.ChannelFuture cancelHandshake(int statusCode,
String closeReason)
WebSocketHandshakercancelHandshake in interface WebSocketHandshakerstatusCode - close code for cancelling the handshake.closeReason - reason for canceling the handshake.public boolean isCancelled()
WebSocketHandshakerisCancelled in interface WebSocketHandshakerpublic boolean isHandshakeStarted()
WebSocketHandshakerisHandshakeStarted in interface WebSocketHandshakerpublic boolean isSecure()
WebSocketHandshakerisSecure in interface WebSocketHandshakerpublic boolean isServerMessage()
WebSocketMessageisServerMessage in interface WebSocketMessagepublic WebSocketConnection getWebSocketConnection()
WebSocketMessagegetWebSocketConnection in interface WebSocketMessagepublic String getChannelId()
WebSocketHandshakergetChannelId in interface WebSocketHandshakerpublic HttpCarbonRequest getHttpCarbonRequest()
WebSocketHandshakergetHttpCarbonRequest in interface WebSocketHandshakerpublic void setHttpCarbonRequest(HttpCarbonRequest request)
Copyright © 2022 WSO2. All rights reserved.