public class OpennmsKafkaProducer extends Object implements AlarmLifecycleListener, EventListener, AlarmFeedbackListener, OnmsTopologyConsumer, ThreadAwareEventListener
| Modifier and Type | Field and Description |
|---|---|
static String |
KAFKA_CLIENT_PID |
| Constructor and Description |
|---|
OpennmsKafkaProducer(ProtobufMapper protobufMapper,
NodeCache nodeCache,
org.osgi.service.cm.ConfigurationAdmin configAdmin,
EventSubscriptionService eventSubscriptionService,
OnmsTopologyDao topologyDao,
int nodeAsyncUpdateThreads) |
public static final String KAFKA_CLIENT_PID
public OpennmsKafkaProducer(ProtobufMapper protobufMapper, NodeCache nodeCache, org.osgi.service.cm.ConfigurationAdmin configAdmin, EventSubscriptionService eventSubscriptionService, OnmsTopologyDao topologyDao, int nodeAsyncUpdateThreads)
public void init()
throws IOException
IOExceptionpublic void destroy()
public boolean shouldForwardAlarm(OnmsAlarm alarm)
public void handleAlarmSnapshot(List<OnmsAlarm> alarms)
AlarmLifecycleListenerhandleAlarmSnapshot in interface AlarmLifecycleListeneralarms - canonical set of alarms in the databasepublic void preHandleAlarmSnapshot()
AlarmLifecycleListenerAlarmLifecycleListener.handleAlarmSnapshot(java.util.List<org.opennms.netmgt.model.OnmsAlarm>).
This can be used to trigger any necessary state tracking to accurately handle
the snapshot results.preHandleAlarmSnapshot in interface AlarmLifecycleListenerpublic void postHandleAlarmSnapshot()
AlarmLifecycleListenerAlarmLifecycleListener.handleAlarmSnapshot(java.util.List<org.opennms.netmgt.model.OnmsAlarm>) has been called on all the listeners, and
after the session & transaction used to perform the snapshot has been closed.
This can be used to trigger any necessary post-processing of the results once
the related session has been closed.
This function may be called immediately after a call to AlarmLifecycleListener.preHandleAlarmSnapshot() if
an error occurred while preparing the snapshot i.e. when opening the transaction.postHandleAlarmSnapshot in interface AlarmLifecycleListenerpublic void handleNewOrUpdatedAlarm(OnmsAlarm alarm)
AlarmLifecycleListenerhandleNewOrUpdatedAlarm in interface AlarmLifecycleListeneralarm - a newly created or updated alarmpublic void handleDeletedAlarm(int alarmId,
String reductionKey)
AlarmLifecycleListenerhandleDeletedAlarm in interface AlarmLifecycleListeneralarmId - id of the alarm that was deletedreductionKey - reduction key of the alarm that was deletedpublic String getName()
EventListenergetName in interface EventListenergetName in interface OnmsTopologyConsumerString object.public void onEvent(IEvent event)
EventListeneronEvent in interface EventListenerevent - a IEvent object.public Set<OnmsTopologyProtocol> getProtocols()
getProtocols in interface OnmsTopologyConsumerpublic void consume(OnmsTopologyMessage message)
consume in interface OnmsTopologyConsumerpublic void setTopologyVertexTopic(String topologyVertexTopic)
public void setTopologyEdgeTopic(String topologyEdgeTopic)
public void setEventTopic(String eventTopic)
public void setAlarmTopic(String alarmTopic)
public void setNodeTopic(String nodeTopic)
public void setAlarmFeedbackTopic(String alarmFeedbackTopic)
public void setEventFilter(String eventFilter)
public void setAlarmFilter(String alarmFilter)
public OpennmsKafkaProducer setDataSync(KafkaAlarmDataSync dataSync)
public void handleAlarmFeedback(List<AlarmFeedback> alarmFeedback)
AlarmFeedbackListenerhandleAlarmFeedback in interface AlarmFeedbackListeneralarmFeedback - the collection of alarm feedbackpublic boolean isForwardingAlarms()
public CountDownLatch getEventForwardedLatch()
public CountDownLatch getAlarmForwardedLatch()
public CountDownLatch getNodeForwardedLatch()
public CountDownLatch getAlarmFeedbackForwardedLatch()
public void setSuppressIncrementalAlarms(boolean suppressIncrementalAlarms)
public AlarmCallbackStateTracker getAlarmCallbackStateTracker()
public void setKafkaSendQueueCapacity(int kafkaSendQueueCapacity)
public int getNumThreads()
getNumThreads in interface ThreadAwareEventListenerpublic CountDownLatch getForwardedTopologyVertexMessage()
public CountDownLatch getForwardedTopologyEdgeMessage()
public String getEncoding()
public void setEncoding(String encoding)
public int getNumEventListenerThreads()
public void setNumEventListenerThreads(int numEventListenerThreads)
Copyright © 2022. All rights reserved.