

Classes | |
| class | Priority |
Public Types | |
| enum | AlarmTableColumn { HIDES_CHILDREN = ("","Parent node flag",true), REDUCED = ("","Reduced flag",true), ICON = ("","Not acknowledged flag",true), TIME = ("Time",null,true), COMPONENT = ("Component",null,true), FAMILY = ("Family",null,true), CODE = ("Code",null,false), CAUSE = ("Cause",null,true), DESCRIPTION = ("Description",null,true), ACTION = ("Action",null,true), PRIORITY = ("Priority",null,true), CONSEQUENCE = ("Consequence",null,false), URL = ("URL",null,false), CONTACT = ("Contact",null,false), EMAIL = ("email",null,false), GSM = ("GSM",null,false), TRIPLET = ("Triplet",null,false) } |
| enum | PriorityLabel { VERY_HIGH = ("VERY HIGH",Color.red), HIGH = ("HIGH", new Color(255,165,31)), MEDIUM = ("MEDIUM",Color.yellow), LOW = ("LOW",new Color(188,255,188)) } |
Public Member Functions | |
| AlarmTableModel (JComponent owner, boolean reduce) | |
| synchronized void | onAlarm (Alarm alarm) |
| synchronized void | acknowledge (AlarmTableEntry alarm) |
| void | onException (LaserSelectionException e) |
| int | getRowCount () |
| int | getColumnCount () |
| AlarmTableEntry | getAlarmAt (int rowIndex) |
| Object | getCellContent (int rowIndex, int columnIndex) |
| void | setAutoAckLevel (ComboBoxValues lvl) |
| Object | getValueAt (int rowIndex, int columnIndex) |
| String | getColumnName (int col) |
| Class<?> | getColumnClass (int columnIndex) |
| AlarmTableEntry | getRowAlarm (int row) |
| AlarmTableEntry | getRowEntry (int row) |
| boolean | isRowAlarmNew (int row) |
| AlarmCounter | getAlarmCounter (AlarmGUIType type) |
| void | alarmSelected (int row) |
| synchronized void | removeInactiveAlarms (AlarmGUIType type) |
| void | setConnectionListener (ConnectionListener listener) |
| void | applyReductions (boolean reduce) |
| void | setCategoryClient (CategoryClient client) |
| CategoryClient | getCategoryClient () |
| synchronized void | clear () |
| void | pause (boolean pause) |
| void | run () |
| void | close () |
| int | hasNotAckAlarms () |
Static Public Attributes | |
| static final int | MAX_ALARMS = 20000 |
| static final int | QUEUE_SIZE = 15000 |
Private Member Functions | |
| void | addAlarm (AlarmTableEntry alarm) |
| void | autoAcknowledge (AlarmTableEntry alarm) |
| void | replaceAlarm (AlarmTableEntry newAlarm) |
Private Attributes | |
| SimpleDateFormat | dateFormat = new IsoDateFormat() |
| HashMap< AlarmGUIType, AlarmCounter > | counters = new HashMap<AlarmGUIType, AlarmCounter>() |
| ConnectionListener | connectionListener = null |
| LinkedBlockingQueue < AlarmTableEntry > | queue = new LinkedBlockingQueue<AlarmTableEntry>(QUEUE_SIZE) |
| Semaphore | paused = new Semaphore(1) |
| volatile boolean | terminateThread = false |
| final Thread | thread |
| boolean | waitIfQueueFull = false |
| JComponent | owner |
| AlarmsReductionContainer | items = null |
| boolean | applyReductionRules |
| ComboBoxValues | autoAckLvl = ComboBoxValues.NONE |
The table model for the table alarms
| alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::AlarmTableModel | ( | JComponent | owner, | |
| boolean | reduce | |||
| ) | [inline] |
Constructor
| owner | The component that owns the table | |
| reduce | true if the reduction rules must be applied | |
| panel | The AlarmPanel |
References applyReductionRules, counters, items, MAX_ALARMS, and thread.
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::acknowledge | ( | AlarmTableEntry | alarm | ) | [inline] |
Acknowledge an alarm that in this version ends up to removing from the table
| alarm | The inactive alarm to acknowledge |
References counters, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), cern::laser::client::data::Status::isActive(), items, owner, and alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::remove().
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::actionPerformed(), and autoAcknowledge().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::addAlarm | ( | AlarmTableEntry | alarm | ) | [inline, private] |
| alarm | The alarm to add |
References alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::add(), counters, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmType(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), cern::laser::client::data::Status::isActive(), items, and owner.
Referenced by run().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::alarmSelected | ( | int | row | ) | [inline] |
The user pressed one mouse button over a row
References alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::alarmSeen(), applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::get(), and items.
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::applyReductions | ( | boolean | reduce | ) | [inline] |
Enable/disable the applying of reduction rules in the table.
by applying reduction rules, the table will not show reduced alarms.
| reduce | if true apply the reduction rules hiding reduced alarms; if reduce is false all the alarms are shown by the table independently of the reduction rules |
References applyReductionRules.
Referenced by alma::acsplugins::alarmsystem::gui::toolbar::Toolbar::actionPerformed().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::autoAcknowledge | ( | AlarmTableEntry | alarm | ) | [inline, private] |
Automatically acknowledge an alarm depending on its priority and the selected priority level
| alarm | The alarm to acknowledge if its priority if greater the the selected priority level |
References acknowledge(), autoAckLvl, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getPriority(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), and cern::laser::client::data::Status::isActive().
Referenced by replaceAlarm().
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::clear | ( | ) | [inline] |
Clear the content of the model
References alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::clear(), and items.
Referenced by alma::acsplugins::alarmsystem::gui::reduced::ReducedChainDlg::refreshContent().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::close | ( | ) | [inline] |
Terminate the thread and free the resources.
References terminateThread, and thread.
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::close().
| AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getAlarmAt | ( | int | rowIndex | ) | [inline] |
Return the alarm shown at the rowIndex row of the table.
| rowIndex | The index of the alarm in the model |
References applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::get(), and items.
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::changeSelection(), and getCellContent().
| AlarmCounter alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getAlarmCounter | ( | AlarmGUIType | type | ) | [inline] |
Return the counter for the given alarm type
| type | The type of the alarm |
References counters.
Referenced by alma::acsplugins::alarmsystem::gui::statusline::StatusLine::initialize().
| CategoryClient alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getCategoryClient | ( | ) | [inline] |
Get the CategoryClient from the AlarmsContainer
| client | The CategoryCLient; it can be null. |
References alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::getCategoryClient(), and items.
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::showReductionChain().
| Object alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getCellContent | ( | int | rowIndex, | |
| int | columnIndex | |||
| ) | [inline] |
Return the text to display in a cell as it is read by the alarm without any formatting (the table add some formatting for example the color)
| rowIndex | The row of the cell | |
| columnIndex | The col of the cell |
References dateFormat, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAction(), getAlarmAt(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmType(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getCause(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getConsequence(), cern::laser::client::data::ResponsiblePerson::getEMail(), cern::laser::client::data::Triplet::getFaultCode(), cern::laser::client::data::Triplet::getFaultFamily(), cern::laser::client::data::Triplet::getFaultMember(), cern::laser::client::data::ResponsiblePerson::getFirstName(), cern::laser::client::data::ResponsiblePerson::getGsmNumber(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getHelpURL(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getPriority(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getProblemDescription(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getResponsiblePerson(), cern::laser::client::data::Status::getSourceTimestamp(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), and alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getTriplet().
Referenced by getValueAt().
| Class<?> alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getColumnClass | ( | int | columnIndex | ) | [inline] |
The model needs to know that class of the PRIORITY column in order to sort by priority (otherwise the table sorts for the displayed string).
| int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getColumnCount | ( | ) | [inline] |
| String alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getColumnName | ( | int | col | ) | [inline] |
| AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getRowAlarm | ( | int | row | ) | [inline] |
Return the alarm whose content fills the given row
| row | The number of the row showing the alarm |
References getRowEntry().
| int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getRowCount | ( | ) | [inline] |
| AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getRowEntry | ( | int | row | ) | [inline] |
Return the entry the given row
| row | The number of the row showing the alarm |
References applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::get(), items, and alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::size().
Referenced by getRowAlarm(), and alma::acsplugins::alarmsystem::gui::table::AlarmTable::prepareRenderer().
| Object alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getValueAt | ( | int | rowIndex, | |
| int | columnIndex | |||
| ) | [inline] |
References getCellContent().
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::AlarmTableFilter::include(), and alma::acsplugins::alarmsystem::gui::table::SearchEngine::search().
| int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::hasNotAckAlarms | ( | ) | [inline] |
Check if the container has alarm not yet acknowledged.
References applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::hasNotAckAlarms(), and items.
Referenced by alma::acsplugins::alarmsystem::gui::sound::AlarmSound::run().
| boolean alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::isRowAlarmNew | ( | int | row | ) | [inline] |
| row | Return true if the alarm is new |
References applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::get(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::isNew, items, and alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::size().
Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::prepareRenderer().
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::onAlarm | ( | Alarm | alarm | ) | [inline] |
Add an alarm in the queue. The thread will get the alarm from the queue and update the model.
| alarm | The alarm to add to the table. |
Implements cern::laser::client::services::selection::AlarmSelectionListener.
References queue, terminateThread, and waitIfQueueFull.
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::addSpecialAlarm(), and alma::acsplugins::alarmsystem::gui::reduced::ReducedChainDlg::getAlarmChain().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::onException | ( | LaserSelectionException | e | ) | [inline] |
Get exception from the client. A message is notified to the listener or written in the standard output if the listener is null.
Implements cern::laser::client::services::selection::AlarmSelectionListener.
References alma::acsplugins::alarmsystem::gui::ConnectionListener::connected(), connectionListener, alma::acsplugins::alarmsystem::gui::ConnectionListener::disconnected(), cern::laser::client::services::selection::LaserSelectionException::getCode(), and alma::acsplugins::alarmsystem::gui::ConnectionListener::heartbeatLost().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::pause | ( | boolean | pause | ) | [inline] |
Pause/un-pause the update of the table
If it is paused then the alarms received in onAlarm are not added in the model but queued until the application is unpaused.
| pause | if true no new alarms are added in the table |
References paused, and terminateThread.
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::pause(), and alma::acsplugins::alarmsystem::gui::CernSysPanel::resume().
| synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::removeInactiveAlarms | ( | AlarmGUIType | type | ) | [inline] |
Remove all the inactive alarms of a given type delegating to the AlarmsContainer. If the type is INACTIVE all inactive alarms are deleted regardless of their priority
| type | The type of the inactive alarms |
References counters, items, and alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::removeInactiveAlarms().
Referenced by alma::acsplugins::alarmsystem::gui::statusline::CounterWidget::actionPerformed().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::replaceAlarm | ( | AlarmTableEntry | newAlarm | ) | [inline, private] |
Replace an alarm already in the table
| newAlarm | The alarm to put in the table |
References autoAcknowledge(), counters, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::get(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmId(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmType(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getStatus(), cern::laser::client::data::Status::isActive(), items, owner, and alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::replace().
Referenced by run().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::run | ( | ) | [inline] |
The thread getting alarms from the queue and injecting in the model.
If an alarm with the same triplet is already in the table it is replaced.
References addAlarm(), applyReductionRules, alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::contains(), counters, alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmId(), alma::acsplugins::alarmsystem::gui::table::AlarmTableEntry::getAlarmType(), items, MAX_ALARMS, owner, paused, queue, alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::removeOldest(), replaceAlarm(), alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::size(), and terminateThread.
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::setAutoAckLevel | ( | ComboBoxValues | lvl | ) | [inline] |
Set the auto acknowledge level i.e. All the inactive alarms having a level equal or lower the the passed level automatically disappear from the table (i.e. with no user intervention)
| lvl | The new auto acknowledge level |
References autoAckLvl.
Referenced by alma::acsplugins::alarmsystem::gui::toolbar::Toolbar::actionPerformed().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::setCategoryClient | ( | CategoryClient | client | ) | [inline] |
Set the CategoryClient in the AlarmsContainer
| client | The CategoryCLient; it can be null. |
References items, and alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer::setCategoryClient().
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::connect(), and alma::acsplugins::alarmsystem::gui::CernSysPanel::disconnect().
| void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::setConnectionListener | ( | ConnectionListener | listener | ) | [inline] |
Set the connection listener
| listener | The listener |
References connectionListener.
Referenced by alma::acsplugins::alarmsystem::gui::CernSysPanel::initialize().
If true applies the reduction rules hiding reduced alarms
Referenced by alarmSelected(), AlarmTableModel(), applyReductions(), getAlarmAt(), getRowCount(), getRowEntry(), hasNotAckAlarms(), isRowAlarmNew(), and run().
ComboBoxValues alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::autoAckLvl = ComboBoxValues.NONE [private] |
The auto acknowledge level
Referenced by autoAcknowledge(), and setAutoAckLevel().
ConnectionListener alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::connectionListener = null [private] |
The listener about the status of the connection
onException Referenced by onException(), and setConnectionListener().
HashMap<AlarmGUIType, AlarmCounter> alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::counters = new HashMap<AlarmGUIType, AlarmCounter>() [private] |
The counter for the alarms
Referenced by acknowledge(), addAlarm(), AlarmTableModel(), getAlarmCounter(), removeInactiveAlarms(), replaceAlarm(), and run().
SimpleDateFormat alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::dateFormat = new IsoDateFormat() [private] |
The date format
Referenced by getCellContent().
AlarmsReductionContainer alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::items = null [private] |
The alarms in the table
Referenced by acknowledge(), addAlarm(), alarmSelected(), AlarmTableModel(), clear(), getAlarmAt(), getCategoryClient(), getRowCount(), getRowEntry(), hasNotAckAlarms(), isRowAlarmNew(), removeInactiveAlarms(), replaceAlarm(), run(), and setCategoryClient().
final int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::MAX_ALARMS = 20000 [static] |
The max number of alarms in the table When the max has been reach, the oldest alarm is removed before adding a new one
Referenced by AlarmTableModel(), and run().
JComponent alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::owner [private] |
The owner component (used to show dialog messages)
Referenced by acknowledge(), addAlarm(), replaceAlarm(), and run().
Semaphore alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::paused = new Semaphore(1) [private] |
The semaphore used to pause the thread
When the application is not paused, the thread acquire the semaphore before getting an alarm from the queue and release it when done.
The pause method acquires the semaphore blocking the thread. When the application is upaused then the semaphore is released and the thread restarts.
LinkedBlockingQueue<AlarmTableEntry> alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::queue = new LinkedBlockingQueue<AlarmTableEntry>(QUEUE_SIZE) [private] |
final int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::QUEUE_SIZE = 15000 [static] |
The max alarm in queue when the table is paused
volatile boolean alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::terminateThread = false [private] |
final Thread alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::thread [private] |
The thread
Referenced by AlarmTableModel(), and close().
boolean alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::waitIfQueueFull = false [private] |
The behavior if the queue is full.
If it is true when a new alarm arrives and the queue is full then it waits until there is one free place in the queue.
If it is false and the queue is full then the incoming alarm will be discarded.
Referenced by onAlarm().
1.6.2