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, Alarm > | alarms = new HashMap<StringAlarm>() |
AlarmDAO | dao |
AlarmCacheListener | listener |
HashMap< Integer, CategoryActiveList > | activeLists = new HashMap<IntegerCategoryActiveList>() |
|
The constructor
|
|
|
|
Print a copy of the alarms in the cache in the standard output. This method is added for debugging
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
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
|
|
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) |
|
|
|
|
|
|