public class JmsNorthbounder extends AbstractNorthbounder implements org.springframework.beans.factory.InitializingBean
Allows alarms to be automatically forwarded to a JMS destination. JMS implementation neutral, defaults to ActiveMQ. To change, add a Spring bean that implements javax.jms.ConnectionFactory and change OpenNMS property opennms.alarms.northbound.jms.connectionFactoryImplRef to that bean's ID. It will be wrapped in the Spring's CachingConnectionFactory so your bean does not need to handle caching or pooling itself.
Configuration is done in $ONMS_HOME/etc/jms-northbounder-configuration.xml and is similar to the syslog NBI config file. See JmsNorthbounderConfig or the appropriate schema file for details.
Modifier and Type | Field and Description |
---|---|
static String |
NBI_NAME
The Constant NBI_NAME.
|
Modifier | Constructor and Description |
---|---|
protected |
JmsNorthbounder()
Instantiates a new JMS northbounder.
|
|
JmsNorthbounder(JmsNorthbounderConfig config,
javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory,
JmsDestination destination)
Instantiates a new JMS northbounder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(NorthboundAlarm alarm)
Accepts.
|
void |
afterPropertiesSet() |
void |
forwardAlarms(List<NorthboundAlarm> alarms)
Forward alarms.
|
JmsNorthbounderConfig |
getConfig()
Gets the configuration.
|
JmsDestination |
getDestination()
Gets the destination.
|
javax.jms.ConnectionFactory |
getJmsNorthbounderConnectionFactory()
Gets the JMS northbounder connection factory.
|
boolean |
isReady()
Used to determine if the northbounder is ready to accept alarms.
|
void |
setJmsNorthbounderConnectionFactory(javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory)
Sets the JMS northbounder connection factory.
|
createMapping, createSyncLostMessage, discard, getName, onAlarm, onPostStart, onPreStart, onStop, preserve, reloadConfig, run, setMaxBatchSize, setMaxPreservedAlarms, setNaglesDelay, setRetryInterval, start, stop
public static final String NBI_NAME
public JmsNorthbounder(JmsNorthbounderConfig config, javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory, JmsDestination destination)
config
- the configurationjmsNorthbounderConnectionFactory
- the JMS northbounder connection factorydestination
- the destinationprotected JmsNorthbounder()
public boolean accepts(NorthboundAlarm alarm)
AbstractNorthbounder
accepts
in class AbstractNorthbounder
alarm
- the alarmpublic boolean isReady()
Northbounder
NorthboundAlarm
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.isReady
in interface Northbounder
true
if the northbounder is ready to accept alarms, false
otherwise.public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException
AbstractNorthbounder
forwardAlarms
in class AbstractNorthbounder
alarms
- the alarmsNorthbounderException
- the northbounder exceptionpublic JmsDestination getDestination()
public JmsNorthbounderConfig getConfig()
public javax.jms.ConnectionFactory getJmsNorthbounderConnectionFactory()
public void setJmsNorthbounderConnectionFactory(javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory)
jmsNorthbounderConnectionFactory
- the new JMS northbounder connection factoryCopyright © 2020. All rights reserved.