public class AlarmCategoryClient extends java.lang.Object implements AlarmSelectionListener
AlarmCategoryClient listens to alarms produced by the alarm server,
by means of a CategoryClient and offers greater functionalities to listeners like:
After instantiating a object of this class, the clients should
register in order to be notified with callbacks and only after
call connect() or connect(Category[]).
close()must be called when finished using this object
to ensure the correct cleanup of the allocated resources.
AlarmCategoryClient has been introduced after ICT-547 offering
more functionality of what has been requested in the ticket to be ready
for next generation of user needs.
As a such, its API will most likely expanded in the future
to cope with new requirements.
Note that it is possible to add filtering capabilities while
connecting to the categories by properly setting Filter to
the AlarmSelectionHandler. However a quick look to filtering
seems to suggest that it is based on SQL because CERN AS originally
persisted alarms in a database. In out implementation all the alarms are
in memory and therefore we can't get advantage of SQL for filtering.
| Constructor and Description |
|---|
AlarmCategoryClient(ContainerServices contServices)
Constructor
|
AlarmCategoryClient(org.omg.CORBA.ORB orb,
AcsLogger logger)
Contructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAlarmListener(AlarmListenersContainer.AlarmListener listener) |
AlarmListenersContainer.AlarmListener |
addAlarmListener(AlarmSelectionListener listener) |
AlarmListenersContainer.AlarmListener |
addAlarmListener(AlarmSelectionListener listener,
AlarmFilter filter) |
boolean |
addStatsListener(AlarmCategoryStatListener listener) |
void |
close()
Release all the resource,
|
void |
connect()
Connects to all the categories of the alarm system.
|
void |
connect(Category[] categories)
Connects to the passed categories of the alarm system
|
Alarm[] |
getActiveChildren(java.lang.String id,
boolean node) |
Alarm[] |
getChildren(java.lang.String id,
boolean node) |
int |
getMultiplicityThreshold(java.lang.String id) |
Alarm[] |
getParents(java.lang.String id,
boolean node) |
void |
onAlarm(Alarm alarm)
This method is executed whenever a new alarm is received.
|
void |
onException(LaserSelectionException e)
This method is executed whenever a new exception happens.
|
boolean |
removeAlarmListener(AlarmListenersContainer.AlarmListener listenerToRemove) |
boolean |
removeStatListener(AlarmCategoryStatListener listenerToRemove) |
public AlarmCategoryClient(ContainerServices contServices) throws AlarmClientException
contServices - The containerServicesAlarmClientException#AlarmCategoryClient(ContainerServices)}public AlarmCategoryClient(org.omg.CORBA.ORB orb,
AcsLogger logger)
orb - The orblogger - The logger#AlarmCategoryClient(ORB, AcsLogger)}public void connect()
throws AlarmClientException,
AcsJCannotGetComponentEx
connect(null).AlarmClientException - In case of failure connecting the clientAcsJCannotGetComponentEx - If the alarm service component is not availableCategoryClient.connect(AlarmSelectionListener, Category[])public void connect(Category[] categories)
throws AlarmClientException,
AcsJCannotGetComponentEx
categories - The categories to connect toAcsJCannotGetComponentEx - In case the AlarmService is not availableAlarmClientException - In case of failure connecting the clientCategoryClient.connect(AlarmSelectionListener, Category[])public void close()
throws AlarmClientException
AlarmClientExceptionpublic void onAlarm(Alarm alarm)
onAlarm in interface AlarmSelectionListeneralarm - the changed alarmAlarmSelectionListenerpublic void onException(LaserSelectionException e)
onException in interface AlarmSelectionListenere - the LaserSelectionException carrying the exception codeAlarmSelectionListenerpublic Alarm[] getParents(java.lang.String id, boolean node) throws AlarmClientException
AlarmClientExceptionCategoryClient#getParents(String, boolean)}public Alarm[] getChildren(java.lang.String id, boolean node) throws AlarmClientException
AlarmClientExceptionCategoryClient#getChildren(String, boolean)}public int getMultiplicityThreshold(java.lang.String id)
throws AlarmClientException
AlarmClientExceptionCategoryClient#getMultiplicityThreshold(String)}public Alarm[] getActiveChildren(java.lang.String id, boolean node) throws AlarmClientException
AlarmClientExceptionCategoryClient#getActiveChildren(String, boolean)}public boolean addAlarmListener(AlarmListenersContainer.AlarmListener listener)
public AlarmListenersContainer.AlarmListener addAlarmListener(AlarmSelectionListener listener, AlarmFilter filter)
public AlarmListenersContainer.AlarmListener addAlarmListener(AlarmSelectionListener listener)
public boolean removeAlarmListener(AlarmListenersContainer.AlarmListener listenerToRemove)
public boolean addStatsListener(AlarmCategoryStatListener listener)
public boolean removeStatListener(AlarmCategoryStatListener listenerToRemove)