public class OpennmsKafkaProducer extends Object implements AlarmLifecycleListener, EventListener
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,
AlarmLifecycleSubscriptionService alarmLifecycleSubscriptionService) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
CountDownLatch |
getAlarmForwardedLatch() |
ReadWriteLock |
getAlarmSyncRwLock() |
CountDownLatch |
getEventForwardedLatch() |
String |
getName()
Return the id of the listener
|
CountDownLatch |
getNodeForwardedLatch() |
void |
handleDeletedAlarm(int alarmId,
String reductionKey) |
void |
handleDeletedAlarm(String reductionKey) |
void |
handleNewOrUpdatedAlarm(OnmsAlarm alarm) |
void |
init() |
boolean |
isForwardingAlarms() |
void |
onEvent(Event event)
Process a sent event.
|
void |
setAlarmFilter(String alarmFilter) |
void |
setAlarmTopic(String alarmTopic) |
void |
setEventFilter(String eventFilter) |
void |
setEventTopic(String eventTopic) |
void |
setNodeTopic(String nodeTopic) |
boolean |
shouldForwardAlarm(OnmsAlarm alarm) |
public static final String KAFKA_CLIENT_PID
public OpennmsKafkaProducer(ProtobufMapper protobufMapper, NodeCache nodeCache, org.osgi.service.cm.ConfigurationAdmin configAdmin, EventSubscriptionService eventSubscriptionService, AlarmLifecycleSubscriptionService alarmLifecycleSubscriptionService)
public void init() throws IOException
IOException
public void destroy()
public boolean shouldForwardAlarm(OnmsAlarm alarm)
public void handleNewOrUpdatedAlarm(OnmsAlarm alarm)
handleNewOrUpdatedAlarm
in interface AlarmLifecycleListener
public void handleDeletedAlarm(int alarmId, String reductionKey)
handleDeletedAlarm
in interface AlarmLifecycleListener
public void handleDeletedAlarm(String reductionKey)
public String getName()
EventListener
getName
in interface EventListener
String
object.public void onEvent(Event event)
EventListener
onEvent
in interface EventListener
event
- a Event
object.public void setEventTopic(String eventTopic)
public void setAlarmTopic(String alarmTopic)
public void setNodeTopic(String nodeTopic)
public void setEventFilter(String eventFilter)
public void setAlarmFilter(String alarmFilter)
public boolean isForwardingAlarms()
public CountDownLatch getEventForwardedLatch()
public CountDownLatch getAlarmForwardedLatch()
public CountDownLatch getNodeForwardedLatch()
public ReadWriteLock getAlarmSyncRwLock()
Copyright © 2019. All rights reserved.