|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.websocket.server.ServerEndpointConfig.Configurator
public abstract static class ServerEndpointConfig.Configurator
The ServerEndpointConfig.Configurator interface may be implemented by developers who want to provide custom configuration algorithms, such as intercepting the opening handshake, or providing arbitrary methods and algorithms that can be accessed from each endpoint instance configured with this configurator. The implementation must provide a platform default configurator loading using the service loader.
Constructor Summary | |
---|---|
ServerEndpointConfig.Configurator()
|
Method Summary | ||
---|---|---|
boolean |
checkOrigin(String originHeaderValue)
Check the value of the Origin header (See Origin Header) the client passed during the opening handshake. |
|
|
getEndpointInstance(Class<T> endpointClass)
This method is called by the container each time a new client connects to the logical endpoint this configurator configures. |
|
List<Extension> |
getNegotiatedExtensions(List<Extension> installed,
List<Extension> requested)
Return the ordered list of extensions that t server endpoint will support given the requested extension list passed in, the empty list if none. |
|
String |
getNegotiatedSubprotocol(List<String> supported,
List<String> requested)
Return the subprotocol the server endpoint has chosen from the requested list supplied by a client who wishes to connect, or none if there wasn't one this server endpoint liked. |
|
void |
modifyHandshake(ServerEndpointConfig sec,
HandshakeRequest request,
HandshakeResponse response)
Called by the container after it has formulated a handshake response resulting from a well-formed handshake request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerEndpointConfig.Configurator()
Method Detail |
---|
public String getNegotiatedSubprotocol(List<String> supported, List<String> requested)
The default platform implementation of this method returns the first subprotocol in the list sent by the client that the server supports, or the empty string if there isn't one.
requested
- the requested subprotocols from the client endpointsupported
- the subprotocols supported by the server endpoint
public List<Extension> getNegotiatedExtensions(List<Extension> installed, List<Extension> requested)
The default platform implementation of this method returns a list containing all of the requested extensions passed to this method that it supports, using the order in the requested extensions, the empty list if none.
installed
- the installed extensions on the implementation.requested
- the requested extensions, in the order they were
requested by the client
public boolean checkOrigin(String originHeaderValue)
The platform default implementation of this method makes a check of the validity of the Origin header sent along with the opening handshake following the recommendation at: Sending the Server's Opening Handshake.
originHeaderValue
- the value of the origin header passed
by the client.
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response)
If the developer does not override this method, no further modification of the request and response are made by the implementation.
request
- the opening handshake request.response
- the proposed opening handshake responsepublic <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException
T
- the type of the endpointendpointClass
- the class of the endpoint
InstantiationException
- if there was an error producing the
endpoint instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |