Class ServerEndpointConfig.Builder
java.lang.Object
jakarta.websocket.server.ServerEndpointConfig.Builder
- Enclosing interface:
ServerEndpointConfig
Builder for creating
ServerEndpointConfig instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns aServerEndpointConfigwith the configured settings.configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator) Sets the configurator to use for the WebSocket handshake.static ServerEndpointConfig.BuilderCreates a new builder for the given endpoint class and path.Sets the list of decoder classes to use for the WebSocket connection.Sets the list of encoder classes to use for the WebSocket connection.extensions(List<Extension> extensions) Sets the list of extensions supported by the endpoint.subprotocols(List<String> subprotocols) Sets the list of sub-protocols supported by the endpoint.
-
Method Details
-
create
Creates a new builder for the given endpoint class and path.- Parameters:
endpointClass- The endpoint classpath- The path at which the endpoint will be registered- Returns:
- A new builder instance
-
build
Builds and returns aServerEndpointConfigwith the configured settings.- Returns:
- The configured server endpoint configuration
-
encoders
Sets the list of encoder classes to use for the WebSocket connection.- Parameters:
encoders- The list of encoder classes- Returns:
- This builder instance
-
decoders
Sets the list of decoder classes to use for the WebSocket connection.- Parameters:
decoders- The list of decoder classes- Returns:
- This builder instance
-
subprotocols
Sets the list of sub-protocols supported by the endpoint.- Parameters:
subprotocols- The list of sub-protocols- Returns:
- This builder instance
-
extensions
Sets the list of extensions supported by the endpoint.- Parameters:
extensions- The list of extensions- Returns:
- This builder instance
-
configurator
public ServerEndpointConfig.Builder configurator(ServerEndpointConfig.Configurator serverEndpointConfigurator) Sets the configurator to use for the WebSocket handshake.- Parameters:
serverEndpointConfigurator- The configurator, ornullto use the default- Returns:
- This builder instance
-