public final class ProxyBackend extends Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg> implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
The proxy backend forwards requests to remote servers using load balancers.
Implementation detail: the proxy backend uses a hierarchy of load balancers / connections factories that are setup this way:
Load Balancers - reference counted (one for bind operations + another one for other operations) | +--- newFailoverLoadBalancer (over primary and secondary servers) | +--- 2 new*RequestLoadBalancer (Affinity or LeastRequests - one for primary servers, one for secondary servers) | +--- newCachedConnectionPool - reference counted | +--- LdapConnectionFactoryNote: Some load balancers/connection factories are reference counted, in order to ease managing their lifecycle and to avoid disturbing clients. When a change affects the load balancers/connection factories, the proxy backend needs to rebuild a whole new load balancer hierarchy in order to make use of them. However, LDAP is a connected protocol, thus closing connections should be avoided when there is no need to. As a consequence some connection factories/load balancers are reference counted to ensure they are closed only when they are no longer referenced.
Constructor and Description |
---|
ProxyBackend() |
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.ProxyBackendCfg newConfig) |
void |
configureBackend(org.forgerock.opendj.server.config.server.ProxyBackendCfg cfg,
ServerContext serverContext)
Configure this backend based on the information in the provided configuration.
|
void |
deregisterBackendMonitor()
Deregisters the backend monitor of this backend.
|
void |
finalizeBackend()
Performs any necessary work to finalize this backend.
|
Set<org.forgerock.opendj.ldap.Dn> |
getBaseDNs()
Retrieves the set of base-level DNs that may be used within this
backend.
|
Set<String> |
getSupportedControls()
Retrieves the OIDs of the controls that may be supported by this
backend.
|
Set<String> |
getSupportedFeatures()
Retrieves the OIDs of the features that may be supported by this
backend.
|
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 . |
boolean |
isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ProxyBackendCfg config,
List<LocalizableMessage> unacceptableReasons,
ServerContext serverContext)
Indicates whether the provided configuration is acceptable for
this backend.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ProxyBackendCfg config,
List<LocalizableMessage> unacceptableReasons) |
boolean |
isPublicBackend()
Indicates whether the base DNs of this backend should be considered public or private.
|
void |
openBackend()
Opens this backend based on the information provided when the backend was configured.
|
void |
registerBackendMonitor()
Registers a backend monitor for this backend.
|
getBackendID, setBackendID
public ProxyBackend()
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.public void configureBackend(org.forgerock.opendj.server.config.server.ProxyBackendCfg cfg, ServerContext serverContext) throws org.forgerock.opendj.config.server.ConfigException
Backend
configureBackend
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
cfg
- The configuration of this backend.serverContext
- The server context for this instanceorg.forgerock.opendj.config.server.ConfigException
- If there is an error in the configuration.public void openBackend() throws org.forgerock.opendj.config.server.ConfigException
Backend
openBackend
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
org.forgerock.opendj.config.server.ConfigException
- If an unrecoverable problem arises while opening the backend.Backend.configureBackend(C, org.opends.server.core.ServerContext)
public Set<org.forgerock.opendj.ldap.Dn> getBaseDNs()
Backend
getBaseDNs
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public Set<String> getSupportedControls()
Backend
getSupportedControls
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public Set<String> getSupportedFeatures()
Backend
getSupportedFeatures
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public void finalizeBackend()
Backend
configureBackend()
has been called.
This may be called during the Directory Server shutdown process or if a backend is disabled
with the server online.
It must not return until the backend is closed.
This method may not throw any exceptions. If any problems are encountered, then they may be logged but the closure should progress as completely as possible.
finalizeBackend
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public boolean isPublicBackend()
Backend
This method also controls the visibility of the associated naming contexts. i.e. if any base DN of this backend is a naming context, then it will be public or private, based on the value returned by this method.
Reminder: Public naming contexts are returned when querying the root DSE entry.
isPublicBackend
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
true
if this backend's baseDNs could be exposed as a public naming context,
false
if they must remain private naming contexts.public boolean isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ProxyBackendCfg config, List<LocalizableMessage> unacceptableReasons, ServerContext serverContext)
Backend
isConfigurationAcceptable
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
config
- The backend configuration for which
to make the determination.unacceptableReasons
- A list that may be used to hold the
reasons that the provided
configuration is not acceptable.serverContext
- this Directory Server instance's server contexttrue
if the provided configuration is acceptable
for this backend, or false
if not.public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ProxyBackendCfg config, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.ProxyBackendCfg newConfig)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public void registerBackendMonitor()
Backend
registerBackendMonitor
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
public void deregisterBackendMonitor()
Backend
deregisterBackendMonitor
in class Backend<org.forgerock.opendj.server.config.server.ProxyBackendCfg>
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.