Class WebSocketHybi

    • Constructor Summary

      Constructors 
      Constructor Description
      WebSocketHybi()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeConnection​(WebSocketXMPPIOService service)
      Method closes connection by sending close frame
      java.nio.ByteBuffer decodeFrame​(WebSocketXMPPIOService service, java.nio.ByteBuffer buf)
      Method responsible for decoding data received from socket and returning data after extracting it from WebSocket frame.
      void encodeFrameAndWrite​(WebSocketXMPPIOService service, java.nio.ByteBuffer buf)
      Method encodes data into WebSocket frame and writes it to passed service
      java.lang.String getId()
      Method to retrieve string identifier of implementation of protcol version
      boolean handshake​(WebSocketXMPPIOService service, java.util.Map<java.lang.String,​java.lang.String> headers, byte[] buf)
      Method responsible for handshaking of WebSocket using proper version of protocol.
      • Methods inherited from class java.lang.Object

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

      • WebSocketHybi

        public WebSocketHybi()
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: WebSocketProtocolIfc
        Method to retrieve string identifier of implementation of protcol version
        Specified by:
        getId in interface WebSocketProtocolIfc
      • handshake

        public boolean handshake​(WebSocketXMPPIOService service,
                                 java.util.Map<java.lang.String,​java.lang.String> headers,
                                 byte[] buf)
                          throws java.security.NoSuchAlgorithmException,
                                 java.io.IOException
        Description copied from interface: WebSocketProtocolIfc
        Method responsible for handshaking of WebSocket using proper version of protocol.
        Specified by:
        handshake in interface WebSocketProtocolIfc
        Returns:
        false - if implementation is not able to handshake using this version of protocol, in other case return true
        Throws:
        java.security.NoSuchAlgorithmException
        java.io.IOException
      • decodeFrame

        public java.nio.ByteBuffer decodeFrame​(WebSocketXMPPIOService service,
                                               java.nio.ByteBuffer buf)
        Description copied from interface: WebSocketProtocolIfc
        Method responsible for decoding data received from socket and returning data after extracting it from WebSocket frame.
        Specified by:
        decodeFrame in interface WebSocketProtocolIfc
        Returns:
        decoded data or null if not full frame is available in input buffer