public final class TrapdConfigFactory extends Object implements TrapdConfig
Constructor and Description |
---|
TrapdConfigFactory(InputStream stream)
Constructor for TrapdConfigFactory.
|
Modifier and Type | Method and Description |
---|---|
static TrapdConfig |
getInstance()
Return the singleton instance of this factory.
|
boolean |
getNewSuspectOnTrap()
Return whether or not a newSuspect event should be sent when a trap is
received from an unknown IP address.
|
String |
getSnmpTrapAddress() |
int |
getSnmpTrapPort()
Return the port on which SNMP traps should be received.
|
List<SnmpV3User> |
getSnmpV3Users()
getSnmpV3Users
|
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
|
static void |
setInstance(TrapdConfig config)
setInstance
|
public TrapdConfigFactory(InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
Constructor for TrapdConfigFactory.
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 TrapdConfig getInstance()
IllegalStateException
- Thrown if the factory has not yet been initialized.public static void setInstance(TrapdConfig config)
setInstance
config
- a TrapdConfig
object.public String getSnmpTrapAddress()
getSnmpTrapAddress
in interface TrapdConfig
public int getSnmpTrapPort()
getSnmpTrapPort
in interface TrapdConfig
public boolean getNewSuspectOnTrap()
getNewSuspectOnTrap
in interface TrapdConfig
public List<SnmpV3User> getSnmpV3Users()
TrapdConfig
getSnmpV3Users
getSnmpV3Users
in interface TrapdConfig
Copyright © 2017. All rights reserved.