Package org.opends.server.api
Class Backend<C extends Configuration>
- java.lang.Object
-
- org.opends.server.api.Backend<C>
-
- Type Parameters:
C- the type of the BackendCfg for the current backend
- Direct Known Subclasses:
LocalBackend
public abstract class Backend<C extends Configuration> extends Object
Represents a directory server backend, which can be either local or remote (proxy). A backend is a LDAP endpoint.
-
-
Constructor Summary
Constructors Constructor Description Backend()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidconfigureBackend(C cfg, ServerContext serverContext)Configure this backend based on the information in the provided configuration.abstract voidfinalizeBackend()Performs any necessary work to finalize this backend.StringgetBackendID()Retrieves the unique identifier for this backend.abstract Set<DN>getBaseDNs()Retrieves the set of base-level DNs that may be used within this backend.abstract Set<String>getSupportedControls()Retrieves the OIDs of the controls that may be supported by this backend.abstract Set<String>getSupportedFeatures()Retrieves the OIDs of the features that may be supported by this backend.booleanisConfigurationAcceptable(C configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons, ServerContext serverContext)Indicates whether the provided configuration is acceptable for this backend.abstract booleanisDefaultRoute()Indicates whether this backend should be considered a default (wild-card) route.abstract booleanisPrivateBackend()Indicates whether this backend holds private data or user data.abstract voidopenBackend()Opens this backend based on the information provided when the backend was configured.voidsetBackendID(String backendID)Specifies the unique identifier for this backend.
-
-
-
Method Detail
-
configureBackend
public abstract void configureBackend(C cfg, ServerContext serverContext) throws ConfigException
Configure this backend based on the information in the provided configuration. When the method returns, the backend will have been configured (ready to be opened) but still unable to process operations.- Parameters:
cfg- The configuration of this backend.serverContext- The server context for this instance- Throws:
ConfigException- If there is an error in the configuration.
-
openBackend
public abstract void openBackend() throws ConfigException, InitializationExceptionOpens this backend based on the information provided when the backend was configured. It also should open any underlying storage and register all suffixes with the server.- Throws:
ConfigException- If an unrecoverable problem arises while opening the backend.InitializationException- If a problem occurs during opening that is not related to the server configuration.- See Also:
configureBackend(C, org.opends.server.core.ServerContext)
-
finalizeBackend
public abstract void finalizeBackend()
Performs any necessary work to finalize this backend. The backend must be an opened backend, so do not use this method on backends where onlyconfigureBackend()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.
-
getBackendID
public final String getBackendID()
Retrieves the unique identifier for this backend.- Returns:
- The unique identifier for this backend.
-
getBaseDNs
public abstract Set<DN> getBaseDNs()
Retrieves the set of base-level DNs that may be used within this backend.- Returns:
- The set of base-level DNs that may be used within this backend.
-
isDefaultRoute
public abstract boolean isDefaultRoute()
Indicates whether this backend should be considered a default (wild-card) route.- Returns:
trueif the backend should be considered as the default route,falseotherwise
-
getSupportedControls
public abstract Set<String> getSupportedControls()
Retrieves the OIDs of the controls that may be supported by this backend.- Returns:
- The OIDs of the controls that may be supported by this backend.
-
getSupportedFeatures
public abstract Set<String> getSupportedFeatures()
Retrieves the OIDs of the features that may be supported by this backend.- Returns:
- The OIDs of the features that may be supported by this backend.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(C configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons, ServerContext serverContext)
Indicates whether the provided configuration is acceptable for this backend. It should be possible to call this method on an uninitialized backend instance in order to determine whether the backend would be able to use the provided configuration.
Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.- Parameters:
configuration- 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 context- Returns:
trueif the provided configuration is acceptable for this backend, orfalseif not.
-
isPrivateBackend
public abstract boolean isPrivateBackend()
Indicates whether this backend holds private data or user data.- Returns:
trueif this backend holds private data, orfalseif it holds user data.
-
setBackendID
public final void setBackendID(String backendID)
Specifies the unique identifier for this backend.- Parameters:
backendID- The unique identifier for this backend.
-
-