public class Bsmd extends Object implements SpringServiceDaemon, BusinessServiceStateChangeHandler, AlarmLifecycleListener
Modifier and Type | Field and Description |
---|---|
protected static long |
DEFAULT_POLL_INTERVAL |
static String |
NAME |
protected static String |
POLL_INTERVAL_KEY |
static long |
RELOAD_DELAY |
Constructor and Description |
---|
Bsmd() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
BusinessServiceStateMachine |
getBusinessServiceStateMachine() |
EventConfDao |
getEventConfDao() |
EventIpcManager |
getEventIpcManager() |
org.springframework.transaction.support.TransactionTemplate |
getTransactionTemplate() |
boolean |
getVerifyReductionKeys() |
void |
handleAlarmSnapshot(List<OnmsAlarm> alarms)
Called periodically with a complete set of alarms as present in the database
at the given timestamp.
|
void |
handleBusinessServiceStateChanged(BusinessServiceGraph graph,
BusinessService businessService,
Status newStatus,
Status prevStatus)
Called when the operational status of a business service was changed.
|
void |
handleDeletedAlarm(int alarmId,
String reductionKey)
Called when an alarm has been deleted.
|
void |
handleNewOrUpdatedAlarm(OnmsAlarm alarm)
Called when an alarm has been created or updated.
|
void |
handleReloadEvent(IEvent e) |
void |
postHandleAlarmSnapshot()
Called after
AlarmLifecycleListener.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. |
void |
preHandleAlarmSnapshot()
Called before the transaction is opened and the alarms are read for subsequent
calls to
AlarmLifecycleListener.handleAlarmSnapshot(java.util.List<org.opennms.netmgt.model.OnmsAlarm>) . |
void |
serviceInterfaceOrNodeDeleted(IEvent e) |
void |
setBusinessServiceStateMachine(BusinessServiceStateMachine stateMachine) |
void |
setEventConfDao(EventConfDao eventConfDao) |
void |
setEventIpcManager(EventIpcManager eventIpcManager) |
void |
setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate template) |
void |
setVerifyReductionKeys(boolean verify) |
void |
start()
start
|
protected static final long DEFAULT_POLL_INTERVAL
protected static final String POLL_INTERVAL_KEY
public static final String NAME
public static final long RELOAD_DELAY
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void start() throws Exception
SpringServiceDaemon
start
start
in interface SpringServiceDaemon
Exception
- if any.public void handleAlarmSnapshot(List<OnmsAlarm> alarms)
AlarmLifecycleListener
handleAlarmSnapshot
in interface AlarmLifecycleListener
alarms
- canonical set of alarms in the databasepublic void preHandleAlarmSnapshot()
AlarmLifecycleListener
AlarmLifecycleListener.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 AlarmLifecycleListener
public void postHandleAlarmSnapshot()
AlarmLifecycleListener
AlarmLifecycleListener.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 AlarmLifecycleListener
public void handleNewOrUpdatedAlarm(OnmsAlarm alarm)
AlarmLifecycleListener
handleNewOrUpdatedAlarm
in interface AlarmLifecycleListener
alarm
- a newly created or updated alarmpublic void handleDeletedAlarm(int alarmId, String reductionKey)
AlarmLifecycleListener
handleDeletedAlarm
in interface AlarmLifecycleListener
alarmId
- id of the alarm that was deletedreductionKey
- reduction key of the alarm that was deletedpublic void serviceInterfaceOrNodeDeleted(IEvent e)
public void handleBusinessServiceStateChanged(BusinessServiceGraph graph, BusinessService businessService, Status newStatus, Status prevStatus)
handleBusinessServiceStateChanged
in interface BusinessServiceStateChangeHandler
public void handleReloadEvent(IEvent e)
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
public void setEventIpcManager(EventIpcManager eventIpcManager)
public EventIpcManager getEventIpcManager()
public void setEventConfDao(EventConfDao eventConfDao)
public EventConfDao getEventConfDao()
public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate template)
public org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
public void setVerifyReductionKeys(boolean verify)
public boolean getVerifyReductionKeys()
public void setBusinessServiceStateMachine(BusinessServiceStateMachine stateMachine)
public BusinessServiceStateMachine getBusinessServiceStateMachine()
Copyright © 2021. All rights reserved.