Class TyrusExtension

  • All Implemented Interfaces:
    Extension, java.io.Serializable

    public class TyrusExtension
    extends java.lang.Object
    implements Extension, java.io.Serializable
    WebSocket Extension implementation.
    Author:
    Pavel Bucek
    See Also:
    Serialized Form
    • Constructor Detail

      • TyrusExtension

        public TyrusExtension​(java.lang.String name)
        Create Extension with specific name.
        Parameters:
        name - extension name.
        Throws:
        java.lang.IllegalArgumentException - when name is null or empty string.
      • TyrusExtension

        public TyrusExtension​(java.lang.String name,
                              java.util.List<Extension.Parameter> parameters)
        Create Extension with name and parameters.
        Parameters:
        name - extension name.
        parameters - extension parameters.
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: Extension
        The name of the extension.
        Specified by:
        getName in interface Extension
        Returns:
        the name of the extension.
      • getParameters

        public java.util.List<Extension.Parameter> getParameters()
        Description copied from interface: Extension
        The extension parameters for this extension in the order they appear in the http headers.
        Specified by:
        getParameters in interface Extension
        Returns:
        The read-only Map of extension parameters belonging to this extension.
      • toString

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • fromString

        public static java.util.List<Extension> fromString​(java.util.List<java.lang.String> s)
        Parsing of one Extension.
        Parameters:
        s - List of String containing Extensions.
        Returns:
        List of extensions represented as TyrusExtension.
      • fromHeaders

        public static java.util.List<Extension> fromHeaders​(java.util.List<java.lang.String> extensionHeaders)
        Parse Extension from headers (represented as List of strings).
        Parameters:
        extensionHeaders - Http Extension headers.
        Returns:
        list of parsed Extensions.