Class ClientFrameBuilder

  • All Implemented Interfaces:
    IFrameBuilder

    public class ClientFrameBuilder
    extends Object
    implements IFrameBuilder
    This build will create frames that a client can send. That is, it will mask the payload, set the MASK bit and add the masking to the frame.
    • Constructor Detail

      • ClientFrameBuilder

        public ClientFrameBuilder()
    • Method Detail

      • buildBinaryFrame

        public RawFrame buildBinaryFrame​(byte[] binary)
        Description copied from interface: IFrameBuilder
        See RFC6455, section 5.6. Data Frames.
        Specified by:
        buildBinaryFrame in interface IFrameBuilder
        Parameters:
        binary - the binary data to create a binary frame
        Returns:
        the properly constructed frame
      • buildCloseFrame

        public RawFrame buildCloseFrame​(ReasonForClosure reasonForClosure)
        Description copied from interface: IFrameBuilder
        See RFC6455, section 7. Closing the Connection.
        Specified by:
        buildCloseFrame in interface IFrameBuilder
        Parameters:
        reasonForClosure - the status code and the optional message to send to the remote endpoint
        Returns:
        the properly constructed frame
      • buildPingFrame

        public RawFrame buildPingFrame​(byte[] binary)
        Description copied from interface: IFrameBuilder
        See RFC6455, section 5.5.2. Ping.
        Specified by:
        buildPingFrame in interface IFrameBuilder
        Parameters:
        binary - the payload of the frame
        Returns:
        the properly constructed frame
      • buildPongFrame

        public RawFrame buildPongFrame​(byte[] binary)
        Description copied from interface: IFrameBuilder
        See RFC6455, section 5.5.3. Pong.
        Specified by:
        buildPongFrame in interface IFrameBuilder
        Parameters:
        binary - the payload of the frame
        Returns:
        the properly constructed frame
      • buildTextFrame

        public RawFrame buildTextFrame​(String text)
        Description copied from interface: IFrameBuilder
        See RFC6455, section 5.6. Data Frames.
        Specified by:
        buildTextFrame in interface IFrameBuilder
        Parameters:
        text - the text to create a text frame
        Returns:
        the properly constructed frame