Class ConfigManager

java.lang.Object
org.opennms.pris.ConfigManager

public class ConfigManager extends Object
The configuration manager. The manager provides a global configuration and a configuration for each instance that represents the requisition name. The configuration base path is the current working directory and can be overwritten by the config system property. The global configuration is loaded from the config.properties in the base path. These properties can be overwritten by the system properties. The instance configurations are loaded from sub-folders relative to the configuration base path where the instance name in the folder name.
Author:
Dustin Frisch <fooker@lab.sh>
  • Constructor Details

    • ConfigManager

      public ConfigManager()
  • Method Details

    • getGlobalConfig

      public Configuration getGlobalConfig()
    • getInstances

      public Collection<String> getInstances()
      Returns all known instance names. All sub-folders of the base directory having a requisition.properties file are interpreted as instance configurations.
      Returns:
      a collection of instance names
    • getInstances

      public Collection<String> getInstances(String glob)
      Returns all known instance names matching the provided glob. All sub-folders of the base directory matching the passed glob and having a requisition.properties file are interpreted as instance configurations. The provided glob pattern is used to limit the returned instances to those matching the glob. To return all instances, "*" can be passed.
      Parameters:
      glob - the glob pattern
      Returns:
      a collection of instance names
    • getInstanceConfig

      public InstanceConfiguration getInstanceConfig(String instance)
      Return the instance configuration. The instance configuration is loaded from the folder specified by the parameter instance.
      Parameters:
      instance - the instance name
      Returns:
      the instance configuration
    • getInstanceConfigWithGlobals

      public InstanceConfiguration getInstanceConfigWithGlobals(String instance)