Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.core

public Class TyrusExtension

extends Object
implements Extension, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, jakarta.websocket.Extension
Imports
java.io.Serializable, java.util.ArrayList, .Collections, .List, java.util.logging.Logger, jakarta.websocket.Extension

WebSocket Extension implementation.
Author
Pavel Bucek

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
public static class
TyrusExtension.TyrusParameter

WebSocket Parameter implementation.

Field Summary

Modifier and TypeField and Description
private static final transient Logger
private final String
private final ArrayList<Extension.Parameter>
private static final long

Constructor Summary

AccessConstructor and Description
public
TyrusExtension(String
extension name.
name
)

Create Extension with specific name.

public
TyrusExtension(String
extension name.
name
,
List<Extension.Parameter>
extension parameters.
parameters
)

Create Extension with name and parameters.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public static List<Extension>

Returns:

list of parsed Extensions.
fromHeaders
(List<String>
Http Extension headers.
extensionHeaders
)

Parse Extension from headers (represented as List of strings).

public static List<Extension>

Returns:

List of extensions represented as TyrusExtension.
fromString
(List<String>
List of String containing Extensions.
s
)

Parsing of one Extension.

public String
getName()

Implements jakarta.websocket.Extension.getName.

The name of the extension.

public List<Extension.Parameter>
getParameters()

Implements jakarta.websocket.Extension.getParameters.

The extension parameters for this extension in the order they appear in the http headers.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

pack-priv static String

Returns:

String containing Extension representation as defined in RFC 6455.
toString
(Extension
Extension instance.
extension
)

Returns defined representation for HTTP headers.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

LOGGERback to summary
private static final transient Logger LOGGER
nameback to summary
private final String name
parametersback to summary
private final ArrayList<Extension.Parameter> parameters
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

TyrusExtensionback to summary
public TyrusExtension(String name)

Create Extension with specific name.

Parameters
name:String

extension name.

Exceptions
IllegalArgumentException:
when name is null or empty string.
TyrusExtensionback to summary
public TyrusExtension(String name, List<Extension.Parameter> parameters)

Create Extension with name and parameters.

Parameters
name:String

extension name.

parameters:List<Extension.Parameter>

extension parameters.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
fromHeadersback to summary
public static List<Extension> fromHeaders(List<String> extensionHeaders)

Parse Extension from headers (represented as List of strings).

Parameters
extensionHeaders:List<String>

Http Extension headers.

Returns:List<Extension>

list of parsed Extensions.

fromStringback to summary
public static List<Extension> fromString(List<String> s)

Parsing of one Extension.

Parameters
s:List<String>

List of String containing Extensions.

Returns:List<Extension>

List of extensions represented as TyrusExtension.

getNameback to summary
public String getName()

Implements jakarta.websocket.Extension.getName.

Doc from jakarta.websocket.Extension.getName.

The name of the extension.

Returns:String

the name of the extension.

Annotations
@Override
getParametersback to summary
public List<Extension.Parameter> getParameters()

Implements jakarta.websocket.Extension.getParameters.

Doc from jakarta.websocket.Extension.getParameters.

The extension parameters for this extension in the order they appear in the http headers.

Returns:List<Extension.Parameter>

The read-only Map of extension parameters belonging to this extension.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toStringback to summary
pack-priv static String toString(Extension extension)

Returns defined representation for HTTP headers.

Parameters
extension:Extension

Extension instance.

Returns:String

String containing Extension representation as defined in RFC 6455.

org.glassfish.tyrus.core back to summary

private final Enum TyrusExtension.ParserState

extends Enum<TyrusExtension.ParserState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState
public static final TyrusExtension.ParserState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TyrusExtension.ParserState
public static TyrusExtension.ParserState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ERRORback to summary
public static final TyrusExtension.ParserState ERROR
NAMEback to summary
public static final TyrusExtension.ParserState NAME
PARAM_NAMEback to summary
public static final TyrusExtension.ParserState PARAM_NAME
PARAM_VALUEback to summary
public static final TyrusExtension.ParserState PARAM_VALUE
PARAM_VALUE_QUOTEDback to summary
public static final TyrusExtension.ParserState PARAM_VALUE_QUOTED
PARAM_VALUE_QUOTED_POSTback to summary
public static final TyrusExtension.ParserState PARAM_VALUE_QUOTED_POST
PARAM_VALUE_QUOTED_QPback to summary
public static final TyrusExtension.ParserState PARAM_VALUE_QUOTED_QP

Constructor Detail

ParserStateback to summary
private ParserState()

Method Detail

valueOfback to summary
public static TyrusExtension.ParserState valueOf(String name)
valuesback to summary
public static TyrusExtension.ParserState[] values()
org.glassfish.tyrus.core back to summary

public Class TyrusExtension.TyrusParameter

extends Object
implements Parameter, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, jakarta.websocket.Extension.Parameter

WebSocket Parameter implementation.

Field Summary

Modifier and TypeField and Description
private final String
private static final long
private final String

Constructor Summary

AccessConstructor and Description
public
TyrusParameter(String
parameter name.
name
,
String
parameter value.
value
)

Create Parameter with name and value.

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Implements jakarta.websocket.Extension.Parameter.getName.

Return the name of the extension parameter.

public String
getValue()

Implements jakarta.websocket.Extension.Parameter.getValue.

Return the value of the extension parameter.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

pack-priv static String

Returns:

String containing Parameter representation as defined in RFC 6455.
toString
(Extension.Parameter
Parameter instance.
parameter
)

Returns defined representation for HTTP headers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name
serialVersionUIDback to summary
private static final long serialVersionUID
valueback to summary
private final String value

Constructor Detail

TyrusParameterback to summary
public TyrusParameter(String name, String value)

Create Parameter with name and value.

Parameters
name:String

parameter name.

value:String

parameter value.

Method Detail

getNameback to summary
public String getName()

Implements jakarta.websocket.Extension.Parameter.getName.

Doc from jakarta.websocket.Extension.Parameter.getName.

Return the name of the extension parameter.

Returns:String

the name of the parameter.

Annotations
@Override
getValueback to summary
public String getValue()

Implements jakarta.websocket.Extension.Parameter.getValue.

Doc from jakarta.websocket.Extension.Parameter.getValue.

Return the value of the extension parameter.

Returns:String

the value of the parameter.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toStringback to summary
pack-priv static String toString(Extension.Parameter parameter)

Returns defined representation for HTTP headers.

Parameters
parameter:Extension.Parameter

Parameter instance.

Returns:String

String containing Parameter representation as defined in RFC 6455.