javax.net.websocket
Interface ServerConfiguration

All Superinterfaces:
EndpointConfiguration

public interface ServerConfiguration
extends EndpointConfiguration

The ServerConfiguration is a special kind of endpoint configuration object that contains web socket configuration information specific only to server endpoints.

Since:
DRAFT 001
Author:
dannycoward

Method Summary
 boolean checkOrigin(String originHeaderValue)
          Check the value of the Origin header (See definition) the client passed during the opening handshake.
 List<String> getNegotiatedExtensions(List<String> requestedExtensions)
          Return the ordered list of extensions that this server will support given the requested extension list passed in.
 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)
          Answers whether the current configuration matches the given URI.
 void modifyHandshake(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 interface javax.net.websocket.EndpointConfiguration
getDecoders, getEncoders, getPath
 

Method Detail

getNegotiatedSubprotocol

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. See Sending the Server's Opening Handshake

Parameters:
clientSubprotocolList -
Returns:

getNegotiatedExtensions

List<String> getNegotiatedExtensions(List<String> requestedExtensions)
Return the ordered list of extensions that this server will support given the requested extension list passed in. See Negotiating Extensions

Parameters:
extensions -
Returns:

checkOrigin

boolean checkOrigin(String originHeaderValue)
Check the value of the Origin header (See definition) the client passed during the opening handshake.

Parameters:
originHeaderValue -
Returns:

matchesURI

boolean matchesURI(URI uri)
Answers whether the current configuration matches the given URI.

Parameters:
uri -
Returns:

modifyHandshake

void modifyHandshake(HandshakeRequest request,
                     HandshakeResponse response)
Called by the container after it has formulated a handshake response resulting from a well-formed handshake request. The container has already has already checked that this configuration has a matching URI, determined the validity of the origin using the checkOrigin method, and filled out the negotiated subprotocols and extensions based on this configuration. Custom configurations may override this method in order to inspect the request parameters and modify the handshake response. and the URI checking also.

Parameters:
headers -
principal -
requestURI -


Copyright © 2012. All Rights Reserved.