Package org.opennms.netmgt.config
Class SyslogdConfigFactory
- java.lang.Object
-
- org.opennms.netmgt.config.SyslogdConfigFactory
-
- All Implemented Interfaces:
SyslogdConfig
public final class SyslogdConfigFactory extends 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(InputStream stream)Constructor for SyslogdConfigFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBatchIntervalMs()Messages are aggregated in batches before being dispatched.intgetBatchSize()Messages are aggregated in batches before being dispatched.StringgetDiscardUei()getDiscardUeiStringgetForwardingRegexp()getForwardingRegexpList<HideMatch>getHideMessages()A collection of Strings we do not want to attach to the event.StringgetListenAddress()getListenAddressIntegergetMatchingGroupHost()getMatchingGroupHostIntegergetMatchingGroupMessage()getMatchingGroupMessagebooleangetNewSuspectOnMessage()Return whether or not a newSuspect event should be sent when a trap is received from an unknown IP address.intgetNumThreads()Number of threads used for consuming/dispatching messages.StringgetParser()getParserintgetQueueSize()Maximum number of messages to keep in memory while waiting to be dispatched.intgetSyslogPort()Return the port on which SNMP traps should be received.TimeZonegetTimeZone()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 usedList<UeiMatch>getUeiList()A collection of Strings->UEI'svoidreload()Reload the config from the default config filebooleanshouldIncludeRawSyslogmessage()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 IOExceptionPrivate constructor- Throws:
IOException- Thrown if the specified config file cannot be read
-
SyslogdConfigFactory
public SyslogdConfigFactory(InputStream stream) throws IOException
Constructor for SyslogdConfigFactory.
- Parameters:
stream- aInputStreamobject.- Throws:
IOException
-
-
Method Detail
-
reload
public void reload() throws IOExceptionReload the config from the default config file- Specified by:
reloadin interfaceSyslogdConfig- Throws:
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:
getSyslogPortin interfaceSyslogdConfig- Returns:
- the port on which SNMP traps should be received
-
getListenAddress
public String getListenAddress()
getListenAddress
- Specified by:
getListenAddressin interfaceSyslogdConfig- Returns:
- a
Stringobject. - 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:
getNewSuspectOnMessagein interfaceSyslogdConfig- Returns:
- whether to generate newSuspect events on traps.
-
getForwardingRegexp
public String getForwardingRegexp()
getForwardingRegexp
- Specified by:
getForwardingRegexpin interfaceSyslogdConfig- Returns:
- a
Stringobject.
-
getMatchingGroupHost
public Integer getMatchingGroupHost()
getMatchingGroupHost
- Specified by:
getMatchingGroupHostin interfaceSyslogdConfig- Returns:
- a int.
-
getMatchingGroupMessage
public Integer getMatchingGroupMessage()
getMatchingGroupMessage
- Specified by:
getMatchingGroupMessagein interfaceSyslogdConfig- Returns:
- a int.
-
getParser
public String getParser()
getParser
- Specified by:
getParserin interfaceSyslogdConfig- Returns:
- the parser class to use when parsing syslog messages, as a string.
-
getUeiList
public List<UeiMatch> getUeiList()
Description copied from interface:SyslogdConfigA collection of Strings->UEI's- Specified by:
getUeiListin interfaceSyslogdConfig
-
getHideMessages
public List<HideMatch> getHideMessages()
Description copied from interface:SyslogdConfigA collection of Strings we do not want to attach to the event.- Specified by:
getHideMessagesin interfaceSyslogdConfig
-
getDiscardUei
public String getDiscardUei()
getDiscardUei
- Specified by:
getDiscardUeiin interfaceSyslogdConfig- Returns:
- a
Stringobject.
-
getNumThreads
public int getNumThreads()
Description copied from interface:SyslogdConfigNumber of threads used for consuming/dispatching messages.- Specified by:
getNumThreadsin interfaceSyslogdConfig- Returns:
- number of threads
-
getQueueSize
public int getQueueSize()
Description copied from interface:SyslogdConfigMaximum number of messages to keep in memory while waiting to be dispatched.- Specified by:
getQueueSizein interfaceSyslogdConfig- Returns:
- queue size
-
getBatchSize
public int getBatchSize()
Description copied from interface:SyslogdConfigMessages are aggregated in batches before being dispatched. When the batch reaches this size, it will be dispatched.- Specified by:
getBatchSizein interfaceSyslogdConfig- Returns:
- batch size
-
getBatchIntervalMs
public int getBatchIntervalMs()
Description copied from interface:SyslogdConfigMessages 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:
getBatchIntervalMsin interfaceSyslogdConfig- Returns:
- interval in ms
-
getTimeZone
public TimeZone getTimeZone()
Description copied from interface:SyslogdConfigOptional: - 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:
getTimeZonein interfaceSyslogdConfig
-
shouldIncludeRawSyslogmessage
public boolean shouldIncludeRawSyslogmessage()
Description copied from interface:SyslogdConfigIndicates 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:
shouldIncludeRawSyslogmessagein interfaceSyslogdConfig- Returns:
- whether or not to include the raw syslog message as an event parameter on events generated by Syslogd
-
-