|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.websocket.server.DefaultServerConfiguration
public class DefaultServerConfiguration
The DefaultServerConfiguration is a concrete class that embodies all the configuration parameters for an endpoint that is to be published as a server endpoint. Developers may subclass this class in order to override the configuration behavior.
Constructor Summary | |
---|---|
DefaultServerConfiguration(Class<? extends Endpoint> endpointClass,
String path)
Creates a server configuration with the given path |
Method Summary | |
---|---|
boolean |
checkOrigin(String originHeaderValue)
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. |
List<Decoder> |
getDecoders()
Return the Decoder implementations configured. |
List<Encoder> |
getEncoders()
Return the Encoder implementations configured. |
Class<?> |
getEndpointClass()
Returns the class of the Endpoint that this configuration configures. |
List<Extension> |
getNegotiatedExtensions(List<Extension> requestedExtensions)
Provides a simple algorithm to return the list of extensions this server will use for the web socket session: the configuration 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. |
String |
getNegotiatedSubprotocol(List<String> requestedSubprotocols)
The default implementation of this method returns, the first subprotocol in the list sent by the client that the server supports, or null if there isn't one none. |
String |
getPath()
Return the path of this server configuration. |
boolean |
matchesURI(URI uri)
This default implementation matches the incoming path to the configuration's URI or URI template if and only if it is an exact match in the case the configuration is a URI, and if and only if it is a valid expansion of the configuration URI template, in the case where the configuration is a URI template. |
void |
modifyHandshake(HandshakeRequest request,
HandshakeResponse response)
The default server configuration does not make any changes to the response. |
DefaultServerConfiguration |
setDecoders(List<Decoder> decoders)
Sets all the decoders that this configuration will support. |
DefaultServerConfiguration |
setEncoders(List<Encoder> encoders)
Sets all the encoders that this configuration will support. |
DefaultServerConfiguration |
setExtensions(List<Extension> extensions)
Sets all the extensions that this configuration will support. |
DefaultServerConfiguration |
setSubprotocols(List<String> subprotocols)
Sets all the subprotocols that this configuration will support. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultServerConfiguration(Class<? extends Endpoint> endpointClass, String path)
path
- the URI or URI template.Method Detail |
---|
public Class<?> getEndpointClass()
getEndpointClass
in interface ServerEndpointConfiguration
public DefaultServerConfiguration setEncoders(List<Encoder> encoders)
encoders
- the encoders supported, may not be null.
public DefaultServerConfiguration setDecoders(List<Decoder> decoders)
decoders
- the encoders supported, may not be null.
public DefaultServerConfiguration setSubprotocols(List<String> subprotocols)
subprotocols
- the encoders supported, may not be null.
public DefaultServerConfiguration setExtensions(List<Extension> extensions)
extensions
- the encoders supported, may not be null.
public List<Encoder> getEncoders()
getEncoders
in interface EndpointConfiguration
public List<Decoder> getDecoders()
getDecoders
in interface EndpointConfiguration
public String getPath()
getPath
in interface ServerEndpointConfiguration
public String getNegotiatedSubprotocol(List<String> requestedSubprotocols)
getNegotiatedSubprotocol
in interface ServerEndpointConfiguration
requestedSubprotocols
- the list of requested subprotocols.
public List<Extension> getNegotiatedExtensions(List<Extension> requestedExtensions)
getNegotiatedExtensions
in interface ServerEndpointConfiguration
requestedExtensions
- the list of extensions requested by the client
public boolean checkOrigin(String originHeaderValue)
checkOrigin
in interface ServerEndpointConfiguration
originHeaderValue
- The value of the Origin header.
public boolean matchesURI(URI uri)
matchesURI
in interface ServerEndpointConfiguration
uri
- the URL of the incoming request
public void modifyHandshake(HandshakeRequest request, HandshakeResponse response)
modifyHandshake
in interface ServerEndpointConfiguration
request
- the handshake request from the clientresponse
- the handshake response formulated by the container.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |