Package org.opennms.netmgt.config
Class SyslogdConfigFactory
- java.lang.Object
-
- org.opennms.netmgt.config.SyslogdConfigFactory
-
- All Implemented Interfaces:
SyslogdConfig
public final class SyslogdConfigFactory extends java.lang.Object implements SyslogdConfig
This is the class used to load the configuration for the OpenNMS Syslogd from syslogd-configuration.xml.- Author:
- Sowmya Nataraj , Tarus Balog , OpenNMS
-
-
Constructor Summary
Constructors Constructor Description SyslogdConfigFactory()
Private constructorSyslogdConfigFactory(java.io.InputStream stream)
Constructor for SyslogdConfigFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBatchIntervalMs()
Messages are aggregated in batches before being dispatched.int
getBatchSize()
Messages are aggregated in batches before being dispatched.java.lang.String
getDiscardUei()
getDiscardUeijava.lang.String
getForwardingRegexp()
getForwardingRegexpjava.util.List<HideMatch>
getHideMessages()
A collection of Strings we do not want to attach to the event.java.lang.String
getListenAddress()
getListenAddressjava.lang.Integer
getMatchingGroupHost()
getMatchingGroupHostjava.lang.Integer
getMatchingGroupMessage()
getMatchingGroupMessageboolean
getNewSuspectOnMessage()
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.java.lang.String
getParser()
getParserint
getQueueSize()
Maximum number of messages to keep in memory while waiting to be dispatched.int
getSyslogPort()
Return the port on which SNMP traps should be received.java.util.TimeZone
getTimeZone()
Optional: - if not null it will be used as default time zone if no time zone is given - if not set the system time zone will be usedjava.util.List<UeiMatch>
getUeiList()
A collection of Strings->UEI'svoid
reload()
Reload the config from the default config fileboolean
shouldIncludeRawSyslogmessage()
Indicates whether or not to include the raw syslog message as an event parameter on events generated by Syslogd.
-
-
-
Constructor Detail
-
SyslogdConfigFactory
public SyslogdConfigFactory() throws java.io.IOException
Private constructor- Throws:
java.io.IOException
- Thrown if the specified config file cannot be read
-
SyslogdConfigFactory
public SyslogdConfigFactory(java.io.InputStream stream) throws java.io.IOException
Constructor for SyslogdConfigFactory.
- Parameters:
stream
- aInputStream
object.- Throws:
java.io.IOException
-
-
Method Detail
-
reload
public void reload() throws java.io.IOException
Reload the config from the default config file- Specified by:
reload
in interfaceSyslogdConfig
- Throws:
java.io.IOException
- Thrown if the specified config file cannot be read/loaded
-
getSyslogPort
public int getSyslogPort()
Return the port on which SNMP traps should be received.- Specified by:
getSyslogPort
in interfaceSyslogdConfig
- Returns:
- the port on which SNMP traps should be received
-
getListenAddress
public java.lang.String getListenAddress()
getListenAddress
- Specified by:
getListenAddress
in interfaceSyslogdConfig
- Returns:
- a
String
object. - Since:
- 1.8.1
-
getNewSuspectOnMessage
public boolean getNewSuspectOnMessage()
Return whether or not a newSuspect event should be sent when a trap is received from an unknown IP address.- Specified by:
getNewSuspectOnMessage
in interfaceSyslogdConfig
- Returns:
- whether to generate newSuspect events on traps.
-
getForwardingRegexp
public java.lang.String getForwardingRegexp()
getForwardingRegexp
- Specified by:
getForwardingRegexp
in interfaceSyslogdConfig
- Returns:
- a
String
object.
-
getMatchingGroupHost
public java.lang.Integer getMatchingGroupHost()
getMatchingGroupHost
- Specified by:
getMatchingGroupHost
in interfaceSyslogdConfig
- Returns:
- a int.
-
getMatchingGroupMessage
public java.lang.Integer getMatchingGroupMessage()
getMatchingGroupMessage
- Specified by:
getMatchingGroupMessage
in interfaceSyslogdConfig
- Returns:
- a int.
-
getParser
public java.lang.String getParser()
getParser
- Specified by:
getParser
in interfaceSyslogdConfig
- Returns:
- the parser class to use when parsing syslog messages, as a string.
-
getUeiList
public java.util.List<UeiMatch> getUeiList()
Description copied from interface:SyslogdConfig
A collection of Strings->UEI's- Specified by:
getUeiList
in interfaceSyslogdConfig
-
getHideMessages
public java.util.List<HideMatch> getHideMessages()
Description copied from interface:SyslogdConfig
A collection of Strings we do not want to attach to the event.- Specified by:
getHideMessages
in interfaceSyslogdConfig
-
getDiscardUei
public java.lang.String getDiscardUei()
getDiscardUei
- Specified by:
getDiscardUei
in interfaceSyslogdConfig
- Returns:
- a
String
object.
-
getNumThreads
public int getNumThreads()
Description copied from interface:SyslogdConfig
Number of threads used for consuming/dispatching messages.- Specified by:
getNumThreads
in interfaceSyslogdConfig
- Returns:
- number of threads
-
getQueueSize
public int getQueueSize()
Description copied from interface:SyslogdConfig
Maximum number of messages to keep in memory while waiting to be dispatched.- Specified by:
getQueueSize
in interfaceSyslogdConfig
- Returns:
- queue size
-
getBatchSize
public int getBatchSize()
Description copied from interface:SyslogdConfig
Messages are aggregated in batches before being dispatched. When the batch reaches this size, it will be dispatched.- Specified by:
getBatchSize
in interfaceSyslogdConfig
- Returns:
- batch size
-
getBatchIntervalMs
public int getBatchIntervalMs()
Description copied from interface:SyslogdConfig
Messages are aggregated in batches before being dispatched. When the batch has been created for longer than this interval it will be dispatched, regardless of the size.- Specified by:
getBatchIntervalMs
in interfaceSyslogdConfig
- Returns:
- interval in ms
-
getTimeZone
public java.util.TimeZone getTimeZone()
Description copied from interface:SyslogdConfig
Optional: - if not null it will be used as default time zone if no time zone is given - if not set the system time zone will be used- Specified by:
getTimeZone
in interfaceSyslogdConfig
-
shouldIncludeRawSyslogmessage
public boolean shouldIncludeRawSyslogmessage()
Description copied from interface:SyslogdConfig
Indicates whether or not to include the raw syslog message as an event parameter on events generated by Syslogd.Default behavior is false unless configured otherwise.
- Specified by:
shouldIncludeRawSyslogmessage
in interfaceSyslogdConfig
- Returns:
- whether or not to include the raw syslog message as an event parameter on events generated by Syslogd
-
-