ClientEndpointConfig.Builder. Developers can override some
of the configuration operations by providing an implementation of
ClientEndpointConfig.Configurator.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ClientEndpointConfig.Builder
The ClientEndpointConfig.Builder is a class used for creating
|
| public static class | ClientEndpointConfig.Configurator
The Configurator class may be extended by developers who want to provide custom configuration algorithms, such as intercepting the opening handshake, or providing arbitrary methods and algorithms that can be accessed from each endpoint instance configured with this configurator. |
| Modifier and Type | Method and Description |
|---|---|
| public ClientEndpointConfig. | Returns: the configurator in use with this configuration.Return the custom configurator for this configuration. |
| public List | Returns: the list of extensions, the empty list if there are none.Return the extensions, in order of preference, favorite first, that this client would like to use for its sessions. |
| public List | Returns: the list of the preferred subprotocols, the empty list if there are noneReturn the ordered list of sub protocols a client endpoint would like to use, in order of preference, favorite first that this client would like to use for its sessions. |
| getConfigurator | back to summary |
|---|---|
| public ClientEndpointConfig. Return the custom configurator for this configuration. If the developer did not provide one, the platform default configurator is returned.
| |
| getExtensions | back to summary |
|---|---|
| public List Return the extensions, in order of preference, favorite first, that this client would like to use for its sessions. 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. | |
| getPreferredSubprotocols | back to summary |
|---|---|
| public List Return the ordered list of sub protocols a client endpoint would like to use, in order of preference, favorite first that this client would like to use for its sessions. 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. | |
ClientEndpointConfig objects for the purposes of
deploying a client endpoint.
Here are some examples:
Building a plain configuration with no encoders, decoders, subprotocols or extensions.
ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build();
Building a configuration with no subprotocols and a custom configurator.
ClientEndpointConfig customCec = ClientEndpointConfig.Builder.create()
.preferredSubprotocols(mySubprotocols)
.configurator(new MyClientConfigurator())
.build();
| Modifier and Type | Field and Description |
|---|---|
| private ClientEndpointConfig. | |
| private List | |
| private List | |
| private List | |
| private List |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ClientEndpointConfig | Returns: a new configuration object.Builds a configuration object using the attributes set on this builder. |
| public ClientEndpointConfig. | Returns: the builder instancethe configurator clientEndpointConfiguratorSets the configurator object for the configuration this builder will build. |
| public static ClientEndpointConfig. | Returns: a new builder object.Creates a new builder object with no subprotocols, extensions, encoders,
decoders and a |
| public ClientEndpointConfig. | |
| public ClientEndpointConfig. | |
| public ClientEndpointConfig. | Returns: the builder instancethe extensions extensions)Set the extensions for the configuration this builder will build. |
| public ClientEndpointConfig. | Returns: the builder instancethe preferred subprotocol names. preferredSubprotocols)Set the preferred sub protocols for the configuration this builder will build. |
| clientEndpointConfigurator | back to summary |
|---|---|
| private ClientEndpointConfig. | |
| decoders | back to summary |
|---|---|
| private List<Class<? extends Decoder>> decoders | |
| encoders | back to summary |
|---|---|
| private List<Class<? extends Encoder>> encoders | |
| extensions | back to summary |
|---|---|
| private List<Extension> extensions | |
| preferredSubprotocols | back to summary |
|---|---|
| private List<String> preferredSubprotocols | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public ClientEndpointConfig build() Builds a configuration object using the attributes set on this builder.
| |
| configurator | back to summary |
|---|---|
| public ClientEndpointConfig. Sets the configurator object for the configuration this builder will build.
| |
| create | back to summary |
|---|---|
| public static ClientEndpointConfig. Creates a new builder object with no subprotocols, extensions, encoders,
decoders and a
| |
| decoders | back to summary |
|---|---|
| public ClientEndpointConfig. Assign the list of decoder implementation classes the client will use.
| |
| encoders | back to summary |
|---|---|
| public ClientEndpointConfig. Assign the list of encoder implementation classes the client will use.
| |
| extensions | back to summary |
|---|---|
| public ClientEndpointConfig. Set the extensions for the configuration this builder will build. The list is treated in order of preference, favorite first, that the client would like to use for its sessions.
| |
| preferredSubprotocols | back to summary |
|---|---|
| public ClientEndpointConfig. Set the preferred sub protocols for the configuration this builder will build. The list is treated in order of preference, favorite first, that this client would like to use for its sessions.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterResponse(HandshakeResponse
the handshake response sent by the server. 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. |
| public void | beforeRequest(Map<String, List<String>>
the mutable map of handshake request headers the implementation is about to send to
start the handshake interaction. 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. |
| Configurator | back to summary |
|---|---|
| public Configurator() | |
| afterResponse | back to summary |
|---|---|
| public 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.
| |
| beforeRequest | back to summary |
|---|---|
| public 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. | |