Package org.forgerock.opendj.server.core
Class Router
- java.lang.Object
-
- org.forgerock.opendj.server.core.Router
-
- All Implemented Interfaces:
RequestHandler
public final class Router extends Object implements RequestHandler
Provides routing on LDAP requests based on Dns.A request is directed to one reactive handler, or multiple handler in case of subordinate searches. Actually, in the case of the router, reactive handlers are backends.
The provided context is expected to contain a
RequestContext
and aClientContext
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Flowable<Response>
handle(org.forgerock.services.context.Context context, Request request)
static RequestHandler
newRouter(CoreConfigManager coreConfigManager, BackendConfigManager backendConfigManager)
Creates a new router.
-
-
-
Method Detail
-
newRouter
public static RequestHandler newRouter(CoreConfigManager coreConfigManager, BackendConfigManager backendConfigManager)
Creates a new router.- Parameters:
coreConfigManager
- The manager which has the knowledge of core configuration attributes of the Directory Server.backendConfigManager
- The manager which has the knowledge of the association between Dns and backends.- Returns:
- a router, as a reactive handler
-
handle
public Flowable<Response> handle(org.forgerock.services.context.Context context, Request request) throws Exception
Description copied from interface:RequestHandler
Returns aFlowable
representing the asynchronousResponse
of the givenrequest
.Successful responses (@see
ResultCode.isExceptional()
must be provided to the subscriber through theSubscriber.onNext(Object)
method. All erroneous responses (e.g: no such object) must be published to the subscriber through theSubscriber.onError(Throwable)
method.- Specified by:
handle
in interfaceRequestHandler
- Parameters:
context
- The request context.request
- The request.- Returns:
- A
Flowable
of zero or severalResponse
to be returned to the caller. - Throws:
Exception
- If an error occurred during the processing of the request.
-
-