|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.websocket.WebSocketUpgradeHandler
public class WebSocketUpgradeHandler
An AsyncHandler
which is able to execute WebSocket upgrade. Use the Builder for configuring WebSocket options.
Nested Class Summary | |
---|---|
static class |
WebSocketUpgradeHandler.Builder
Build a WebSocketUpgradeHandler |
Nested classes/interfaces inherited from interface com.ning.http.client.AsyncHandler |
---|
AsyncHandler.STATE |
Constructor Summary | |
---|---|
protected |
WebSocketUpgradeHandler(WebSocketUpgradeHandler.Builder b)
|
Method Summary | |
---|---|
AsyncHandler.STATE |
onBodyPartReceived(HttpResponseBodyPart bodyPart)
Invoked as soon as some response body part are received. |
void |
onClose(WebSocket webSocket,
int status,
String reasonPhrase)
|
WebSocket |
onCompleted()
Invoked once the HTTP response processing is finished. |
void |
onFailure(Throwable t)
If the upgrade fail. |
AsyncHandler.STATE |
onHeadersReceived(HttpResponseHeaders headers)
Invoked as soon as the HTTP headers has been received. |
AsyncHandler.STATE |
onStatusReceived(HttpResponseStatus responseStatus)
Invoked as soon as the HTTP status line has been received |
void |
onSuccess(WebSocket webSocket)
If the HTTP Upgrade succeed (response's status code equals 101), the AsyncHttpProvider will invoke that
method |
void |
onThrowable(Throwable t)
Invoked when an unexpected exception occurs during the processing of the response. |
void |
resetSuccess()
|
boolean |
touchSuccess()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected WebSocketUpgradeHandler(WebSocketUpgradeHandler.Builder b)
Method Detail |
---|
public void onThrowable(Throwable t)
onThrowable
in interface AsyncHandler<WebSocket>
t
- a Throwable
public boolean touchSuccess()
public void resetSuccess()
public AsyncHandler.STATE onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exception
onBodyPartReceived
in interface AsyncHandler<WebSocket>
bodyPart
- response's body part.
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic AsyncHandler.STATE onStatusReceived(HttpResponseStatus responseStatus) throws Exception
onStatusReceived
in interface AsyncHandler<WebSocket>
responseStatus
- the status code and test of the response
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic AsyncHandler.STATE onHeadersReceived(HttpResponseHeaders headers) throws Exception
onHeadersReceived
in interface AsyncHandler<WebSocket>
headers
- the HTTP headers.
AsyncHandler.STATE
telling to CONTINUE or ABORT the current processing.
Exception
- if something wrong happenspublic WebSocket onCompleted() throws Exception
onCompleted
in interface AsyncHandler<WebSocket>
Future
Exception
- if something wrong happenspublic void onSuccess(WebSocket webSocket)
AsyncHttpProvider
will invoke that
method
onSuccess
in interface UpgradeHandler<WebSocket>
webSocket
- an Upgradable entitypublic void onFailure(Throwable t)
onFailure
in interface UpgradeHandler<WebSocket>
t
- a Throwable
public void onClose(WebSocket webSocket, int status, String reasonPhrase)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |