Class SyslogNorthbounder
- java.lang.Object
-
- org.opennms.netmgt.alarmd.api.support.AbstractNorthbounder
-
- org.opennms.netmgt.alarmd.northbounder.syslog.SyslogNorthbounder
-
- All Implemented Interfaces:
java.lang.Runnable
,Northbounder
,StatusFactory<NorthboundAlarm>
,org.springframework.beans.factory.InitializingBean
public class SyslogNorthbounder extends AbstractNorthbounder implements org.springframework.beans.factory.InitializingBean
Forwards alarms via Syslog.- Author:
- David Hustace
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
NBI_NAME
The Constant NBI_NAME.
-
Constructor Summary
Constructors Constructor Description SyslogNorthbounder(SyslogNorthbounderConfigDao configDao, java.lang.String destination)
Instantiates a new Syslog northbounder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(NorthboundAlarm alarm)
The abstraction makes a call here to determine if the alarm should be placed on the queue of alarms to be sent northerly.void
afterPropertiesSet()
void
forwardAlarms(java.util.List<NorthboundAlarm> alarms)
Each implementation of the AbstractNorthbounder has a nice queue (Nagle's algorithmic) and the worker thread that processes the queue calls this method to send alarms to the northern NMS.SyslogNorthbounderConfig
getConfig()
Gets the Syslog configuration.boolean
isReady()
Used to determine if the northbounder is ready to accept alarms.-
Methods inherited from class org.opennms.netmgt.alarmd.api.support.AbstractNorthbounder
createMapping, createSyncLostMessage, discard, getName, onAlarm, onPostStart, onPreStart, onStop, preserve, reloadConfig, run, setMaxBatchSize, setMaxPreservedAlarms, setNaglesDelay, setRetryInterval, start, stop
-
-
-
-
Field Detail
-
NBI_NAME
protected static final java.lang.String NBI_NAME
The Constant NBI_NAME.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SyslogNorthbounder
public SyslogNorthbounder(SyslogNorthbounderConfigDao configDao, java.lang.String destination)
Instantiates a new Syslog northbounder.- Parameters:
configDao
- the Syslog configuration DAOdestination
- the destination
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
accepts
public boolean accepts(NorthboundAlarm alarm)
The abstraction makes a call here to determine if the alarm should be placed on the queue of alarms to be sent northerly.- Specified by:
accepts
in classAbstractNorthbounder
- Parameters:
alarm
- the alarm- Returns:
- true, if successful
-
isReady
public boolean isReady()
Description copied from interface:Northbounder
Used to determine if the northbounder is ready to accept alarms. If no northbounders are ready, the caller can save resources by not creating and initializing theNorthboundAlarm
s. This method is called once after northbounder is registered and started. If the status were to change sometime after, the northbounder must re-register itself.- Specified by:
isReady
in interfaceNorthbounder
- Returns:
true
if the northbounder is ready to accept alarms,false
otherwise.
-
forwardAlarms
public void forwardAlarms(java.util.List<NorthboundAlarm> alarms) throws NorthbounderException
Each implementation of the AbstractNorthbounder has a nice queue (Nagle's algorithmic) and the worker thread that processes the queue calls this method to send alarms to the northern NMS.- Specified by:
forwardAlarms
in classAbstractNorthbounder
- Parameters:
alarms
- the alarms- Throws:
NorthbounderException
- the northbounder exception
-
getConfig
public SyslogNorthbounderConfig getConfig()
Gets the Syslog configuration.- Returns:
- the Syslog configuration
-
-