javax.websocket
Interface ClientEndpointConfiguration

All Superinterfaces:
EndpointConfiguration
All Known Implementing Classes:
DefaultClientConfiguration

public interface ClientEndpointConfiguration
extends EndpointConfiguration

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

Since:
DRAFT 001
Author:
dannycoward

Method Summary
 void afterResponse(HandshakeResponse hr)
          This method is called by the implementation after it has received a handshake response from the server as a result of a handshake interaction it initiated.
 void beforeRequest(Map<String,List<String>> headers)
          This method is called by the implementation after it has formulated the handshake request that will be used to initiate the connection to the server, but before it has sent any part of the request.
 List<Extension> getExtensions()
          Return the list of all the extensions that this client supports, the empty list if there are none.
 List<String> getPreferredSubprotocols()
          The ordered list of sub protocols a client endpoint would like to use, the empty list if there are none.
 
Methods inherited from interface javax.websocket.EndpointConfiguration
getDecoders, getEncoders
 

Method Detail

getPreferredSubprotocols

List<String> getPreferredSubprotocols()
The ordered list of sub protocols a client endpoint would like to use, the empty list if there are none. This list is used to generate the Sec-WebSocket-Protocol header in the opening handshake for clients using this configuration. The first protocol name is the most preferred. See Client Opening Handshake.

Returns:
a list of the preferred subprotocols.

getExtensions

List<Extension> getExtensions()
Return the list of all the extensions that this client supports, the empty list if there are none. These are the extensions that will be used to populate the Sec-WebSocket-Extensions header in the opening handshake for clients using this configuration. The first extension in the list is the most preferred extension. See Negotiating Extensions.

Returns:
the list of extensions.

beforeRequest

void beforeRequest(Map<String,List<String>> headers)
This method is called by the implementation after it has formulated the handshake request that will be used to initiate the connection to the server, but before it has sent any part of the request. This allows the developer to inspect and modify the handshake request headers prior to the start of the handshake interaction.

Parameters:
headers - the mutable map of handshake request headers the implementation is about to send to start the handshake interaction.

afterResponse

void afterResponse(HandshakeResponse hr)
This method is called by the implementation after it has received a handshake response from the server as a result of a handshake interaction it initiated. The developer may implement this method in order to inspect the returning handshake response.

Parameters:
hr - the handshake response sent by the server.



Copyright © 2012-2013 Oracle and/or its affiliates. All rights reserved.