Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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 getAlarmServiceComponent () throws Exception
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
final String alarmServiceIDL = "*/AlarmService:*"
AlarmService 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 


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 

void alma::alarmsystem::clients::CategoryClient::close  )  throws AlarmClientException [inline]
 

Release all the resource,

Exceptions:
AlarmClientException 

void alma::alarmsystem::clients::CategoryClient::connect AlarmSelectionListener  listener,
Category[]  categories
throws AlarmClientException, AcsJCannotGetComponentEx [inline]
 

Connects to the passed categories of the alarm system

Parameters:
listener The lister to notify of the alarms received from the categories
categories The categories to connect to
Exceptions:
AcsJCannotGetComponentEx In case the AlarmService is not available
AlarmClientException In case of failure connecting the client

void alma::alarmsystem::clients::CategoryClient::connect AlarmSelectionListener  listener  )  throws AlarmClientException, AcsJCannotGetComponentEx [inline]
 

Connects to all the categories of the alarm system.

It is equivalent to connect(listener,null).

Parameters:
listener The lister to notify of the alarms received from the categories
Exceptions:
AlarmClientException In case of failure connecting the client
AcsJCannotGetComponentEx If the alarm service component is not available
See also:
CategoryClient.connect(AlarmSelectionListener listener, Category[] categories)

Alarm alma::alarmsystem::clients::CategoryClient::convertAlarmType alma.alarmsystem.Alarm  alarm  )  [inline, private]
 

Convert a CORBA alarm into a client alarm.

Parameters:
alarm The CORBA alarm
Returns:
the client alarm

void alma::alarmsystem::clients::CategoryClient::finalize  )  throws Throwable [inline, protected]
 

Ensure that the resources have been released before destroying the object

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

void alma::alarmsystem::clients::CategoryClient::getAlarmServiceComponent  )  throws Exception [inline, private]
 

Connect the AlarmSrevice component

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

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

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


Member Data Documentation

AlarmService alma::alarmsystem::clients::CategoryClient::alarm [private]
 

final String alma::alarmsystem::clients::CategoryClient::alarmServiceIDL = "*/AlarmService:*" [private]
 

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

To avoid to release the resources twice

ContainerServices alma::alarmsystem::clients::CategoryClient::contSvc [private]
 

ACS ContainerServices

Configuration alma::alarmsystem::clients::CategoryClient::defaultConf [private]
 

The user to log in (test for instance)

AlarmSelectionHandler alma::alarmsystem::clients::CategoryClient::jms_selectionHandler [private]
 

/ The alarm selection handler

Logger alma::alarmsystem::clients::CategoryClient::logger [private]
 

The logger

User alma::alarmsystem::clients::CategoryClient::testUser [private]
 

The user to log in (test for instance)

UserHandlerImpl alma::alarmsystem::clients::CategoryClient::userHandler [private]
 

The user handler


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:01:35 2009 for ACS Java API by doxygen 1.3.8