Interface WebSocketMessage.Factory

All Known Implementing Classes:
GenericWebSocketMessage.GenericFactory
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 Summary

    Modifier and Type
    Method
    Description
    binary(io.netty.buffer.ByteBuf value)
    Creates a binary message with the specified payload data.
    binary(org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> stream)
    Creates a binary message with the specified payload data stream.
    text(String value)
    Creates a text message with the specified payload data.
    text(org.reactivestreams.Publisher<String> stream)
    Creates a text message with the specified payload data stream.
    text_raw(io.netty.buffer.ByteBuf value)
    Creates a text message with the specified raw payload data.
    text_raw(org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> stream)
    Creates a text message with the specified raw payload data stream.
  • 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

      WebSocketMessage text(org.reactivestreams.Publisher<String> stream)

      Creates a text message with the specified payload data stream.

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

      WebSocketMessage text_raw(io.netty.buffer.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(org.reactivestreams.Publisher<io.netty.buffer.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(io.netty.buffer.ByteBuf value)

      Creates a binary message with the specified payload data.

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

      WebSocketMessage binary(org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> stream)

      Creates a binary message with the specified payload data stream.

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