public final class Router extends Object implements RequestHandler
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 a ClientContext
.
Modifier and Type | Method and Description |
---|---|
Flowable<Response> |
handle(org.forgerock.services.context.Context context,
Request request)
|
static RequestHandler |
newRouter(CoreConfigManager coreConfigManager,
BackendConfigManager backendConfigManager)
Creates a new router.
|
public static RequestHandler newRouter(CoreConfigManager coreConfigManager, BackendConfigManager backendConfigManager)
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.public Flowable<Response> handle(org.forgerock.services.context.Context context, Request request) throws Exception
RequestHandler
Flowable
representing the asynchronous Response
of the given request
.
Successful responses (@see ResultCode.isExceptional()
must be provided to the
subscriber through the Subscriber.onNext(Object)
method. All erroneous responses
(e.g: no such object) must be published to the subscriber through the
Subscriber.onError(Throwable)
method.
handle
in interface RequestHandler
context
- The request context.request
- The request.Flowable
of zero or several Response
to be returned to the caller.Exception
- If an error occurred during the processing of the request.Copyright 2010-2020 ForgeRock AS.