Package 

Class Protocol

  • All Implemented Interfaces:
    com.tds.common.websocket.protocols.IProtocol

    
    public class Protocol
     implements IProtocol
                        

    Class which represents the protocol used as Sec-WebSocket-Protocol

    • Constructor Summary

      Constructors 
      Constructor Description
      Protocol(String providedProtocol) Constructor for a Sec-Websocket-Protocol
    • Method Summary

      Modifier and Type Method Description
      String getProvidedProtocol() Return the specific Sec-WebSocket-protocol header offer for this protocol if the endpoint.
      boolean acceptProvidedProtocol(String inputProtocolHeader) Check if the received Sec-WebSocket-Protocol header field contains a offer for the specificprotocol
      IProtocol copyInstance() To prevent protocols to be used more than once the Websocket implementation should call thismethod in order to create a new usable version of a given protocol instance.
      String toString()
      boolean equals(Object o)
      int hashCode()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Protocol

        Protocol(String providedProtocol)
        Constructor for a Sec-Websocket-Protocol
        Parameters:
        providedProtocol - the protocol string
    • Method Detail

      • getProvidedProtocol

         String getProvidedProtocol()

        Return the specific Sec-WebSocket-protocol header offer for this protocol if the endpoint. Ifthe extension returns an empty string (""), the offer will not be included in the handshake.

      • acceptProvidedProtocol

         boolean acceptProvidedProtocol(String inputProtocolHeader)

        Check if the received Sec-WebSocket-Protocol header field contains a offer for the specificprotocol

        Parameters:
        inputProtocolHeader - the received Sec-WebSocket-Protocol header field offered by theother endpoint
      • copyInstance

         IProtocol copyInstance()

        To prevent protocols to be used more than once the Websocket implementation should call thismethod in order to create a new usable version of a given protocol instance.