Class OpennmsKafkaProducer

    • Field Detail

      • KAFKA_CLIENT_PID

        public static final java.lang.String KAFKA_CLIENT_PID
        See Also:
        Constant Field Values
    • Method Detail

      • init

        public void init()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • destroy

        public void destroy()
      • shouldForwardAlarm

        public boolean shouldForwardAlarm​(OnmsAlarm alarm)
      • handleAlarmSnapshot

        public void handleAlarmSnapshot​(java.util.List<OnmsAlarm> alarms)
        Description copied from interface: AlarmLifecycleListener
        Called periodically with a complete set of alarms as present in the database at the given timestamp. This should be used to synchronize any state to ensure it matches what is currently in the database. Note that it is possible that the *current* state of alarms is different from the state at the time at which the snapshot was taken. Implementations should take this in consideration when performing any state synchronization. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleAlarmSnapshot in interface AlarmLifecycleListener
        Parameters:
        alarms - canonical set of alarms in the database
      • handleNewOrUpdatedAlarm

        public void handleNewOrUpdatedAlarm​(OnmsAlarm alarm)
        Description copied from interface: AlarmLifecycleListener
        Called when an alarm has been created or updated. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleNewOrUpdatedAlarm in interface AlarmLifecycleListener
        Parameters:
        alarm - a newly created or updated alarm
      • handleDeletedAlarm

        public void handleDeletedAlarm​(int alarmId,
                                       java.lang.String reductionKey)
        Description copied from interface: AlarmLifecycleListener
        Called when an alarm has been deleted. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Specified by:
        handleDeletedAlarm in interface AlarmLifecycleListener
        Parameters:
        alarmId - id of the alarm that was deleted
        reductionKey - reduction key of the alarm that was deleted
      • setTopologyVertexTopic

        public void setTopologyVertexTopic​(java.lang.String topologyVertexTopic)
      • setTopologyEdgeTopic

        public void setTopologyEdgeTopic​(java.lang.String topologyEdgeTopic)
      • setEventTopic

        public void setEventTopic​(java.lang.String eventTopic)
      • setAlarmTopic

        public void setAlarmTopic​(java.lang.String alarmTopic)
      • setNodeTopic

        public void setNodeTopic​(java.lang.String nodeTopic)
      • setAlarmFeedbackTopic

        public void setAlarmFeedbackTopic​(java.lang.String alarmFeedbackTopic)
      • setEventFilter

        public void setEventFilter​(java.lang.String eventFilter)
      • setAlarmFilter

        public void setAlarmFilter​(java.lang.String alarmFilter)
      • isForwardingAlarms

        public boolean isForwardingAlarms()
      • getEventForwardedLatch

        public java.util.concurrent.CountDownLatch getEventForwardedLatch()
      • getAlarmForwardedLatch

        public java.util.concurrent.CountDownLatch getAlarmForwardedLatch()
      • getNodeForwardedLatch

        public java.util.concurrent.CountDownLatch getNodeForwardedLatch()
      • getAlarmFeedbackForwardedLatch

        public java.util.concurrent.CountDownLatch getAlarmFeedbackForwardedLatch()
      • setSuppressIncrementalAlarms

        public void setSuppressIncrementalAlarms​(boolean suppressIncrementalAlarms)
      • setKafkaSendQueueCapacity

        public void setKafkaSendQueueCapacity​(int kafkaSendQueueCapacity)
      • getForwardedTopologyVertexMessage

        public java.util.concurrent.CountDownLatch getForwardedTopologyVertexMessage()
      • getForwardedTopologyEdgeMessage

        public java.util.concurrent.CountDownLatch getForwardedTopologyEdgeMessage()
      • getEncoding

        public java.lang.String getEncoding()
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
      • getNumEventListenerThreads

        public int getNumEventListenerThreads()
      • setNumEventListenerThreads

        public void setNumEventListenerThreads​(int numEventListenerThreads)