

Public Member Functions | |
| ACSAlarmDAOImpl (Logger log) | |
| List< FaultFamily > | loadAlarms () throws Exception |
| ReductionDefinitions | getReductionDefinitions () |
| Alarm | findAlarm (String alarmId) |
| Alarm | getAlarm (String alarmId) |
| String[] | findAlarmIdsByPriority (Integer priority) |
| String | findLaserSurveillanceAlarmId () |
| void | deleteAlarm (Alarm alarm) |
| void | saveMemberAlarms (String member) |
| void | saveAlarm (Alarm alarm) |
| void | updateAlarm (Alarm alarm) |
| void | updateStatus (Status status) |
| Collection | search (String select_sql) |
| Collection | archiveSearch (String select_sql) |
| Building | findBuilding (String building) |
| void | setConfAccessor (ConfigurationAccessor conf) |
| void | setSurveillanceAlarmId (String surveillanceAlarmId) |
| void | setResponsiblePersonDAO (ResponsiblePersonDAO responsiblePersonDAO) |
| String[] | getAllAlarmIDs () |
| ConcurrentHashMap< String, Source > | getSources () |
Package Functions | |
| Building | loadBuilding (String buildingID) |
Static Package Functions | |
| static AlarmRefMatcher | toMatcher (AlarmDefinition def) |
| static String | memberFromAlarmID (String alarmId) |
| static String | encodeToXML (Alarm alarm) |
| static String | encodeToXML (StringBuffer result, Alarm alarm) |
Package Attributes | |
| Logger | logger |
| ConfigurationAccessor | conf |
| String | surveillanceAlarmId |
| ResponsiblePersonDAO | responsiblePersonDAO |
Static Package Attributes | |
| static final HardcodedBuilding | theBuilding = HardcodedBuilding.instance |
| static final HardcodedLocation | theLocation = HardcodedLocation.instance |
Private Member Functions | |
| void | generateLaserCoreAlarms () |
| void | generateAlarmsMap (Vector< FaultFamily > families) |
| void | loadReductionRules () |
| void | saveAllIDs () |
| void | addAlarmToCache (Alarm alarm) |
Private Attributes | |
| ConcurrentHashMap< String, Alarm > | alarmDefs = new ConcurrentHashMap<String,Alarm>() |
| ConcurrentHashMap< String, Source > | srcDefs = new ConcurrentHashMap<String, Source>() |
Static Private Attributes | |
| static final String | ALARM_DEFINITION_PATH = "/Alarms/AlarmDefinitions" |
| static final String | REDUCTION_DEFINITION_PATH = "/Alarms/Administrative/ReductionDefinitions" |
| static final String | XML_DOCUMENT_TYPE = "AlarmDefinitions" |
| static final String | DEFAULT_FM = "*" |
Read alarms from the CDB.
CDB contains one file per each possible FF and one entry per each FC and FM. It is possible to specify a default member to be used when the administrator did not specify the member.
The alarms are stored in an HashMap having the triplet as key. The default member has a triplet with a "*" replacing its name.
The sources are defined together with an alarm definition so they are read here and requested by the ACSSourceDAOImpl at startup (instead of being read again from CDB).
The initialization of the alarms is not completely done by loadAlarms because not all the info are available at this time. In fact the categories are assigned to alarms by ACSCategoryDAOImpl
| com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::ACSAlarmDAOImpl | ( | Logger | log | ) | [inline] |
Constructor
| log | The log (not null) | |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References generateLaserCoreAlarms(), and logger.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::addAlarmToCache | ( | Alarm | alarm | ) | [inline, private] |
Add an alarm in cache (alarmDefs)
The Alarm to add in the cache must be not null and with a valid ID otherwise an exception is thrown.
| alarm | The Alarm to add to the cache |
References alarmDefs, and cern::laser::business::data::Alarm::getAlarmId().
Referenced by generateAlarmsMap(), generateLaserCoreAlarms(), saveAlarm(), and updateAlarm().
| Collection com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::archiveSearch | ( | String | select_sql | ) | [inline] |
| select_sql |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::deleteAlarm | ( | Alarm | alarm | ) | [inline] |
| category |
| HibernateException |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References alarmDefs, cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::Alarm::getTriplet(), saveMemberAlarms(), and cern::laser::business::data::Triplet::toIdentifier().
Referenced by alma::acs::lasercore::test::TestAlarmDAO::testDeleteAlarm().
| static String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::encodeToXML | ( | StringBuffer | result, | |
| Alarm | alarm | |||
| ) | [inline, static, package] |
References cern::laser::business::data::Alarm::getAction(), cern::laser::business::data::Location::getBuilding(), cern::laser::business::data::Building::getBuildingNumber(), cern::laser::business::data::Alarm::getCause(), cern::laser::business::data::Alarm::getConsequence(), cern::laser::business::data::Triplet::getFaultCode(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::Location::getFloor(), cern::laser::business::data::Alarm::getHelpURL(), cern::laser::business::data::Alarm::getIdentifier(), cern::laser::business::data::Alarm::getInstant(), cern::laser::business::data::Alarm::getLocation(), cern::laser::business::data::Location::getMnemonic(), cern::laser::business::data::Source::getName(), cern::laser::business::data::Alarm::getPiquetEmail(), cern::laser::business::data::Alarm::getPiquetGSM(), cern::laser::business::data::Location::getPosition(), cern::laser::business::data::Alarm::getPriority(), cern::laser::business::data::Alarm::getProblemDescription(), cern::laser::business::data::ResponsiblePerson::getResponsibleId(), cern::laser::business::data::Alarm::getResponsiblePerson(), cern::laser::business::data::Location::getRoom(), cern::laser::business::data::Alarm::getSource(), cern::laser::business::data::Alarm::getSystemName(), and cern::laser::business::data::Alarm::getTriplet().
| static String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::encodeToXML | ( | Alarm | alarm | ) | [inline, static, package] |
| Alarm com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::findAlarm | ( | String | alarmId | ) | [inline] |
Returns the alarm corresponding to the given id.
| identifier | the id of the alarm to find |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References getAlarm().
Referenced by alma::acs::lasercore::test::TestAlarmDAO::testFindAlarm().
| String [] com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::findAlarmIdsByPriority | ( | Integer | priority | ) | [inline] |
| priority |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References alarmDefs, and cern::laser::business::data::AlarmImpl::getPriority().
| Building com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::findBuilding | ( | String | building | ) | [inline] |
| building |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References cern::laser::business::data::Building::getBuildingNumber(), and theBuilding.
| String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::findLaserSurveillanceAlarmId | ( | ) | [inline] |
Returns all alarms.
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References getAlarm(), and surveillanceAlarmId.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::generateAlarmsMap | ( | Vector< FaultFamily > | families | ) | [inline, private] |
Generate the alarms from the definition of the fault families. The alarms will be added into the HashMap with their triplet as key. The default item has FM="*".
The sources read from the families are also added to the HashMap of the sources
| families | The FF read from the CDB |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References addAlarmToCache(), DEFAULT_FM, cern::laser::business::data::AlarmImpl::getAlarmId(), cern::laser::business::data::Source::getName(), cern::laser::business::data::Source::getSourceId(), cern::laser::business::data::AlarmImpl::getTriplet(), logger, cern::laser::business::data::AlarmImpl::setAction(), cern::laser::business::data::AlarmImpl::setCategories(), cern::laser::business::data::AlarmImpl::setCause(), cern::laser::business::data::AlarmImpl::setConsequence(), cern::laser::business::data::AlarmImpl::setHelpURL(), cern::laser::business::data::AlarmImpl::setIdentifier(), cern::laser::business::data::AlarmImpl::setInstant(), cern::laser::business::data::AlarmImpl::setLocation(), cern::laser::business::data::AlarmImpl::setMultiplicityChildrenIds(), cern::laser::business::data::AlarmImpl::setMultiplicityParentIds(), cern::laser::business::data::AlarmImpl::setNodeChildrenIds(), cern::laser::business::data::AlarmImpl::setNodeParentIds(), cern::laser::business::data::AlarmImpl::setPiquetEmail(), cern::laser::business::data::AlarmImpl::setPiquetGSM(), cern::laser::business::data::AlarmImpl::setPriority(), cern::laser::business::data::AlarmImpl::setProblemDescription(), cern::laser::business::data::AlarmImpl::setResponsiblePerson(), cern::laser::business::data::AlarmImpl::setSource(), cern::laser::business::data::AlarmImpl::setTriplet(), srcDefs, and cern::laser::business::data::Triplet::toIdentifier().
Referenced by loadAlarms().
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::generateLaserCoreAlarms | ( | ) | [inline, private] |
Add the alarms generated by the alarm component
References addAlarmToCache(), and logger.
Referenced by ACSAlarmDAOImpl().
| Alarm com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::getAlarm | ( | String | alarmId | ) | [inline] |
Get an alarm from the cache.
Get an alarm from the cache. If the alarm with the given triplet is not in the cache then it looks for a default alarm before returning null.
If a default alarm is found, then a new alarm is created by cloning the default alarm. The triplet of this new alarm is set to be equal to the passed alarm ID.
| alarmId | The ID of the alarm |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References alarmDefs, cern::laser::business::data::AlarmImpl::clone(), conf, DEFAULT_FM, cern::laser::business::data::Triplet::getFaultCode(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Triplet::getFaultMember(), logger, cern::laser::business::data::AlarmImpl::setAlarmId(), and cern::laser::business::data::AlarmImpl::setTriplet().
Referenced by findAlarm(), findLaserSurveillanceAlarmId(), alma::acs::lasercore::test::TestAlarmDAO::testDeleteAlarm(), alma::acs::lasercore::test::TestAlarmDAO::testGetAlarmID(), and alma::acs::lasercore::test::TestAlarmDAO::testResponsiblePerson().
| String [] com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::getAllAlarmIDs | ( | ) | [inline] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References alarmDefs.
Referenced by alma::acs::lasercore::test::TestAlarmDAO::testAlarmIDs(), and alma::acs::lasercore::test::TestAlarmDAO::testDeleteAlarm().
| ReductionDefinitions com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::getReductionDefinitions | ( | ) | [inline] |
References conf, com::cosylab::acs::laser::dao::ConfigurationAccessor::getConfiguration(), logger, REDUCTION_DEFINITION_PATH, and com::cosylab::acs::laser::dao::xml::ReductionDefinitions::unmarshal().
Referenced by com::cosylab::cdb::jdal::hibernate::plugin::HibernateWDALAlarmPluginImpl::importAlarms(), and loadReductionRules().
| ConcurrentHashMap<String,Source> com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::getSources | ( | ) | [inline] |
Getter method
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References srcDefs.
Referenced by com::cosylab::acs::laser::LaserComponent::initialize(), and alma::acs::lasercore::test::TestAlarmDAO::testGetSources().
| List<FaultFamily> com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::loadAlarms | ( | ) | throws Exception [inline] |
Load alarms from CDB.
Read the alarms by the alarm definitions file of the CDB. The initialization of the alarms is not complete at this stage. In fact the categories are assigned to alarms when reading the categories from the CDB by ACSCategoryDAOImpl
| Exception | In case of error while parsing XML definition files |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References ALARM_DEFINITION_PATH, conf, generateAlarmsMap(), com::cosylab::acs::laser::dao::ConfigurationAccessor::getConfiguration(), loadReductionRules(), and XML_DOCUMENT_TYPE.
Referenced by com::cosylab::cdb::jdal::hibernate::plugin::HibernateWDALAlarmPluginImpl::importAlarms(), com::cosylab::acs::laser::LaserComponent::initialize(), and alma::acs::lasercore::test::TestAlarmDAO::setUp().
| Building com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::loadBuilding | ( | String | buildingID | ) | [inline, package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References cern::laser::business::data::Building::getBuildingNumber(), and theBuilding.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::loadReductionRules | ( | ) | [inline, private] |
Load the reduction rules from the CDB.
Read the reduction rules from the CDB and set up the alarms accordingly
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References cern::laser::business::data::AlarmImpl::addMultiplicityChild(), cern::laser::business::data::AlarmImpl::addNodeChild(), alarmDefs, com::cosylab::acs::laser::dao::LinkSpec::child, com::cosylab::acs::laser::dao::AlarmRefMatcher::family, com::cosylab::acs::laser::dao::xml::Threshold::getAlarmDefinition(), com::cosylab::acs::laser::dao::xml::Child::getAlarmDefinition(), com::cosylab::acs::laser::dao::xml::Parent::getAlarmDefinition(), cern::laser::business::data::AlarmImpl::getAlarmId(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultFamily(), com::cosylab::acs::laser::dao::xml::ReductionDefinitions::getLinksToCreate(), getReductionDefinitions(), com::cosylab::acs::laser::dao::xml::Thresholds::getThreshold(), com::cosylab::acs::laser::dao::xml::Thresholds::getThresholdCount(), com::cosylab::acs::laser::dao::xml::ReductionDefinitions::getThresholds(), com::cosylab::acs::laser::dao::AlarmRefMatcher::isMatch(), com::cosylab::acs::laser::dao::LinkSpec::isMultiplicity, logger, com::cosylab::acs::laser::dao::AlarmRefMatcher::member, com::cosylab::acs::laser::dao::AlarmRefMatcher::minCode, com::cosylab::acs::laser::dao::LinkSpec::parent, and toMatcher().
Referenced by loadAlarms().
| static String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::memberFromAlarmID | ( | String | alarmId | ) | [inline, static, package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::saveAlarm | ( | Alarm | alarm | ) | [inline] |
| parent |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References addAlarmToCache(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::Alarm::getTriplet(), and saveMemberAlarms().
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::saveAllIDs | ( | ) | [inline, private] |
References alarmDefs, conf, cern::laser::business::data::Triplet::getFaultCode(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::Alarm::getTriplet(), com::cosylab::acs::laser::dao::ConfigurationAccessor::isWriteable(), and com::cosylab::acs::laser::dao::ConfigurationAccessor::setConfiguration().
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::saveMemberAlarms | ( | String | member | ) | [inline] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by deleteAlarm(), saveAlarm(), and updateAlarm().
| Collection com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::search | ( | String | select_sql | ) | [inline] |
| select_sql |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::setConfAccessor | ( | ConfigurationAccessor | conf | ) | [inline] |
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::setResponsiblePersonDAO | ( | ResponsiblePersonDAO | responsiblePersonDAO | ) | [inline] |
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::setSurveillanceAlarmId | ( | String | surveillanceAlarmId | ) | [inline] |
| static AlarmRefMatcher com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::toMatcher | ( | AlarmDefinition | def | ) | [inline, static, package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultCode(), com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultFamily(), and com::cosylab::acs::laser::dao::xml::AlarmDefinition::getFaultMember().
Referenced by loadReductionRules().
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::updateAlarm | ( | Alarm | alarm | ) | [inline] |
| parent |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
References addAlarmToCache(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::business::data::Alarm::getTriplet(), and saveMemberAlarms().
| void com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::updateStatus | ( | Status | status | ) | [inline] |
Implements cern::laser::business::dao::AlarmDAO.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
final String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::ALARM_DEFINITION_PATH = "/Alarms/AlarmDefinitions" [static, private] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by loadAlarms().
ConcurrentHashMap<String,Alarm> com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::alarmDefs = new ConcurrentHashMap<String,Alarm>() [private] |
The alarms read out the CDB The CDB contains fault families. The alarms are generated from the fault families.
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by addAlarmToCache(), deleteAlarm(), findAlarmIdsByPriority(), getAlarm(), getAllAlarmIDs(), loadReductionRules(), and saveAllIDs().
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by getAlarm(), getReductionDefinitions(), loadAlarms(), and saveAllIDs().
final String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::DEFAULT_FM = "*" [static, private] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by generateAlarmsMap(), and getAlarm().
Logger com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::logger [package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by ACSAlarmDAOImpl(), generateAlarmsMap(), generateLaserCoreAlarms(), getAlarm(), getReductionDefinitions(), and loadReductionRules().
final String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::REDUCTION_DEFINITION_PATH = "/Alarms/Administrative/ReductionDefinitions" [static, private] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by getReductionDefinitions().
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
ConcurrentHashMap<String, Source> com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::srcDefs = new ConcurrentHashMap<String, Source>() [private] |
Source are defined together with alarms This HashMap contains all the sources read from CDB
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by generateAlarmsMap(), and getSources().
String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::surveillanceAlarmId [package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by findLaserSurveillanceAlarmId().
final HardcodedBuilding com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::theBuilding = HardcodedBuilding.instance [static, package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by findBuilding(), and loadBuilding().
final HardcodedLocation com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::theLocation = HardcodedLocation.instance [static, package] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
final String com::cosylab::acs::laser::dao::ACSAlarmDAOImpl::XML_DOCUMENT_TYPE = "AlarmDefinitions" [static, private] |
Reimplemented in cl::utfsm::acs::acg::dao::ACSAlarmDAOImpl.
Referenced by loadAlarms().
1.6.2