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 |
---|---|
io.reactivex.Flowable<org.forgerock.opendj.ldap.messages.Response> |
handle(org.forgerock.services.context.Context context,
org.forgerock.opendj.ldap.messages.Request request)
Returns a
Flowable representing the asynchronous Response of the given 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 io.reactivex.Flowable<org.forgerock.opendj.ldap.messages.Response> handle(org.forgerock.services.context.Context context, org.forgerock.opendj.ldap.messages.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
onNext() method. All erroneous responses (e.g: no such object) must be published to the subscriber through the
onError() 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-2017 ForgeRock AS. All Rights Reserved.