Classes | Public Member Functions | Protected Member Functions | Protected Attributes

alma.acs.logging.table.LogEntryTableModelBase Class Reference

Inheritance diagram for alma.acs.logging.table.LogEntryTableModelBase:
alma.acs.logging.table.LogTableDataModel

List of all members.

Classes

class  TableUpdater

Public Member Functions

 LogEntryTableModelBase (LoggingClient client) throws Exception
final int getColumnCount ()
int numberOfUsedFiles ()
long usedDiskSpace () throws IOException
synchronized int getRowCount ()
synchronized Object getValueAt (int row, int column)
synchronized ILogEntry getVisibleLogEntry (int row)
synchronized void clearAll ()
long totalLogNumber ()
Calendar getTimeFrame ()
synchronized Integer getLogKey (int index)
synchronized int findKeyPos (Integer key)
final String getColumnName (int columnIndex)
final Class<?> getColumnClass (int column)
synchronized void appendLog (ILogEntry log)
synchronized void replaceLog (int pos, ILogEntry newEntry)
void close (boolean sync)

Protected Member Functions

synchronized void updateTableEntries ()

Protected Attributes

LogCache allLogs = null
RowEntries rows = new RowEntries(10000)
Vector< ILogEntryrowsToAdd = new Vector<ILogEntry>()
TableUpdater tableUpdater
final LoggingClient loggingClient

Detailed Description

The table model with basic functionalities.

This model can be reused by log tables with reduced functionalities like the error browsers.

Author:
acaproni

Constructor & Destructor Documentation

alma.acs.logging.table.LogEntryTableModelBase.LogEntryTableModelBase ( LoggingClient  client  )  throws Exception

Member Function Documentation

synchronized void alma.acs.logging.table.LogEntryTableModelBase.appendLog ( ILogEntry  log  ) 

Adds the log to the table.

To avoid updating the table very frequently, the logs to add are immediately inserted in the LogCache but their insertion in the table is delayed and done by the TableUpdater thread.
For this reason each log is inserted in the temporary vector rowsToAdd that will be flushed into rows by the thread.

Parameters:
log The log to add

References alma.acs.logging.table.LogEntryTableModelBase.rowsToAdd.

Referenced by com.cosylab.logging.LoggingClient.logEntryReceived(), and alma.acs.logging.errorbrowser.Engine.run().

void alma.acs.logging.table.LogEntryTableModelBase.close ( boolean  sync  ) 

Closes all the threads and frees the resources This is the last method to call before closing the application

Parameters:
sync If it is true wait the termination of the threads before returning

Reimplemented in alma.acs.logging.table.LogTableDataModel.

References alma.acs.logging.table.LogEntryTableModelBase.clearAll(), alma.acs.logging.table.LogEntryTableModelBase.TableUpdater.close(), and alma.acs.logging.table.LogEntryTableModelBase.tableUpdater.

Referenced by alma.acs.logging.errorbrowser.ErrorTab.close().

synchronized int alma.acs.logging.table.LogEntryTableModelBase.findKeyPos ( Integer  key  ) 

Return the position of the key in the vector.

There are cases when the key is not anymore in the vector and in such situations this method return null.
For example it could happen if the log has been deleted by the LogDeleter.

Parameters:
key The key whose position in the vector has to be found
Returns:
The position of the key in the vector of logs or -1 if the key is not in the vector

References alma.acs.logging.table.LogEntryTableModelBase.rows.

final Class<?> alma.acs.logging.table.LogEntryTableModelBase.getColumnClass ( int  column  ) 

Returns default class for column. Creation date: (12/1/2001 14:18:53)

Returns:
java.lang.Class
Parameters:
column int
final int alma.acs.logging.table.LogEntryTableModelBase.getColumnCount (  ) 

Return number of columns in table

final String alma.acs.logging.table.LogEntryTableModelBase.getColumnName ( int  columnIndex  ) 

Returns name of the column based LogEntryXML fields. If the specified index does not return a valid column, blank string is returned. Creation date: (11/11/2001 13:50:16)

Returns:
java.lang.String
Parameters:
columnIndex int
synchronized Integer alma.acs.logging.table.LogEntryTableModelBase.getLogKey ( int  index  ) 

Return the key of the log in the given position of the vector of keys.

There are several cases that forbids to retrieve the key in the given position, in such a situations the method return null. One typical situation is when the entry has been deleted by the LogDeleter.

Parameters:
index The position in the model of the key
Returns:
The key in the passed position or null if it is not possible to return the key
See also:
findKeyPos(Integer key)

References alma.acs.logging.table.LogEntryTableModelBase.rows.

synchronized int alma.acs.logging.table.LogEntryTableModelBase.getRowCount (  ) 
See also:
javax.swing.table.TableModel.getRowCount()

References alma.acs.logging.table.LogEntryTableModelBase.rows.

Calendar alma.acs.logging.table.LogEntryTableModelBase.getTimeFrame (  ) 
synchronized Object alma.acs.logging.table.LogEntryTableModelBase.getValueAt ( int  row,
int  column 
)
int alma.acs.logging.table.LogEntryTableModelBase.numberOfUsedFiles (  ) 
synchronized void alma.acs.logging.table.LogEntryTableModelBase.replaceLog ( int  pos,
ILogEntry  newEntry 
)

Replace a log entry with another

Parameters:
pos The position in the cache of the log to replace
newEntry The new LogEntryXML

References alma.acs.logging.table.LogEntryTableModelBase.allLogs, and com.cosylab.logging.client.cache.LogMultiFileCache.replaceLog().

Referenced by alma.acs.logging.table.TablePopupMenu.actionPerformed().

long alma.acs.logging.table.LogEntryTableModelBase.totalLogNumber (  ) 
synchronized void alma.acs.logging.table.LogEntryTableModelBase.updateTableEntries (  )  [protected]

Update the table entries before refreshing the table

Returns:
true If the model has been changed and the table needs to be refreshed

Reimplemented in alma.acs.logging.table.LogTableDataModel.

Referenced by alma.acs.logging.table.LogEntryTableModelBase.TableUpdater.run().

long alma.acs.logging.table.LogEntryTableModelBase.usedDiskSpace (  )  throws IOException
Returns:
The amount of disk space used by the files of the cache
Exceptions:
IOException In case of error getting the size of at least one of the used cache files

References alma.acs.logging.table.LogEntryTableModelBase.allLogs, and com.cosylab.logging.client.cache.LogMultiFileCache.getFilesSize().


Member Data Documentation

The vector of logs to add in the rows.

Newly arrived logs are added to this vector and flushed into rows by the TableUpdater thread.

Referenced by alma.acs.logging.table.LogEntryTableModelBase.appendLog(), and alma.acs.logging.table.LogEntryTableModelBase.clearAll().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties