public class DefaultWebSocketClient extends FuturePromise<ClientUpgradeResponse> implements WebSocketClient
Promise.Adapter<C>
Constructor and Description |
---|
DefaultWebSocketClient(WebSocketClientFactory factory,
EventDriver websocket) |
Modifier and Type | Method and Description |
---|---|
Future<ClientUpgradeResponse> |
connect(URI websocketUri) |
void |
failed(Throwable cause)
Callback invoked when the operation fails.
|
protected ClientUpgradeRequest |
getClientUpgradeRequest() |
WebSocketConnection |
getConnection() |
WebSocketClientFactory |
getFactory() |
Masker |
getMasker() |
WebSocketPolicy |
getPolicy() |
ClientUpgradeRequest |
getUpgradeRequest() |
ClientUpgradeResponse |
getUpgradeResponse() |
EventDriver |
getWebSocket() |
URI |
getWebSocketUri() |
void |
setMasker(Masker masker) |
void |
setUpgradeResponse(ClientUpgradeResponse response) |
void |
succeeded(ClientUpgradeResponse response)
Callback invoked when the operation completes.
|
cancel, get, get, isCancelled, isDone, rethrow, toString
public DefaultWebSocketClient(WebSocketClientFactory factory, EventDriver websocket)
public Future<ClientUpgradeResponse> connect(URI websocketUri) throws IOException
connect
in interface WebSocketClient
IOException
public void failed(Throwable cause)
Promise
Callback invoked when the operation fails.
failed
in interface Promise<ClientUpgradeResponse>
failed
in class FuturePromise<ClientUpgradeResponse>
cause
- the reason for the operation failureprotected ClientUpgradeRequest getClientUpgradeRequest()
public WebSocketConnection getConnection()
public WebSocketClientFactory getFactory()
getFactory
in interface WebSocketClient
public Masker getMasker()
getMasker
in interface WebSocketClient
public WebSocketPolicy getPolicy()
getPolicy
in interface WebSocketClient
public ClientUpgradeRequest getUpgradeRequest()
getUpgradeRequest
in interface WebSocketClient
public ClientUpgradeResponse getUpgradeResponse()
getUpgradeResponse
in interface WebSocketClient
public EventDriver getWebSocket()
getWebSocket
in interface WebSocketClient
public URI getWebSocketUri()
getWebSocketUri
in interface WebSocketClient
public void setMasker(Masker masker)
setMasker
in interface WebSocketClient
public void setUpgradeResponse(ClientUpgradeResponse response)
public void succeeded(ClientUpgradeResponse response)
Promise
Callback invoked when the operation completes.
succeeded
in interface Promise<ClientUpgradeResponse>
succeeded
in class FuturePromise<ClientUpgradeResponse>
response
- the contextPromise.failed(Throwable)
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.