Interface WebSocketMessage

All Known Implementing Classes:
GenericWebSocketMessage

public interface WebSocketMessage

Represents a WebSocket message which can be fragmented into multiple data frames as defined by RFC 6455 Section 5.4.

Since:
1.5
Author:
Jeremy Kuhn
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A factory used to create WebSocket message.
    static enum 
    WebSocket message type.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Publisher<io.netty.buffer.ByteBuf>
    Returns the message payload binary data stream.
    org.reactivestreams.Publisher<WebSocketFrame>
    Returns the frames that composes the message.
    Returns the WebSocket message type.
    reactor.core.publisher.Mono<io.netty.buffer.ByteBuf>
    Returns the message payload binary data.
    reactor.core.publisher.Mono<String>
    Returns the message payload text data stream.
    org.reactivestreams.Publisher<String>
    Returns the message payload text data stream.
  • Method Details

    • getKind

      Returns the WebSocket message type.

      Returns:
      a WebSocket message type
    • frames

      org.reactivestreams.Publisher<WebSocketFrame> frames()

      Returns the frames that composes the message.

      Note that the returned publisher is exclusive: it is only possible to subscribe to one of the publisher returned by frames(), binary(), reducedBinary(), text() or reducedText().

      Returns:
      a WebSocker frames publisher
    • binary

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

      Returns the message payload binary data stream.

      Note that the returned publisher is exclusive: it is only possible to subscribe to one of the publisher returned by frames(), binary(), reducedBinary(), text() or reducedText().

      Returns:
      a data publisher
    • reducedBinary

      reactor.core.publisher.Mono<io.netty.buffer.ByteBuf> reducedBinary()

      Returns the message payload binary data.

      This method basically reduces the result of binary().

      Note that the returned publisher is exclusive: it is only possible to subscribe to one of the publisher returned by frames(), binary(), reducedBinary(), text() or reducedText().

      Returns:
      a mono emitting the binary payload
    • text

      org.reactivestreams.Publisher<String> text()

      Returns the message payload text data stream.

      Note that the returned publisher is exclusive: it is only possible to subscribe to one of the publisher returned by frames(), binary(), reducedBinary(), text() or reducedText().

      Returns:
      a text publisher
    • reducedText

      reactor.core.publisher.Mono<String> reducedText()

      Returns the message payload text data stream.

      This method basically reduces the result of text().

      Note that the returned publisher is exclusive: it is only possible to subscribe to one of the publisher returned by frames(), binary(), reducedBinary(), text() or reducedText().

      Returns:
      a mono emitting the text payload