javax.net.websocket
Interface ServerEndpointConfiguration

All Superinterfaces:
EndpointConfiguration
All Known Implementing Classes:
DefaultServerConfiguration, DefaultServerEndpointConfiguration

public interface ServerEndpointConfiguration
extends EndpointConfiguration

The ServerEndpointConfiguration 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)
          http://java.net/jira/browse/WEBSOCKET_SPEC-45 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:
requestedSubprotocols - the requested subprotocols.
Returns:
the negotiated subprotocol.

getNegotiatedExtensions

List<String> getNegotiatedExtensions(List<String> requestedExtensions)
http://java.net/jira/browse/WEBSOCKET_SPEC-45 Return the ordered list of extensions that this server will support given the requested extension list passed in. See Negotiating Extensions

Parameters:
requestedExtensions - the requested extentions, in order.
Returns:

checkOrigin

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

Parameters:
originHeaderValue - the value of the origin header.
Returns:

matchesURI

boolean matchesURI(URI uri)
Answers whether the current configuration matches the given URI. This method may be overridden by implementations with any number of algorithms for determining a match.

Parameters:
uri - the uri of the incoming handshake.
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:
request - the opening handshake request.
response - the proposed opening handshake response


Copyright © 2012. All Rights Reserved.