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::ACSAlarmCacheImpl Class Reference

List of all members.

Public Member Functions

 ACSAlarmCacheImpl (AlarmDAO alarmDAO, AlarmCacheListener alarmCacheListener)
void initializeAlarmCache (Map alarms, Map activeLists)
Alarm getCopy (String identifier) throws AlarmCacheException
Alarm getReference (String identifier) throws AlarmCacheException
void replace (Alarm alarm) throws AlarmCacheException
void put (Alarm alarm) throws AlarmCacheException
void invalidate (String identifier) throws AlarmCacheException
CategoryActiveList getActiveListReference (Integer identifier) throws AlarmCacheException
void close ()
void removeActiveList (Integer identifier) throws AlarmCacheException

Private Member Functions

void sendMsgToListener (Alarm actual, Alarm old)
void dumpAlarmsCache (boolean verbose)
CategoryActiveList getCategoryList (Integer categoryId)
void updateCategoryActiveLists (Alarm alarm)

Private Attributes

HashMap< String, Alarmalarms = new HashMap<StringAlarm>()
AlarmDAO dao
AlarmCacheListener listener
HashMap< Integer, CategoryActiveListactiveLists = new HashMap<IntegerCategoryActiveList>()

Constructor & Destructor Documentation

com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::ACSAlarmCacheImpl AlarmDAO  alarmDAO,
AlarmCacheListener  alarmCacheListener
[inline]
 

The constructor

Parameters:
alarmDAO The object to access the database
alarmCacheListener The listener


Member Function Documentation

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::close  )  [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::dumpAlarmsCache boolean  verbose  )  [inline, private]
 

Print a copy of the alarms in the cache in the standard output. This method is added for debugging

Parameters:
verbose If true the details of each alarm found in the cache is also displayed

CategoryActiveList com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::getActiveListReference Integer  identifier  )  throws AlarmCacheException [inline]
 

CategoryActiveList com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::getCategoryList Integer  categoryId  )  [inline, private]
 

Return the CategoryActiveList for the specified categoryId. If the CategoryActiveList does not exist than a new one is created and inserted in the activeList and then returned to the caller

Parameters:
categoryId The categoryId identifying the CategoryActiveList
Returns:
The CategoryActiveList for the specified categoryId

Alarm com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::getCopy String  identifier  )  throws AlarmCacheException [inline]
 

Alarm com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::getReference String  identifier  )  throws AlarmCacheException [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::initializeAlarmCache Map  alarms,
Map  activeLists
[inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::invalidate String  identifier  )  throws AlarmCacheException [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::put Alarm  alarm  )  throws AlarmCacheException [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::removeActiveList Integer  identifier  )  throws AlarmCacheException [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::replace Alarm  alarm  )  throws AlarmCacheException [inline]
 

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::sendMsgToListener Alarm  actual,
Alarm  old
[inline, private]
 

Send the message to the listener

NOTE: If the previous alarm does not exist (for example if the alarm is new) then we send as old alarm the actual alarm If we send a null then cern.laser.business.pojo.AlarmPublisher:publish returns an exception while executing Status previous_alarm_status=previous.getStatus();

This policy seems reasonable but could have an impact somewhere

Parameters:
actual The actual alarm
old The previous alarm

void com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::updateCategoryActiveLists Alarm  alarm  )  [inline, private]
 

Update the CategoryActiveList for the alarm: all the CategoryActiveLists of the categories of the alarm will be updated. The alarmId is inserted or removed in the CategoryActiveList depending of the status of the alarm

Parameters:
alarm The alarm whose id must be inserted or removed for the CategoryActiveLists of its categories


Member Data Documentation

HashMap<Integer,CategoryActiveList> com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::activeLists = new HashMap<IntegerCategoryActiveList>() [private]
 

The HashMap with the active alarms per each category The map contains a CategoryActiveList per each category (the key is the Integer identifying the category)

Policy: the CategoryActiveList for a category is created and inserted in the map when a new alarm arrives (remember that an alarm has a Set of Categories) So it basically happens in the put and replace methods (based on the status of the alarm itself)

HashMap<String,Alarm> com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::alarms = new HashMap<StringAlarm>() [private]
 

AlarmDAO com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::dao [private]
 

AlarmCacheListener com::cosylab::acs::laser::dao::ACSAlarmCacheImpl::listener [private]
 


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