public class DefaultServerConfiguration extends Object implements ServerConfiguration
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultServerConfiguration()
For subclass implementations.
|
|
DefaultServerConfiguration(URI uri)
Creates a server configuration with the given URI.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkOrigin(String originHeaderValue)
Makes a check of the validity of the Origin header sent along with the opening
handshake.
|
List<Decoder> |
getDecoders()
Return the Decoder implementations configured.
|
List<Encoder> |
getEncoders()
Return the Decoder implementations configured.
|
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.
|
String |
getNegotiatedSubprotocol(List<String> requestedSubprotocols)
Return the subprotocol this 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.
|
boolean |
matchesURI(URI uri)
A URI is a match if and only if it is an exact match (.equals()) the URI used
to create this configuration.
|
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) |
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.
|
protected DefaultServerConfiguration()
public DefaultServerConfiguration(URI uri)
public DefaultServerConfiguration setEncoders(List<Encoder> encoders)
public DefaultServerConfiguration setDecoders(List<Decoder> decoders)
public DefaultServerConfiguration setSubprotocols(List<String> subprotocols)
public DefaultServerConfiguration setExtensions(List<Extension> extensions)
public List<Encoder> getEncoders()
getEncoders in interface EndpointConfigurationpublic List<Decoder> getDecoders()
getDecoders in interface EndpointConfigurationpublic String getNegotiatedSubprotocol(List<String> requestedSubprotocols)
getNegotiatedSubprotocol in interface ServerConfigurationclientSubprotocolList - public List<Extension> getNegotiatedExtensions(List<Extension> requestedExtensions)
getNegotiatedExtensions in interface ServerConfigurationrequestedExtensions - public boolean checkOrigin(String originHeaderValue)
checkOrigin in interface ServerConfigurationoriginHeaderValue - public boolean matchesURI(URI uri)
matchesURI in interface ServerConfigurationuri - public void modifyHandshake(HandshakeRequest request, HandshakeResponse response)
modifyHandshake in interface ServerConfigurationrequest - response -
Copyright © 2012 Oracle and/or its affiliates. All rights reserved.