org.aselect.agent.admin
Class TicketMonitorModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.aselect.agent.admin.TicketMonitorModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, javax.swing.table.TableModel

public class TicketMonitorModel
extends javax.swing.table.AbstractTableModel
implements java.lang.Runnable

Monitors the tickets that are issued by the A-Select Agent.

Description:
This method monitors the issued tickets of the A-Select Agent. This class implements Runnable in which it periodically checks the TicketManager for issued ticket. The data is used by the AdminMonitor for display in the GUI.

Concurrency issues:
None.

Author:
Alfa & Ariss
See Also:
Serialized Form

Field Summary
static java.lang.String MODULE
          The MODULE name.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TicketMonitorModel(int iCheckInterval)
          Initializes the class.
 
Method Summary
 int getColumnCount()
          Returns the number of columns.
 java.lang.String getColumnName(int xIndex)
          Returns the colum nname.
 int getRowCount()
          Returns the number of rows.
 long getTicketsCounter()
           
 java.lang.Object getValueAt(int iRow, int iColumn)
          Returns the value of an information items in this model.
 void run()
          Loops and upon wakeup (monitoring interval), fetches the ticket information from the TicketManager.
 void stop()
          Stops monitoring.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

public static final java.lang.String MODULE
The MODULE name.

See Also:
Constant Field Values
Constructor Detail

TicketMonitorModel

public TicketMonitorModel(int iCheckInterval)
                   throws java.lang.NumberFormatException,
                          ASelectConfigException
Initializes the class.

Description:
This method initalizes the class by initializing variables and starting the runner thread for monitoring.

Concurrency issues:
None.

Preconditions:
None.

Postconditions:
None.

Parameters:
iCheckInterval - the monitoring interval (in seconds) to wait for updating the ticket information.
Throws:
ASelectConfigException - on configuration error. @ throws NumberFormatException on non-parseable max_tickets config item.
java.lang.NumberFormatException - If 'max_tickets' parameter is incorrect.
Method Detail

stop

public void stop()
Stops monitoring.


getTicketsCounter

public long getTicketsCounter()
Returns:
the number of issued tickets.

getRowCount

public int getRowCount()
Returns the number of rows.

Specified by:
getRowCount in interface javax.swing.table.TableModel
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Returns the number of columns.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnCount()

getValueAt

public java.lang.Object getValueAt(int iRow,
                                   int iColumn)
Returns the value of an information items in this model.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Returns:
the String representation of the item.
See Also:
TableModel.getValueAt(int, int)

getColumnName

public java.lang.String getColumnName(int xIndex)
Returns the colum nname.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnName(int)

run

public void run()
Loops and upon wakeup (monitoring interval), fetches the ticket information from the TicketManager.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()


Copyright © 2008 SURFnet BV. All Rights Reserved.