Interface Router
-
- All Known Implementing Classes:
DirectRouter
,PathRouter
,ProtocolRouter
public interface Router
TheRouter
interface represents a means of routing a session initiating request to the correct service. Typically a service is chosen based on the sub-protocol provided in the initiating request, however it can be chosen on any criteria available in the request. An initiating request must contain aConnection
header with thewebsocket
token according to RFC 6455 section 4.2.1. If the request does not contain this token it is treated as a normal request and aService
will not be resolved.If a service has been successfully chosen from the initiating request the the value of
Sec-WebSocket-Protocol
will contain either the chosen protocol if a match was made with the initiating request or null to indicate a default choice.- See Also:
RouterContainer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Service
route(Request request, Response response)
This is used to route an incoming request to a service if the request represents a WebSocket handshake as defined by RFC 6455.
-
-
-
Method Detail
-
route
Service route(Request request, Response response)
This is used to route an incoming request to a service if the request represents a WebSocket handshake as defined by RFC 6455. If the request is not a session initiating handshake then this must return a null value to allow it to be processed by some other part of the server.- Parameters:
request
- this is the request to use for routingresponse
- this is the response to establish the session- Returns:
- a service that can be used to process the session
-
-