Interface IFrameBuilder

  • All Known Implementing Classes:
    ClientFrameBuilder

    public interface IFrameBuilder
    An IFrameBuilder knows how to create different kind of frames.
    • Field Detail

      • EXTENDED_LENGTH_MAX_VALUE

        static final int EXTENDED_LENGTH_MAX_VALUE
        The maximum length for an extended payload (7+16 bits).
        See Also:
        Constant Field Values
    • Method Detail

      • buildBinaryFrame

        RawFrame buildBinaryFrame​(byte[] binary)
        See RFC6455, section 5.6. Data Frames.
        Parameters:
        binary - the binary data to create a binary frame
        Returns:
        the properly constructed frame
      • buildCloseFrame

        RawFrame buildCloseFrame​(ReasonForClosure reasonForClosure)
        See RFC6455, section 7. Closing the Connection.
        Parameters:
        reasonForClosure - the status code and the optional message to send to the remote endpoint
        Returns:
        the properly constructed frame
      • buildPingFrame

        RawFrame buildPingFrame​(byte[] payload)
        See RFC6455, section 5.5.2. Ping.
        Parameters:
        payload - the payload of the frame
        Returns:
        the properly constructed frame
      • buildPongFrame

        RawFrame buildPongFrame​(byte[] payload)
        See RFC6455, section 5.5.3. Pong.
        Parameters:
        payload - the payload of the frame
        Returns:
        the properly constructed frame
      • buildTextFrame

        RawFrame buildTextFrame​(String text)
        See RFC6455, section 5.6. Data Frames.
        Parameters:
        text - the text to create a text frame
        Returns:
        the properly constructed frame