cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl Class Reference

Inheritance diagram for cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl:
Inheritance graph
[legend]
Collaboration diagram for cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl:
Collaboration graph
[legend]

List of all members.

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, CategorycatPathToCategory = new HashMap<String, Category>()
HashMap< Integer, Categorycategories = 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"

Constructor & Destructor Documentation

cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::ACSCategoryDAOImpl ( Logger  log,
com.cosylab.acs.laser.dao.ACSAlarmDAOImpl  alarmDAO 
) [inline]

Constructor

Parameters:
log The log (not null)

References alarmDao, and logger.


Member Function Documentation

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]
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.

Parameters:
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.

See also:
LaserCoreAlarms
LaserCoreFaultState
LaserCoreFaultCodes

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.

Parameters:
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.

Parameters:
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]
void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::dumpCategories (  )  [inline, private]
Category [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findAllCategories (  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findByCategoryTreeRoot (  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findBySurveillanceCategory (  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findCategory ( Integer  identifier  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::findCategoryByPath ( String  path  )  [inline]
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]
Integer [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getAllCategoryIDs (  )  [inline]
Categories cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategories (  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategory ( Integer  identifier  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategoryByPath ( String  path  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getCategoryByPathInitialized ( String  path  )  [inline]
Integer [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getChildren ( Integer  parentId  )  [inline]
Category cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::getDefaultCategory (  )  [inline]
void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::linkWithAlarms (  )  [inline]
alma.acs.alarmsystem.generated.Category [] cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::loadCategories (  )  throws Exception [inline]
void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::saveCategory ( Category  category  )  [inline]
void cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::setCategoryTreeRoot ( String  categoryTreeRoot  )  [inline]
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 ':'

Parameters:
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]
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]

Member Data Documentation

HashMap<Integer, Category> cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::categories = new HashMap<Integer, Category>() [package]
final String cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/Categories" [static, private]
HashMap<String, Category> cl::utfsm::acs::acg::dao::ACSCategoryDAOImpl::catPathToCategory = new HashMap<String, Category>() [package]

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().


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

Generated by  doxygen 1.6.2