|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.api.Backend
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=false) public abstract class Backend
This class defines the set of methods and structures that must be implemented for a Directory Server backend.
Constructor Summary | |
---|---|
protected |
Backend()
Creates a new backend with the provided information. |
Method Summary | |
---|---|
abstract void |
addEntry(Entry entry,
AddOperation addOperation)
Adds the provided entry to this backend. |
void |
addSubordinateBackend(Backend subordinateBackend)
Adds the provided backend to the set of subordinate backends for this backend. |
abstract void |
configureBackend(Configuration cfg)
Configure this backend based on the information in the provided configuration. |
abstract void |
createBackup(BackupConfig backupConfig)
Creates a backup of the contents of this backend in a form that may be restored at a later date if necessary. |
abstract void |
deleteEntry(DN entryDN,
DeleteOperation deleteOperation)
Removes the specified entry from this backend. |
boolean |
entryExists(DN entryDN)
Indicates whether an entry with the specified DN exists in the backend. |
abstract void |
exportLDIF(LDIFExportConfig exportConfig)
Exports the contents of this backend to LDIF. |
abstract void |
finalizeBackend()
Performs any necessary work to finalize this backend, including closing any underlying databases or connections and deregistering any suffixes that it manages with the Directory Server. |
java.lang.String |
getBackendID()
Retrieves the unique identifier for this backend. |
BackendMonitor |
getBackendMonitor()
Retrieves the backend monitor that is associated with this backend. |
abstract DN[] |
getBaseDNs()
Retrieves the set of base-level DNs that may be used within this backend. |
abstract Entry |
getEntry(DN entryDN)
Retrieves the requested entry from this backend. |
abstract long |
getEntryCount()
Retrieves the total number of entries contained in this backend, if that information is available. |
Backend |
getParentBackend()
Retrieves the parent backend for this backend. |
Backend[] |
getSubordinateBackends()
Retrieves the set of subordinate backends for this backend. |
abstract java.util.Set<java.lang.String> |
getSupportedControls()
Retrieves the OIDs of the controls that may be supported by this backend. |
abstract java.util.Set<java.lang.String> |
getSupportedFeatures()
Retrieves the OIDs of the features that may be supported by this backend. |
WritabilityMode |
getWritabilityMode()
Retrieves the writability mode for this backend. |
boolean |
handlesEntry(DN entryDN)
Indicates whether this backend should be used to handle operations for the provided entry. |
static boolean |
handlesEntry(DN entryDN,
java.util.List<DN> baseDNs,
java.util.List<DN> excludeDNs)
Indicates whether a backend should be used to handle operations for the provided entry given the set of base DNs and exclude DNs. |
abstract ConditionResult |
hasSubordinates(DN entryDN)
Indicates whether the requested entry has any subordinates. |
boolean |
hasSubSuffix(DN subSuffixDN)
Indicates whether this backend has a subordinate backend registered with the provided base DN. |
abstract LDIFImportResult |
importLDIF(LDIFImportConfig importConfig)
Imports information from an LDIF file into this backend. |
abstract void |
initializeBackend()
Initializes this backend based on the information provided when the backend was configured. |
boolean |
isConfigurationAcceptable(Configuration configuration,
java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this backend. |
abstract boolean |
isIndexed(AttributeType attributeType,
IndexType indexType)
Indicates whether search operations which target the specified attribute in the indicated manner would be considered indexed in this backend. |
boolean |
isIndexed(AttributeType attributeType,
MatchingRule matchingRule)
Indicates whether extensible match search operations that target the specified attribute with the given matching rule should be considered indexed in this backend. |
boolean |
isIndexed(SearchFilter filter)
Indicates whether a subtree search using the provided filter would be indexed in this backend. |
abstract boolean |
isLocal()
Indicates whether the data associated with this backend may be considered local (i.e., in a repository managed by the Directory Server) rather than remote (i.e., in an external repository accessed by the Directory Server but managed through some other means). |
boolean |
isPrivateBackend()
Indicates whether this backend holds private data or user data. |
abstract long |
numSubordinates(DN entryDN,
boolean subtree)
Retrieves the number of subordinates for the requested entry. |
abstract void |
preloadEntryCache()
Attempts to pre-load all the entries stored within this backend into the entry cache. |
abstract void |
removeBackup(BackupDirectory backupDirectory,
java.lang.String backupID)
Removes the specified backup if it is possible to do so. |
void |
removeSubordinateBackend(Backend subordinateBackend)
Removes the provided backend from the set of subordinate backends for this backend. |
void |
removeSubSuffix(DN subSuffixDN,
DN parentDN)
Removes the backend associated with the specified sub-suffix if it is registered. |
abstract void |
renameEntry(DN currentDN,
Entry entry,
ModifyDNOperation modifyDNOperation)
Moves and/or renames the provided entry in this backend, altering any subordinate entries as necessary. |
abstract void |
replaceEntry(Entry entry,
ModifyOperation modifyOperation)
Replaces the specified entry with the provided entry in this backend. |
abstract void |
restoreBackup(RestoreConfig restoreConfig)
Restores a backup of the contents of this backend. |
abstract void |
search(SearchOperation searchOperation)
Processes the specified search in this backend. |
void |
setBackendID(java.lang.String backendID)
Specifies the unique identifier for this backend. |
void |
setBackendMonitor(BackendMonitor backendMonitor)
Sets the backend monitor for this backend. |
void |
setParentBackend(Backend parentBackend)
Specifies the parent backend for this backend. |
void |
setPrivateBackend(boolean isPrivateBackend)
Specifies whether this backend holds private data or user data. |
void |
setSubordinateBackends(Backend[] subordinateBackends)
Specifies the set of subordinate backends for this backend. |
void |
setWritabilityMode(WritabilityMode writabilityMode)
Specifies the writability mode for this backend. |
abstract boolean |
supportsBackup()
Indicates whether this backend provides a backup mechanism of any kind. |
abstract boolean |
supportsBackup(BackupConfig backupConfig,
java.lang.StringBuilder unsupportedReason)
Indicates whether this backend provides a mechanism to perform a backup of its contents in a form that can be restored later, based on the provided configuration. |
boolean |
supportsControl(java.lang.String controlOID)
Indicates whether this backend supports the specified control. |
boolean |
supportsFeature(java.lang.String featureOID)
Indicates whether this backend supports the specified feature. |
abstract boolean |
supportsLDIFExport()
Indicates whether this backend provides a mechanism to export the data it contains to an LDIF file. |
abstract boolean |
supportsLDIFImport()
Indicates whether this backend provides a mechanism to import its data from an LDIF file. |
abstract boolean |
supportsRestore()
Indicates whether this backend provides a mechanism to restore a backup. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Backend()
super
to invoke this constructor.
Method Detail |
---|
public abstract void configureBackend(Configuration cfg) throws ConfigException
cfg
- The configuration of this backend.
ConfigException
- If there is an error in the configuration.public boolean isConfigurationAcceptable(Configuration configuration, java.util.List<Message> unacceptableReasons)
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.
true
if the provided configuration is acceptable
for this backend, or false
if not.public abstract void initializeBackend() throws ConfigException, InitializationException
ConfigException
- If an unrecoverable problem arises in
the process of performing the
initialization.
InitializationException
- If a problem occurs during
initialization that is not
related to the server
configuration.configureBackend(org.opends.server.admin.Configuration)
public abstract void finalizeBackend()
public abstract DN[] getBaseDNs()
public abstract void preloadEntryCache() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if backend does not
support this operation.public abstract boolean isLocal()
true
if the data associated with this backend
may be considered local, or false
if it is
remote.public abstract boolean isIndexed(AttributeType attributeType, IndexType indexType)
true
for the specified
attribute and index type.
attributeType
- The attribute type for which to make the
determination.indexType
- The index type for which to make the
determination.
true
if search operations targeting the
specified attribute in the indicated manner should be
considered indexed, or false
if not.public boolean isIndexed(AttributeType attributeType, MatchingRule matchingRule)
attributeType
- The attribute type for which to make the
determination.matchingRule
- The matching rule for which to make the
determination.
true
if extensible match search operations
targeting the specified attribute with the given
matching rule should be considered indexed, or
false
if not.public boolean isIndexed(SearchFilter filter)
filter
- The search filter for which to make the
determination.
true
if it is believed that the provided filter
would be indexed in this backend, or false
if
not.public abstract Entry getEntry(DN entryDN) throws DirectoryException
entryDN
- The distinguished name of the entry to retrieve.
null
if the entry does
not exist.
DirectoryException
- If a problem occurs while trying to
retrieve the entry.public abstract ConditionResult hasSubordinates(DN entryDN) throws DirectoryException
entryDN
- The distinguished name of the entry.
ConditionResult.TRUE
if the entry has one or more
subordinates or ConditionResult.FALSE
otherwise
or ConditionResult.UNDEFINED
if it can not be
determined.
DirectoryException
- If a problem occurs while trying to
retrieve the entry.public abstract long numSubordinates(DN entryDN, boolean subtree) throws DirectoryException
entryDN
- The distinguished name of the entry.subtree
- true
to include all entries from the
requested entry to the lowest level in the
tree or false
to only include
the entries immediately below the requested
entry.
DirectoryException
- If a problem occurs while trying to
retrieve the entry.public boolean entryExists(DN entryDN) throws DirectoryException
getEntry
, but backend implementations may override this
with a more efficient version that does not require a lock. The
caller is not required to hold any locks on the specified DN.
entryDN
- The DN of the entry for which to determine
existence.
true
if the specified entry exists in this
backend, or false
if it does not.
DirectoryException
- If a problem occurs while trying to
make the determination.public abstract void addEntry(Entry entry, AddOperation addOperation) throws DirectoryException, CanceledOperationException
entry
- The entry to add to this backend.addOperation
- The add operation with which the new entry
is associated. This may be null
for adds performed internally.
DirectoryException
- If a problem occurs while trying to
add the entry.
CanceledOperationException
- If this backend noticed and
reacted to a request to
cancel or abandon the add
operation.public abstract void deleteEntry(DN entryDN, DeleteOperation deleteOperation) throws DirectoryException, CanceledOperationException
entryDN
- The DN of the entry to remove from this
backend.deleteOperation
- The delete operation with which this
action is associated. This may be
null
for deletes performed
internally.
DirectoryException
- If a problem occurs while trying to
remove the entry.
CanceledOperationException
- If this backend noticed and
reacted to a request to
cancel or abandon the
delete operation.public abstract void replaceEntry(Entry entry, ModifyOperation modifyOperation) throws DirectoryException, CanceledOperationException
entry
- The new entry to use in place of the
existing entry with the same DN.modifyOperation
- The modify operation with which this
action is associated. This may be
null
for modifications performed
internally.
DirectoryException
- If a problem occurs while trying to
replace the entry.
CanceledOperationException
- If this backend noticed and
reacted to a request to
cancel or abandon the
modify operation.public abstract void renameEntry(DN currentDN, Entry entry, ModifyDNOperation modifyDNOperation) throws DirectoryException, CanceledOperationException
currentDN
- The current DN of the entry to be
replaced.entry
- The new content to use for the entry.modifyDNOperation
- The modify DN operation with which
this action is associated. This may
be null
for modify DN
operations performed internally.
DirectoryException
- If a problem occurs while trying to
perform the rename.
CanceledOperationException
- If this backend noticed and
reacted to a request to
cancel or abandon the
modify DN operation.public abstract void search(SearchOperation searchOperation) throws DirectoryException, CanceledOperationException
SearchOperation.returnEntry
method. The caller is not
required to have any locks when calling this operation.
searchOperation
- The search operation to be processed.
DirectoryException
- If a problem occurs while processing
the search.
CanceledOperationException
- If this backend noticed and
reacted to a request to
cancel or abandon the
search operation.public abstract java.util.Set<java.lang.String> getSupportedControls()
public final boolean supportsControl(java.lang.String controlOID)
controlOID
- The OID of the control for which to make the
determination.
true
if this backends supports the control with
the specified OID, or false
if it does not.public abstract java.util.Set<java.lang.String> getSupportedFeatures()
public final boolean supportsFeature(java.lang.String featureOID)
featureOID
- The OID of the feature for which to make the
determination.
true
if this backend supports the feature with
the specified OID, or false
if it does not.public abstract boolean supportsLDIFExport()
true
if this backend provides an LDIF export
mechanism, or false
if not.public abstract void exportLDIF(LDIFExportConfig exportConfig) throws DirectoryException
supportsLDIFExport
returns
true
. Note that the server will not explicitly
initialize this backend before calling this method.
exportConfig
- The configuration to use when performing
the export.
DirectoryException
- If a problem occurs while performing
the LDIF export.public abstract boolean supportsLDIFImport()
true
if this backend provides an LDIF import
mechanism, or false
if not.public abstract LDIFImportResult importLDIF(LDIFImportConfig importConfig) throws DirectoryException
supportsLDIFImport
returns true
. Note that the server will not explicitly
initialize this backend before calling this method.
importConfig
- The configuration to use when performing
the import.
DirectoryException
- If a problem occurs while performing
the LDIF import.public abstract boolean supportsBackup()
true
for backends that
it is not possible to archive directly (e.g., those that don't
store their data locally, but rather pass through requests to
some other repository).
true
if this backend provides any kind of backup
mechanism, or false
if it does not.public abstract boolean supportsBackup(BackupConfig backupConfig, java.lang.StringBuilder unsupportedReason)
backupConfig
- The configuration of the backup for
which to make the determination.unsupportedReason
- A buffer to which a message can be
appended
explaining why the requested backup is
not supported.
true
if this backend provides a mechanism for
performing backups with the provided configuration, or
false
if not.public abstract void createBackup(BackupConfig backupConfig) throws DirectoryException
supportsBackup
returns true
.
Note that the server will not explicitly initialize this backend
before calling this method.
backupConfig
- The configuration to use when performing
the backup.
DirectoryException
- If a problem occurs while performing
the backup.public abstract void removeBackup(BackupDirectory backupDirectory, java.lang.String backupID) throws DirectoryException
backupDirectory
- The backup directory structure with
which the specified backup is
associated.backupID
- The backup ID for the backup to be
removed.
DirectoryException
- If it is not possible to remove the
specified backup for some reason
(e.g., no such backup exists or
there are other backups that are
dependent upon it).public abstract boolean supportsRestore()
true
if this backend provides a mechanism for
restoring backups, or false
if not.public abstract void restoreBackup(RestoreConfig restoreConfig) throws DirectoryException
supportsRestore
returns
true
. Note that the server will not explicitly
initialize this backend before calling this method.
restoreConfig
- The configuration to use when performing
the restore.
DirectoryException
- If a problem occurs while performing
the restore.public final java.lang.String getBackendID()
public final void setBackendID(java.lang.String backendID)
backendID
- The unique identifier for this backend.public final boolean isPrivateBackend()
true
if this backend holds private data, or
false
if it holds user data.public final void setPrivateBackend(boolean isPrivateBackend)
isPrivateBackend
- Specifies whether this backend holds
private data or user data.public final WritabilityMode getWritabilityMode()
public final void setWritabilityMode(WritabilityMode writabilityMode)
writabilityMode
- The writability mode for this backend.public final BackendMonitor getBackendMonitor()
null
if none has been assigned.public final void setBackendMonitor(BackendMonitor backendMonitor)
backendMonitor
- The backend monitor for this backend.public abstract long getEntryCount()
public final Backend getParentBackend()
null
if
there is none.public final void setParentBackend(Backend parentBackend)
parentBackend
- The parent backend for this backend.public final Backend[] getSubordinateBackends()
public final void setSubordinateBackends(Backend[] subordinateBackends)
subordinateBackends
- The set of subordinate backends for
this backend.public final boolean hasSubSuffix(DN subSuffixDN)
subSuffixDN
- The DN of the sub-suffix for which to make
the determination.
true
if this backend has a subordinate backend
registered with the provided base DN, or false
if it does not.public final void removeSubSuffix(DN subSuffixDN, DN parentDN) throws ConfigException
subSuffixDN
- The DN of the sub-suffix to remove from this
backend.parentDN
- The superior DN for the sub-suffix DN that
matches one of the subordinate base DNs for
this backend.
ConfigException
- If the sub-suffix exists but it is not
possible to remove it for some reason.public final void addSubordinateBackend(Backend subordinateBackend)
subordinateBackend
- The backend to add to the set of
subordinate backends for this
backend.public final void removeSubordinateBackend(Backend subordinateBackend)
subordinateBackend
- The backend to remove from the set of
subordinate backends for this
backend.public final boolean handlesEntry(DN entryDN)
entryDN
- The DN of the entry for which to make the
determination.
true
if this backend handles operations for the
provided entry, or false
if it does not.public static final boolean handlesEntry(DN entryDN, java.util.List<DN> baseDNs, java.util.List<DN> excludeDNs)
entryDN
- The DN of the entry for which to make the
determination.baseDNs
- The set of base DNs for the backend.excludeDNs
- The set of DNs that should be excluded from
the backend.
true
if the backend should handle operations for
the provided entry, or false
if it does not.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |