javax.websocket
Class DefaultClientConfiguration

java.lang.Object
  extended by javax.websocket.DefaultClientConfiguration
All Implemented Interfaces:
ClientEndpointConfiguration, EndpointConfiguration

public class DefaultClientConfiguration
extends Object
implements ClientEndpointConfiguration

The DefaultClientConfiguration is a concrete implementation of a client configuration. Developers may subclass this class in order to provide their own custom configuration behaviors.

Author:
dannycoward

Constructor Summary
DefaultClientConfiguration()
          Creates a client configuration with no preferred sub protocols, extensions, decoders or encoders.
 
Method Summary
 void afterResponse(HandshakeResponse hr)
          The default implementation of this method performs no actions on the HandshakeResponse.
 void beforeRequest(Map<String,List<String>> hr)
          The default implementation of this method performs no actions on the HandshakeRequest headers.
 List<Decoder> getDecoders()
          Return the (unmodifiable) list of decoders this client will use.
 List<Encoder> getEncoders()
          Return the (unmodifiable) list of encoders this client will use.
 List<Extension> getExtensions()
          Return the extensions, in order of preference, favorite first, that this client would like to use for its sessions.
 List<String> getPreferredSubprotocols()
          Return the protocols, in order of preference, favorite first, that this client would like to use for its sessions.
 DefaultClientConfiguration setDecoders(List<Decoder> decoders)
          Assign the list of decoders this client will use.
 DefaultClientConfiguration setEncoders(List<Encoder> encoders)
          Assign the list of encoders this client will use.
 DefaultClientConfiguration setExtensions(List<Extension> extensions)
          Assign the List of preferred extensions that this client would like to use.
 DefaultClientConfiguration setPreferredSubprotocols(List<String> preferredSubprotocols)
          Assign the List of preferred subprotocols that this client would like to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClientConfiguration

public DefaultClientConfiguration()
Creates a client configuration with no preferred sub protocols, extensions, decoders or encoders.

Method Detail

getPreferredSubprotocols

public List<String> getPreferredSubprotocols()
Return the protocols, in order of preference, favorite first, that this client would like to use for its sessions.

Specified by:
getPreferredSubprotocols in interface ClientEndpointConfiguration
Returns:
the preferred subprotocols.

setPreferredSubprotocols

public DefaultClientConfiguration setPreferredSubprotocols(List<String> preferredSubprotocols)
Assign the List of preferred subprotocols that this client would like to use.

Parameters:
preferredSubprotocols - the preferred subprotocols.
Returns:
this endpoint configuration.

getExtensions

public List<Extension> getExtensions()
Return the extensions, in order of preference, favorite first, that this client would like to use for its sessions.

Specified by:
getExtensions in interface ClientEndpointConfiguration
Returns:
the (unmodifiable) extension list.

setExtensions

public DefaultClientConfiguration setExtensions(List<Extension> extensions)
Assign the List of preferred extensions that this client would like to use.

Parameters:
extensions - the extensions, cannot be null.
Returns:
this endpoint configuration.

getEncoders

public List<Encoder> getEncoders()
Return the (unmodifiable) list of encoders this client will use.

Specified by:
getEncoders in interface EndpointConfiguration
Returns:
the encoder list.

setEncoders

public DefaultClientConfiguration setEncoders(List<Encoder> encoders)
Assign the list of encoders this client will use.

Parameters:
encoders - the encoders to use, cannot be null.
Returns:
this endpoint configuration.

getDecoders

public List<Decoder> getDecoders()
Return the (unmodifiable) list of decoders this client will use.

Specified by:
getDecoders in interface EndpointConfiguration
Returns:
the decoders to use.

setDecoders

public DefaultClientConfiguration setDecoders(List<Decoder> decoders)
Assign the list of decoders this client will use.

Parameters:
decoders - the extensions, cannot be null.
Returns:
this endpoint configuration.

beforeRequest

public void beforeRequest(Map<String,List<String>> hr)
The default implementation of this method performs no actions on the HandshakeRequest headers.

Specified by:
beforeRequest in interface ClientEndpointConfiguration
Parameters:
hr - handshake request the implementation has formulated.

afterResponse

public void afterResponse(HandshakeResponse hr)
The default implementation of this method performs no actions on the HandshakeResponse.

Specified by:
afterResponse in interface ClientEndpointConfiguration
Parameters:
hr - the handshake response sent by the server.



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