Package jakarta.websocket.server
Class ServerEndpointConfig.Builder
- java.lang.Object
- 
- jakarta.websocket.server.ServerEndpointConfig.Builder
 
- 
- Enclosing interface:
- ServerEndpointConfig
 
 public static final class ServerEndpointConfig.Builder extends Object The ServerEndpointConfig.Builder is a class used for creatingServerEndpointConfig.Builderobjects 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();- Author:
- dannycoward
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerEndpointConfigbuild()Builds the configuration object using the current attributes that have been set on this builder object.ServerEndpointConfig.Builderconfigurator(ServerEndpointConfig.Configurator serverEndpointConfigurator)Sets the custom configurator to use on the configuration object built by this builder.static ServerEndpointConfig.Buildercreate(Class<?> endpointClass, 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.Builderdecoders(List<Class<? extends Decoder>> decoders)Sets the decoder implementation classes to use in the configuration.ServerEndpointConfig.Builderencoders(List<Class<? extends Encoder>> encoders)Sets the list of encoder implementation classes for this builder.ServerEndpointConfig.Builderextensions(List<Extension> extensions)Sets the extensions to use in the configuration.ServerEndpointConfig.Buildersubprotocols(List<String> subprotocols)Sets the subprotocols to use in the configuration.
 
- 
- 
- 
Method Detail- 
createpublic static ServerEndpointConfig.Builder create(Class<?> endpointClass, 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.- Parameters:
- endpointClass- the class of the endpoint to configure
- path- The URI or URI template where the endpoint will be deployed. A trailing "/" will be ignored and the path must begin with /.
- Returns:
- a new instance of ServerEndpointConfig.Builder
 
 - 
buildpublic ServerEndpointConfig build() Builds the configuration object using the current attributes that have been set on this builder object.- Returns:
- a new ServerEndpointConfig object.
 
 - 
encoderspublic ServerEndpointConfig.Builder encoders(List<Class<? extends Encoder>> encoders) Sets the list of encoder implementation classes for this builder.- Parameters:
- encoders- the encoders
- Returns:
- this builder instance
 
 - 
decoderspublic ServerEndpointConfig.Builder decoders(List<Class<? extends Decoder>> decoders) Sets the decoder implementation classes to use in the configuration.- Parameters:
- decoders- the decoders
- Returns:
- this builder instance.
 
 - 
subprotocolspublic ServerEndpointConfig.Builder subprotocols(List<String> subprotocols) Sets the subprotocols to use in the configuration.- Parameters:
- subprotocols- the subprotocols.
- Returns:
- this builder instance
 
 - 
extensionspublic ServerEndpointConfig.Builder extensions(List<Extension> extensions) Sets the extensions to use in the configuration.- Parameters:
- extensions- the extensions to use.
- Returns:
- this builder instance.
 
 - 
configuratorpublic ServerEndpointConfig.Builder configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator) Sets the custom configurator to use on the configuration object built by this builder.- Parameters:
- serverEndpointConfigurator- the configurator
- Returns:
- this builder instance
 
 
- 
 
-