Module io.netty5.codec.http
Class WebSocketServerHandshakeCompletionEvent
- java.lang.Object
-
- io.netty5.handler.codec.http.websocketx.WebSocketHandshakeCompletionEvent
-
- io.netty5.handler.codec.http.websocketx.WebSocketServerHandshakeCompletionEvent
-
- All Implemented Interfaces:
ProtocolEvent
public final class WebSocketServerHandshakeCompletionEvent extends WebSocketHandshakeCompletionEvent
A websocket handshake was completed on the server-side.
-
-
Constructor Summary
Constructors Constructor Description WebSocketServerHandshakeCompletionEvent(WebSocketVersion version, String requestUri, HttpHeaders requestHeaders, String selectedSubprotocol)
Create a new event that indicate a successful websocket handshake.WebSocketServerHandshakeCompletionEvent(Throwable cause)
Create a new event that indicate a failed websocket handshake.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpHeaders
requestHeaders()
Return the requestHttpHeaders
of the handshake ifProtocolEvent.isSuccess()
returnstrue
,null
otherwise.String
requestUri()
String
selectedSubprotocol()
Return the selected sub-protocol of the handshake ifProtocolEvent.isSuccess()
returnstrue
and one was selected,null
otherwise.-
Methods inherited from class io.netty5.handler.codec.http.websocketx.WebSocketHandshakeCompletionEvent
cause, toString, version
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.handler.codec.ProtocolEvent
isFailed, isSuccess
-
-
-
-
Constructor Detail
-
WebSocketServerHandshakeCompletionEvent
public WebSocketServerHandshakeCompletionEvent(WebSocketVersion version, String requestUri, HttpHeaders requestHeaders, String selectedSubprotocol)
Create a new event that indicate a successful websocket handshake.- Parameters:
version
- theWebSocketVersion
that was used.requestUri
- the URI of the request.requestHeaders
- the headers of the upgrade request.selectedSubprotocol
- the selected sub-protocol, if any.
-
WebSocketServerHandshakeCompletionEvent
public WebSocketServerHandshakeCompletionEvent(Throwable cause)
Create a new event that indicate a failed websocket handshake.- Parameters:
cause
- the cause of the failure.
-
-
Method Detail
-
requestUri
public String requestUri()
- Returns:
- the uri.
-
requestHeaders
public HttpHeaders requestHeaders()
Return the requestHttpHeaders
of the handshake ifProtocolEvent.isSuccess()
returnstrue
,null
otherwise.- Returns:
- the headers.
-
selectedSubprotocol
public String selectedSubprotocol()
Return the selected sub-protocol of the handshake ifProtocolEvent.isSuccess()
returnstrue
and one was selected,null
otherwise.- Returns:
- the sub-protocol.
-
-