Interface WebSocketUpgrade
-
- All Superinterfaces:
WebSocketUpgrade
- All Known Subinterfaces:
UpgradeToWebSocket
- All Known Implementing Classes:
UpgradeToWebSocketLowLevel
public interface WebSocketUpgrade extends WebSocketUpgrade
An attribute that will be added to an WebSocket upgrade HttpRequest that enables a request handler to upgrade this connection to a WebSocket connection and registers a WebSocket handler.This is a low-level API. You might want to use
handleWebSocketMessages
instead as documented at https://doc.akka.io/libraries/akka-http/current/server-side/websocket-support.html#routing-support
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description akka.stream.Graph<akka.stream.FlowShape<Message,Message>,akka.NotUsed>
createScalaFlow(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource)
Java APIjava.lang.Iterable<java.lang.String>
getRequestedProtocols()
Java APIHttpResponse
handleMessages(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,java.lang.Object> handlerFlow, scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".HttpResponse
handleMessagesWith(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,?> handlerFlow)
Java APIHttpResponse
handleMessagesWith(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,?> handlerFlow, java.lang.String subprotocol)
Java APIHttpResponse
handleMessagesWith(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource)
Java APIHttpResponse
handleMessagesWith(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource, java.lang.String subprotocol)
Java APIHttpResponse
handleMessagesWithSinkSource(akka.stream.Graph<akka.stream.SinkShape<Message>,java.lang.Object> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,java.lang.Object> outSource, scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".scala.collection.immutable.Seq<java.lang.String>
requestedProtocols()
A sequence of protocols the client accepts.
-
-
-
Method Detail
-
createScalaFlow
akka.stream.Graph<akka.stream.FlowShape<Message,Message>,akka.NotUsed> createScalaFlow(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource)
Java API- Parameters:
inSink
- (undocumented)outSource
- (undocumented)- Returns:
- (undocumented)
-
getRequestedProtocols
java.lang.Iterable<java.lang.String> getRequestedProtocols()
Java API- Specified by:
getRequestedProtocols
in interfaceWebSocketUpgrade
- Returns:
- (undocumented)
-
handleMessages
HttpResponse handleMessages(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,java.lang.Object> handlerFlow, scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".Returns a response to return in a request handler that will signal the low-level HTTP implementation to upgrade the connection to WebSocket and use the supplied handler to handle incoming WebSocket messages.
Optionally, a subprotocol out of the ones requested by the client can be chosen.
- Parameters:
handlerFlow
- (undocumented)subprotocol
- (undocumented)- Returns:
- (undocumented)
-
handleMessagesWith
HttpResponse handleMessagesWith(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,?> handlerFlow)
Java API- Specified by:
handleMessagesWith
in interfaceWebSocketUpgrade
- Parameters:
handlerFlow
- (undocumented)- Returns:
- (undocumented)
-
handleMessagesWith
HttpResponse handleMessagesWith(akka.stream.Graph<akka.stream.FlowShape<Message,Message>,?> handlerFlow, java.lang.String subprotocol)
Java API- Specified by:
handleMessagesWith
in interfaceWebSocketUpgrade
- Parameters:
handlerFlow
- (undocumented)subprotocol
- (undocumented)- Returns:
- (undocumented)
-
handleMessagesWith
HttpResponse handleMessagesWith(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource)
Java API- Specified by:
handleMessagesWith
in interfaceWebSocketUpgrade
- Parameters:
inSink
- (undocumented)outSource
- (undocumented)- Returns:
- (undocumented)
-
handleMessagesWith
HttpResponse handleMessagesWith(akka.stream.Graph<akka.stream.SinkShape<Message>,?> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,?> outSource, java.lang.String subprotocol)
Java API- Specified by:
handleMessagesWith
in interfaceWebSocketUpgrade
- Parameters:
inSink
- (undocumented)outSource
- (undocumented)subprotocol
- (undocumented)- Returns:
- (undocumented)
-
handleMessagesWithSinkSource
HttpResponse handleMessagesWithSinkSource(akka.stream.Graph<akka.stream.SinkShape<Message>,java.lang.Object> inSink, akka.stream.Graph<akka.stream.SourceShape<Message>,java.lang.Object> outSource, scala.Option<java.lang.String> subprotocol)
The high-level interface to create a WebSocket server based on "messages".Returns a response to return in a request handler that will signal the low-level HTTP implementation to upgrade the connection to WebSocket and use the supplied inSink to consume messages received from the client and the supplied outSource to produce message to sent to the client.
Optionally, a subprotocol out of the ones requested by the client can be chosen.
- Parameters:
inSink
- (undocumented)outSource
- (undocumented)subprotocol
- (undocumented)- Returns:
- (undocumented)
-
requestedProtocols
scala.collection.immutable.Seq<java.lang.String> requestedProtocols()
A sequence of protocols the client accepts.See http://tools.ietf.org/html/rfc6455#section-1.9
- Returns:
- (undocumented)
-
-