public static final class ServerEndpointConfig.Builder
extends java.lang.Object
ServerEndpointConfig.Builder objects for
the purposes of deploying a server endpoint.
Here are some examples:
Building a plain configuration for an endpoint with just a path.
ServerEndpointConfig config = ServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class, "/foo").build();
Building a configuration with no subprotocols and a custom configurator.
ServerEndpointConfig config = ServerEndpointConfig.Builder.create(ProgrammaticEndpoint.class, "/bar")
.subprotocols(subprotocols)
.configurator(new MyServerConfigurator())
.build();
| Modifier and Type | Method and Description |
|---|---|
ServerEndpointConfig |
build()
Builds the configuration object using the current attributes that have been set on this builder object.
|
ServerEndpointConfig.Builder |
configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator)
Sets the custom configurator to use on the configuration object built by this builder.
|
static ServerEndpointConfig.Builder |
create(java.lang.Class<?> endpointClass,
java.lang.String path)
Creates the builder with the mandatory information of the endpoint class (programmatic or annotated), the
relative URI or URI-template to use, and with no subprotocols, extensions, encoders, decoders or custom
configurator.
|
ServerEndpointConfig.Builder |
decoders(java.util.List<java.lang.Class<? extends Decoder>> decoders)
Sets the decoder implementation classes to use in the configuration.
|
ServerEndpointConfig.Builder |
encoders(java.util.List<java.lang.Class<? extends Encoder>> encoders)
Sets the list of encoder implementation classes for this builder.
|
ServerEndpointConfig.Builder |
extensions(java.util.List<Extension> extensions)
Sets the extensions to use in the configuration.
|
ServerEndpointConfig.Builder |
subprotocols(java.util.List<java.lang.String> subprotocols)
Sets the subprotocols to use in the configuration.
|
public static ServerEndpointConfig.Builder create(java.lang.Class<?> endpointClass, java.lang.String path)
endpointClass - the class of the endpoint to configurepath - The URI or URI template where the endpoint will be deployed. A trailing "/" will be
ignored and the path must begin with /.public ServerEndpointConfig build()
public ServerEndpointConfig.Builder encoders(java.util.List<java.lang.Class<? extends Encoder>> encoders)
encoders - the encoderspublic ServerEndpointConfig.Builder decoders(java.util.List<java.lang.Class<? extends Decoder>> decoders)
decoders - the decoderspublic ServerEndpointConfig.Builder subprotocols(java.util.List<java.lang.String> subprotocols)
subprotocols - the subprotocols.public ServerEndpointConfig.Builder extensions(java.util.List<Extension> extensions)
extensions - the extensions to use.public ServerEndpointConfig.Builder configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator)
serverEndpointConfigurator - the configurator