public class ReadOnlyConfigFileHandler extends ConfigHandler<BackendCfg>
Backend.BackendOperation
Constructor and Description |
---|
ReadOnlyConfigFileHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(Entry entry,
AddOperation arg1)
Adds the provided entry to this backend.
|
void |
configureBackend(BackendCfg cfg,
ServerContext serverContext)
Configure this backend based on the information in the provided configuration.
|
void |
createBackup(BackupConfig arg0)
Creates a backup of the contents of this backend in a form that may be restored at a later date
if necessary.
|
void |
deleteEntry(DN arg0,
DeleteOperation arg1)
Removes the specified entry from this backend.
|
void |
exportLDIF(LDIFExportConfig arg0)
Exports the contents of this backend to LDIF.
|
void |
finalizeConfigHandler()
Finalizes this configuration handler so that it will release any
resources associated with it so that it will no longer be used.
|
DN[] |
getBaseDNs()
Retrieves the set of base-level DNs that may be used within this
backend.
|
ConfigEntry |
getConfigEntry(DN entryDN)
Retrieves the requested entry from the configuration.
|
ConfigEntry |
getConfigRootEntry()
Retrieves the entry that is at the root of the Directory Server
configuration.
|
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.
|
String |
getInstanceRoot()
Retrieves the absolute path of the Directory Server instance
root.
|
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.
|
String |
getServerRoot()
Retrieves the absolute path of the Directory Server install
root.
|
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.
|
org.forgerock.opendj.ldap.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.
|
void |
initializeConfigHandler(String configFile,
boolean checkSchema)
Bootstraps this configuration handler using the information in
the provided configuration file.
|
boolean |
isIndexed(AttributeType arg0,
IndexType arg1)
Indicates whether search operations which target the specified
attribute in the indicated manner would be considered indexed
in this backend.
|
void |
openBackend()
Opens this backend based on the information provided when the backend was configured.
|
void |
removeBackup(BackupDirectory backupDirectory,
String backupID)
Removes the specified backup if it is possible to do so.
|
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 |
restoreBackup(RestoreConfig restoreConfig)
Restores a backup of the contents of this backend.
|
void |
search(SearchOperation searchOperation)
Processes the specified search in this backend.
|
boolean |
supports(Backend.BackendOperation backendOperation)
Indicates whether this backend supports the provided backend operation.
|
void |
writeSuccessfulStartupConfig()
Indicates that the Directory Server has started successfully and
that the configuration handler should save a copy of the current
configuration for use as a "last known good" reference.
|
void |
writeUpdatedConfig()
Writes an updated version of the Directory Server configuration
to the repository.
|
addSubordinateBackend, closeBackend, entryExists, finalizeBackend, getBackendID, getBackendMonitor, getParentBackend, getPersistentSearches, getSubordinateBackends, getWritabilityMode, handlesEntry, handlesEntry, isConfigurationAcceptable, isIndexed, isPrivateBackend, rebuildBackend, registerPersistentSearch, removeSubordinateBackend, setBackendID, setBackendMonitor, setParentBackend, setPrivateBackend, setWritabilityMode, supportsControl, verifyBackend
public ReadOnlyConfigFileHandler()
public void finalizeConfigHandler()
finalizeConfigHandler
in class ConfigHandler<BackendCfg>
public ConfigEntry getConfigEntry(DN entryDN) throws org.forgerock.opendj.config.server.ConfigException
getConfigEntry
in class ConfigHandler<BackendCfg>
entryDN
- The distinguished name of the configuration
entry to retrieve.org.forgerock.opendj.config.server.ConfigException
- If a problem occurs while interacting
with the configuration.public ConfigEntry getConfigRootEntry() throws org.forgerock.opendj.config.server.ConfigException
getConfigRootEntry
in class ConfigHandler<BackendCfg>
org.forgerock.opendj.config.server.ConfigException
- If a problem occurs while interacting
with the configuration.public String getServerRoot()
getServerRoot
in class ConfigHandler<BackendCfg>
public String getInstanceRoot()
getInstanceRoot
in class ConfigHandler<BackendCfg>
public void initializeConfigHandler(String configFile, boolean checkSchema) throws InitializationException
initializeConfigHandler
in class ConfigHandler<BackendCfg>
configFile
- The path to the file to use to initialize
this configuration handler.checkSchema
- Indicates whether to perform schema checking
on the configuration data.InitializationException
- If a problem occurs while
attempting to initialize this
configuration handler.public void writeSuccessfulStartupConfig()
writeSuccessfulStartupConfig
in class ConfigHandler<BackendCfg>
public void writeUpdatedConfig() throws DirectoryException
writeUpdatedConfig
in class ConfigHandler<BackendCfg>
DirectoryException
- If a problem is encountered while
writing the updated configuration.public void addEntry(Entry entry, AddOperation arg1) throws DirectoryException, CanceledOperationException
addEntry
in class Backend<BackendCfg>
entry
- The entry to add to this backend.arg1
- 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 void configureBackend(BackendCfg cfg, ServerContext serverContext) throws org.forgerock.opendj.config.server.ConfigException
configureBackend
in class Backend<BackendCfg>
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 createBackup(BackupConfig arg0) throws DirectoryException
Backend.supports(BackendOperation)
with
Backend.BackendOperation.BACKUP
returns true
.
Note that the server will not explicitly initialize this backend before calling this method.
createBackup
in class Backend<BackendCfg>
arg0
- The configuration to use when performing the backup.DirectoryException
- If a problem occurs while performing the backup.public void deleteEntry(DN arg0, DeleteOperation arg1) throws DirectoryException, CanceledOperationException
deleteEntry
in class Backend<BackendCfg>
arg0
- The DN of the entry to remove from this
backend.arg1
- 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 void exportLDIF(LDIFExportConfig arg0) throws DirectoryException
Backend.supports(BackendOperation)
with Backend.BackendOperation.LDIF_EXPORT
returns
true
.
Note that the server will not explicitly initialize this backend before calling this method.
exportLDIF
in class Backend<BackendCfg>
arg0
- The configuration to use when performing the export.DirectoryException
- If a problem occurs while performing the LDIF export.public DN[] getBaseDNs()
getBaseDNs
in class Backend<BackendCfg>
public Entry getEntry(DN entryDN) throws DirectoryException
getEntry
in class Backend<BackendCfg>
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 long getEntryCount()
getEntryCount
in class Backend<BackendCfg>
public Set<String> getSupportedControls()
getSupportedControls
in class Backend<BackendCfg>
public Set<String> getSupportedFeatures()
getSupportedFeatures
in class Backend<BackendCfg>
public org.forgerock.opendj.ldap.ConditionResult hasSubordinates(DN entryDN) throws DirectoryException
hasSubordinates
in class Backend<BackendCfg>
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 LDIFImportResult importLDIF(LDIFImportConfig importConfig, ServerContext serverContext) throws DirectoryException
Backend.supports(BackendOperation)
with Backend.BackendOperation.LDIF_IMPORT
returns
true
.
Note that the server will not explicitly initialize this backend before calling this method.
importLDIF
in class Backend<BackendCfg>
importConfig
- The configuration to use when performing the import.serverContext
- The server contextDirectoryException
- If a problem occurs while performing the LDIF import.public void openBackend() throws org.forgerock.opendj.config.server.ConfigException, InitializationException
openBackend
in class Backend<BackendCfg>
org.forgerock.opendj.config.server.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.Backend.configureBackend(C, org.opends.server.core.ServerContext)
public boolean isIndexed(AttributeType arg0, IndexType arg1)
true
for the specified
attribute and index type.isIndexed
in class Backend<BackendCfg>
arg0
- The attribute type for which to make the
determination.arg1
- 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 long getNumberOfChildren(DN parentDN) throws DirectoryException
getNumberOfChildren
in class Backend<BackendCfg>
parentDN
- The distinguished name of the parent.DirectoryException
- If baseDN isn't a base dn managed by this backend or if a problem occurs while trying to retrieve the
entry.public long getNumberOfEntriesInBaseDN(DN baseDN) throws DirectoryException
getNumberOfEntriesInBaseDN
in class Backend<BackendCfg>
baseDN
- The base distinguished name.DirectoryException
- If baseDN isn't a base dn managed by this backend or if a problem occurs while trying to retrieve the
entry.public void removeBackup(BackupDirectory backupDirectory, String backupID) throws DirectoryException
removeBackup
in class Backend<BackendCfg>
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 void renameEntry(DN currentDN, Entry entry, ModifyDNOperation modifyDNOperation) throws DirectoryException, CanceledOperationException
renameEntry
in class Backend<BackendCfg>
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.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 void replaceEntry(Entry oldEntry, Entry newEntry, ModifyOperation modifyOperation) throws DirectoryException, CanceledOperationException
replaceEntry
in class Backend<BackendCfg>
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.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 void restoreBackup(RestoreConfig restoreConfig) throws DirectoryException
Backend.supports(BackendOperation)
with Backend.BackendOperation.RESTORE
returns true
.
Note that the server will not explicitly initialize this backend before calling this method.
restoreBackup
in class Backend<BackendCfg>
restoreConfig
- The configuration to use when performing the restore.DirectoryException
- If a problem occurs while performing the restore.public void search(SearchOperation searchOperation) throws DirectoryException, CanceledOperationException
SearchOperation.returnEntry
method. The caller is not
required to have any locks when calling this operation.search
in class Backend<BackendCfg>
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 boolean supports(Backend.BackendOperation backendOperation)
supports
in class Backend<BackendCfg>
backendOperation
- the backend operationtrue
if this backend supports the provided backend operation, false
otherwise.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.