- All Known Implementing Classes:
GenericWebSocketMessage
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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceA factory used to create WebSocket message.static enumWebSocket message type. -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<io.netty.buffer.ByteBuf> binary()Returns the message payload binary data stream.org.reactivestreams.Publisher<WebSocketFrame> frames()Returns the frames that composes the message.getKind()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> text()Returns the message payload text data stream.
-
Method Details
-
getKind
WebSocketMessage.Kind 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()orreducedText().- 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()orreducedText().- 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()orreducedText().- 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()orreducedText().- 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()orreducedText().- Returns:
- a mono emitting the text payload
-