public static final class ClientEndpointConfig.Builder
extends java.lang.Object
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 | Method and Description |
---|---|
ClientEndpointConfig |
build()
Builds a configuration object using the attributes set on this builder.
|
ClientEndpointConfig.Builder |
configurator(ClientEndpointConfig.Configurator clientEndpointConfigurator)
Sets the configurator object for the configuration this builder will build.
|
static ClientEndpointConfig.Builder |
create()
Creates a new builder object with no subprotocols, extensions, encoders, decoders and a
null
configurator. |
ClientEndpointConfig.Builder |
decoders(java.util.List<java.lang.Class<? extends Decoder>> decoders)
Assign the list of decoder implementation classes the client will use.
|
ClientEndpointConfig.Builder |
encoders(java.util.List<java.lang.Class<? extends Encoder>> encoders)
Assign the list of encoder implementation classes the client will use.
|
ClientEndpointConfig.Builder |
extensions(java.util.List<Extension> extensions)
Set the extensions for the configuration this builder will build.
|
ClientEndpointConfig.Builder |
preferredSubprotocols(java.util.List<java.lang.String> preferredSubprotocols)
Set the preferred sub protocols for the configuration this builder will build.
|
ClientEndpointConfig.Builder |
sslContext(javax.net.ssl.SSLContext sslContext)
Assign the SSLContext to be used when connection to the WebSocket server.
|
public static ClientEndpointConfig.Builder create()
null
configurator.public ClientEndpointConfig build()
public ClientEndpointConfig.Builder configurator(ClientEndpointConfig.Configurator clientEndpointConfigurator)
clientEndpointConfigurator
- the configuratorpublic ClientEndpointConfig.Builder preferredSubprotocols(java.util.List<java.lang.String> preferredSubprotocols)
preferredSubprotocols
- the preferred subprotocol names.public ClientEndpointConfig.Builder extensions(java.util.List<Extension> extensions)
extensions
- the extensionspublic ClientEndpointConfig.Builder encoders(java.util.List<java.lang.Class<? extends Encoder>> encoders)
encoders
- the encoder implementation classespublic ClientEndpointConfig.Builder decoders(java.util.List<java.lang.Class<? extends Decoder>> decoders)
decoders
- the decoder implementation classespublic ClientEndpointConfig.Builder sslContext(javax.net.ssl.SSLContext sslContext)
sslContext
- The SSLContext which must be initialised for secure WebSocket (wss) connections or
null
for insecure WebSocket (ws) connections.