Public Member Functions | Package Functions | Static Package Functions | Static Package Attributes

com.cosylab.acs.laser.dao.ACSAlarmDAOImpl Class Reference

Inheritance diagram for com.cosylab.acs.laser.dao.ACSAlarmDAOImpl:
cern.laser.business.dao.AlarmDAO cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl

List of all members.

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, SourcegetSources ()
void setAlarmCache (ACSAlarmCacheImpl alarmCache)
void setAlarmProcessor (AlarmMessageProcessorImpl processor)

Package Functions

Building loadBuilding (String buildingID)

Static Package Functions

static String memberFromAlarmID (String alarmId)
static String encodeToXML (Alarm alarm)
static String encodeToXML (StringBuffer result, Alarm alarm)

Static Package Attributes

static final HardcodedBuilding theBuilding = HardcodedBuilding.instance
static final HardcodedLocation theLocation = HardcodedLocation.instance

Detailed Description

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

For the assigning alarms to reduction rules, the class take advantage of the fact that a parent in a reduction rule never contains regular expressions nor wildcards.

See also:
ACSSourceDAOImpl
ACSCategoryDAOImpl
Author:
acaproni

Constructor & Destructor Documentation

com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.ACSAlarmDAOImpl ( Logger  log  ) 

Constructor

Parameters:
log The log (not null)
 

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.


Member Function Documentation

Collection com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.archiveSearch ( String  select_sql  ) 
Parameters:
select_sql 
Returns:

Implements cern.laser.business.dao.AlarmDAO.

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.deleteAlarm ( Alarm  alarm  ) 
static String com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.encodeToXML ( Alarm  alarm  )  [static, package]
Alarm com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findAlarm ( String  alarmId  ) 

Returns the alarm corresponding to the given id.

Parameters:
identifier the id of the alarm to find
Returns:
the alarm

Implements cern.laser.business.dao.AlarmDAO.

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

References com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getAlarm().

String [] com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findAlarmIdsByPriority ( Integer  priority  ) 
Building com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findBuilding ( String  building  ) 
String com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findLaserSurveillanceAlarmId (  ) 

Returns all alarms.

Returns:
all alarms

Implements cern.laser.business.dao.AlarmDAO.

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

References com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getAlarm().

Alarm com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getAlarm ( String  alarmId  ) 

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.

Parameters:
alarmId The ID of the alarm
Returns:
An alarm with the given ID if it exists in the CDB If an alarm with the give ID does not exist but a matching default alarm is defined then it return a clone of the default alarm null If the alarm is not defined in the CDB and a default alarm does not exist

Implements cern.laser.business.dao.AlarmDAO.

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

References cern.laser.business.data.AlarmImpl.clone(), cern.laser.business.data.Triplet.getFaultCode(), cern.laser.business.data.Triplet.getFaultFamily(), cern.laser.business.data.Triplet.getFaultMember(), cern.laser.business.data.AlarmImpl.setAlarmId(), and cern.laser.business.data.AlarmImpl.setTriplet().

Referenced by com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findAlarm(), and com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.findLaserSurveillanceAlarmId().

String [] com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getAllAlarmIDs (  ) 
ReductionDefinitions com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getReductionDefinitions (  ) 
ConcurrentHashMap<String,Source> com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.getSources (  ) 

Getter method

Returns:
The sources

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

Referenced by com.cosylab.acs.laser.LaserComponent.initialize().

List<FaultFamily> com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.loadAlarms (  )  throws Exception

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

Exceptions:
Exception In case of error while parsing XML definition files
See also:
ACSCategoryDAOImpl

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

References com.cosylab.acs.laser.dao.ConfigurationAccessor.getConfiguration(), org.exolab.castor.xml.Unmarshaller.setValidation(), org.exolab.castor.xml.Unmarshaller.setWhitespacePreserve(), and org.exolab.castor.xml.Unmarshaller.unmarshal().

Referenced by com.cosylab.cdb.jdal.hibernate.plugin.HibernateWDALAlarmPluginImpl.importAlarms(), and com.cosylab.acs.laser.LaserComponent.initialize().

Building com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.loadBuilding ( String  buildingID  )  [package]
static String com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.memberFromAlarmID ( String  alarmId  )  [static, package]
Collection com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.search ( String  select_sql  ) 
Parameters:
select_sql 
Returns:

Implements cern.laser.business.dao.AlarmDAO.

Reimplemented in cl.utfsm.acs.acg.dao.ACSAlarmDAOImpl.

void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.setAlarmCache ( ACSAlarmCacheImpl  alarmCache  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.setAlarmProcessor ( AlarmMessageProcessorImpl  processor  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.setConfAccessor ( ConfigurationAccessor  conf  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.setResponsiblePersonDAO ( ResponsiblePersonDAO  responsiblePersonDAO  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.setSurveillanceAlarmId ( String  surveillanceAlarmId  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.updateAlarm ( Alarm  alarm  ) 
void com.cosylab.acs.laser.dao.ACSAlarmDAOImpl.updateStatus ( Status  status  ) 

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties