public class WebSocketUpgradeHandler extends 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(List<WebSocketListener> listeners) |
Modifier and Type | Method and Description |
---|---|
AsyncHandler.State |
onBodyPartReceived(HttpResponseBodyPart bodyPart)
Invoked as soon as some response body part are received.
|
NettyWebSocket |
onCompleted()
Invoked once the HTTP response processing is finished.
|
AsyncHandler.State |
onHeadersReceived(HttpResponseHeaders headers)
Invoked as soon as the HTTP headers has been received.
|
void |
onOpen() |
AsyncHandler.State |
onStatusReceived(HttpResponseStatus responseStatus)
Invoked as soon as the HTTP status line has been received
|
void |
onThrowable(Throwable t)
Invoked when an unexpected exception occurs during the processing of the response.
|
void |
setWebSocket(NettyWebSocket webSocket) |
public WebSocketUpgradeHandler(List<WebSocketListener> listeners)
public final AsyncHandler.State onStatusReceived(HttpResponseStatus responseStatus) throws 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.Exception
- if something wrong happenspublic final AsyncHandler.State onHeadersReceived(HttpResponseHeaders headers) throws Exception
AsyncHandler
onHeadersReceived
in interface AsyncHandler<NettyWebSocket>
headers
- the HTTP headers.AsyncHandler.State
telling to CONTINUE or ABORT the current processing.Exception
- if something wrong happenspublic final AsyncHandler.State onBodyPartReceived(HttpResponseBodyPart bodyPart) throws 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.Exception
- if something wrong happenspublic final NettyWebSocket onCompleted() throws Exception
AsyncHandler
onCompleted
in interface AsyncHandler<NettyWebSocket>
Future
Exception
- if something wrong happenspublic final void onThrowable(Throwable t)
AsyncHandler
onThrowable
in interface AsyncHandler<NettyWebSocket>
t
- a Throwable
public final void setWebSocket(NettyWebSocket webSocket)
public final void onOpen()
Copyright © 2017. All Rights Reserved.