Class ExtensionConfig

java.lang.Object
org.eclipse.jetty.websocket.core.ExtensionConfig
Direct Known Subclasses:
JakartaWebSocketExtensionConfig

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

    • ExtensionConfig

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

      public ExtensionConfig(String name, Map<String,String> parameters)
    • ExtensionConfig

      public ExtensionConfig(String parameterizedName)
  • Method Details

    • parse

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

      public static List<ExtensionConfig> parseEnum(Enumeration<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 List<ExtensionConfig> parseList(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 String toHeaderValue(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 List<Map.Entry<String,String>> getInternalParameters()
    • removeInternalParameters

      public void removeInternalParameters()
    • getName

      public String getName()
    • getParameter

      public final int getParameter(String key, int defValue)
    • getParameter

      public final String getParameter(String key, String defValue)
    • getParameterizedName

      public final String getParameterizedName()
    • getParameterizedNameWithoutInternalParams

      public final String getParameterizedNameWithoutInternalParams()
    • quoteIfNeeded

      public static void quoteIfNeeded(StringBuilder buf, String str)
    • getParameterKeys

      public final Set<String> getParameterKeys()
    • getParameters

      public final Map<String,String> getParameters()
      Return parameters found in request URI.
      Returns:
      the parameter map
    • setParameter

      public final void setParameter(String key)
    • setParameter

      public final void setParameter(String key, int value)
    • setParameter

      public final void setParameter(String key, String value)
    • toString

      public String toString()
      Overrides:
      toString in class Object