Package com.tailf.ncs.alarmman.producer
Class AlarmSinkCentral
Object
com.tailf.ncs.alarmman.producer.AlarmSinkCentral
- All Implemented Interfaces:
AlarmSinkCentralMBean,Runnable
An
AlarmSinkCentral represent a central "proxy"
for created AlarmSink's.
When AlarmSink's is created ( with the default
constructor ), they are attched to the AlarmSinkCentral
singleton instance which writes alarms directly into the
alarm list on behalf of the attached AlarmSink instances.
The benefit of using the AlarmSinkCentral is:
- User do not need to create Cdb objects when creating
AlarmSink - Possible to buffer alarms for faster throughput.
AlarmSinkCentral is available
in NCS JVM.
When specifying the queue size the amount alarm will be queued before
it is written to Cdb.
Alarms are written to a blocking queue within the
same JVM as the NCS. The NCS writes the alarms
down into the CDB.-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayBlockingQueue<Alarm>Returns the alarm queue from theAlarmSinkCentralstatic AlarmSinkCentralgetAlarmSink(int alarmQueueLen, Cdb cdb) Deprecated.static AlarmSinkCentralgetAlarmSink(int alarmQueueLen, Cdb cdb, int alarmBufSize, long alarmBufTimeout) Deprecated.static AlarmSinkCentralgetAlarmSink(int alarmQueueLen, Maapi maapi) Creates and returns the singleton instance of theAlarmSinkCentralstatic AlarmSinkCentralgetAlarmSink(int alarmQueueLen, Maapi maapi, int alarmBufSize, long alarmBufTimeout) Creates and returns the buffered NCS alarm queue.booleanisAlive()booleanvoidrun()voidstart()voidstop()
-
Method Details
-
getAlarmQueue
Returns the alarm queue from theAlarmSinkCentral- Returns:
- the current alarm queue. null if NsMux has not yet started.
-
getAlarmSink
Deprecated.Creates and returns the singleton instance of theAlarmSinkCentral- Parameters:
alarmQueueLen- the maximum length of the queuecdb- the Cdb instance used to write alarm info- Returns:
- AlarmSinkCentral singleton instance
-
getAlarmSink
Creates and returns the singleton instance of theAlarmSinkCentral- Parameters:
alarmQueueLen- the maximum length of the queuemaapi- the Maapi instance used to write alarm info- Returns:
- AlarmSinkCentral singleton instance
-
getAlarmSink
@Deprecated public static AlarmSinkCentral getAlarmSink(int alarmQueueLen, Cdb cdb, int alarmBufSize, long alarmBufTimeout) Deprecated.Creates and returns the buffered NCS alarm queue.- Parameters:
alarmQueueLen- the maximum length of the queuecdb- the Cdb instance used to write alarm infoalarmBufSize- the size of the alarm bufferalarmBufTimeout- timeout in seconds after which the buffer will be submitted if there are no new alarms in the queue- Returns:
- AlarmSinkCentral singleton instance
-
getAlarmSink
public static AlarmSinkCentral getAlarmSink(int alarmQueueLen, Maapi maapi, int alarmBufSize, long alarmBufTimeout) Creates and returns the buffered NCS alarm queue.- Parameters:
alarmQueueLen- the maximum length of the queuemaapi- the Maapi instance used to write alarm infoalarmBufSize- the size of the alarm bufferalarmBufTimeout- timeout in seconds after which the buffer will be submitted if there are no new alarms in the queue- Returns:
- AlarmSinkCentral singleton instance
-
start
public void start()- Specified by:
startin interfaceAlarmSinkCentralMBean
-
isAlive
public boolean isAlive()- Specified by:
isAlivein interfaceAlarmSinkCentralMBean
-
requestStop
public boolean requestStop() -
stop
public void stop()- Specified by:
stopin interfaceAlarmSinkCentralMBean
-
run
public void run()
-