Class 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.
    • 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
    • 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 interface ServerEndpointConfig
        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 interface EndpointConfig
        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 interface EndpointConfig
        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 interface ServerEndpointConfig
        Returns:
        the path
      • getUserProperties

        public final java.util.Map<java.lang.String,​java.lang.Object> getUserProperties()
        Editable map of user properties.
        Specified by:
        getUserProperties in interface EndpointConfig
        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 interface ServerEndpointConfig
        Returns:
        the list of subprotocols, the empty list if none