alma::alarmsystem::clients::CategoryClient Class Reference

Collaboration diagram for alma::alarmsystem::clients::CategoryClient:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CategoryClient (ContainerServices contServices) throws AlarmClientException
void connect (AlarmSelectionListener listener) throws AlarmClientException, AcsJCannotGetComponentEx
void connect (AlarmSelectionListener listener, Category[] categories) throws AlarmClientException, AcsJCannotGetComponentEx
void close () throws AlarmClientException
Alarm[] getParents (String id, boolean node) throws AlarmClientException
Alarm[] getChildren (String id, boolean node) throws AlarmClientException
int getMultiplicityThreshold (String id) throws AlarmClientException
Alarm[] getActiveChildren (String id, boolean node) throws AlarmClientException

Protected Member Functions

void finalize () throws Throwable

Private Member Functions

void addCategories (Configuration config, Category[] categories) throws Exception
Alarm convertAlarmType (alma.alarmsystem.Alarm alarm)

Private Attributes

UserHandlerImpl userHandler
User testUser
Configuration defaultConf
AlarmSelectionHandler jms_selectionHandler
ContainerServices contSvc
Logger logger
CERNAlarmService alarm
volatile boolean closed = false

Detailed Description

A client that listen to alarms from all the categories.

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.

Author:
acaproni

Constructor & Destructor Documentation

alma::alarmsystem::clients::CategoryClient::CategoryClient ( ContainerServices  contServices  )  throws AlarmClientException [inline]

Constructor

Parameters:
contServices The containerServices
Exceptions:
AlarmClientException 

References contSvc, alma::acs::container::ContainerServicesBase::getLogger(), and logger.


Member Function Documentation

void alma::alarmsystem::clients::CategoryClient::addCategories ( Configuration  config,
Category[]  categories 
) throws Exception [inline, private]

Add the categories to the configuration i.e. add the categories the client wants to listen to

Parameters:
config The Configuration
categories The categories to listen to If it is null, it adds all the categories returned by the alarm system component
Exceptions:
Exception 

References cern::laser::client::services::selection::CategorySelection::add(), alarm, cern::laser::client::services::selection::Selection::createCategorySelection(), alma::alarmsystem::CERNAlarmServiceOperations::getCategories(), logger, and cern::laser::client::services::selection::Selection::setCategorySelection().

Referenced by connect().

void alma::alarmsystem::clients::CategoryClient::close (  )  throws AlarmClientException [inline]
void alma::alarmsystem::clients::CategoryClient::connect ( AlarmSelectionListener  listener,
Category[]  categories 
) throws AlarmClientException, AcsJCannotGetComponentEx [inline]
void alma::alarmsystem::clients::CategoryClient::connect ( AlarmSelectionListener  listener  )  throws AlarmClientException, AcsJCannotGetComponentEx [inline]
Alarm alma::alarmsystem::clients::CategoryClient::convertAlarmType ( alma.alarmsystem.Alarm  alarm  )  [inline, private]
void alma::alarmsystem::clients::CategoryClient::finalize (  )  throws Throwable [inline, protected]

Ensure that the resources have been released before destroying the object

References close(), and closed.

Alarm [] alma::alarmsystem::clients::CategoryClient::getActiveChildren ( String  id,
boolean  node 
) throws AlarmClientException [inline]

Get the active children of a reduced alarm.

The method asks the alarm service component for the active children of a reduced alarm.

Parameters:
id The id of the alarm
node true if the alarm is a Node alarm; false if the alarm of the passed ID is a multiplicity.
Returns:
The array of the alarm parent of the alarm with the passed ID
Exceptions:
AlarmClientException In case of error getting the alarms from the component

References alarm, convertAlarmType(), alma::alarmsystem::CERNAlarmServiceOperations::getActiveMultiplicityChildren(), and alma::alarmsystem::CERNAlarmServiceOperations::getActiveNodeChildren().

Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::showActiveChildren(), and alma::alarmsystem::clients::test::TestCategoryActiveChildren::testActiveChildren().

Alarm [] alma::alarmsystem::clients::CategoryClient::getChildren ( String  id,
boolean  node 
) throws AlarmClientException [inline]

Get the parents of a reduced alarm.

The method asks the alarm service component for the children of a reduced alarm.

Parameters:
id The id of the alarm
node true if the alarm is a Node alarm; false if the alarm of the passed ID is a multiplicity.
Returns:
The array of the alarm parent of the alarm with the passed ID
Exceptions:
AlarmClientException In case of error getting the alarms from the component

References alarm, convertAlarmType(), alma::alarmsystem::CERNAlarmServiceOperations::getMultiplicityChildren(), and alma::alarmsystem::CERNAlarmServiceOperations::getNodeChildren().

Referenced by alma::acsplugins::alarmsystem::gui::reduced::ReducedChainDlg::getAlarmChain(), alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::hideReducedChildren(), and alma::alarmsystem::clients::test::CategoryClientChildren::testGetNodeChildren().

int alma::alarmsystem::clients::CategoryClient::getMultiplicityThreshold ( String  id  )  throws AlarmClientException [inline]

Return the threshold for the multiplicity node whose ID is passed as parameter.

Parameters:
id The id of the multiplicity node
Returns:
The multiplicity threshold of the node with the given id
Exceptions:
AlarmClientException If an error happens getting the threshold from the component

References alarm, and alma::alarmsystem::CERNAlarmServiceOperations::getMultiplicityThreshold().

Referenced by alma::alarmsystem::clients::test::CategoryClientThreshold::testGetThreashold().

Alarm [] alma::alarmsystem::clients::CategoryClient::getParents ( String  id,
boolean  node 
) throws AlarmClientException [inline]

Get the parents of a reduced alarm.

The method asks the alarm service component for the parents of a reduced alarm.

Parameters:
id The id of the alarm
node true if the alarm is a Node alarm; false if the alarm of the passed ID is a multiplicity.
Returns:
The array of the alarm parent of the alarm with the passed ID
Exceptions:
AlarmClientException In case of error getting the alarms from the component

References alarm, convertAlarmType(), alma::alarmsystem::CERNAlarmServiceOperations::getMultiplicityParents(), and alma::alarmsystem::CERNAlarmServiceOperations::getNodeParents().

Referenced by alma::alarmsystem::clients::test::CategoryClientParent::testGetNodeParents().


Member Data Documentation

volatile boolean alma::alarmsystem::clients::CategoryClient::closed = false [private]

To avoid to release the resources twice

Referenced by close(), connect(), and finalize().

ACS ContainerServices

Referenced by CategoryClient(), and connect().

The user to log in (test for instance)

Referenced by connect().

/ The alarm selection handler

Referenced by close(), and connect().

The logger

Referenced by addCategories(), CategoryClient(), and connect().

The user to log in (test for instance)

Referenced by connect().

The user handler

Referenced by connect().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2