Class WebSocketImpl

  • All Implemented Interfaces:
    WebSocket, org.apache.qpid.proton.engine.impl.TransportLayer

    public class WebSocketImpl
    extends Object
    implements WebSocket, org.apache.qpid.proton.engine.impl.TransportLayer
    Implementation for WebSocket.
    • Field Detail

      • isWebSocketEnabled

        protected Boolean isWebSocketEnabled
    • Constructor Detail

      • WebSocketImpl

        public WebSocketImpl​(int customMaxFrameSize)
        Create WebSocket transport layer - which, after configuring using the configure(String, String, String, int, String, Map, WebSocketHandler) API is ready for layering in qpid-proton-j transport layers, using TransportInternal.addTransportLayer(TransportLayer) API.
        Parameters:
        customMaxFrameSize - the maximum frame size that this layer will buffer for
    • Method Detail

      • wrap

        public org.apache.qpid.proton.engine.impl.TransportWrapper wrap​(org.apache.qpid.proton.engine.impl.TransportInput input,
                                                                        org.apache.qpid.proton.engine.impl.TransportOutput output)
        Specified by:
        wrap in interface org.apache.qpid.proton.engine.impl.TransportLayer
      • configure

        public void configure​(String host,
                              String path,
                              String query,
                              int port,
                              String protocol,
                              Map<String,​String> additionalHeaders,
                              WebSocketHandler webSocketHandler)
        Description copied from interface: WebSocket
        Configure WebSocket connection.
        Specified by:
        configure in interface WebSocket
        Parameters:
        host - the hots name
        path - the resource path
        query - the query
        port - the port
        protocol - the base protocol
        additionalHeaders - the Map of additional headers
        webSocketHandler - the web socket handler
      • wrapBuffer

        public void wrapBuffer​(ByteBuffer srcBuffer,
                               ByteBuffer dstBuffer)
        Description copied from interface: WebSocket
        Add WebSocket frame to send the given buffer.
        Specified by:
        wrapBuffer in interface WebSocket
        Parameters:
        srcBuffer - the source buffer
        dstBuffer - the destination buffer
      • getOutputBuffer

        public ByteBuffer getOutputBuffer()
        Description copied from interface: WebSocket
        Access the output buffer (read only).
        Specified by:
        getOutputBuffer in interface WebSocket
        Returns:
        The current output buffer.
      • getInputBuffer

        public ByteBuffer getInputBuffer()
        Description copied from interface: WebSocket
        Access the input buffer (read only).
        Specified by:
        getInputBuffer in interface WebSocket
        Returns:
        The current input buffer.
      • getPingBuffer

        public ByteBuffer getPingBuffer()
        Description copied from interface: WebSocket
        Access the ping buffer (read only).
        Specified by:
        getPingBuffer in interface WebSocket
        Returns:
        The ping input buffer.
      • getWsInputBuffer

        public ByteBuffer getWsInputBuffer()
        Description copied from interface: WebSocket
        Access the web socket input buffer (read only).
        Specified by:
        getWsInputBuffer in interface WebSocket
        Returns:
        The wsInputBuffer input buffer.
      • getEnabled

        public Boolean getEnabled()
        Description copied from interface: WebSocket
        Access if WebSocket enabled .
        Specified by:
        getEnabled in interface WebSocket
        Returns:
        True if WebSocket enabled otherwise false.
      • writeUpgradeRequest

        protected void writeUpgradeRequest()
      • writePong

        protected void writePong()
      • writeClose

        protected void writeClose()