Package com.tailf.ncs.alarmman.producer
Class AlarmSinkCentral
Object
com.tailf.ncs.alarmman.producer.AlarmSinkCentral
- All Implemented Interfaces:
AutoCloseable
,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.-
Constructor Summary
ConstructorsConstructorDescriptionAlarmSinkCentral
(int alarmQueueLen, Maapi maapi) Creates an NCS alarm sink.AlarmSinkCentral
(int alarmQueueLen, Maapi maapi, int alarmBufSize, long alarmBufTimeout) Creates an NCS alarm sink. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static AlarmSinkCentral
getAlarmSink
(int alarmQueueLen, Maapi maapi) Deprecated.getQueue()
Returns the alarm queue.boolean
isAlive()
boolean
void
run()
void
start()
void
stop()
-
Constructor Details
-
AlarmSinkCentral
Creates an NCS alarm sink.- Parameters:
alarmQueueLen
- the maximum length of the queue.maapi
- the Maapi instance used to write alarm info
-
AlarmSinkCentral
Creates an NCS alarm sink.- Parameters:
alarmQueueLen
- the maximum length of the queue.maapi
- 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
-
-
Method Details
-
getAlarmSink
Deprecated.UseNcsMain.getSinkCentral()
orAlarmSinkCentral(int, Maapi)
instead.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
-
getQueue
Returns the alarm queue.- Returns:
- the current alarm queue.
-
start
public void start() -
isAlive
public boolean isAlive() -
requestStop
public boolean requestStop() -
stop
public void stop() -
run
public void run() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
NcsMain.getSinkCentral()
orAlarmSinkCentral(int, Maapi)
instead.