public class BackendConfigManager extends Object implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.BackendCfg>, org.forgerock.opendj.config.server.ConfigurationAddListener<org.forgerock.opendj.server.config.server.BackendCfg>, org.forgerock.opendj.config.server.ConfigurationDeleteListener<org.forgerock.opendj.server.config.server.BackendCfg>
It performs the necessary initialization of the backends when the server is first started, and then manages any changes to them while the server is running.
Modifier and Type | Class and Description |
---|---|
static class |
BackendConfigManager.NamingContext
Represents a naming context, determined by its base DN.
|
static class |
BackendConfigManager.NamingContextFilter
Filter on naming context.
|
Constructor and Description |
---|
BackendConfigManager(ServerContext serverContext)
Creates a new instance of this backend config manager.
|
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationAdd(org.forgerock.opendj.server.config.server.BackendCfg cfg) |
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.BackendCfg cfg) |
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationDelete(org.forgerock.opendj.server.config.server.BackendCfg cfg) |
boolean |
containsLocalNamingContext(org.forgerock.opendj.ldap.Dn dn)
Indicates whether the specified DN is contained in the local backends as a naming context.
|
void |
deregisterBackend(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend)
Deregisters a backend.
|
void |
deregisterBaseDNs(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend)
Deregisters all the base DNs for the provided backend.
|
void |
deregisterLocalBackendInitializationListener(LocalBackendInitializationListener listener)
Deregisters a local backend initialization listener.
|
Backend<?> |
findBackendForEntry(org.forgerock.opendj.ldap.Dn entryDn)
Retrieves the backend that should be used to handle operations on the specified entry.
|
LocalBackend<?> |
findLocalBackendForEntry(org.forgerock.opendj.ldap.Dn entryDn)
Retrieves the local backend and the corresponding baseDN that should be used to handle operations on the
specified entry.
|
org.forgerock.opendj.ldap.Dn |
findNamingContextForEntry(org.forgerock.opendj.ldap.Dn entryDn)
Retrieves the naming context that should be used to handle operations on the specified entry.
|
Iterator<org.forgerock.opendj.ldap.Dn> |
findSubordinateNamingContextsForEntry(org.forgerock.opendj.ldap.Dn entryDn)
Retrieves the set of local naming contexts that are subordinates of the naming context that should be used to
handle operations on the specified entry.
|
Set<Backend<?>> |
getAllBackends()
Returns the set of all backends.
|
Backend<?> |
getBackendWithBaseDn(org.forgerock.opendj.ldap.Dn baseDn)
Retrieves the backend with the specified base DN.
|
LocalBackend<?> |
getLocalBackendById(String backendId)
Retrieves a local backend provided its identifier.
|
LocalBackend<?> |
getLocalBackendWithBaseDN(org.forgerock.opendj.ldap.Dn baseDn)
Retrieves the local backend with the specified base DN.
|
Set<org.forgerock.opendj.ldap.Dn> |
getNamingContexts(BackendConfigManager.NamingContextFilter... filters)
Retrieves naming contexts corresponding to backends, filtered with the combination of all provided filters.
|
org.forgerock.opendj.ldap.Dn |
getParentDNInSuffix(org.forgerock.opendj.ldap.Dn dn)
Retrieves the DN that is the immediate parent for this DN.
|
RootDSEBackend |
getRootDSEBackend()
Retrieves the Root DSE backend.
|
Set<Backend<?>> |
getSubordinateBackends(Backend<?> backend)
Retrieves the set of subordinate backends of the provided backend.
|
boolean |
hasBackend(String backendId)
Indicates whether the backend with the provided id exists.
|
void |
initializeBackendConfig(Collection<String> backendIdsToStart)
Initializes the configuration associated with the Directory Server backends.
|
void |
initializeBackends(Collection<String> backendIDsToStart,
org.forgerock.opendj.server.config.server.RootCfg root)
Initializes specified backends.
|
boolean |
isConfigurationAddAcceptable(org.forgerock.opendj.server.config.server.BackendCfg backendCfg,
List<LocalizableMessage> unacceptableReason) |
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.BackendCfg backendCfg,
List<LocalizableMessage> unacceptableReason) |
boolean |
isConfigurationDeleteAcceptable(org.forgerock.opendj.server.config.server.BackendCfg cfg,
List<LocalizableMessage> unacceptableReason) |
void |
registerBackend(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend)
Registers a backend.
|
Set<org.forgerock.opendj.ldap.Dn> |
registerBaseDNs(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend,
Set<org.forgerock.opendj.ldap.Dn> newBaseDns)
Registers the provided base DNs for the provided backend.
|
void |
registerLocalBackendInitializationListener(LocalBackendInitializationListener listener)
Registers a local backend initialization listener.
|
void |
shutdownLocalBackends()
Shutdown all local backends.
|
public BackendConfigManager(ServerContext serverContext)
serverContext
- The server context.public void initializeBackendConfig(Collection<String> backendIdsToStart) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
backendIdsToStart
- The list of backendID to start. Everything will be started if empty.org.forgerock.opendj.config.server.ConfigException
- If a critical configuration problem prevents the backend initialization from succeeding.InitializationException
- If a problem occurs while initializing the backends that is not related to the server configuration.public void initializeBackends(Collection<String> backendIDsToStart, org.forgerock.opendj.server.config.server.RootCfg root) throws org.forgerock.opendj.config.server.ConfigException
backendIDsToStart
- The list of backendID to start. Everything will be started if empty.root
- The configuration of the server's Root backendorg.forgerock.opendj.config.server.ConfigException
- If a critical configuration problem prevents the backend initialization from succeeding.public Set<Backend<?>> getAllBackends()
public LocalBackend<?> getLocalBackendWithBaseDN(org.forgerock.opendj.ldap.Dn baseDn)
baseDn
- The DN that is registered as one of the base DNs for the backend to retrieve.null
if there is no local backend registered
with the specified base DN.public Backend<?> getBackendWithBaseDn(org.forgerock.opendj.ldap.Dn baseDn) throws DirectoryException
baseDn
- The DN that is registered as one of the base DNs for the backend to retrieve.null
if none existDirectoryException
- if no backend is found with the specified base DNpublic RootDSEBackend getRootDSEBackend()
public org.forgerock.opendj.ldap.Dn getParentDNInSuffix(org.forgerock.opendj.ldap.Dn dn)
dn
- thenull
if this DN does not have a parent
(either because there is only a single RDN component or because this DN is a suffix defined in the
server).public Backend<?> findBackendForEntry(org.forgerock.opendj.ldap.Dn entryDn)
entryDn
- The DN of the entry for which to retrieve the corresponding backend.null
if no appropriate backend is registered with the server.public org.forgerock.opendj.ldap.Dn findNamingContextForEntry(org.forgerock.opendj.ldap.Dn entryDn)
entryDn
- The DN of the entry for which to retrieve the corresponding naming context.null
if no appropriate naming context is registered with the server.public LocalBackend<?> findLocalBackendForEntry(org.forgerock.opendj.ldap.Dn entryDn)
entryDn
- The DN of the entry for which to retrieve the corresponding backend.null
if no appropriate local backend is registered
with the server.public LocalBackend<?> getLocalBackendById(String backendId)
backendId
- Identifier of the backendnull
if there is no local backend registered with the specified id.public boolean hasBackend(String backendId)
backendId
- The backend ID for which to make the determination.true
if a backend with the specified backend ID exists, false
otherwisepublic Set<Backend<?>> getSubordinateBackends(Backend<?> backend)
backend
- The backend for which to retrieve the subordinates backends.null
public Iterator<org.forgerock.opendj.ldap.Dn> findSubordinateNamingContextsForEntry(org.forgerock.opendj.ldap.Dn entryDn)
entryDn
- The DN of the entry for which to retrieve the corresponding naming context.null
if no appropriate naming context is registered with the server.public Set<org.forgerock.opendj.ldap.Dn> getNamingContexts(BackendConfigManager.NamingContextFilter... filters)
filters
- filter the naming contextsBackendConfigManager.NamingContext
public boolean containsLocalNamingContext(org.forgerock.opendj.ldap.Dn dn)
dn
- The DN for which to make the determination.true
if the specified DN is a naming context in one backend, or false
if it is not.public void registerLocalBackendInitializationListener(LocalBackendInitializationListener listener)
listener
- The listener to register.public void deregisterLocalBackendInitializationListener(LocalBackendInitializationListener listener)
listener
- The listener to deregister.public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.BackendCfg backendCfg, List<LocalizableMessage> unacceptableReason)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.BackendCfg>
public Set<org.forgerock.opendj.ldap.Dn> registerBaseDNs(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend, Set<org.forgerock.opendj.ldap.Dn> newBaseDns) throws DirectoryException
Backends should call this method when their baseDNs are updated.
backend
- The non-null
backend responsible for the provided base DNs.newBaseDns
- the new base DNs for the backend. An empty set asks to deregister this backend.DirectoryException
- If a problem occurs while attempting to register the provided base DNs.public void deregisterBaseDNs(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend)
backend
- The non-null
backend for which to deregister al the base DNs.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.BackendCfg cfg)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.BackendCfg>
public void registerBackend(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend) throws DirectoryException
backend
- The backend to register with the server. Neither the backend nor its backend ID may be null
.DirectoryException
- If the backend ID for the provided backend conflicts with the backend ID of an existing backend.public boolean isConfigurationAddAcceptable(org.forgerock.opendj.server.config.server.BackendCfg backendCfg, List<LocalizableMessage> unacceptableReason)
isConfigurationAddAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationAddListener<org.forgerock.opendj.server.config.server.BackendCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationAdd(org.forgerock.opendj.server.config.server.BackendCfg cfg)
applyConfigurationAdd
in interface org.forgerock.opendj.config.server.ConfigurationAddListener<org.forgerock.opendj.server.config.server.BackendCfg>
public boolean isConfigurationDeleteAcceptable(org.forgerock.opendj.server.config.server.BackendCfg cfg, List<LocalizableMessage> unacceptableReason)
isConfigurationDeleteAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationDeleteListener<org.forgerock.opendj.server.config.server.BackendCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationDelete(org.forgerock.opendj.server.config.server.BackendCfg cfg)
applyConfigurationDelete
in interface org.forgerock.opendj.config.server.ConfigurationDeleteListener<org.forgerock.opendj.server.config.server.BackendCfg>
public void deregisterBackend(Backend<? extends org.forgerock.opendj.server.config.server.BackendCfg> backend) throws DirectoryException
backend
- The backend to deregister with the server. It must not be null
.DirectoryException
- if any problem occurs while deregistering this backendpublic void shutdownLocalBackends()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.