public class WebSocketUpgradeHandler extends java.lang.Object implements AsyncHandler<NettyWebSocket>
AsyncHandler
which is able to execute WebSocket upgrade. Use the Builder for configuring WebSocket options.Modifier and Type | Class and Description |
---|---|
static class |
WebSocketUpgradeHandler.Builder
Build a
WebSocketUpgradeHandler |
AsyncHandler.State
Constructor and Description |
---|
WebSocketUpgradeHandler(java.util.List<WebSocketListener> listeners) |
Modifier and Type | Method and Description |
---|---|
AsyncHandler.State |
onBodyPartReceived(HttpResponseBodyPart bodyPart)
Invoked as soon as some response body part are received.
|
protected void |
onBodyPartReceived0(HttpResponseBodyPart bodyPart) |
NettyWebSocket |
onCompleted()
Invoked once the HTTP response processing is finished.
|
protected void |
onCompleted0() |
AsyncHandler.State |
onHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers)
Invoked as soon as the HTTP headers have been received.
|
protected void |
onHeadersReceived0(io.netty.handler.codec.http.HttpHeaders headers) |
void |
onOpen() |
protected void |
onOpen0() |
AsyncHandler.State |
onStatusReceived(HttpResponseStatus responseStatus)
Invoked as soon as the HTTP status line has been received
|
protected void |
onStatusReceived0(HttpResponseStatus responseStatus) |
void |
onThrowable(java.lang.Throwable t)
Invoked when an unexpected exception occurs during the processing of the response.
|
protected void |
onThrowable0(java.lang.Throwable t) |
void |
setWebSocket(NettyWebSocket webSocket) |
protected void |
setWebSocket0(NettyWebSocket webSocket) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onConnectionOffer, onConnectionPoolAttempt, onConnectionPooled, onHostnameResolutionAttempt, onHostnameResolutionFailure, onHostnameResolutionSuccess, onRequestSend, onRetry, onTcpConnectAttempt, onTcpConnectFailure, onTcpConnectSuccess, onTlsHandshakeAttempt, onTlsHandshakeFailure, onTlsHandshakeSuccess, onTrailingHeadersReceived
public WebSocketUpgradeHandler(java.util.List<WebSocketListener> listeners)
protected void setWebSocket0(NettyWebSocket webSocket)
protected void onStatusReceived0(HttpResponseStatus responseStatus) throws java.lang.Exception
java.lang.Exception
protected void onHeadersReceived0(io.netty.handler.codec.http.HttpHeaders headers) throws java.lang.Exception
java.lang.Exception
protected void onBodyPartReceived0(HttpResponseBodyPart bodyPart) throws java.lang.Exception
java.lang.Exception
protected void onCompleted0() throws java.lang.Exception
java.lang.Exception
protected void onThrowable0(java.lang.Throwable t)
protected void onOpen0()
public final AsyncHandler.State onStatusReceived(HttpResponseStatus responseStatus) throws java.lang.Exception
AsyncHandler
onStatusReceived
in interface AsyncHandler<NettyWebSocket>
responseStatus
- the status code and test of the responseAsyncHandler.State
telling to CONTINUE or ABORT the current processing.java.lang.Exception
- if something wrong happenspublic final AsyncHandler.State onHeadersReceived(io.netty.handler.codec.http.HttpHeaders headers) throws java.lang.Exception
AsyncHandler
onHeadersReceived
in interface AsyncHandler<NettyWebSocket>
headers
- the HTTP headers.AsyncHandler.State
telling to CONTINUE or ABORT the current processing.java.lang.Exception
- if something wrong happenspublic final AsyncHandler.State onBodyPartReceived(HttpResponseBodyPart bodyPart) throws java.lang.Exception
AsyncHandler
onBodyPartReceived
in interface AsyncHandler<NettyWebSocket>
bodyPart
- response's body part.AsyncHandler.State
telling to CONTINUE or ABORT the current processing. Aborting will also close the connection.java.lang.Exception
- if something wrong happenspublic final NettyWebSocket onCompleted() throws java.lang.Exception
AsyncHandler
onCompleted
in interface AsyncHandler<NettyWebSocket>
Future
java.lang.Exception
- if something wrong happenspublic final void onThrowable(java.lang.Throwable t)
AsyncHandler
onThrowable
in interface AsyncHandler<NettyWebSocket>
t
- a Throwable
public final void setWebSocket(NettyWebSocket webSocket)
public final void onOpen()
Copyright © 2019. All Rights Reserved.