public final class Installation extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BACKUPS_PATH_RELATIVE
The relative path where the backup files are.
|
static String |
CONFIG_PATH_RELATIVE
The relative path where the config files are.
|
static String |
DEFAULT_INTERACTIVE_BASE_DN
The default base DN prompted to user in setup interactive mode.
|
static String |
DEFAULT_JAVA_PROPERTIES_FILE
The default java properties file.
|
static String |
HISTORY_LOG_FILE_NAME
Name of the file kept in the history directory containing logs of upgrade and reversions.
|
static String |
INSTANCE_LOCATION_PATH
The path to the instance.loc file.
|
static String |
INSTANCE_LOCATION_PATH_RELATIVE
The relative path to the instance.loc file.
|
static String |
LIBRARIES_PATH_RELATIVE
The relative path where all the libraries (jar files) are.
|
static String |
LOCKS_PATH_RELATIVE
Relative path to the locks directory.
|
static String |
MAC_CONTROLPANEL_FILE_NAME
The MacOS X control panel application bundle name.
|
static String |
MAC_JAVA_APP_STUB_NAME
The MacOS X Java application stub name.
|
static String |
OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH
Relative path to bootstrap-client OpenDJ jar file.
|
static String |
OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH
Relative path to bootstrap OpenDJ jar file.
|
static String |
RELATIVE_JAVA_PROPERTIES_FILE
The default java properties file relative path.
|
static String[] |
REQUIRED_DIRECTORIES
Directories required to be present for this installation to be considered valid.
|
static String |
SCRIPT_UTIL_FILE_UNIX
Script utils file for UNIX systems.
|
static String |
SCRIPT_UTIL_FILE_WINDOWS
Script utils file for Windows.
|
static String |
SET_JAVA_PROPERTIES_FILE_UNIX
The set java home and arguments properties file for UNIX systems.
|
static String |
SET_JAVA_PROPERTIES_FILE_WINDOWS
The set java home and arguments properties file for Windows.
|
static String |
UNIX_BINARIES_PATH_RELATIVE
The relative path where all the UNIX binaries (scripts) are.
|
static String |
UNIX_CONTROLPANEL_FILE_NAME
The UNIX control panel script file name.
|
static String |
UNIX_IMPORT_LDIF
The UNIX import LDIF script file name.
|
static String |
UNIX_SETUP_FILE_NAME
The UNIX setup script file name.
|
static String |
UNIX_START_FILE_NAME
The UNIX start script file name.
|
static String |
UNIX_STATUSCLI_FILE_NAME
The UNIX status command line script file name.
|
static String |
UNIX_STOP_FILE_NAME
The UNIX stop script file name.
|
static String |
UNIX_UNINSTALL_FILE_NAME
The UNIX uninstall script file name.
|
static String |
UNIX_UPGRADE_FILE_NAME
The UNIX upgrade script file name.
|
static String |
WINDOWS_BINARIES_PATH_RELATIVE
The relative path where all the Windows binaries (batch files) are.
|
static String |
WINDOWS_CONTROLPANEL_FILE_NAME
The Windows control panel batch file name.
|
static String |
WINDOWS_IMPORT_LDIF
The Windows import LDIF batch file name.
|
static String |
WINDOWS_START_FILE_NAME
The Windows start batch file name.
|
static String |
WINDOWS_STATUSCLI_FILE_NAME
The Windows status command line batch file name.
|
static String |
WINDOWS_STOP_FILE_NAME
The Windows stop batch file name.
|
static String |
WINDOWS_UNINSTALL_FILE_NAME
The Windows uninstall batch file name.
|
Constructor and Description |
---|
Installation(File rootDirectory,
File instanceDirectory)
Creates a new instance from a root directory specified as a File.
|
Installation(String rootDirectory,
String instanceRootDirectory)
Creates a new instance from a root directory specified as a string.
|
Modifier and Type | Method and Description |
---|---|
File |
createHistoryBackupDirectory()
Creates a new directory in the history directory appropriate for backing up
an installation during an upgrade.
|
File |
getBackupDirectory()
Returns the path to the backup files under the install path.
|
Configuration |
getBaseConfiguration()
Gets the Configuration object representing this file.
|
File |
getBaseConfigurationFile()
Creates a File object representing config/upgrade/schema.ldif.current which
the server creates the first time it starts if there are schema
customizations.
|
File |
getBaseSchemaFile()
Creates a File object representing config/upgrade/schema.ldif.current which
the server creates the first time it starts if there are schema
customizations.
|
File |
getBinariesDirectory()
Returns the relative path of the directory containing the binaries/scripts
of the Open DS installation.
|
BuildInformation |
getBuildInformation()
Gets information about the build that was used to produce the bits for this
installation.
|
BuildInformation |
getBuildInformation(boolean useCachedVersion)
Gets information about the build that was used to produce the bits for this
installation.
|
File |
getClassesDirectory()
Returns the path to the classes directory.
|
File |
getCommandFile(String command)
Gets the file for invoking a particular command appropriate for the current
operating system.
|
File |
getConfigurationDirectory()
Returns the path to the config files under the install path.
|
File |
getConfigurationUpgradeDirectory()
Gets the directory config/upgrade.
|
File |
getControlPanelCommandFile()
Gets the control panel command file appropriate for the current operating
system.
|
Configuration |
getCurrentConfiguration()
Gets the Configuration object representing this file.
|
File |
getCurrentConfigurationFile()
Returns the path to the configuration file of the directory server.
|
File |
getDatabasesDirectory()
Returns the path to the database files under the install path.
|
File |
getHistoryDirectory()
Returns the directory where the lock files are stored.
|
File |
getHistoryLogFile()
Gets the log file where the history of upgrades and reversions is kept.
|
BuildInformation |
getInstanceBuildInformation()
Gets information about the build that was used to produce the instance.
|
File |
getInstanceDirectory()
Gets the top level directory of an OpenDJ instance.
|
String |
getInstanceVCSRevision()
Gets the VCS revision of the instance.
|
String |
getInvalidityReason()
Creates a string explaining why this is not a legitimate OpenDJ
installation.
|
File |
getLdifDirectory()
Returns the 'ldif' directory.
|
File |
getLibrariesDirectory()
Returns the path to the libraries.
|
static Installation |
getLocal()
Obtains the installation by reading the classpath of the running JVM to
determine the location of the jars and determine the installation root.
|
File |
getLocksDirectory()
Returns the directory where the lock files are stored.
|
File |
getLogsDirectory()
Returns the path to the log files under the install path.
|
File |
getOpenDSJarFile()
Returns the path to the opends jar file.
|
File |
getQuicksetupJarFile()
Returns the path to the quicksetup jar file.
|
File |
getResourcesDirectory()
Returns the path to the resources directory.
|
File |
getRootDirectory()
Gets the top level directory of an OpenDJ installation.
|
File |
getSchemaConcatFile()
Creates a File object representing config/upgrade/schema.ldif.current which
the server creates the first time it starts if there are schema
customizations.
|
File |
getServerStartCommandFile()
Gets the file responsible for stopping the server appropriate for the
current operating system.
|
File |
getServerStopCommandFile()
Gets the file responsible for stopping the server appropriate for the
current operating system.
|
static String |
getSetupFileName()
Returns the setup file name to use with the current operating system.
|
Status |
getStatus()
Gets the current status of this installation.
|
File |
getTemplateDirectory()
Gets the directory used to store the template configuration.
|
File |
getTemporaryDirectory()
Gets the directory used to store files temporarily.
|
File |
getTemporaryUpgradeDirectory()
Gets the directory where the upgrader stores files temporarily.
|
File |
getUninstallBatFile()
Returns the path to the uninstall.bat file.
|
String |
getVCSRevision()
Gets the VCS revision of the build.
|
boolean |
isValid(File file)
Indicates whether this installation appears to be an actual OpenDJ
installation.
|
void |
setInstanceDirectory(File instanceDirectory)
Sets the root directory of this instance.
|
void |
setRootDirectory(File rootDirectory)
Sets the root directory of this installation.
|
static void |
validateRootDirectory(File rootDirectory)
Performs validation on the specified file to make sure that it is an actual
OpenDJ installation.
|
public static final String OPENDJ_BOOTSTRAP_JAR_RELATIVE_PATH
public static final String OPENDJ_BOOTSTRAP_CLIENT_JAR_RELATIVE_PATH
public static final String WINDOWS_BINARIES_PATH_RELATIVE
public static final String UNIX_BINARIES_PATH_RELATIVE
public static final String LIBRARIES_PATH_RELATIVE
public static final String BACKUPS_PATH_RELATIVE
public static final String CONFIG_PATH_RELATIVE
public static final String LOCKS_PATH_RELATIVE
public static final String INSTANCE_LOCATION_PATH_RELATIVE
public static final String INSTANCE_LOCATION_PATH
public static final String UNIX_SETUP_FILE_NAME
public static final String UNIX_UNINSTALL_FILE_NAME
public static final String WINDOWS_UNINSTALL_FILE_NAME
public static final String UNIX_UPGRADE_FILE_NAME
public static final String UNIX_START_FILE_NAME
public static final String WINDOWS_START_FILE_NAME
public static final String UNIX_STOP_FILE_NAME
public static final String WINDOWS_STOP_FILE_NAME
public static final String UNIX_CONTROLPANEL_FILE_NAME
public static final String WINDOWS_CONTROLPANEL_FILE_NAME
public static final String MAC_JAVA_APP_STUB_NAME
public static final String MAC_CONTROLPANEL_FILE_NAME
public static final String UNIX_STATUSCLI_FILE_NAME
public static final String WINDOWS_STATUSCLI_FILE_NAME
public static final String UNIX_IMPORT_LDIF
public static final String WINDOWS_IMPORT_LDIF
public static final String HISTORY_LOG_FILE_NAME
public static final String DEFAULT_JAVA_PROPERTIES_FILE
public static final String RELATIVE_JAVA_PROPERTIES_FILE
public static final String SET_JAVA_PROPERTIES_FILE_WINDOWS
public static final String SCRIPT_UTIL_FILE_UNIX
public static final String SCRIPT_UTIL_FILE_WINDOWS
public static final String SET_JAVA_PROPERTIES_FILE_UNIX
public static final String[] REQUIRED_DIRECTORIES
public static final String DEFAULT_INTERACTIVE_BASE_DN
public Installation(String rootDirectory, String instanceRootDirectory)
rootDirectory
- of this installationinstanceRootDirectory
- The instance root directorypublic Installation(File rootDirectory, File instanceDirectory)
rootDirectory
- of this installationinstanceDirectory
- of the instancepublic static void validateRootDirectory(File rootDirectory) throws IllegalArgumentException
rootDirectory
- File directory candidateIllegalArgumentException
- if root directory does not appear to be an OpenDJ installation
root. The thrown exception contains a localized message
indicating the reason why rootDirectory
is not a
valid OpenDJ install root.public static Installation getLocal()
public File getRootDirectory()
public File getInstanceDirectory()
public void setRootDirectory(File rootDirectory)
rootDirectory
- File of this installationpublic void setInstanceDirectory(File instanceDirectory)
instanceDirectory
- File of this instancepublic boolean isValid(File file)
file
- The root directorypublic String getInvalidityReason()
public Configuration getCurrentConfiguration()
public Configuration getBaseConfiguration() throws ApplicationException
ApplicationException
- if there was a problem determining the svn rev number.public Status getStatus()
public File getLibrariesDirectory()
public File getResourcesDirectory()
public File getClassesDirectory()
public File getSchemaConcatFile()
public File getBaseSchemaFile() throws ApplicationException
ApplicationException
- if there was a problem determining the svn revision numberpublic File getBaseConfigurationFile() throws ApplicationException
ApplicationException
- if there was a problem determining the svn revision numberpublic String getVCSRevision() throws ApplicationException
ApplicationException
- if for some reason the number could not be determinedpublic String getInstanceVCSRevision() throws ApplicationException
ApplicationException
- if for some reason the number could not be determinedpublic File getCurrentConfigurationFile()
public File getBinariesDirectory()
public File getDatabasesDirectory()
public File getBackupDirectory()
public File getConfigurationDirectory()
public File getLogsDirectory()
public File getLocksDirectory()
public File getTemplateDirectory()
public File getTemporaryDirectory()
public File getHistoryDirectory()
public File createHistoryBackupDirectory() throws IOException
IOException
- if an error occurred creating the directory.public File getHistoryLogFile()
public File getConfigurationUpgradeDirectory()
public File getTemporaryUpgradeDirectory()
public File getCommandFile(String command)
command
- name of the commandpublic File getServerStartCommandFile()
public File getServerStopCommandFile()
public static String getSetupFileName()
public File getLdifDirectory()
public File getQuicksetupJarFile()
public File getOpenDSJarFile()
public File getUninstallBatFile()
public File getControlPanelCommandFile()
public BuildInformation getBuildInformation() throws ApplicationException
ApplicationException
- if there is a problem obtaining the build informationpublic BuildInformation getBuildInformation(boolean useCachedVersion) throws ApplicationException
useCachedVersion
- where true indicates that a potentially cached version of the
build information is acceptable for use; false indicates the the
build information will be created from scratch which is
potentially time consumingApplicationException
- if there is a problem obtaining the build informationpublic BuildInformation getInstanceBuildInformation()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.