@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class DirectoryEnvironmentConfig extends Object
Constructor and Description |
---|
DirectoryEnvironmentConfig()
Creates a new directory environment configuration initialized
from the system properties defined in the JVM.
|
DirectoryEnvironmentConfig(boolean checkIfServerIsRunning)
Creates a new directory environment configuration initialized from the
system properties defined in the JVM.
|
Modifier and Type | Method and Description |
---|---|
boolean |
disableAdminDataSynchronization()
Indicates whether the Directory Server startup process should
skip the synchronization between admin data and the
configuration.
|
boolean |
disableConnectionHandlers()
Indicates whether the Directory Server startup process should
skip the connection handler creation and initialization phases.
|
boolean |
disableExec()
Indicates whether the Directory Server should be allowed to use
the
Runtime.exec() method to be able to launch external
commands on the underlying system. |
boolean |
disableSynchronization()
Indicates whether the Directory Server startup process should
skip the synchronization provider creation and initialization
phases.
|
boolean |
forceDaemonThreads()
Indicates whether all threads created by the Directory Server
should be created as daemon threads.
|
File |
getConfigFile()
Retrieves the configuration file that should be used to
initialize the Directory Server config handler.
|
File |
getInstanceRoot()
Retrieves the directory that should be considered the instance
root.
|
String |
getInstanceRootAsString()
Retrieves the path of the directory that should be considered the instance
root.
|
File |
getLockDirectory()
Retrieves the directory that should be used to hold the server
lock files.
|
int |
getMaxConfigArchiveSize()
Retrieves the maximum number of archived configurations that the
Directory Server should maintain.
|
File |
getSchemaDirectory()
Retrieves the directory that contains the server schema
configuration files.
|
File |
getServerRoot()
Retrieves the directory that should be considered the server root.
|
String |
getServerRootAsString()
Retrieves the path of the directory that should be considered the server
root.
|
boolean |
maintainConfigArchive()
Indicates whether the Directory Server should maintain an archive
of previous configurations.
|
File |
setConfigFile(File configFile)
Specifies the configuration file that should be used to
initialize the Directory Server config handler.
|
boolean |
setDisableConnectionHandlers(boolean disableConnectionHandlers)
Specifies whether the Directory Server startup process should
skip the connection handler creation and initialization phases.
|
boolean |
setForceDaemonThreads(boolean forceDaemonThreads)
Specifies whether all threads created by the Directory Server
should be created as daemon threads.
|
File |
setInstanceRoot(File instanceRoot)
Specifies the directory that should be considered the instance
root.
|
boolean |
setMaintainConfigArchive(boolean maintainConfigArchive)
Specifies whether the Directory Server should maintain an archive
of previous configurations.
|
String |
setProperty(String name,
String value)
Specifies a property with the given name and value.
|
File |
setSchemaDirectory(File schemaDirectory)
Specifies the directory that should contain the server schema
configuration files.
|
File |
setServerRoot(File serverRoot)
Specifies the directory that should be considered the server
root.
|
boolean |
useLastKnownGoodConfiguration()
Indicates whether the Directory Server should attempt to start
with the "last known good" configuration rather than the current
active configuration file.
|
public DirectoryEnvironmentConfig()
public DirectoryEnvironmentConfig(boolean checkIfServerIsRunning)
checkIfServerIsRunning
- If true
, prevent any change when server is running.public String setProperty(String name, String value) throws InitializationException
null
.name
- The name of the property to set.value
- The value of the property to set, or null
if the property is to be removed.null
if it was not previously set.InitializationException
- If the Directory Server is
already running.public File getServerRoot()
The determination will first be based on the properties defined in this object. If no value is found there, then the JVM system properties will be checked, followed by an environment variable. If there is still no value, then the location of the config file, if available, is used to determine the root.
null
if it can't be determined.public String getServerRootAsString()
This method uses the same rules than getServerRoot
method, but
never returns null
. If no directory can be found it returns as a
last resort the value of "user.dir" system property.
public File getInstanceRoot()
null
if it can't be determined.public String getInstanceRootAsString()
This method uses the same rules than getInstanceRoot
method, but
never returns null
. If no directory can be found it returns as a
last resort the value of "user.dir" system property.
public File setServerRoot(File serverRoot) throws InitializationException
serverRoot
- The directory that should be considered the
server root.null
if there was
none.InitializationException
- If the Directory Server is
already running or there is a
problem with the provided
server root.public File setInstanceRoot(File instanceRoot) throws InitializationException
instanceRoot
- The directory that should be considered the
instanceRoot root.null
if there was
none.InitializationException
- If the Directory Server is
already running or there is a
problem with the provided
server root.public File getConfigFile()
null
if
no configuration file is defined.public File setConfigFile(File configFile) throws InitializationException
configFile
- The configuration file that should be used to
initialize the Directory Server config
handler.null
if none was defined.InitializationException
- If the Directory Server is
already running or there is a
problem with the provided
configuration file.public boolean useLastKnownGoodConfiguration()
false
will be returned.true
if the Directory Server should attempt to
start using the "last known good" configuration, or
false
if it should try to start using the
active configuration.public boolean maintainConfigArchive()
true
will be returned.true
if the Directory Server should maintain an
archive of previous configurations, or false
if
not.public boolean setMaintainConfigArchive(boolean maintainConfigArchive) throws InitializationException
maintainConfigArchive
- Indicates whether the Directory
Server should maintain an archive
of previous configurations.true
will
be returned.InitializationException
- If the Directory Server is
already running.public int getMaxConfigArchiveSize()
public File getSchemaDirectory()
null
if none is defined.public File setSchemaDirectory(File schemaDirectory) throws InitializationException
schemaDirectory
- The directory that should contain the
server schema configuration files.null
if none was defined.InitializationException
- If the Directory Server is
already running or there is a
problem with the provided
schema directory.public File getLockDirectory()
null
if it cannot be determined.public boolean disableConnectionHandlers()
true
if the Directory Server should not start
its connection handlers, or false
if the
connection handlers should be enabled.public boolean disableSynchronization()
true
if the Directory Server should not start
its synchronization provider, or false
if the
synchronization provider should be enabled.public boolean disableAdminDataSynchronization()
true
if the Directory Server should start
synchronization between admin data and the
configuration.public boolean setDisableConnectionHandlers(boolean disableConnectionHandlers) throws InitializationException
disableConnectionHandlers
- Indicates whether the
Directory Server should skip
the connection handler
creation and initialization
phases.false
will
be returned.InitializationException
- If the Directory Server is
already running.public boolean forceDaemonThreads()
true
if all threads created by the Directory
Server should be created as daemon threads, or
false
if not.public boolean setForceDaemonThreads(boolean forceDaemonThreads) throws InitializationException
forceDaemonThreads
- Indicates whether all threads created
by the Directory Server should be
created as daemon threads.false
will
be returned.InitializationException
- If the Directory Server is
already running.public boolean disableExec()
Runtime.exec()
method to be able to launch external
commands on the underlying system.true
if the Directory Server should be allowed
to use Runtime.exec()
, or false
if not.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.