public final class ThresholdingConfigFactory extends Object
Constructor and Description |
---|
ThresholdingConfigFactory(InputStream stream)
Constructor for ThresholdingConfigFactory.
|
Modifier and Type | Method and Description |
---|---|
Group |
getGroup(String groupName)
getGroup
|
Collection<String> |
getGroupNames()
getGroupNames
|
static ThresholdingConfigFactory |
getInstance()
Return the singleton instance of this factory.
|
String |
getRrdRepository(String groupName)
Retrieves the configured path to the RRD file repository for the
specified thresholding group.
|
Collection<Basethresholddef> |
getThresholds(String groupName)
Retrieves a Collection object consisting of all the
org.opennms.netmgt.config.Threshold objects which make up the specified
thresholding group.
|
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
static void |
reload()
Reload the config from the default config file
|
void |
saveCurrent()
Saves the current in-memory configuration to disk and reloads
|
static void |
setInstance(ThresholdingConfigFactory instance)
setInstance
|
void |
update()
update
|
public ThresholdingConfigFactory(InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
Constructor for ThresholdingConfigFactory.
stream
- a InputStream
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static void init() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- Thrown if the specified config file cannot be readorg.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static void reload() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
IOException
- Thrown if the specified config file cannot be read/loadedorg.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public static ThresholdingConfigFactory getInstance()
IllegalStateException
- Thrown if the factory has not yet been initialized.public static void setInstance(ThresholdingConfigFactory instance)
setInstance
instance
- a ThresholdingConfigFactory
object.public String getRrdRepository(String groupName)
groupName
- Group name to lookupIllegalArgumentException
- if group name does not exist in the group map.public Collection<Basethresholddef> getThresholds(String groupName)
groupName
- Group name to lookupIllegalArgumentException
- if group name does not exist in the group map.public Collection<String> getGroupNames()
getGroupNames
Collection
object.public void saveCurrent() throws org.exolab.castor.xml.MarshalException, IOException, org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
- if any.IOException
- if any.org.exolab.castor.xml.ValidationException
- if any.public void update() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
update
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.Copyright © 2017. All rights reserved.