Package javax.websocket.server
Class DefaultServerEndpointConfig
- java.lang.Object
-
- javax.websocket.server.DefaultServerEndpointConfig
-
- All Implemented Interfaces:
EndpointConfig
,ServerEndpointConfig
final class DefaultServerEndpointConfig extends java.lang.Object implements ServerEndpointConfig
The DefaultServerEndpointConfig is a concrete class that embodies all the configuration parameters for an endpoint that is to be published as a server endpoint. Developers may subclass this class in order to override the configuration behavior.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.websocket.server.ServerEndpointConfig
ServerEndpointConfig.Builder, ServerEndpointConfig.Configurator
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Class<? extends Decoder>>
decoders
private java.util.List<java.lang.Class<? extends Encoder>>
encoders
private java.lang.Class<?>
endpointClass
private java.util.List<Extension>
extensions
private java.lang.String
path
private ServerEndpointConfig.Configurator
serverEndpointConfigurator
private java.util.List<java.lang.String>
subprotocols
private java.util.Map<java.lang.String,java.lang.Object>
userProperties
-
Constructor Summary
Constructors Constructor Description DefaultServerEndpointConfig(java.lang.Class<?> endpointClass, java.lang.String path, java.util.List<java.lang.String> subprotocols, java.util.List<Extension> extensions, java.util.List<java.lang.Class<? extends Encoder>> encoders, java.util.List<java.lang.Class<? extends Decoder>> decoders, ServerEndpointConfig.Configurator serverEndpointConfigurator)
DefaultServerEndpointConfig(java.lang.Class<? extends Endpoint> endpointClass, java.lang.String path)
Creates a server configuration with the given path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerEndpointConfig.Configurator
getConfigurator()
Return the ServerEndpointConfiguratorjava.util.List<java.lang.Class<? extends Decoder>>
getDecoders()
Return the Decoder implementation classes configured.java.util.List<java.lang.Class<? extends Encoder>>
getEncoders()
Return the Encoder implementation classes configured.java.lang.Class<?>
getEndpointClass()
Returns the class of the Endpoint that this configuration configures.java.util.List<Extension>
getExtensions()
Return the websocket extensions configured.java.lang.String
getPath()
Return the path of this server configuration.java.util.List<java.lang.String>
getSubprotocols()
Return the websocket subprotocols configured.java.util.Map<java.lang.String,java.lang.Object>
getUserProperties()
Editable map of user properties.
-
-
-
Field Detail
-
path
private java.lang.String path
-
endpointClass
private java.lang.Class<?> endpointClass
-
subprotocols
private java.util.List<java.lang.String> subprotocols
-
extensions
private java.util.List<Extension> extensions
-
encoders
private java.util.List<java.lang.Class<? extends Encoder>> encoders
-
decoders
private java.util.List<java.lang.Class<? extends Decoder>> decoders
-
userProperties
private java.util.Map<java.lang.String,java.lang.Object> userProperties
-
serverEndpointConfigurator
private ServerEndpointConfig.Configurator serverEndpointConfigurator
-
-
Constructor Detail
-
DefaultServerEndpointConfig
DefaultServerEndpointConfig(java.lang.Class<?> endpointClass, java.lang.String path, java.util.List<java.lang.String> subprotocols, java.util.List<Extension> extensions, java.util.List<java.lang.Class<? extends Encoder>> encoders, java.util.List<java.lang.Class<? extends Decoder>> decoders, ServerEndpointConfig.Configurator serverEndpointConfigurator)
-
DefaultServerEndpointConfig
DefaultServerEndpointConfig(java.lang.Class<? extends Endpoint> endpointClass, java.lang.String path)
Creates a server configuration with the given path- Parameters:
path
- the URI or URI template.
-
-
Method Detail
-
getEndpointClass
public java.lang.Class<?> getEndpointClass()
Returns the class of the Endpoint that this configuration configures.- Specified by:
getEndpointClass
in interfaceServerEndpointConfig
- Returns:
- the class of the Endpoint.
-
getEncoders
public java.util.List<java.lang.Class<? extends Encoder>> getEncoders()
Return the Encoder implementation classes configured. These will be used by the container to encode outgoing messages.- Specified by:
getEncoders
in interfaceEndpointConfig
- Returns:
- the encoder implementation classes, in an unmodifiable list, empty if there are none.
-
getDecoders
public java.util.List<java.lang.Class<? extends Decoder>> getDecoders()
Return the Decoder implementation classes configured. These will be used by the container to decode incoming messages into the expected custom objects on MessageHandler callbacks.- Specified by:
getDecoders
in interfaceEndpointConfig
- Returns:
- the decoder implementation classes, in an unmodifiable list.
-
getPath
public java.lang.String getPath()
Return the path of this server configuration. The path is a relative URI or URI-template.- Specified by:
getPath
in interfaceServerEndpointConfig
- Returns:
- the path
-
getConfigurator
public ServerEndpointConfig.Configurator getConfigurator()
Return the ServerEndpointConfigurator- Specified by:
getConfigurator
in interfaceServerEndpointConfig
- Returns:
- the ServerEndpointConfigurator
-
getUserProperties
public final java.util.Map<java.lang.String,java.lang.Object> getUserProperties()
Editable map of user properties.- Specified by:
getUserProperties
in interfaceEndpointConfig
- Returns:
- a modifiable Map of application data.
-
getSubprotocols
public final java.util.List<java.lang.String> getSubprotocols()
Description copied from interface:ServerEndpointConfig
Return the websocket subprotocols configured.- Specified by:
getSubprotocols
in interfaceServerEndpointConfig
- Returns:
- the list of subprotocols, the empty list if none
-
getExtensions
public final java.util.List<Extension> getExtensions()
Description copied from interface:ServerEndpointConfig
Return the websocket extensions configured.- Specified by:
getExtensions
in interfaceServerEndpointConfig
- Returns:
- the list of extensions, the empty list if none.
-
-