Interface WebSocketMessage.Factory

Enclosing interface:
WebSocketMessage

public static interface WebSocketMessage.Factory

A factory used to create WebSocket message.

It allows to create message that comply with the configuration (e.g. max frame size...). The specified payload data publisher can be rearranged to comply with max frame size by splitting big fragments into smaller frames.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • text

      WebSocketMessage text(String value)

      Creates a text message with the specified payload data.

      Parameters:
      value - payload data
      Returns:
      a WebSocket message
    • text

      Creates a text message with the specified payload data stream.

      Parameters:
      stream - payload data stream
      Returns:
      a WebSocket message
    • text_raw

      WebSocketMessage text_raw(ByteBuf value)

      Creates a text message with the specified raw payload data.

      Parameters:
      value - raw payload data
      Returns:
      a WebSocket message
    • text_raw

      WebSocketMessage text_raw(Publisher<ByteBuf> stream)

      Creates a text message with the specified raw payload data stream.

      Parameters:
      stream - raw payload data stream
      Returns:
      a WebSocket message
    • binary

      WebSocketMessage binary(ByteBuf value)

      Creates a binary message with the specified payload data.

      Parameters:
      value - payload data
      Returns:
      a WebSocket message
    • binary

      Creates a binary message with the specified payload data stream.

      Parameters:
      stream - payload data stream
      Returns:
      a WebSocket message