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< ILogEntry > | rowsToAdd = new Vector<ILogEntry>() |
TableUpdater | tableUpdater |
final LoggingClient | loggingClient |
The table model with basic functionalities.
This model can be reused by log tables with reduced functionalities like the error browsers.
alma.acs.logging.table.LogEntryTableModelBase.LogEntryTableModelBase | ( | LoggingClient | client | ) | throws Exception |
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.
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().
synchronized void alma.acs.logging.table.LogEntryTableModelBase.clearAll | ( | ) |
Remove all the logs
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, com.cosylab.logging.client.cache.LogCache.clear(), alma.acs.logging.table.LogEntryTableModelBase.rows, and alma.acs.logging.table.LogEntryTableModelBase.rowsToAdd.
Referenced by com.cosylab.logging.LoggingClient.EventHandler.actionPerformed(), alma.acs.logging.table.LogEntryTableModelBase.close(), and alma.acs.logging.table.LogTableDataModel.loadFromURL().
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
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
.
key | The key whose position in the vector has to be found |
-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)
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)
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
.
index | The position in the model of the key |
null
if it is not possible to return the keyReferences alma.acs.logging.table.LogEntryTableModelBase.rows.
synchronized int alma.acs.logging.table.LogEntryTableModelBase.getRowCount | ( | ) |
References alma.acs.logging.table.LogEntryTableModelBase.rows.
Calendar alma.acs.logging.table.LogEntryTableModelBase.getTimeFrame | ( | ) |
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, and com.cosylab.logging.client.cache.LogCache.getTimeFrame().
synchronized Object alma.acs.logging.table.LogEntryTableModelBase.getValueAt | ( | int | row, | |
int | column | |||
) |
Returns an item according to the row and the column of its position.
row | int | |
column | int |
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, com.cosylab.logging.engine.log.ILogEntry.getField(), com.cosylab.logging.client.cache.LogCache.getLogTimestamp(), com.cosylab.logging.client.cache.LogCache.getLogType(), alma.acs.logging.table.LogEntryTableModelBase.getVisibleLogEntry(), com.cosylab.logging.engine.log.ILogEntry.hasDatas(), and alma.acs.logging.table.LogEntryTableModelBase.rows.
synchronized ILogEntry alma.acs.logging.table.LogEntryTableModelBase.getVisibleLogEntry | ( | int | row | ) |
Return the log shown in the passed row.
row | The row of the table containing the log |
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, com.cosylab.logging.client.cache.LogCache.getLog(), and alma.acs.logging.table.LogEntryTableModelBase.rows.
Referenced by alma.acs.logging.table.TablePopupMenu.actionPerformed(), alma.acs.logging.table.LogEntryTable.changeSelection(), alma.acs.logging.table.LogEntryTable.getExtraInfo(), alma.acs.logging.table.LogEntryTableModelBase.getValueAt(), alma.acs.logging.errorbrowser.Engine.run(), alma.acs.logging.table.TablePopupMenu.show(), com.cosylab.logging.LoggingClient.showDetailedLogInfo(), and alma.acs.logging.table.LogEntryTable.zoom().
int alma.acs.logging.table.LogEntryTableModelBase.numberOfUsedFiles | ( | ) |
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, and com.cosylab.logging.client.cache.LogMultiFileCache.getNumberOfCacheFiles().
synchronized void alma.acs.logging.table.LogEntryTableModelBase.replaceLog | ( | int | pos, | |
ILogEntry | newEntry | |||
) |
Replace a log entry with another
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 | ( | ) |
References alma.acs.logging.table.LogEntryTableModelBase.allLogs, and com.cosylab.logging.client.cache.LogMultiFileCache.getSize().
Referenced by alma.acs.logging.errorbrowser.Engine.run().
synchronized void alma.acs.logging.table.LogEntryTableModelBase.updateTableEntries | ( | ) | [protected] |
Update the table entries before refreshing the table
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 |
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().
LogCache alma.acs.logging.table.LogEntryTableModelBase.allLogs = null [protected] |
The cache of all the logs received.
Referenced by alma.acs.logging.table.LogEntryTableModelBase.clearAll(), alma.acs.logging.table.LogEntryTableModelBase.getTimeFrame(), alma.acs.logging.table.LogEntryTableModelBase.getValueAt(), alma.acs.logging.table.LogEntryTableModelBase.getVisibleLogEntry(), alma.acs.logging.table.LogEntryTableModelBase.LogEntryTableModelBase(), alma.acs.logging.table.LogEntryTableModelBase.numberOfUsedFiles(), alma.acs.logging.table.LogEntryTableModelBase.replaceLog(), alma.acs.logging.table.LogEntryTableModelBase.totalLogNumber(), and alma.acs.logging.table.LogEntryTableModelBase.usedDiskSpace().
final LoggingClient alma.acs.logging.table.LogEntryTableModelBase.loggingClient [protected] |
The LoggingClient that owns this table model
Referenced by alma.acs.logging.table.LogTableDataModel.loadFromFile(), alma.acs.logging.table.LogTableDataModel.loadFromURL(), and alma.acs.logging.table.LogEntryTableModelBase.LogEntryTableModelBase().
RowEntries alma.acs.logging.table.LogEntryTableModelBase.rows = new RowEntries(10000) [protected] |
Each row shows a log identified by a key returned by the cache.
This vector stores the key of each log shown in the table.
Referenced by alma.acs.logging.table.LogEntryTableModelBase.clearAll(), alma.acs.logging.table.LogEntryTableModelBase.findKeyPos(), alma.acs.logging.table.LogEntryTableModelBase.getLogKey(), alma.acs.logging.table.LogEntryTableModelBase.getRowCount(), alma.acs.logging.table.LogEntryTableModelBase.getValueAt(), and alma.acs.logging.table.LogEntryTableModelBase.getVisibleLogEntry().
Vector<ILogEntry> alma.acs.logging.table.LogEntryTableModelBase.rowsToAdd = new Vector<ILogEntry>() [protected] |
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 thread to refresh the content of the table
Referenced by alma.acs.logging.table.LogEntryTableModelBase.close(), and alma.acs.logging.table.LogEntryTableModelBase.LogEntryTableModelBase().