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 AlarmDataStoreIOException - when an error occurs in loading/parsing the Kafka client/stream configurationpublic void destroy()
destroy in interface AlarmDataStorepublic AlarmSyncResults synchronizeAlarmsWithDb()
synchronizeAlarmsWithDb in interface AlarmDataStorepublic void setAlarmTopic(String alarmTopic)
public void setAlarmSyncIntervalMs(long intervalMs)
public void setStartWithCleanState(boolean startWithCleanState)
setStartWithCleanState in interface AlarmDataStorepublic boolean isEnabled()
isEnabled in interface AlarmDataStorepublic boolean isReady()
isReady in interface AlarmDataStorepublic Map<String,OpennmsModelProtos.Alarm> getAlarms()
getAlarms in interface AlarmDataStorepublic OpennmsModelProtos.Alarm getAlarm(String reductionKey)
getAlarm in interface AlarmDataStoreCopyright © 2019. All rights reserved.