public abstract class WebSocket
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
WebSocket.MappedWebSocketAcceptor<In,Out>
Utility class for creating WebSockets.
|
Modifier and Type | Field and Description |
---|---|
static WebSocket.MappedWebSocketAcceptor<akka.util.ByteString,akka.util.ByteString> |
Binary
Acceptor for binary WebSockets.
|
static WebSocket.MappedWebSocketAcceptor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode> |
Json
Acceptor for JSON WebSockets.
|
static WebSocket.MappedWebSocketAcceptor<java.lang.String,java.lang.String> |
Text
Acceptor for text WebSockets.
|
Constructor and Description |
---|
WebSocket() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.concurrent.CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<Message,Message,?>>> |
apply(Http.RequestHeader request)
Invoke the WebSocket.
|
static <In,Out> WebSocket.MappedWebSocketAcceptor<In,Out> |
json(java.lang.Class<In> in)
Acceptor for JSON WebSockets.
|
public static final WebSocket.MappedWebSocketAcceptor<java.lang.String,java.lang.String> Text
public static final WebSocket.MappedWebSocketAcceptor<akka.util.ByteString,akka.util.ByteString> Binary
public static final WebSocket.MappedWebSocketAcceptor<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode> Json
public abstract java.util.concurrent.CompletionStage<F.Either<Result,akka.stream.javadsl.Flow<Message,Message,?>>> apply(Http.RequestHeader request)
request
- The request for the WebSocket.public static <In,Out> WebSocket.MappedWebSocketAcceptor<In,Out> json(java.lang.Class<In> in)
In
- The websocket's input type (what it receives from clients)Out
- The websocket's output type (what it writes to clients)in
- The class of the incoming messages, used to decode them from the JSON.