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

com::cosylab::acs::laser::dao::ACSCategoryDAOImpl Class Reference

Collaboration diagram for com::cosylab::acs::laser::dao::ACSCategoryDAOImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Category getDefaultCategory ()
 ACSCategoryDAOImpl (Logger log, 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 ()

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

final String CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/Categories"
final String ALARM_CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/AlarmCategoryDefinitions"

Detailed Description

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)

See also:
ACSAlarmDAOImpl
Author:
acaproni


Constructor & Destructor Documentation

com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::ACSCategoryDAOImpl Logger  log,
ACSAlarmDAOImpl  alarmDAO
[inline]
 

Constructor

Parameters:
log The log (not null)


Member Function Documentation

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

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.

Parameters:
childrenName The name of this category
ID The ID of this category

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.

Parameters:
category The category to assign to the alarms
FF The fault family of the alarms to assign the category to

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.

Parameters:
defCategory The default category

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::deleteCategory Category  category  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::dumpCategories  )  [inline, private]
 

Dumps the category.

Category [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findAllCategories  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findByCategoryTreeRoot  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findBySurveillanceCategory  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findCategory Integer  identifier  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::findCategoryByPath String  path  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::flushCategory  )  [inline]
 

String [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getAlarms Integer  categoryId  )  [inline]
 

Integer [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getAllCategoryIDs  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategory Integer  identifier  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategoryByPath String  path  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getCategoryByPathInitialized String  path  )  [inline]
 

Integer [] com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getChildren Integer  parentId  )  [inline]
 

Category com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::getDefaultCategory  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::linkWithAlarms  )  [inline]
 

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

Returns:
list of Category entries read from CDB
Exceptions:
Exception In case of error reading the values from the CDB

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::saveCategory Category  category  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setCategoryTreeRoot String  categoryTreeRoot  )  [inline]
 

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 ':'

Parameters:
cat 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::setSurveillanceCategoryPath String  surveillanceCategoryPath  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::updateCategory Category  category  )  [inline]
 


Member Data Documentation

final String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::ALARM_CATEGORY_DEFINITION_PATH = "/Alarms/Administrative/AlarmCategoryDefinitions" [static, private]
 

AlarmDAO com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::alarmDao [package]
 

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]
 

String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::categoryTreeRoot [package]
 

HashMap<String, Category> com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::catPathToCategory = new HashMap<String Category>() [package]
 

ConfigurationAccessor com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::conf [package]
 

Category com::cosylab::acs::laser::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.

Logger com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::logger [package]
 

int com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::nextCatID = 1 [package]
 

String com::cosylab::acs::laser::dao::ACSCategoryDAOImpl::surveillanceCategoryPath [package]
 


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