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 HttpHeadersrequestHeaders()Return the requestHttpHeadersof the handshake ifProtocolEvent.isSuccess()returnstrue,nullotherwise.StringrequestUri()StringselectedSubprotocol()Return the selected sub-protocol of the handshake ifProtocolEvent.isSuccess()returnstrueand one was selected,nullotherwise.-
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- theWebSocketVersionthat 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 requestHttpHeadersof the handshake ifProtocolEvent.isSuccess()returnstrue,nullotherwise.- Returns:
- the headers.
-
selectedSubprotocol
public String selectedSubprotocol()
Return the selected sub-protocol of the handshake ifProtocolEvent.isSuccess()returnstrueand one was selected,nullotherwise.- Returns:
- the sub-protocol.
-
-