public abstract class SPIEndpoint extends Object
| Constructor and Description |
|---|
SPIEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
checkHandshake(SPIHandshakeRequest hr)
This method must be called by the provider during
its check for a successful websocket handshake.
|
abstract javax.websocket.Session |
createSessionForRemoteEndpoint(SPIRemoteEndpoint re,
String subprotocol,
List<javax.websocket.Extension> extensions)
Creates a Session based on the
SPIRemoteEndpoint, subprotocols and extensions. |
abstract javax.websocket.EndpointConfig |
getEndpointConfig()
Get Endpoint configuration.
|
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 void |
onClose(SPIRemoteEndpoint 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(SPIRemoteEndpoint gs,
String subprotocol,
List<javax.websocket.Extension> extensions)
Called by the provider when the web socket connection
is established.
|
abstract void |
onMessage(SPIRemoteEndpoint 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(SPIRemoteEndpoint 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(SPIRemoteEndpoint 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(SPIRemoteEndpoint 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(SPIRemoteEndpoint 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(SPIRemoteEndpoint gs,
ByteBuffer bytes)
Called by the provider when the web socket connection
has an incoming pong message from the given remote endpoint.
|
abstract void |
remove()
Called by the provider after all connections have been closed to
this endpoint, and after the endpoint has been removed from service.
|
public abstract boolean checkHandshake(SPIHandshakeRequest hr)
hr - SPIHandshakeRequest that is going to be checked.true if handshake is successful false otherwise.public abstract void onConnect(SPIRemoteEndpoint gs, String subprotocol, List<javax.websocket.Extension> extensions)
gs - SPIRemoteEndpoint who has just connected to this web socket endpoint.public abstract void onMessage(SPIRemoteEndpoint gs, String messageString)
gs - SPIRemoteEndpoint who sent the message.messageString - the String message.public abstract void onPartialMessage(SPIRemoteEndpoint 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(SPIRemoteEndpoint 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(SPIRemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onPong(SPIRemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onPing(SPIRemoteEndpoint gs, ByteBuffer bytes)
gs - SPIRemoteEndpoint who sent the message.bytes - the message.public abstract void onClose(SPIRemoteEndpoint gs, javax.websocket.CloseReason closeReason)
gs - SPIRemoteEndpoint who has just closed the connection.public abstract void remove()
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(SPIRemoteEndpoint re, String subprotocol, List<javax.websocket.Extension> extensions)
SPIRemoteEndpoint, 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()
Copyright © 2012-2013. All Rights Reserved.