Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acsplugins::alarmsystem::gui::table::AlarmTableModel Class Reference

Collaboration diagram for alma::acsplugins::alarmsystem::gui::table::AlarmTableModel:

Collaboration graph
[legend]
List of all members.

Public Types

enum  AlarmTableColumn {
  HIDES_CHILDREN, flag, true, REDUCED,
  flag, true, ICON, flag,
  true, Time, null, true,
  Component, null, true, Code,
  null, true, Priority, null,
  true, Description, null, true,
  Cause, null, true, Action,
  null, false, Consequence, null,
  false, URL, null, false,
  Contact, null, false, email,
  null, false, GSM, null,
  false, Triplet, null, false,
  Family, null, title, popupTitle,
  visibleAtStartup = title (popupTitle==null) ? title : popupTitleinitiallyVisible
}

Public Member Functions

 AlarmTableModel (JComponent owner, boolean reduce)
synchronized void onAlarm (Alarm alarm)
synchronized void acknowledge (Alarm alarm)
void onException (LaserSelectionException e)
int getRowCount ()
int getColumnCount ()
Object getCellContent (int rowIndex, int columnIndex)
void setAutoAckLevel (ComboBoxValues lvl)
Object getValueAt (int rowIndex, int columnIndex)
Override String getColumnName (int col)
Alarm 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)
Override void run ()
void close ()

Static Public Attributes

final int MAX_ALARMS = 20000
final int QUEUE_SIZE = 15000

Package Types


Private Member Functions

void addAlarm (Alarm alarm)
void autoAcknowledge (Alarm alarm)
void replaceAlarm (Alarm newAlarm)

Private Attributes

SimpleDateFormat dateFormat = new IsoDateFormat()
HashMap< AlarmGUIType, AlarmCountercounters = new HashMap<AlarmGUIType AlarmCounter>()
ConnectionListener connectionListener = null
LinkedBlockingQueue< Alarmqueue = new LinkedBlockingQueue<Alarm>(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

Detailed Description

The table model for the table alarms


Member Enumeration Documentation

enum alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::AlarmTableColumn
 

The title of each column.

To change the initial order of the columns, change the order of the declaration of this enumerated.

Author:
acaproni
Enumeration values:
HIDES_CHILDREN 
flag 
true 
REDUCED 
flag 
true 
ICON 
flag 
true 
Time 
null 
true 
Component 
null 
true 
Code 
null 
true 
Priority 
null 
true 
Description 
null 
true 
Cause 
null 
true 
Action 
null 
false 
Consequence 
null 
false 
URL 
null 
false 
Contact 
null 
false 
email 
null 
false 
GSM 
null 
false 
Triplet 
null 
false 
Family 
null 
title  Constructor

Parameters:
title The name of the column in the table header
popupTitle The name of the column in the popup menu; if it is null then it is set to be equal to title
initiallyVisible if true the column is visible at startup
popupTitle 
visibleAtStartup 


Constructor & Destructor Documentation

alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::AlarmTableModel JComponent  owner,
boolean  reduce
[inline]
 

Constructor

Parameters:
owner The component that owns the table
reduce true if the reduction rules must be applied
panel The AlarmPanel


Member Function Documentation

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::acknowledge Alarm  alarm  )  [inline]
 

Acknowledge an alarm that in this version ends up to removing from the table

Parameters:
alarm The inactive alarm to acknowledge

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::addAlarm Alarm  alarm  )  [inline, private]
 

Parameters:
alarm The alarm to add

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::alarmSelected int  row  )  [inline]
 

The user pressed one mouse button over a row

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.

Parameters:
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

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::autoAcknowledge Alarm  alarm  )  [inline, private]
 

Automatically acknowledge an alarm depending on its priority and the selected priority level

Parameters:
alarm The alarm to acknowledge if its priority if greater the the selected priority level

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::clear  )  [inline]
 

Clear the content of the model

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::close  )  [inline]
 

Terminate the thread and free the resources.

AlarmCounter alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getAlarmCounter AlarmGUIType  type  )  [inline]
 

Return the counter for the given alarm type

Parameters:
type The type of the alarm
Returns:
The counter for the alarm type

CategoryClient alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getCategoryClient  )  [inline]
 

Get the CategoryClient from the AlarmsContainer

Parameters:
client The CategoryCLient; it can be null.

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)

Parameters:
rowIndex The row of the cell
columnIndex The col of the cell
Returns:
The string to display in the cell

int alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getColumnCount  )  [inline]
 

Override String alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getColumnName int  col  )  [inline]
 

Alarm alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getRowAlarm int  row  )  [inline]
 

Return the alarm whose content fills the given row

Parameters:
row The number of the row showing the alarm
Returns:
The alarm shown in the row

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

Parameters:
row The number of the row showing the alarm
Returns:
The entry

Object alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getValueAt int  rowIndex,
int  columnIndex
[inline]
 

See also:
javax.swing.table.AbstractTableModel

boolean alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::isRowAlarmNew int  row  )  [inline]
 

Parameters:
row Return true if the alarm is new

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.

Parameters:
alarm The alarm to add to the table.
See also:
AlarmSelectionListener

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.

See also:
AlarmSelectionListener

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.

Parameters:
pause if true no new alarms are added in the table

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

Parameters:
type The type of the inactive alarms
See also:
AlarmsContainer.removeInactiveAlarms

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::replaceAlarm Alarm  newAlarm  )  [inline, private]
 

Replace an alarm already in the table

Parameters:
newAlarm The alarm to put in the table

Override 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.

See also:
java.lang.Runnable#run()

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)

Parameters:
lvl The new auto acknowledge level

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::setCategoryClient CategoryClient  client  )  [inline]
 

Set the CategoryClient in the AlarmsContainer

Parameters:
client The CategoryCLient; it can be null.

void alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::setConnectionListener ConnectionListener  listener  )  [inline]
 

Set the connection listener

Parameters:
listener The listener


Member Data Documentation

boolean alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::applyReductionRules [private]
 

If true applies the reduction rules hiding reduced alarms

ComboBoxValues alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::autoAckLvl = ComboBoxValues.NONE [private]
 

The auto acknowledge level

ConnectionListener alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::connectionListener = null [private]
 

The listener about the status of the connection

See also:
onException

HashMap<AlarmGUIType, AlarmCounter> alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::counters = new HashMap<AlarmGUIType AlarmCounter>() [private]
 

The counter for the alarms

SimpleDateFormat alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::dateFormat = new IsoDateFormat() [private]
 

The date format

AlarmsReductionContainer alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::items = null [private]
 

The alarms in the table

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

JComponent alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::owner [private]
 

The owner component (used to show dialog messages)

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<Alarm> alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::queue = new LinkedBlockingQueue<Alarm>(QUEUE_SIZE) [private]
 

The queue of alarms received from the CategoryClient that will be injected in the table

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]
 

Signal the thread to terminate

final Thread alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::thread [private]
 

The thread

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.


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