Interface WSTransport

  • All Superinterfaces:
    Service, Transport
    All Known Implementing Classes:
    AmqpWSTransport

    public interface WSTransport
    extends Transport
    Interface for a WebSocket Transport which provide hooks that a servlet can use to pass along WebSocket data and events.
    • Method Detail

      • getMaxFrameSize

        int getMaxFrameSize()
        Returns:
        the maximum frame size allowed for this WS Transport.
      • getSubProtocol

        String getSubProtocol()
        Returns:
        the WS sub-protocol that this transport is supplying.
      • setTransportSink

        void setTransportSink​(WSTransport.WSTransportSink outputSink)
        Called to provide the WS with the output data sink.
      • onWebSocketText

        void onWebSocketText​(String data)
                      throws IOException
        Called from the WebSocket framework when new incoming String data is received.
        Parameters:
        data - The newly received incoming data.
        Throws:
        IOException - if an error occurs or the socket doesn't support text data.
      • onWebSocketBinary

        void onWebSocketBinary​(ByteBuffer data)
                        throws IOException
        Called from the WebSocket framework when new incoming Binary data is received.
        Parameters:
        data - The newly received incoming data.
        Throws:
        IOException - if an error occurs or the socket doesn't support binary data.
      • onWebSocketClosed

        void onWebSocketClosed()
                        throws IOException
        Called from the WebSocket framework when the socket has been closed unexpectedly.
        Throws:
        IOException - if an error while processing the close.