
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 |
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.
| alma::alarmsystem::clients::CategoryClient::CategoryClient | ( | ContainerServices | contServices | ) | throws AlarmClientException [inline] |
Constructor
| contServices | The containerServices |
| AlarmClientException |
References contSvc, alma::acs::container::ContainerServicesBase::getLogger(), and logger.
| 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
| config | The Configuration | |
| categories | The categories to listen to If it is null, it adds all the categories returned by the alarm system component |
| 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] |
Release all the resource,
| AlarmClientException |
References cern::laser::client::services::selection::AlarmSelectionHandler::close(), closed, and jms_selectionHandler.
Referenced by alma::alarmsystem::test::manager::ManagerTest::close(), alma::acsplugins::alarmsystem::gui::CernSysPanel::disconnect(), finalize(), alma::alarmsystem::clients::test::UserPropsTest::tearDown(), alma::alarmsystem::clients::test::CategoryClientThreshold::tearDown(), alma::alarmsystem::clients::test::CategoryClientTest::tearDown(), alma::alarmsystem::clients::test::CategoryClientParent::tearDown(), alma::alarmsystem::clients::test::CategoryClientChildren::tearDown(), alma::acs::alarmsystem::test::BACITest::tearDown(), and alma::alarmsystem::clients::test::TestCategoryActiveChildren::teraDown().
| void alma::alarmsystem::clients::CategoryClient::connect | ( | AlarmSelectionListener | listener, | |
| Category[] | categories | |||
| ) | throws AlarmClientException, AcsJCannotGetComponentEx [inline] |
Connects to the passed categories of the alarm system
| listener | The lister to notify of the alarms received from the categories | |
| categories | The categories to connect to |
| AcsJCannotGetComponentEx | In case the AlarmService is not available | |
| AlarmClientException | In case of failure connecting the client |
References addCategories(), alarm, closed, contSvc, defaultConf, cern::laser::client::services::selection::AlarmSelectionHandler::get(), alma::alarmsystem::corbaservice::CernAlarmServiceUtils::getCernAlarmService(), cern::laser::console::User::getDefaultConfiguration(), cern::laser::console::Configuration::getSelection(), cern::laser::console::impl::UserHandlerImpl::getUser(), jms_selectionHandler, logger, cern::laser::client::services::selection::AlarmSelectionHandler::select(), alma::maciErrType::wrappers::AcsJCannotGetComponentEx::setReason(), testUser, and userHandler.
| 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).
| listener | The lister to notify of the alarms received from the categories |
| AlarmClientException | In case of failure connecting the client | |
| AcsJCannotGetComponentEx | If the alarm service component is not available |
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::connect(), alma::alarmsystem::test::manager::ManagerTest::ManagerTest(), alma::alarmsystem::clients::test::UserPropsTest::setUp(), alma::acs::alarmsystem::test::BACITest::setUp(), alma::alarmsystem::clients::test::TestCategoryActiveChildren::testActiveChildren(), alma::alarmsystem::clients::test::CategoryClientTest::testAlarmReception(), alma::alarmsystem::clients::test::CategoryClientChildren::testGetNodeChildren(), alma::alarmsystem::clients::test::CategoryClientParent::testGetNodeParents(), and alma::alarmsystem::clients::test::CategoryClientThreshold::testGetThreashold().
| Alarm alma::alarmsystem::clients::CategoryClient::convertAlarmType | ( | alma.alarmsystem.Alarm | alarm | ) | [inline, private] |
Convert a CORBA alarm into a client alarm.
| alarm | The CORBA alarm |
References alarm, alma::alarmsystem::Category::categoryId, alma::alarmsystem::Category::description, alma::alarmsystem::Category::leaf, alma::alarmsystem::Category::name, alma::alarmsystem::Category::path, and cern::laser::business::data::Location::setBuilding().
Referenced by getActiveChildren(), getChildren(), and getParents().
| void alma::alarmsystem::clients::CategoryClient::finalize | ( | ) | throws Throwable [inline, protected] |
| 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.
| 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. |
| 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.
| 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. |
| 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.
| id | The id of the multiplicity node |
| 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.
| 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. |
| 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().
The alarm service component
Referenced by addCategories(), connect(), convertAlarmType(), getActiveChildren(), getChildren(), getMultiplicityThreshold(), and getParents().
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().
Logger alma::alarmsystem::clients::CategoryClient::logger [private] |
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().
1.6.2