

Classes | |
| class | AlarmContainerException |
Public Member Functions | |
| AlarmsContainer (int max) | |
| synchronized int | size () |
| synchronized void | add (AlarmTableEntry entry) throws AlarmContainerException |
| synchronized boolean | contains (String alarmID) |
| synchronized AlarmTableEntry | get (int pos) |
| synchronized AlarmTableEntry | get (String id) |
| synchronized void | clear () |
| synchronized AlarmTableEntry | removeOldest () throws AlarmContainerException |
| synchronized void | remove (AlarmTableEntry entry) throws AlarmContainerException |
| synchronized int | removeInactiveAlarms (AlarmGUIType type) throws AlarmContainerException |
| synchronized void | replace (AlarmTableEntry newAlarm) throws AlarmContainerException |
| synchronized int | hasNotAckAlarms () |
Private Attributes | |
| HashMap< String, AlarmTableEntry > | entries = new HashMap<String, AlarmTableEntry>() |
| final Vector< String > | index = new Vector<String>() |
| final int | maxAlarms |
A container for the alarms as needed by the AlarmTableModel
It is composed of 2 collections:
HashMap stores each entry accessed by its alarmID (the key) Vector of Strings used to remember the position of each alarm when the max number of alarms has been reached It also allows to access the alarms by row Basically the array stores the alarmID of each row in the table. The content of the row i.e. the Alarm, is then obtained by the HashMap passing the alarmID.
In this way it is possible to get the entry of a row by getting the key from the Vector. And it is possible to get an alarm from the HashMap.
| alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::AlarmsContainer | ( | int | max | ) | [inline] |
Build an AlarmContainer
| max | The max number of alarms to store in the container | |
| panel | The AlarmPanel |
References maxAlarms.
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::add | ( | AlarmTableEntry | entry | ) | throws AlarmContainerException [inline] |
Add an entry (i.e a alarm) in the collection.
If there is no room available in the container, an exception is thrown. Checking if there is enough room must be done by the caller.
| alarm | The not null entry to add |
| {@link | AlarmContainerException} If the entry is already in the container |
Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::clear | ( | ) | [inline] |
Remove all the elements in the container
Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.
| synchronized boolean alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::contains | ( | String | alarmID | ) | [inline] |
Check if an alarm with the given ID is in the container
| alarmID | The ID of the alarm |
References entries.
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::run().
| synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::get | ( | String | id | ) | [inline] |
Return the entry with the given ID
| id | The not null ID of the alarm in the container |
nullif the container does not contain an entry for the given id References entries.
| synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::get | ( | int | pos | ) | [inline] |
Return the entry in the given position
| pos | The position of the alarm in the container | |
| reduced | true if the alarms in the table are reduced |
References index.
| synchronized int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::hasNotAckAlarms | ( | ) | [inline] |
Check if the container has alarm not yet acknowledged.
If there are alarms to be acknowledged by the user, this method returns the highest of their priorities. Note that for alarm system the highest priority is 0 and lowest is 3.
References entries, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getPriority(), and alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::isNew.
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::remove | ( | AlarmTableEntry | entry | ) | throws AlarmContainerException [inline] |
Remove the entry for the passed alarm
| entry | The alarm whose entry must be removed |
| AlarmContainerException | If the alarm is not in the container |
Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.
| synchronized int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::removeInactiveAlarms | ( | AlarmGUIType | type | ) | throws AlarmContainerException [inline] |
Remove all the inactive alarms of a given type.
If the type is INACTIVE all inactive alarms are deleted regardless of their priority
| type | The type of the inactive alarms |
References entries, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getPriority(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), and cern::laser::client::data::Status::isActive().
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::removeInactiveAlarms(), and alma::acs::alarm::test::panel::AlarmContainerTest::testRemoveInactivAls().
| synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::removeOldest | ( | ) | throws AlarmContainerException [inline] |
Remove the oldest entry in the container
| AlarmContainerException | If the container is empty |
Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::replace | ( | AlarmTableEntry | newAlarm | ) | throws AlarmContainerException [inline] |
Replace the alarm in a row with passed one.
The entry to replace the alarm is given by the alarm ID of the parameter.
| newAlarm | The not null new alarm |
| AlarmContainerException | if the entry is not in the container |
Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.
References entries, index, and alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::updateAlarm().
| synchronized int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::size | ( | ) | [inline] |
Return the number of alarms in the container.
References index.
HashMap<String, AlarmTableEntry> alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::entries = new HashMap<String, AlarmTableEntry>() [private] |
The entries in the table
Referenced by add(), clear(), contains(), get(), hasNotAckAlarms(), remove(), removeInactiveAlarms(), removeOldest(), and replace().
final Vector<String> alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::index = new Vector<String>() [private] |
final int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::maxAlarms [private] |
The maximum number of alarms to store in the container
Referenced by add(), and AlarmsContainer().
1.6.2