Package 

Interface IExtension


  • 
    public interface IExtension
    
                        

    Interface which specifies all required methods to develop a websocket extension.

    • Method Summary

      Modifier and Type Method Description
      abstract void decodeFrame(Framedata inputFrame) Decode a frame with a extension specific algorithm.
      abstract void encodeFrame(Framedata inputFrame) Encode a frame with a extension specific algorithm.
      abstract boolean acceptProvidedExtensionAsServer(String inputExtensionHeader) Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a server
      abstract boolean acceptProvidedExtensionAsClient(String inputExtensionHeader) Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a client
      abstract void isFrameValid(Framedata inputFrame) Check if the received frame is correctly implemented by the other endpoint and there are nospecification errors (like wrongly set RSV)
      abstract String getProvidedExtensionAsClient() Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a client.
      abstract String getProvidedExtensionAsServer() Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a server.
      abstract IExtension copyInstance() Extensions must only be by one websocket at all.
      abstract void reset() Cleaning up internal stats when the draft gets reset.
      abstract String toString() Return a string which should contain the class name as well as additional information about thecurrent configurations for this extension (DEBUG purposes)
      • Methods inherited from class java.lang.Object

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

      • decodeFrame

         abstract void decodeFrame(Framedata inputFrame)

        Decode a frame with a extension specific algorithm. The algorithm is subject to be implementedby the specific extension. The resulting frame will be used in the application

        Parameters:
        inputFrame - the frame, which has do be decoded to be used in the application
      • encodeFrame

         abstract void encodeFrame(Framedata inputFrame)

        Encode a frame with a extension specific algorithm. The algorithm is subject to be implementedby the specific extension. The resulting frame will be send to the other endpoint.

        Parameters:
        inputFrame - the frame, which has do be encoded to be used on the other endpoint
      • acceptProvidedExtensionAsServer

         abstract boolean acceptProvidedExtensionAsServer(String inputExtensionHeader)

        Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a server

        Parameters:
        inputExtensionHeader - the received Sec-WebSocket-Extensions header field offered by theother endpoint
      • acceptProvidedExtensionAsClient

         abstract boolean acceptProvidedExtensionAsClient(String inputExtensionHeader)

        Check if the received Sec-WebSocket-Extensions header field contains a offer for the specificextension if the endpoint is in the role of a client

        Parameters:
        inputExtensionHeader - the received Sec-WebSocket-Extensions header field offered by theother endpoint
      • isFrameValid

         abstract void isFrameValid(Framedata inputFrame)

        Check if the received frame is correctly implemented by the other endpoint and there are nospecification errors (like wrongly set RSV)

        Parameters:
        inputFrame - the received frame
      • getProvidedExtensionAsClient

         abstract String getProvidedExtensionAsClient()

        Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a client. If the extension returns an empty string (""), the offer will not beincluded in the handshake.

      • getProvidedExtensionAsServer

         abstract String getProvidedExtensionAsServer()

        Return the specific Sec-WebSocket-Extensions header offer for this extension if the endpoint isin the role of a server. If the extension returns an empty string (""), the offer will not beincluded in the handshake.

      • copyInstance

         abstract IExtension copyInstance()

        Extensions must only be by one websocket at all. To prevent extensions to be used more thanonce the Websocket implementation should call this method in order to create a new usableversion of a given extension instance. The copy can be safely used in conjunction with anew websocket connection.

      • reset

         abstract void reset()

        Cleaning up internal stats when the draft gets reset.

      • toString

         abstract String toString()

        Return a string which should contain the class name as well as additional information about thecurrent configurations for this extension (DEBUG purposes)