org.opends.server.api
Class ConfigHandler

java.lang.Object
  extended by org.opends.server.api.Backend
      extended by org.opends.server.api.ConfigHandler
Direct Known Subclasses:
ConfigFileHandler

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=true)
public abstract class ConfigHandler
extends Backend

This class defines the set of methods and structures that must be implemented by a Directory Server configuration handler.


Constructor Summary
ConfigHandler()
           
 
Method Summary
abstract  void finalizeConfigHandler()
          Finalizes this configuration handler so that it will release any resources associated with it so that it will no longer be used.
abstract  ConfigEntry getConfigEntry(DN entryDN)
          Retrieves the requested entry from the configuration.
abstract  ConfigEntry getConfigRootEntry()
          Retrieves the entry that is at the root of the Directory Server configuration.
abstract  java.lang.String getServerRoot()
          Retrieves the absolute path of the Directory Server instance root.
abstract  void initializeConfigHandler(java.lang.String configFile, boolean checkSchema)
          Bootstraps this configuration handler using the information in the provided configuration file.
abstract  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.
abstract  void writeUpdatedConfig()
          Writes an updated version of the Directory Server configuration to the repository.
 
Methods inherited from class org.opends.server.api.Backend
addEntry, addSubordinateBackend, configureBackend, createBackup, deleteEntry, entryExists, exportLDIF, finalizeBackend, getBackendID, getBackendMonitor, getBaseDNs, getEntry, getEntryCount, getParentBackend, getSubordinateBackends, getSupportedControls, getSupportedFeatures, getWritabilityMode, handlesEntry, handlesEntry, hasSubordinates, hasSubSuffix, importLDIF, initializeBackend, isConfigurationAcceptable, isIndexed, isIndexed, isIndexed, isLocal, isPrivateBackend, numSubordinates, preloadEntryCache, removeBackup, removeSubordinateBackend, removeSubSuffix, renameEntry, replaceEntry, restoreBackup, search, setBackendID, setBackendMonitor, setParentBackend, setPrivateBackend, setSubordinateBackends, setWritabilityMode, supportsBackup, supportsBackup, supportsControl, supportsFeature, supportsLDIFExport, supportsLDIFImport, supportsRestore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigHandler

public ConfigHandler()
Method Detail

initializeConfigHandler

public abstract void initializeConfigHandler(java.lang.String configFile,
                                             boolean checkSchema)
                                      throws InitializationException
Bootstraps this configuration handler using the information in the provided configuration file. Depending on this configuration handler implementation, the provided file may contain either the entire server configuration or information that is needed to access the configuration in some other location or repository.

Parameters:
configFile - The path to the file to use to initialize this configuration handler.
checkSchema - Indicates whether to perform schema checking on the configuration data.
Throws:
InitializationException - If a problem occurs while attempting to initialize this configuration handler.

finalizeConfigHandler

public abstract void finalizeConfigHandler()
Finalizes this configuration handler so that it will release any resources associated with it so that it will no longer be used. This will be called when the Directory Server is shutting down, as well as in the startup process once the schema has been read so that the configuration can be re-read using the updated schema.


getConfigRootEntry

public abstract ConfigEntry getConfigRootEntry()
                                        throws ConfigException
Retrieves the entry that is at the root of the Directory Server configuration.

Returns:
The entry that is at the root of the Directory Server configuration.
Throws:
ConfigException - If a problem occurs while interacting with the configuration.

getConfigEntry

public abstract ConfigEntry getConfigEntry(DN entryDN)
                                    throws ConfigException
Retrieves the requested entry from the configuration.

Parameters:
entryDN - The distinguished name of the configuration entry to retrieve.
Returns:
The requested configuration entry.
Throws:
ConfigException - If a problem occurs while interacting with the configuration.

getServerRoot

public abstract java.lang.String getServerRoot()
Retrieves the absolute path of the Directory Server instance root.

Returns:
The absolute path of the Directory Server instance root.

writeUpdatedConfig

public abstract void writeUpdatedConfig()
                                 throws DirectoryException
Writes an updated version of the Directory Server configuration to the repository. This should ensure that the stored configuration matches the pending configuration.

Throws:
DirectoryException - If a problem is encountered while writing the updated configuration.

writeSuccessfulStartupConfig

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=false)
public abstract 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. Note that this may not be possible with some kinds of configuration repositories, so it should be a best effort attempt.

This method should only be called by the Directory Server itself when the server has started successfully. It should not be invoked by any other component at any other time.