Interface RegistriesConfig

All Known Subinterfaces:
RegistriesConfig.Mutable
All Known Implementing Classes:
RegistriesConfigImpl, RegistriesConfigImpl.Builder

public interface RegistriesConfig
Registry client configuration. Consists of a list of registry configurations that will be providing platform and extension information to the client.
  • Method Details

    • isDebug

      boolean isDebug()
      Enables or disables registry client debug mode.
      Returns:
      true if the debug mode should be enabled, otherwise - false
    • getRegistries

      List<RegistryConfig> getRegistries()
      A list of registries that should queried when generating catalogs of platforms and extensions.
      Returns:
      list of registries that should queried when generating catalogs of platforms and extensions
    • getSource

      ConfigSource getSource()
      Returns:
      ConfigSource that describes origin of this configuration
    • mutable

      default RegistriesConfig.Mutable mutable()
      Returns:
      a mutable copy of this registry configuration
    • persist

      default void persist(Path p) throws IOException
      Persist this configuration to the specified file.
      Parameters:
      p - Target path
      Throws:
      IOException - if the specified file can not be written to.
    • persist

      void persist() throws IOException
      Persist this configuration to the original source (if possible). Does nothing for configurations read from environment variables.
      Throws:
      IOException - if the source file can not be written to.
    • resolveConfig

      static RegistriesConfig resolveConfig()
      Resolve the active registries configuration from system properties, the environment, and defaults.
      Returns:
      immutable RegistriesConfig
    • resolveFromFile

      static RegistriesConfig resolveFromFile(Path configYaml)
      Resolve the active registries configuration from the specified file
      Parameters:
      configYaml - Yaml file to read from
      Returns:
      read-only RegistriesConfig object
    • fromFile

      static RegistriesConfig fromFile(Path path) throws IOException
      Read config from the specified file
      Parameters:
      path - File to read from (yaml or json)
      Returns:
      read-only RegistriesConfig object (will return defaults for an empty file)
      Throws:
      IOException
    • mutableFromFile

      static RegistriesConfig.Mutable mutableFromFile(Path path) throws IOException
      Read config from the specified file
      Parameters:
      path - File to read from (yaml or json)
      Returns:
      mutable (possibly incomplete) RegistriesConfig object (will return defaults for an empty file)
      Throws:
      IOException
    • builder

      static RegistriesConfig.Mutable builder()
      Returns:
      a new mutable instance