

Public Member Functions | |
| Category | getDefaultCategory () |
| ACSCategoryDAOImpl (Logger log, com.cosylab.acs.laser.dao.ACSAlarmDAOImpl alarmDAO) | |
| Category | findCategory (Integer identifier) |
| Category | getCategory (Integer identifier) |
| Category | findByCategoryTreeRoot () |
| Category | findBySurveillanceCategory () |
| Category[] | findAllCategories () |
| Category | findCategoryByPath (String path) |
| Category | getCategoryByPathInitialized (String path) |
| Category | getCategoryByPath (String path) |
| void | saveCategory (Category category) |
| void | updateCategory (Category category) |
| void | deleteCategory (Category category) |
| String[] | getAlarms (Integer categoryId) |
| Integer[] | getChildren (Integer parentId) |
| alma.acs.alarmsystem.generated.Category[] | loadCategories () throws Exception |
| void | linkWithAlarms () |
| void | flushCategory () |
| void | setConfAccessor (ConfigurationAccessor conf) |
| void | setCategoryTreeRoot (String categoryTreeRoot) |
| void | setSurveillanceCategoryPath (String surveillanceCategoryPath) |
| Integer[] | getAllCategoryIDs () |
| Categories | getCategories () |
| void | flushCategories (Categories cats) |
| void | addCategory (Categories cats, alma.acs.alarmsystem.generated.Category cat) |
| void | updateCategory (Categories cats, alma.acs.alarmsystem.generated.Category cat) |
| void | deleteCategory (Categories cats, alma.acs.alarmsystem.generated.Category cat) |
Package Attributes | |
| int | nextCatID = 1 |
| AlarmDAO | alarmDao |
| ConfigurationAccessor | conf |
| HashMap< String, Category > | catPathToCategory = new HashMap<String, Category>() |
| HashMap< Integer, Category > | categories = new HashMap<Integer, Category>() |
| String | surveillanceCategoryPath |
| String | categoryTreeRoot |
| Logger | logger |
Private Member Functions | |
| void | assignCategoryOfCoreAlarms () |
| void | assignDefaultCategory (Category defCategory) |
| void | adjustParentIDs (String childrenName, int ID) |
| void | setParentID (CategoryImpl cat) |
| void | addRootCategory () |
| void | dumpCategories () |
| void | assignCategoryToAlarms (Category category, String FF) |
Private Attributes | |
| Category | defaultCategory = null |
Static Private Attributes | |
| static final String | CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/Categories" |
| static final String | ALARM_CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/AlarmCategoryDefinitions" |
| cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::ACSCategoryDAOImpl | ( | Logger | log, | |
| com.cosylab.acs.laser.dao.ACSAlarmDAOImpl | alarmDAO | |||
| ) | [inline] |
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::addCategory | ( | Categories | cats, | |
| alma.acs.alarmsystem.generated.Category | cat | |||
| ) | [inline] |
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::addRootCategory | ( | ) | [inline, private] |
Add the ROOT category
This avoid the user to add this entry in the CDB
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 cl::utfsm::acs::acg::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 |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References getCategoryByPath(), cern::laser::business::data::CategoryImpl::getChildrenIds(), logger, and cern::laser::business::data::CategoryImpl::setChildrenIds().
Referenced by loadCategories().
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::assignCategoryOfCoreAlarms | ( | ) | [inline, private] |
Assign core alarms to the root category.
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References assignCategoryToAlarms(), and getCategoryByPath().
Referenced by loadCategories().
| void cl::utfsm::acs::acg::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 |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 cl::utfsm::acs::acg::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 |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::deleteCategory | ( | Categories | cats, | |
| alma.acs.alarmsystem.generated.Category | cat | |||
| ) | [inline] |
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::deleteCategory | ( | Category | category | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories, catPathToCategory, and cern::laser::business::data::Category::getCategoryId().
Referenced by cl::utfsm::acs::acg::dao::ACSCategoryDAOImplTest::testDeleteCategory().
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::dumpCategories | ( | ) | [inline, private] |
Dumps the category.
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findAllCategories | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories.
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findByCategoryTreeRoot | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categoryTreeRoot, and findCategoryByPath().
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findBySurveillanceCategory | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References findCategoryByPath(), and surveillanceCategoryPath.
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findCategory | ( | Integer | identifier | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References getCategory().
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findCategoryByPath | ( | String | path | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References getCategoryByPath().
Referenced by findByCategoryTreeRoot(), and findBySurveillanceCategory().
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::flushCategories | ( | Categories | cats | ) | [inline] |
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::flushCategory | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getAlarms | ( | Integer | categoryId | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References getCategory().
| Integer [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getAllCategoryIDs | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories.
| Categories cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategories | ( | ) | [inline] |
References CATEGORY_DEFINITION_PATH, conf, com::cosylab::acs::laser::dao::ConfigurationAccessor::getConfiguration(), and com::cosylab::acs::laser::dao::ConfigurationAccessor::isWriteable().
Referenced by cl::utfsm::acs::acg::dao::ACSCategoryDAOImplTest::testDeleteCategory(), cl::utfsm::acs::acg::dao::ACSCategoryDAOImplTest::testSaveCategory(), and cl::utfsm::acs::acg::dao::ACSCategoryDAOImplTest::testUpdateCategory().
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategory | ( | Integer | identifier | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories.
Referenced by dumpCategories(), findCategory(), getAlarms(), and getChildren().
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategoryByPath | ( | String | path | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References catPathToCategory.
Referenced by adjustParentIDs(), assignCategoryOfCoreAlarms(), findCategoryByPath(), getCategoryByPathInitialized(), linkWithAlarms(), and setParentID().
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategoryByPathInitialized | ( | String | path | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References getCategoryByPath().
| Integer [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getChildren | ( | Integer | parentId | ) | [inline] |
| Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getDefaultCategory | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References defaultCategory.
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::linkWithAlarms | ( | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 [] cl::utfsm::acs::acg::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 |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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().
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::saveCategory | ( | Category | category | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories, catPathToCategory, cern::laser::business::data::CategoryImpl::getCategoryId(), cern::laser::business::data::CategoryImpl::getPath(), nextCatID, and cern::laser::business::data::CategoryImpl::setCategoryId().
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::setCategoryTreeRoot | ( | String | categoryTreeRoot | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::setConfAccessor | ( | ConfigurationAccessor | conf | ) | [inline] |
| void cl::utfsm::acs::acg::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 |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
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 cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::setSurveillanceCategoryPath | ( | String | surveillanceCategoryPath | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::updateCategory | ( | Categories | cats, | |
| alma.acs.alarmsystem.generated.Category | cat | |||
| ) | [inline] |
| void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::updateCategory | ( | Category | category | ) | [inline] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
References categories, catPathToCategory, cern::laser::business::data::Category::getCategoryId(), and cern::laser::business::data::Category::getPath().
Referenced by cl::utfsm::acs::acg::dao::ACSCategoryDAOImplTest::testUpdateCategory().
final String cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::ALARM_CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/AlarmCategoryDefinitions" [static, private] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by flushCategory(), and linkWithAlarms().
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by ACSCategoryDAOImpl(), assignCategoryToAlarms(), assignDefaultCategory(), flushCategory(), and linkWithAlarms().
HashMap<Integer, Category> cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::categories = new HashMap<Integer, Category>() [package] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by addRootCategory(), assignDefaultCategory(), deleteCategory(), dumpCategories(), findAllCategories(), getAllCategoryIDs(), getCategory(), getChildren(), loadCategories(), saveCategory(), and updateCategory().
final String cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/Categories" [static, private] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by flushCategories(), flushCategory(), getCategories(), and loadCategories().
String cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::categoryTreeRoot [package] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by findByCategoryTreeRoot().
HashMap<String, Category> cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::catPathToCategory = new HashMap<String, Category>() [package] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by addRootCategory(), deleteCategory(), flushCategory(), getCategoryByPath(), linkWithAlarms(), loadCategories(), saveCategory(), and updateCategory().
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by flushCategories(), flushCategory(), getCategories(), linkWithAlarms(), and loadCategories().
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::defaultCategory = null [private] |
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.
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by getDefaultCategory(), and loadCategories().
Logger cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::logger [package] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by ACSCategoryDAOImpl(), adjustParentIDs(), assignCategoryToAlarms(), assignDefaultCategory(), loadCategories(), and setParentID().
int cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::nextCatID = 1 [package] |
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by addRootCategory(), loadCategories(), and saveCategory().
Reimplemented from com::cosylab::acs::laser::dao::ACSCategoryDAOImpl.
Referenced by findBySurveillanceCategory().
1.6.2