Class JmsNorthbounder

  • All Implemented Interfaces:
    java.lang.Runnable, Northbounder, StatusFactory<NorthboundAlarm>, org.springframework.beans.factory.InitializingBean

    public class JmsNorthbounder
    extends AbstractNorthbounder
    implements org.springframework.beans.factory.InitializingBean
    Northbound Interface JMS Implementation

    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.

    Author:
    David Hustace, David Schlenk
    • Field Detail

      • NBI_NAME

        public static final java.lang.String NBI_NAME
        The Constant NBI_NAME.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JmsNorthbounder

        public JmsNorthbounder​(JmsNorthbounderConfig config,
                               javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory,
                               JmsDestination destination)
        Instantiates a new JMS northbounder.
        Parameters:
        config - the configuration
        jmsNorthbounderConnectionFactory - the JMS northbounder connection factory
        destination - the destination
      • JmsNorthbounder

        protected JmsNorthbounder()
        Instantiates a new JMS northbounder.
    • Method Detail

      • 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 the NorthboundAlarms. 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 interface Northbounder
        Returns:
        true if the northbounder is ready to accept alarms, false otherwise.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • getDestination

        public JmsDestination getDestination()
        Gets the destination.
        Returns:
        the destination
      • getConfig

        public JmsNorthbounderConfig getConfig()
        Gets the configuration.
        Returns:
        the configuration
      • getJmsNorthbounderConnectionFactory

        public javax.jms.ConnectionFactory getJmsNorthbounderConnectionFactory()
        Gets the JMS northbounder connection factory.
        Returns:
        the JMS northbounder connection factory
      • setJmsNorthbounderConnectionFactory

        public void setJmsNorthbounderConnectionFactory​(javax.jms.ConnectionFactory jmsNorthbounderConnectionFactory)
        Sets the JMS northbounder connection factory.
        Parameters:
        jmsNorthbounderConnectionFactory - the new JMS northbounder connection factory