Class PathRouter
- java.lang.Object
-
- org.simpleframework.http.socket.service.PathRouter
-
- All Implemented Interfaces:
Router
public class PathRouter extends java.lang.Object implements Router
ThePathRouter
is used when there are multiple services that can be used. Each service is selected based on the path sent in the initiating request. If a match cannot be made based on the request then a default service us chosen.- Author:
- Niall Gallagher
- See Also:
RouterContainer
-
-
Constructor Summary
Constructors Constructor Description PathRouter(java.util.Map<java.lang.String,Service> registry, Service primary)
Constructor for thePathRouter
object.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
PathRouter
public PathRouter(java.util.Map<java.lang.String,Service> registry, Service primary) throws java.io.IOException
Constructor for thePathRouter
object. This is used to create a router using a selection of services that can be selected using the path provided in the initiating request.- Parameters:
registry
- this is the registry of available servicesprimary
- this is the default service to use- Throws:
java.io.IOException
-
-
Method Detail
-
route
public 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 will return a null value to allow it to be processed by some other part of the server.
-
-