public class NullBackend extends LocalBackend<NullBackendCfg>
LocalBackend.BackendOperation
Constructor and Description |
---|
NullBackend()
Creates a new backend with the provided information.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(Entry entry,
AddOperation addOperation)
Adds the provided entry to this backend.
|
void |
closeBackend()
Performs any necessary work to finally close this backend, particularly closing any underlying databases or
connections and deregistering any suffixes that it manages with the Directory Server.
|
void |
configureBackend(NullBackendCfg config,
ServerContext serverContext)
Configure this backend based on the information in the provided configuration.
|
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.
|
void |
exportLDIF(LDIFExportConfig exportConfig)
Exports the contents of this backend to LDIF.
|
Set<Dn> |
getBaseDNs()
Retrieves the set of base-level DNs that may be used within this backend.
|
Entry |
getEntry(Dn entryDn)
Retrieves the requested entry from this backend.
|
long |
getEntryCount()
Retrieves the total number of entries contained in this backend, if that information is available.
|
long |
getNumberOfChildren(Dn parentDN)
Retrieves the number of subordinates immediately below the requested entry.
|
long |
getNumberOfEntriesInBaseDN(Dn baseDN)
Retrieves the number of entries for the specified base DN including all entries from the requested entry to the
lowest level in the tree.
|
Set<String> |
getSupportedControls()
Retrieves the OIDs of the controls that may be supported by this backend.
|
ConditionResult |
hasSubordinates(Dn entryDN)
Indicates whether the requested entry has any subordinates.
|
LDIFImportResult |
importLDIF(LDIFImportConfig importConfig,
ServerContext serverContext)
Imports information from an LDIF file into this backend.
|
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 |
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 |
renameEntry(Dn currentDN,
Entry entry,
ModifyDnOperation modifyDNOperation)
Moves and/or renames the provided entry in this backend, altering any subordinate entries as necessary.
|
void |
replaceEntry(Entry oldEntry,
Entry newEntry,
ModifyOperation modifyOperation)
Replaces the specified entry with the provided entry in this backend.
|
void |
search(SearchOperation searchOperation)
Processes the specified search in this backend.
|
boolean |
supports(LocalBackend.BackendOperation backendOperation)
Indicates whether this backend supports the provided backend operation.
|
createBackup, deregisterBackendMonitor, finalizeBackend, getLocalBackendMonitor, getPersistentSearches, getWritabilityMode, handle, handlesEntry, handlesEntry, isIndexed, rebuildBackend, registerBackendMonitor, registerPersistentSearch, removeBackup, restoreBackup, setWritabilityMode, supportsControl, verifyBackend
getBackendID, getHealthStatus, getSupportedFeatures, isConfigurationAcceptable, setBackendID, toString
public NullBackend()
super()
to invoke this constructor.public void configureBackend(NullBackendCfg config, ServerContext serverContext)
Backend
configureBackend
in class Backend<NullBackendCfg>
config
- The configuration of this backend.serverContext
- The server context for this instancepublic void openBackend() throws InitializationException
LocalBackend
openBackend
in class LocalBackend<NullBackendCfg>
InitializationException
- If a problem occurs during opening that is not related to the server configuration.Backend.configureBackend(C, org.opends.server.core.ServerContext)
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<NullBackendCfg>
true
if this backend's baseDNs could be exposed as a public naming context, false
if they
must remain private naming contexts.public void closeBackend()
LocalBackend
It will be called as final step of finalizeBackend()
, so subclasses might override it.
closeBackend
in class LocalBackend<NullBackendCfg>
public Set<Dn> getBaseDNs()
Backend
getBaseDNs
in class Backend<NullBackendCfg>
public long getEntryCount()
LocalBackend
getEntryCount
in class LocalBackend<NullBackendCfg>
public boolean isIndexed(AttributeType attributeType, IndexType indexType)
LocalBackend
true
for the specified attribute and index type.isIndexed
in class LocalBackend<NullBackendCfg>
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 ConditionResult hasSubordinates(Dn entryDN)
LocalBackend
hasSubordinates
in class LocalBackend<NullBackendCfg>
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.public long getNumberOfEntriesInBaseDN(Dn baseDN)
LocalBackend
getNumberOfEntriesInBaseDN
in class LocalBackend<NullBackendCfg>
baseDN
- The base distinguished name.public long getNumberOfChildren(Dn parentDN)
LocalBackend
getNumberOfChildren
in class LocalBackend<NullBackendCfg>
parentDN
- The distinguished name of the parent.public Entry getEntry(Dn entryDn)
LocalBackend
getEntry
in class LocalBackend<NullBackendCfg>
entryDn
- The distinguished name of the entry to retrieve.null
if the entry does not exist.public boolean entryExists(Dn entryDN)
LocalBackend
getEntry
, but backend implementations may override this with a more efficient version. The caller is not
required to hold any locks on the specified DN.entryExists
in class LocalBackend<NullBackendCfg>
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.public void addEntry(Entry entry, AddOperation addOperation)
LocalBackend
addEntry
in class LocalBackend<NullBackendCfg>
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.public void deleteEntry(Dn entryDN, DeleteOperation deleteOperation)
LocalBackend
deleteEntry
in class LocalBackend<NullBackendCfg>
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.public void replaceEntry(Entry oldEntry, Entry newEntry, ModifyOperation modifyOperation)
LocalBackend
replaceEntry
in class LocalBackend<NullBackendCfg>
oldEntry
- The original entry that is being replaced.newEntry
- 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.public void renameEntry(Dn currentDN, Entry entry, ModifyDnOperation modifyDNOperation)
LocalBackend
renameEntry
in class LocalBackend<NullBackendCfg>
currentDN
- The current DN of the entry to be moved/renamed.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.public void search(SearchOperation searchOperation) throws LdapException
LocalBackend
SearchOperation.returnEntry
method. The caller is not required to have any locks when calling this
operation.search
in class LocalBackend<NullBackendCfg>
searchOperation
- The search operation to be processed.LdapException
- If a problem occurs while processing the search.CancelledResultException
- If this backend noticed and reacted to a request to cancel or abandon the search operation.public Set<String> getSupportedControls()
Backend
getSupportedControls
in class Backend<NullBackendCfg>
public boolean supports(LocalBackend.BackendOperation backendOperation)
LocalBackend
supports
in class LocalBackend<NullBackendCfg>
backendOperation
- the backend operationtrue
if this backend supports the provided backend operation, false
otherwise.public void exportLDIF(LDIFExportConfig exportConfig) throws LdapException
LocalBackend
LocalBackend.supports(BackendOperation)
with LocalBackend.BackendOperation.LDIF_EXPORT
returns true
.
Note that the server will not explicitly initialize this backend before calling this method.
exportLDIF
in class LocalBackend<NullBackendCfg>
exportConfig
- The configuration to use when performing the export.LdapException
- If a problem occurs while performing the LDIF export.public LDIFImportResult importLDIF(LDIFImportConfig importConfig, ServerContext serverContext) throws LdapException
LocalBackend
LocalBackend.supports(BackendOperation)
with LocalBackend.BackendOperation.LDIF_IMPORT
returns true
.
Note that the server will not explicitly initialize this backend before calling this method.
importLDIF
in class LocalBackend<NullBackendCfg>
importConfig
- The configuration to use when performing the import.serverContext
- The server contextLdapException
- If a problem occurs while performing the LDIF import.Copyright 2010-2022 ForgeRock AS.