

Read the categories from the CDB.
When the categories are available, the alarms are assigned to the categories (this complete the alarms initialization initiated by ACSAlarmDAOImpl)
| com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::ACSCategoryDAOImpl | ( | Logger | log, | |
| ACSAlarmDAOImpl | alarmDAO | |||
| ) | [inline] |
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::addRootCategory | ( | ) | [inline, private] |
Add the ROOT category
This avoid the user to add this entry in the CDB
References categories, catPathToCategory, cern::laser::business::data::CategoryImpl::getCategoryId(), cern::laser::business::data::CategoryImpl::getPath(), nextCatID, cern::laser::business::data::CategoryImpl::setAlarmIds(), cern::laser::business::data::CategoryImpl::setCategoryId(), cern::laser::business::data::CategoryImpl::setChildrenIds(), cern::laser::business::data::CategoryImpl::setDescription(), cern::laser::business::data::CategoryImpl::setName(), cern::laser::business::data::CategoryImpl::setParentId(), and cern::laser::business::data::CategoryImpl::setPath().
Referenced by loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::adjustParentIDs | ( | String | childrenName, | |
| int | ID | |||
| ) | [inline, private] |
Set the ID of this category in the children list of its parents
A category contains a list of all its children. The first category is ROOT. If a category is child of another category is inferred by its name. If a category has no parents, it is set to be a ROOT child.
| childrenName | The name of this category | |
| ID | The ID of this category |
References getCategoryByPath(), cern::laser::business::data::CategoryImpl::getChildrenIds(), logger, and cern::laser::business::data::CategoryImpl::setChildrenIds().
Referenced by loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::assignCategoryOfCoreAlarms | ( | ) | [inline, private] |
Assign core alarms to the root category.
References assignCategoryToAlarms(), and getCategoryByPath().
Referenced by loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::assignCategoryToAlarms | ( | Category | category, | |
| String | FF | |||
| ) | [inline, private] |
Assign the category to the all the alarms of a given FaultFamily.
In the CDB each category has a list (eventually empty) of FaultFamily. If a FaultFamily appear in the definition of a Category then add such category to all the alarms of such FF.
| category | The category to assign to the alarms | |
| FF | The fault family of the alarms to assign the category to |
References alarmDao, cern::laser::business::dao::AlarmDAO::getAlarm(), cern::laser::business::data::Alarm::getAlarmId(), cern::laser::business::data::Alarm::getCategories(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Category::getName(), cern::laser::business::data::Alarm::getTriplet(), and logger.
Referenced by assignCategoryOfCoreAlarms(), and loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::assignDefaultCategory | ( | Category | defCategory | ) | [inline, private] |
Assign the default category to the alarms not assigned to any category
Scans all the alarms to check for alarms without any category and assign the default category to them.
| defCategory | The default category |
References alarmDao, categories, cern::laser::business::dao::AlarmDAO::getAlarm(), cern::laser::business::data::Alarm::getAlarmId(), cern::laser::business::data::Alarm::getCategories(), cern::laser::business::data::Category::getPath(), logger, and cern::laser::business::data::Alarm::setCategories().
Referenced by loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::deleteCategory | ( | Category | category | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References categories, catPathToCategory, and cern::laser::business::data::Category::getCategoryId().
Referenced by com::cosylab::acs::alarm::ACSCategoryDAOTest::testDeleteCategory().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::dumpCategories | ( | ) | [inline, private] |
Dumps the category.
References categories, getCategory(), cern::laser::business::data::CategoryImpl::getCategoryId(), cern::laser::business::data::CategoryImpl::getChildrenIds(), cern::laser::business::data::CategoryImpl::getDescription(), cern::laser::business::data::CategoryImpl::getName(), cern::laser::business::data::CategoryImpl::getParentId(), and cern::laser::business::data::CategoryImpl::getPath().
| Category [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findAllCategories | ( | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References categories.
Referenced by com::cosylab::acs::alarm::ACSCategoryDAOTest::testFindAllCategories().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findByCategoryTreeRoot | ( | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References categoryTreeRoot, and findCategoryByPath().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findBySurveillanceCategory | ( | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References findCategoryByPath(), and surveillanceCategoryPath.
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findCategory | ( | Integer | identifier | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References getCategory().
Referenced by com::cosylab::acs::alarm::ACSCategoryDAOTest::testGettingCategories().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findCategoryByPath | ( | String | path | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References getCategoryByPath().
Referenced by findByCategoryTreeRoot(), and findBySurveillanceCategory().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::flushCategory | ( | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkDefinitionListType::addAlarmCategoryLink(), com::cosylab::acs::laser::dao::xml::CategoryDefinitionListType::addCategoryDefinition(), ALARM_CATEGORY_DEFINITION_PATH, alarmDao, CATEGORY_DEFINITION_PATH, catPathToCategory, conf, cern::laser::business::dao::AlarmDAO::getAlarm(), cern::laser::business::data::CategoryImpl::getAlarmIds(), cern::laser::business::data::CategoryImpl::getDescription(), cern::laser::business::data::Triplet::getFaultCode(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::CategoryImpl::getPath(), cern::laser::business::data::Alarm::getTriplet(), com::cosylab::acs::laser::dao::ConfigurationAccessor::isWriteable(), com::cosylab::acs::laser::dao::xml::CategoryDefinitions::marshal(), com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkType::setAlarm(), com::cosylab::acs::laser::dao::xml::CategoryDefinitions::setCategoriesToCreate(), com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkType::setCategory(), com::cosylab::acs::laser::dao::xml::AlarmCategoryDefinitions::setCategoryLinksToCreate(), com::cosylab::acs::laser::dao::ConfigurationAccessor::setConfiguration(), com::cosylab::acs::laser::dao::xml::CategoryDefinitionType::setDescription(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::setFaultCode(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::setFaultFamily(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::setFaultMember(), and com::cosylab::acs::laser::dao::xml::CategoryDefinition::setPath().
| String [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getAlarms | ( | Integer | categoryId | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References getCategory().
| Integer [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getAllCategoryIDs | ( | ) | [inline] |
References categories.
Referenced by com::cosylab::acs::alarm::ACSCategoryDAOTest::testDeleteCategory(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testFindAllCategories(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetCategoryByID(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetChilds(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testLoadCategory(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testRootChilds(), and com::cosylab::acs::alarm::ACSCategoryDAOTest::testUpdateCategory().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategory | ( | Integer | identifier | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References categories.
Referenced by dumpCategories(), findCategory(), getAlarms(), getChildren(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testDeleteCategory(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetCategoryByID(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetChilds(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGettingCategories(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testLoadCategory(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testRootChilds(), and com::cosylab::acs::alarm::ACSCategoryDAOTest::testUpdateCategory().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategoryByPath | ( | String | path | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References catPathToCategory.
Referenced by adjustParentIDs(), assignCategoryOfCoreAlarms(), findCategoryByPath(), getCategoryByPathInitialized(), linkWithAlarms(), setParentID(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testDeleteCategory(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetCategoryByID(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetChilds(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGetRoot(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testGettingCategories(), com::cosylab::acs::alarm::ACSCategoryDAOTest::testRootChilds(), and com::cosylab::acs::alarm::ACSCategoryDAOTest::testUpdateCategory().
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategoryByPathInitialized | ( | String | path | ) | [inline] |
Implements cern::laser::business::dao::CategoryDAO.
References getCategoryByPath().
| Integer [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getChildren | ( | Integer | parentId | ) | [inline] |
| Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getDefaultCategory | ( | ) | [inline] |
References defaultCategory.
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::linkWithAlarms | ( | ) | [inline] |
References cern::laser::business::data::CategoryImpl::addChildCategory(), ALARM_CATEGORY_DEFINITION_PATH, alarmDao, catPathToCategory, conf, cern::laser::business::dao::AlarmDAO::getAlarm(), com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkType::getAlarm(), com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkDefinitionListType::getAlarmCategoryLink(), com::cosylab::acs::laser::dao::xml::AlarmCategoryLinkType::getCategory(), getCategoryByPath(), com::cosylab::acs::laser::dao::xml::AlarmCategoryDefinitions::getCategoryLinksToCreate(), com::cosylab::acs::laser::dao::ConfigurationAccessor::getConfiguration(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultCode(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultFamily(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultMember(), cern::laser::business::data::CategoryImpl::getPath(), com::cosylab::acs::laser::dao::xml::CategoryDefinition::getPath(), and com::cosylab::acs::laser::dao::xml::AlarmCategoryDefinitions::unmarshal().
| alma.acs.alarmsystem.generated.Category [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::loadCategories | ( | ) | throws Exception [inline] |
Load the categories from the CDB.
Loads all the category from the CDB and build an internal representation of category. The category is also added to all the alarms having the fault family specified in the XML.
All the categories derive from ROOT that is built here as default (in this way the user does ot need to add the ROOT entry in the CDB).
| Exception | In case of error reading the values from the CDB |
References addRootCategory(), adjustParentIDs(), assignCategoryOfCoreAlarms(), assignCategoryToAlarms(), assignDefaultCategory(), categories, CATEGORY_DEFINITION_PATH, catPathToCategory, conf, defaultCategory, cern::laser::business::data::CategoryImpl::getCategoryId(), com::cosylab::acs::laser::dao::ConfigurationAccessor::getConfiguration(), cern::laser::business::data::CategoryImpl::getName(), cern::laser::business::data::Category::getPath(), cern::laser::business::data::CategoryImpl::getPath(), logger, nextCatID, cern::laser::business::data::CategoryImpl::setAlarmIds(), cern::laser::business::data::CategoryImpl::setCategoryId(), cern::laser::business::data::CategoryImpl::setChildrenIds(), cern::laser::business::data::CategoryImpl::setDescription(), cern::laser::business::data::CategoryImpl::setName(), setParentID(), and cern::laser::business::data::CategoryImpl::setPath().
Referenced by com::cosylab::acs::laser::LaserComponent::initialize(), and com::cosylab::acs::alarm::ACSCategoryDAOTest::setUp().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::saveCategory | ( | Category | category | ) | [inline] |
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setCategoryTreeRoot | ( | String | categoryTreeRoot | ) | [inline] |
Referenced by com::cosylab::acs::laser::LaserComponent::initialize().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setConfAccessor | ( | ConfigurationAccessor | conf | ) | [inline] |
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setParentID | ( | CategoryImpl | cat | ) | [inline, private] |
Set the parent ID of the passed category
Each category has a parent ID that can be evaluated by reading the name of the category. If the name does not contain ':' then the parent ID is the ROOT. Otherwise its parent is the category whose name is represented by the substring before the ':'
| cat |
References getCategoryByPath(), cern::laser::business::data::CategoryImpl::getCategoryId(), cern::laser::business::data::Category::getCategoryId(), cern::laser::business::data::CategoryImpl::getPath(), logger, cern::laser::business::data::CategoryImpl::setName(), cern::laser::business::data::CategoryImpl::setParentId(), and cern::laser::business::data::CategoryImpl::setPath().
Referenced by loadCategories().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setSurveillanceCategoryPath | ( | String | surveillanceCategoryPath | ) | [inline] |
Referenced by com::cosylab::acs::laser::LaserComponent::initialize().
| void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::updateCategory | ( | Category | category | ) | [inline] |
final String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::ALARM_CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/AlarmCategoryDefinitions" [static, private] |
Referenced by flushCategory(), and linkWithAlarms().
Referenced by ACSCategoryDAOImpl(), assignCategoryToAlarms(), assignDefaultCategory(), flushCategory(), and linkWithAlarms().
HashMap<Integer, Category> com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::categories = new HashMap<Integer, Category>() [package] |
final String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/Categories" [static, private] |
Referenced by flushCategory(), and loadCategories().
String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::categoryTreeRoot [package] |
Referenced by findByCategoryTreeRoot().
HashMap<String, Category> com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::catPathToCategory = new HashMap<String, Category>() [package] |
Referenced by addRootCategory(), deleteCategory(), flushCategory(), getCategoryByPath(), linkWithAlarms(), loadCategories(), saveCategory(), and updateCategory().
Referenced by flushCategory(), linkWithAlarms(), and loadCategories().
The default category used to publish alarms not assigned to any category.
This is read by the CDB from the is-default attribute of a category. In the configuration files there should be only one default category but we can't consider an error if there is more then one (in this case a log message is submitted). If the default category is defined more then once, the first definition is used.
If no default category is defined another log message is submitted. In this case alarms not assigned to any category will remain unassigned.
Referenced by getDefaultCategory(), and loadCategories().
Logger com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::logger [package] |
Referenced by ACSCategoryDAOImpl(), adjustParentIDs(), assignCategoryToAlarms(), assignDefaultCategory(), loadCategories(), and setParentID().
int com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::nextCatID = 1 [package] |
Referenced by addRootCategory(), loadCategories(), and saveCategory().
Referenced by findBySurveillanceCategory().
1.6.2