public class CategoryClient
extends java.lang.Object
AlarmCategoryClient
and should not be instantiated directly.
It is a wrapper to CERN classes in order to simplify the usage from ACS without dealing with low level details of the alarm system.
The class connects to the alarm system as a CERN client, logging in a generic user. The listener receives alarms and errors from the alarm system by means of a callback. The alarm system sends all the already active alarms when the user logs is.
The close() method has to be called in order to free all the resources.
TODO: reduce the visibility of this class to ensure it is not used outside of
AlarmCategoryClient
| Constructor and Description |
|---|
CategoryClient(ContainerServices contServices)
Constructor
|
CategoryClient(org.omg.CORBA.ORB orb,
AcsLogger logger)
Contructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release all the resource,
|
void |
connect(AlarmSelectionListener listener)
Connects to all the categories of the alarm system.
|
void |
connect(AlarmSelectionListener listener,
Category[] categories)
Connects to the passed categories of the alarm system
|
protected void |
finalize()
Ensure that the resources have been released before destroying the object
|
Alarm[] |
getActiveChildren(java.lang.String id,
boolean node)
Get the active children of a reduced alarm.
|
Alarm[] |
getChildren(java.lang.String id,
boolean node)
Get the parents of a reduced alarm.
|
int |
getMultiplicityThreshold(java.lang.String id)
Return the threshold for the multiplicity node whose
ID is passed as parameter.
|
Alarm[] |
getParents(java.lang.String id,
boolean node)
Get the parents of a reduced alarm.
|
public CategoryClient(ContainerServices contServices) throws AlarmClientException
contServices - The containerServicesAlarmClientExceptionpublic CategoryClient(org.omg.CORBA.ORB orb,
AcsLogger logger)
orb - The orblogger - The loggerpublic void connect(AlarmSelectionListener listener) throws AlarmClientException, AcsJCannotGetComponentEx
connect(listener,null).listener - The lister to notify of the alarms received from the categoriesAlarmClientException - In case of failure connecting the clientAcsJCannotGetComponentEx - If the alarm service component is not availableconnect(AlarmSelectionListener, Category[])public void connect(AlarmSelectionListener listener, Category[] categories) throws AlarmClientException, AcsJCannotGetComponentEx
listener - The lister to notify of the alarms received from the categoriescategories - The categories to connect toAcsJCannotGetComponentEx - In case the AlarmService is not availableAlarmClientException - In case of failure connecting the clientpublic void close()
throws AlarmClientException
AlarmClientExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic Alarm[] getParents(java.lang.String id, boolean node) throws AlarmClientException
The method asks the alarm service component for the parents of a reduced alarm.
id - The id of the alarmnode - true if the alarm is a Node alarm;
false if the alarm of the passed ID is a multiplicity.AlarmClientException - In case of error getting the alarms from the componentpublic Alarm[] getChildren(java.lang.String id, boolean node) throws AlarmClientException
The method asks the alarm service component for the children of a reduced alarm.
id - The id of the alarmnode - true if the alarm is a Node alarm;
false if the alarm of the passed ID is a multiplicity.AlarmClientException - In case of error getting the alarms from the componentpublic int getMultiplicityThreshold(java.lang.String id)
throws AlarmClientException
id - The id of the multiplicity nodeAlarmClientException - If an error happens getting the threshold from the componentpublic Alarm[] getActiveChildren(java.lang.String id, boolean node) throws AlarmClientException
The method asks the alarm service component for the active children of a reduced alarm.
id - The id of the alarmnode - true if the alarm is a Node alarm;
false if the alarm of the passed ID is a multiplicity.AlarmClientException - In case of error getting the alarms from the component