public abstract class EndpointWrapper extends Object
EndpointWrapper with its representation of
a websocket endpoint mapped to a base URI that wishes to handle incoming
messages.| Constructor and Description |
|---|
EndpointWrapper() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
checkHandshake(UpgradeRequest hr)
This method must be called by the provider during
its check for a successful websocket handshake.
|
abstract javax.websocket.Session |
createSessionForRemoteEndpoint(RemoteEndpoint re,
String subprotocol,
List<javax.websocket.Extension> extensions)
Creates a Session based on the
RemoteEndpoint, subprotocols and extensions. |
abstract javax.websocket.EndpointConfig |
getEndpointConfig()
Get Endpoint configuration.
|
abstract String |
getEndpointPath()
Get Endpoint absolute path.
|
abstract List<javax.websocket.Extension> |
getNegotiatedExtensions(List<javax.websocket.Extension> clientExtensions)
Get the negotiated extensions' names based on the extensions supported by client.
|
abstract String |
getNegotiatedProtocol(List<String> clientProtocols)
Compute the sub - protocol which will be used.
|
abstract Set<javax.websocket.Session> |
getOpenSessions()
Get the endpoint's open
Sessions. |
abstract javax.websocket.WebSocketContainer |
getWebSocketContainer()
Get
WebSocketContainer. |
abstract void |
onClose(RemoteEndpoint gs,
javax.websocket.CloseReason closeReason)
Called by the provider when the web socket connection
to the given remote endpoint has just closed.
|
abstract void |
onConnect(RemoteEndpoint gs,
String subprotocol,
List<javax.websocket.Extension> extensions)
Called by the provider when the web socket connection
is established.
|
abstract void |
onMessage(RemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection
has an incoming binary message from the given remote endpoint.
|
abstract void |
onMessage(RemoteEndpoint gs,
String messageString)
Called by the provider when the web socket connection
has an incoming text message from the given remote endpoint.
|
abstract void |
onPartialMessage(RemoteEndpoint gs,
ByteBuffer partialBytes,
boolean last)
Called by the provider when the web socket connection
has an incoming partial binary message from the given remote endpoint.
|
abstract void |
onPartialMessage(RemoteEndpoint gs,
String partialString,
boolean last)
Called by the provider when the web socket connection
has an incoming partial text message from the given remote endpoint.
|
abstract void |
onPing(RemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection
has an incoming ping message from the given remote endpoint.
|
abstract void |
onPong(RemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection
has an incoming pong message from the given remote endpoint.
|
public abstract boolean checkHandshake(UpgradeRequest hr)
hr - SPIHandshakeRequest that is going to be checked.true if handshake is successful false otherwise.public abstract void onConnect(RemoteEndpoint gs, String subprotocol, List<javax.websocket.Extension> extensions)
gs - SPIRemoteEndpoint who has just connected to this web socket endpoint.public abstract void onMessage(RemoteEndpoint gs, String messageString)
gs - SPIRemoteEndpoint who sent the message.messageString - the String message.public abstract void onPartialMessage(RemoteEndpoint gs, String partialString, boolean last)
gs - SPIRemoteEndpoint who sent the message.partialString - the String message.last - to indicate if this is the last partial string in the sequencepublic abstract void onPartialMessage(RemoteEndpoint gs, ByteBuffer partialBytes, boolean last)
gs - SPIRemoteEndpoint who sent the message.partialBytes - the piece of the binary message.last - to indicate if this is the last partial byte buffer in the sequencepublic abstract void onMessage(RemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onPong(RemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onPing(RemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onClose(RemoteEndpoint gs, javax.websocket.CloseReason closeReason)
gs - SPIRemoteEndpoint who has just closed the connection.public abstract List<javax.websocket.Extension> getNegotiatedExtensions(List<javax.websocket.Extension> clientExtensions)
clientExtensions - names of the extensions' supported by client.public abstract String getNegotiatedProtocol(List<String> clientProtocols)
clientProtocols - sub - protocols supported by client.null if none found.public abstract Set<javax.websocket.Session> getOpenSessions()
Sessions.public abstract javax.websocket.Session createSessionForRemoteEndpoint(RemoteEndpoint re, String subprotocol, List<javax.websocket.Extension> extensions)
RemoteEndpoint, subprotocols and extensions.re - the other end of the connection.subprotocol - used.extensions - extensions used.Session representing the connection.public abstract javax.websocket.EndpointConfig getEndpointConfig()
public abstract String getEndpointPath()
public abstract javax.websocket.WebSocketContainer getWebSocketContainer()
WebSocketContainer.Copyright © 2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.