Class WsCloseFrame

java.lang.Object
org.jdrupes.httpcodec.protocols.websocket.WsFrameHeader
org.jdrupes.httpcodec.protocols.websocket.WsCloseFrame
All Implemented Interfaces:
MessageHeader
Direct Known Subclasses:
WsCloseResponse

public class WsCloseFrame extends WsFrameHeader
Represents a WebSocket close frame.

Note that status code and reason are modeled as part of the header in this API although they are handled like payload by the “wire protocol”.

  • Constructor Details

    • WsCloseFrame

      public WsCloseFrame(Integer statusCode, CharBuffer reason)
      Creates a new close control frame.
      Parameters:
      statusCode - the status code (if any)
      reason - the reason (if any)
  • Method Details

    • hasPayload

      public boolean hasPayload()
      Description copied from interface: MessageHeader
      Returns true if the complete message comprises additional data in Buffers when decoded or encoded.
      Returns:
      true if payload data follows
    • isFinal

      public boolean isFinal()
      Description copied from interface: MessageHeader
      Returns true if this is the final message received or transmitted on a connection.
      Returns:
      the result
    • statusCode

      Returns:
      the statusCode
    • reason

      public Optional<String> reason()
      Returns:
      the reason
    • toString

      public String toString()
      Overrides:
      toString in class Object