Record Class ServerPaths

java.lang.Object
java.lang.Record
org.forgerock.opendj.config.ServerPaths
Record Components:
installPath - the installation path
instancePath - the instance path
configFile - the path to the configuration file

public record ServerPaths(Path installPath, Path instancePath, Path configFile) extends Record
Stores and manages server paths: the instance path, installation path, and configuration file.
  • Field Details

    • CONFIG_DIR_NAME

      public static final String CONFIG_DIR_NAME
      Config directory name.
      See Also:
    • CONFIG_FILE_NAME

      public static final String CONFIG_FILE_NAME
      The configuration LDIF file name.
      See Also:
    • CONFIG_FILE_RELATIVE_PATH

      public static final Path CONFIG_FILE_RELATIVE_PATH
      Relative Path to the OpenDJ instance of the config/config.ldif directory.
    • INSTALL_ROOT_SYSTEM_PROPERTY

      public static final String INSTALL_ROOT_SYSTEM_PROPERTY
      The install root where binaries are.
      See Also:
    • INSTANCE_ROOT_SYSTEM_PROPERTY

      public static final String INSTANCE_ROOT_SYSTEM_PROPERTY
      The instance path where the server is running.
      See Also:
    • PROPERTY_CONFIG_FILE

      public static final String PROPERTY_CONFIG_FILE
      The name of the system property that can be used to specify the path to the configuration file that should be used to initialize the config handler.
      See Also:
  • Constructor Details

    • ServerPaths

      public ServerPaths(Path installPath, Path instancePath, Path configFile)
      Canonical constructor.
  • Method Details

    • saveSystemProperties

      public static ServerPaths.InstallAndInstanceProperties saveSystemProperties()
      Returns the system properties for the install and instance directories.
      Returns:
      the system properties for the install and instance directories
    • restoreSystemProperties

      public static void restoreSystemProperties(ServerPaths.InstallAndInstanceProperties savedValues)
      Sets the system properties for the install and instance directories.
      Parameters:
      savedValues - the installation and instance directories
    • setSpecificSystemProperties

      public static void setSpecificSystemProperties(Path installRoot, Path instanceRoot)
      Sets the system properties for the install and instance directories.
      Parameters:
      installRoot - the installation directory root
      instanceRoot - the instance directory root
    • setSpecificSystemProperties

      public static void setSpecificSystemProperties(String installRoot, String instanceRoot)
      Sets the system properties for the install and instance directories.
      Parameters:
      installRoot - the installation directory root
      instanceRoot - the instance directory root
    • serverPaths

      public static ServerPaths serverPaths()
      Creates a new server paths.
      Returns:
      the server paths
    • serverPathsBuilder

      public static ServerPaths.Builder serverPathsBuilder()
      Creates a new server paths builder.
      Returns:
      the server paths builder
    • getDefaultServerPaths

      public static ServerPaths getDefaultServerPaths()
      Returns the default server paths.
      Returns:
      the default server paths
    • getSupportedInstanceLocFileLocation

      public static List<Path> getSupportedInstanceLocFileLocation(Path archivePath)
      Returns the list of supported instance.loc file locations.
      Parameters:
      archivePath - the path to the exploded archive
      Returns:
      the list of supported instance.loc file locations
    • getInstancePathFromInstanceLocFile

      public static Path getInstancePathFromInstanceLocFile(Path installPath)
      Returns the instance path stored in the instance.loc file.
      Parameters:
      installPath - the installation path
      Returns:
      the instance path stored in the instance.loc file
    • computeInstancePathFromConfigFile

      public static Path computeInstancePathFromConfigFile(Path configFile)
      Returns the instance path computed from the configuration file.
      Parameters:
      configFile - the configuration file
      Returns:
      the instance path computed from the configuration file
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • installPath

      public Path installPath()
      Returns the value of the installPath record component.
      Returns:
      the value of the installPath record component
    • instancePath

      public Path instancePath()
      Returns the value of the instancePath record component.
      Returns:
      the value of the instancePath record component
    • configFile

      public Path configFile()
      Returns the value of the configFile record component.
      Returns:
      the value of the configFile record component