public class KafkaAlarmDataSync extends Object implements AlarmDataStore, Runnable
Modifier and Type | Field and Description |
---|---|
static String |
KAFKA_STREAMS_PID |
Constructor and Description |
---|
KafkaAlarmDataSync(org.osgi.service.cm.ConfigurationAdmin configAdmin,
OpennmsKafkaProducer kafkaProducer,
AlarmDao alarmDao,
ProtobufMapper protobufMapper,
org.springframework.transaction.support.TransactionOperations transactionOperations) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
OpennmsModelProtos.Alarm |
getAlarm(String reductionKey) |
Map<String,OpennmsModelProtos.Alarm> |
getAlarms() |
void |
init()
This method initializes the stream client, but doesn't actually start it until
an alarm is forwarded by the producer.
|
boolean |
isEnabled() |
boolean |
isReady() |
void |
run() |
void |
setAlarmSyncIntervalMs(long intervalMs) |
void |
setAlarmTopic(String alarmTopic) |
void |
setStartWithCleanState(boolean startWithCleanState) |
AlarmSyncResults |
synchronizeAlarmsWithDb() |
public static final String KAFKA_STREAMS_PID
public KafkaAlarmDataSync(org.osgi.service.cm.ConfigurationAdmin configAdmin, OpennmsKafkaProducer kafkaProducer, AlarmDao alarmDao, ProtobufMapper protobufMapper, org.springframework.transaction.support.TransactionOperations transactionOperations)
public void init() throws IOException
init
in interface AlarmDataStore
IOException
- when an error occurs in loading/parsing the Kafka client/stream configurationpublic void destroy()
destroy
in interface AlarmDataStore
public AlarmSyncResults synchronizeAlarmsWithDb()
synchronizeAlarmsWithDb
in interface AlarmDataStore
public void setAlarmTopic(String alarmTopic)
public void setAlarmSyncIntervalMs(long intervalMs)
public void setStartWithCleanState(boolean startWithCleanState)
setStartWithCleanState
in interface AlarmDataStore
public boolean isEnabled()
isEnabled
in interface AlarmDataStore
public boolean isReady()
isReady
in interface AlarmDataStore
public Map<String,OpennmsModelProtos.Alarm> getAlarms()
getAlarms
in interface AlarmDataStore
public OpennmsModelProtos.Alarm getAlarm(String reductionKey)
getAlarm
in interface AlarmDataStore
Copyright © 2019. All rights reserved.