Class WebSocketFrame

  • All Implemented Interfaces:
    Frame
    Direct Known Subclasses:
    ControlFrame, DataFrame

    @Deprecated(since="2021-05-27")
    public abstract class WebSocketFrame
    extends java.lang.Object
    implements Frame
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
    A Base Frame as seen in RFC 6455. Sec 5.2
         0                   1                   2                   3
         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
        +-+-+-+-+-------+-+-------------+-------------------------------+
        |F|R|R|R| opcode|M| Payload len |    Extended payload length    |
        |I|S|S|S|  (4)  |A|     (7)     |             (16/64)           |
        |N|V|V|V|       |S|             |   (if payload len==126/127)   |
        | |1|2|3|       |K|             |                               |
        +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - +
        |     Extended payload length continued, if payload len == 127  |
        + - - - - - - - - - - - - - - - +-------------------------------+
        |                               |Masking-key, if MASK set to 1  |
        +-------------------------------+-------------------------------+
        | Masking-key (continued)       |          Payload Data         |
        +-------------------------------- - - - - - - - - - - - - - - - +
        :                     Payload Data continued ...                :
        + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
        |                     Payload Data continued ...                |
        +---------------------------------------------------------------+
      
    • Method Detail

      • assertValid

        public abstract void assertValid()
        Deprecated.
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Overrides:
        equals in class java.lang.Object
      • getMask

        public byte[] getMask()
        Deprecated.
        Specified by:
        getMask in interface Frame
      • getOpCode

        public final byte getOpCode()
        Deprecated.
        Specified by:
        getOpCode in interface Frame
      • getPayload

        public java.nio.ByteBuffer getPayload()
        Deprecated.
        Get the payload ByteBuffer. possible null.
        Specified by:
        getPayload in interface Frame
      • getPayloadAsUTF8

        public java.lang.String getPayloadAsUTF8()
        Deprecated.
      • getPayloadLength

        public int getPayloadLength()
        Deprecated.
        Description copied from interface: Frame
        The original payload length (Buffer.remaining())
        Specified by:
        getPayloadLength in interface Frame
        Returns:
        the original payload length (Buffer.remaining())
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class java.lang.Object
      • hasPayload

        public boolean hasPayload()
        Deprecated.
        Specified by:
        hasPayload in interface Frame
      • isControlFrame

        public abstract boolean isControlFrame()
        Deprecated.
      • isDataFrame

        public abstract boolean isDataFrame()
        Deprecated.
      • isFin

        public boolean isFin()
        Deprecated.
        Specified by:
        isFin in interface Frame
      • isLast

        public boolean isLast()
        Deprecated.
        Description copied from interface: Frame
        Specified by:
        isLast in interface Frame
        Returns:
        true if final frame.
      • isMasked

        public boolean isMasked()
        Deprecated.
        Specified by:
        isMasked in interface Frame
      • isRsv1

        public boolean isRsv1()
        Deprecated.
        Specified by:
        isRsv1 in interface Frame
      • isRsv2

        public boolean isRsv2()
        Deprecated.
        Specified by:
        isRsv2 in interface Frame
      • isRsv3

        public boolean isRsv3()
        Deprecated.
        Specified by:
        isRsv3 in interface Frame
      • reset

        public void reset()
        Deprecated.
      • setMask

        public Frame setMask​(byte[] maskingKey)
        Deprecated.
      • setMasked

        public Frame setMasked​(boolean mask)
        Deprecated.
      • setPayload

        public WebSocketFrame setPayload​(java.nio.ByteBuffer buf)
        Deprecated.
        Set the data payload.

        The provided buffer will be used as is, no copying of bytes performed.

        The provided buffer should be flipped and ready to READ from.

        Parameters:
        buf - the bytebuffer to set
        Returns:
        the frame itself
      • setRsv1

        public WebSocketFrame setRsv1​(boolean rsv1)
        Deprecated.
      • setRsv2

        public WebSocketFrame setRsv2​(boolean rsv2)
        Deprecated.
      • setRsv3

        public WebSocketFrame setRsv3​(boolean rsv3)
        Deprecated.
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object