Package com.tailf.ncs.alarmman.consumer
Class AlarmSourceCentral
Object
com.tailf.ncs.alarmman.consumer.AlarmSourceCentral
- All Implemented Interfaces:
 Runnable
The consuming part of the Alarm API.
 
This class acts as a proxy where incoming alarms are dispatched or
 forwarded to all registered AlarmSource attached to it.
 
 One AlarmSourceCentral  (and corresponding
 AlarmSinkCentral) is always present
 in the NCS JVM and it is started when NCS JVM is started.
 
It is also possible to start AlarmSourceCentral
 outside the NCS JVM.
 
Each client AlarmSource that is attached to
 a AlarmSourceCentral gets its own queue to
 check for incoming alarms.
 
The AlarmSourceCentral maintains or handles
 the client queues, for each incoming alarm to CDB
 it creates a new instance of Alarm and puts the
 new instance into all the client queues that are attached to this
 AlarmSourceCentral.
- 
Constructor Summary
ConstructorsConstructorDescriptionAlarmSourceCentral(int alarmQueueLen, Cdb cdb) Creates a new AlarmSourceCentral object. - 
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayBlockingQueue<Alarm>Deprecated.static AlarmSourceCentralgetAlarmSource(int alarmQueueLen, Cdb cdb) Deprecated.UseNcsMain.getSourceCentral()instead.booleanisAlive()Returns true if the AlarmSourceCentral is running.static voidreturnAlarmQueue(ArrayBlockingQueue<Alarm> queue) Deprecated.UsereturnQueue(ArrayBlockingQueue<Alarm>)instead.voidrun()voidstart()Start the AlarmSourceCentral which makes it possible for AlarmSource's to attach to thisAlarmSourceCentraland receive notifications.voidstop()Stops the AlarmSourceCentral. 
- 
Constructor Details
- 
AlarmSourceCentral
Creates a new AlarmSourceCentral object.- Parameters:
 alarmQueueLen- maximum length of the out queues to the subscribes.cdb- the CDB socket to subscribe over.- Throws:
 IOException- if the CDB connection fails.ConfException- if the CDB subscription fails.
 
 - 
 - 
Method Details
- 
isAlive
public boolean isAlive()Returns true if the AlarmSourceCentral is running.- Returns:
 - true if the AlarmSourceCentral is running, else false.
 
 - 
getAlarmSource
@Deprecated public static AlarmSourceCentral getAlarmSource(int alarmQueueLen, Cdb cdb) throws IOException, NavuException, ConfException Deprecated.UseNcsMain.getSourceCentral()instead.Retrieves the alarm source central object.- Parameters:
 alarmQueueLen- the maximum queue length.cdb- the CDB socket to subscribe over.- Returns:
 - the alarm source
 - Throws:
 IOException- if there is an I/O errorNavuException- if there is a Navu errorConfException- if there is a protocol error
 - 
getAlarmQueue
Deprecated.UsegetQueue()instead.Returns a new alarm queue.- Returns:
 ArrayBlockingQueue<Alarm>
 - 
returnAlarmQueue
Deprecated.UsereturnQueue(ArrayBlockingQueue<Alarm>)instead.Returns the queue.- Parameters:
 queue- the queue to return.
 - 
start
public void start()Start the AlarmSourceCentral which makes it possible for AlarmSource's to attach to thisAlarmSourceCentraland receive notifications. - 
stop
public void stop()Stops the AlarmSourceCentral. - 
run
public void run() 
 - 
 
getQueue()instead.