Class ExtensionConfig

  • Direct Known Subclasses:
    JavaxWebSocketExtensionConfig

    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 name,
                               java.util.Map<java.lang.String,​java.lang.String> parameters)
      • 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)
      • isInternalExtension

        public boolean isInternalExtension()
      • getInternalParameters

        public java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.String>> getInternalParameters()
      • removeInternalParameters

        public void removeInternalParameters()
      • 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()
      • getParameterizedNameWithoutInternalParams

        public final java.lang.String getParameterizedNameWithoutInternalParams()
      • quoteIfNeeded

        public static void quoteIfNeeded​(java.lang.StringBuilder buf,
                                         java.lang.String str)
      • 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
      • 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