Class DirectRouter
java.lang.Object
org.simpleframework.http.socket.service.DirectRouter
- All Implemented Interfaces:
Router
The
DirectRouter
object is used to create a router
that uses a single service. Typically this is used by simpler
servers that wish to expose a single sub-protocol to clients.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDirectRouter
(Service service) Constructor for theDirectRouter
object.DirectRouter
(Service service, String protocol) Constructor for theDirectRouter
object. -
Method Summary
-
Field Details
-
service
The service used by this router instance. -
protocol
The protocol used or null if none was specified.
-
-
Constructor Details
-
DirectRouter
Constructor for theDirectRouter
object. This is used to create an object that will select a single service. Creating an instance with this constructor means that the protocol header will not be set.- Parameters:
service
- this is the service used by this instanceprotocol
- the protocol used by this router or null
-
DirectRouter
Constructor for theDirectRouter
object. This is used to create an object that will select a single service. If the protocol specified is null then the response to the session initiation will contain null for the protocol header.- Parameters:
service
- this is the service used by this instanceprotocol
- the protocol used by this router or null
-
-
Method Details
-
route
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 will return a null value to allow it to be processed by some other part of the server.
-