java.lang.Object
java.lang.Record
org.elasticsearch.entitlement.runtime.policy.PathLookupImpl
All Implemented Interfaces:
PathLookup

public record PathLookupImpl(Path homeDir, Path configDir, Path[] dataDirs, Path sharedDataDir, Path[] sharedRepoDirs, Path libDir, Path modulesDir, Path pluginsDir, Path logsDir, Path tempDir, Path pidFile, Function<String,Stream<String>> settingResolver) extends Record implements PathLookup
Standard manager for resolving known paths.
  • Constructor Details

    • PathLookupImpl

      public PathLookupImpl(Path homeDir, Path configDir, Path[] dataDirs, Path sharedDataDir, Path[] sharedRepoDirs, Path libDir, Path modulesDir, Path pluginsDir, Path logsDir, Path tempDir, Path pidFile, Function<String,Stream<String>> settingResolver)
      Creates an instance of a PathLookupImpl record class.
      Parameters:
      homeDir - the value for the homeDir record component
      configDir - the value for the configDir record component
      dataDirs - the value for the dataDirs record component
      sharedDataDir - the value for the sharedDataDir record component
      sharedRepoDirs - the value for the sharedRepoDirs record component
      libDir - the value for the libDir record component
      modulesDir - the value for the modulesDir record component
      pluginsDir - the value for the pluginsDir record component
      logsDir - the value for the logsDir record component
      tempDir - the value for the tempDir record component
      pidFile - the value for the pidFile record component
      settingResolver - the value for the settingResolver record component
  • Method Details

    • getBaseDirPaths

      public Stream<Path> getBaseDirPaths(PathLookup.BaseDir baseDir)
      Specified by:
      getBaseDirPaths in interface PathLookup
    • resolveSettingPaths

      public Stream<Path> resolveSettingPaths(PathLookup.BaseDir baseDir, String settingName)
      Specified by:
      resolveSettingPaths in interface PathLookup
      Returns:
      all paths obtained by resolving all values of the given setting under all paths of the given baseDir.
    • isPathOnDefaultFilesystem

      public boolean isPathOnDefaultFilesystem(Path path)
      Specified by:
      isPathOnDefaultFilesystem in interface PathLookup
    • 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.
    • homeDir

      public Path homeDir()
      Returns the value of the homeDir record component.
      Returns:
      the value of the homeDir record component
    • configDir

      public Path configDir()
      Returns the value of the configDir record component.
      Returns:
      the value of the configDir record component
    • dataDirs

      public Path[] dataDirs()
      Returns the value of the dataDirs record component.
      Returns:
      the value of the dataDirs record component
    • sharedDataDir

      public Path sharedDataDir()
      Returns the value of the sharedDataDir record component.
      Returns:
      the value of the sharedDataDir record component
    • sharedRepoDirs

      public Path[] sharedRepoDirs()
      Returns the value of the sharedRepoDirs record component.
      Returns:
      the value of the sharedRepoDirs record component
    • libDir

      public Path libDir()
      Returns the value of the libDir record component.
      Returns:
      the value of the libDir record component
    • modulesDir

      public Path modulesDir()
      Returns the value of the modulesDir record component.
      Returns:
      the value of the modulesDir record component
    • pluginsDir

      public Path pluginsDir()
      Returns the value of the pluginsDir record component.
      Returns:
      the value of the pluginsDir record component
    • logsDir

      public Path logsDir()
      Returns the value of the logsDir record component.
      Returns:
      the value of the logsDir record component
    • tempDir

      public Path tempDir()
      Returns the value of the tempDir record component.
      Returns:
      the value of the tempDir record component
    • pidFile

      public Path pidFile()
      Returns the value of the pidFile record component.
      Specified by:
      pidFile in interface PathLookup
      Returns:
      the value of the pidFile record component
    • settingResolver

      public Function<String,Stream<String>> settingResolver()
      Returns the value of the settingResolver record component.
      Returns:
      the value of the settingResolver record component