Class ExtensionConfig


  • public class ExtensionConfig
    extends java.lang.Object
    Represents an Extension Configuration, as seen during the connection Handshake process.
    • Constructor Detail

      • ExtensionConfig

        public ExtensionConfig​(ExtensionConfig copy)
        Copy constructor
        Parameters:
        copy - the extension config to copy
      • ExtensionConfig

        public ExtensionConfig​(java.lang.String parameterizedName)
    • Method Detail

      • parse

        public static ExtensionConfig parse​(java.lang.String parameterizedName)
        Parse a single parameterized name.
        Parameters:
        parameterizedName - the parameterized name
        Returns:
        the ExtensionConfig
      • parseEnum

        public static java.util.List<ExtensionConfig> parseEnum​(java.util.Enumeration<java.lang.String> valuesEnum)
        Parse enumeration of Sec-WebSocket-Extensions header values into a ExtensionConfig list
        Parameters:
        valuesEnum - the raw header values enum
        Returns:
        the list of extension configs
      • parseList

        public static java.util.List<ExtensionConfig> parseList​(java.lang.String... rawSecWebSocketExtensions)
        Parse 1 or more raw Sec-WebSocket-Extensions header values into a ExtensionConfig list
        Parameters:
        rawSecWebSocketExtensions - the raw header values
        Returns:
        the list of extension configs
      • toHeaderValue

        public static java.lang.String toHeaderValue​(java.util.List<ExtensionConfig> configs)
        Convert a list of ExtensionConfig to a header value
        Parameters:
        configs - the list of extension configs
        Returns:
        the header value (null if no configs present)
      • getName

        public java.lang.String getName()
      • getParameter

        public final int getParameter​(java.lang.String key,
                                      int defValue)
      • getParameter

        public final java.lang.String getParameter​(java.lang.String key,
                                                   java.lang.String defValue)
      • getParameterizedName

        public final java.lang.String getParameterizedName()
      • getParameterKeys

        public final java.util.Set<java.lang.String> getParameterKeys()
      • getParameters

        public final java.util.Map<java.lang.String,​java.lang.String> getParameters()
        Return parameters found in request URI.
        Returns:
        the parameter map
      • init

        public final void init​(ExtensionConfig other)
        Initialize the parameters on this config from the other configuration.
        Parameters:
        other - the other configuration.
      • setParameter

        public final void setParameter​(java.lang.String key)
      • setParameter

        public final void setParameter​(java.lang.String key,
                                       int value)
      • setParameter

        public final void setParameter​(java.lang.String key,
                                       java.lang.String value)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object