public final class TrapdConfigFactory extends Object implements TrapdConfig
| Constructor and Description |
|---|
TrapdConfigFactory(InputStream stream)
Constructor for TrapdConfigFactory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBatchIntervalMs()
Messages are aggregated in batches before being dispatched.
|
int |
getBatchSize()
Messages are aggregated in batches before being dispatched.
|
TrapdConfiguration |
getConfig() |
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.
|
int |
getNumThreads()
Number of threads used for consuming/dispatching messages.
|
int |
getQueueSize()
Maximum number of messages to keep in memory while waiting
to be dispatched.
|
String |
getSnmpTrapAddress() |
int |
getSnmpTrapPort()
Return the port on which SNMP traps should be received.
|
List<SnmpV3User> |
getSnmpV3Users() |
static void |
init()
Load the config from the default config file and create the singleton
instance of this factory.
|
boolean |
isIncludeRawMessage() |
static void |
reload()
Reload the config from the default config file
|
static void |
setInstance(TrapdConfig config)
setInstance
|
boolean |
shouldUseAddressFromVarbind() |
void |
update(TrapdConfig config) |
public TrapdConfigFactory(InputStream stream) throws IOException
Constructor for TrapdConfigFactory.
stream - a InputStream object.IOExceptionpublic static void init()
throws IOException
IOException - Thrown if the specified config file cannot be readIOException - if any.public static void reload()
throws IOException
IOException - Thrown if the specified config file cannot be read/loadedIOException - 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 TrapdConfigpublic int getSnmpTrapPort()
getSnmpTrapPort in interface TrapdConfigpublic boolean getNewSuspectOnTrap()
getNewSuspectOnTrap in interface TrapdConfigpublic List<SnmpV3User> getSnmpV3Users()
getSnmpV3Users in interface TrapdConfigpublic boolean isIncludeRawMessage()
isIncludeRawMessage in interface TrapdConfigpublic int getNumThreads()
TrapdConfiggetNumThreads in interface TrapdConfigpublic int getQueueSize()
TrapdConfiggetQueueSize in interface TrapdConfigpublic int getBatchSize()
TrapdConfiggetBatchSize in interface TrapdConfigpublic int getBatchIntervalMs()
TrapdConfiggetBatchIntervalMs in interface TrapdConfigpublic boolean shouldUseAddressFromVarbind()
shouldUseAddressFromVarbind in interface TrapdConfigpublic void update(TrapdConfig config)
update in interface TrapdConfigpublic TrapdConfiguration getConfig()
Copyright © 2022. All rights reserved.