Class ExtensionConfig
- java.lang.Object
-
- org.eclipse.jetty.websocket.api.extensions.ExtensionConfig
-
public class ExtensionConfig extends java.lang.Object
Represents an Extension Configuration, as seen during the connection Handshake process.
-
-
Constructor Summary
Constructors Constructor Description ExtensionConfig(java.lang.String parameterizedName)
ExtensionConfig(ExtensionConfig copy)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
int
getParameter(java.lang.String key, int defValue)
java.lang.String
getParameter(java.lang.String key, java.lang.String defValue)
java.lang.String
getParameterizedName()
java.util.Set<java.lang.String>
getParameterKeys()
java.util.Map<java.lang.String,java.lang.String>
getParameters()
Return parameters found in request URI.void
init(ExtensionConfig other)
Initialize the parameters on this config from the other configuration.static ExtensionConfig
parse(java.lang.String parameterizedName)
Parse a single parameterized name.static java.util.List<ExtensionConfig>
parseEnum(java.util.Enumeration<java.lang.String> valuesEnum)
Parse enumeration ofSec-WebSocket-Extensions
header values into aExtensionConfig
liststatic java.util.List<ExtensionConfig>
parseList(java.lang.String... rawSecWebSocketExtensions)
Parse 1 or more rawSec-WebSocket-Extensions
header values into aExtensionConfig
listvoid
setParameter(java.lang.String key)
void
setParameter(java.lang.String key, int value)
void
setParameter(java.lang.String key, java.lang.String value)
static java.lang.String
toHeaderValue(java.util.List<ExtensionConfig> configs)
Convert a list ofExtensionConfig
to a header valuejava.lang.String
toString()
-
-
-
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 ofSec-WebSocket-Extensions
header values into aExtensionConfig
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 rawSec-WebSocket-Extensions
header values into aExtensionConfig
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 ofExtensionConfig
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 classjava.lang.Object
-
-