Package org.opennms.pris
Class ConfigManager
java.lang.Object
org.opennms.pris.ConfigManager
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetInstanceConfig
(String instance) Return the instance configuration.getInstanceConfigWithGlobals
(String instance) Returns all known instance names.getInstances
(String glob) Returns all known instance names matching the provided glob.
-
Constructor Details
-
ConfigManager
public ConfigManager()
-
-
Method Details
-
getGlobalConfig
-
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
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
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
-