

Classes | |
| class | TableUpdater |
Public Member Functions | |
| LogEntryTableModelBase () throws Exception | |
| final int | getColumnCount () |
| int | numberOfUsedFiles () |
| long | usedDiskSpace () throws IOException |
| 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 | |
| void | updateTableEntries () |
Protected Attributes | |
| LogCache | allLogs = null |
| RowEntries | rows = new RowEntries(10000) |
| Vector< Integer > | rowsToAdd = new Vector<Integer>() |
| TableUpdater | tableUpdater |
Private Member Functions | |
| void | flushLogs () |
Private Attributes | |
| boolean | closed = false |
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 | ( | ) | throws Exception [inline] |
Constructor
References allLogs, and tableUpdater.
| synchronized void alma::acs::logging::table::LogEntryTableModelBase::appendLog | ( | ILogEntry | log | ) | [inline] |
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 com::cosylab::logging::client::cache::LogCache::add(), allLogs, closed, and rowsToAdd.
Referenced by com::cosylab::logging::LoggingClient::logEntryReceived(), and alma::acs::logging::errorbrowser::Engine::run().
| synchronized void alma::acs::logging::table::LogEntryTableModelBase::clearAll | ( | ) | [inline] |
Remove all the logs
References allLogs, com::cosylab::logging::client::cache::LogCache::clear(), rows, and rowsToAdd.
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), close(), and alma::acs::logging::table::LogTableDataModel::loadFromURL().
| void alma::acs::logging::table::LogEntryTableModelBase::close | ( | boolean | sync | ) | [inline] |
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 clearAll(), alma::acs::logging::table::LogEntryTableModelBase::TableUpdater::close(), closed, and tableUpdater.
Referenced by alma::acs::logging::errorbrowser::ErrorTab::close().
| synchronized int alma::acs::logging::table::LogEntryTableModelBase::findKeyPos | ( | Integer | key | ) | [inline] |
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 rows.
| void alma::acs::logging::table::LogEntryTableModelBase::flushLogs | ( | ) | [inline, private] |
Flush the logs from the temporary vector into the table.
New logs are appended in the temporary vector rowsToAdd to limit the frequency of updating the table model. This method flushes the logs from the temporary vector into the model vector (rows).
true if at least one log has been added to the model References rows, and rowsToAdd.
Referenced by updateTableEntries().
| final Class<?> alma::acs::logging::table::LogEntryTableModelBase::getColumnClass | ( | int | column | ) | [inline] |
Returns default class for column. Creation date: (12/1/2001 14:18:53)
| column | int |
| final int alma::acs::logging::table::LogEntryTableModelBase::getColumnCount | ( | ) | [inline] |
Return number of columns in table
| final String alma::acs::logging::table::LogEntryTableModelBase::getColumnName | ( | int | columnIndex | ) | [inline] |
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 | ) | [inline] |
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 rows.
| int alma::acs::logging::table::LogEntryTableModelBase::getRowCount | ( | ) | [inline] |
References rows.
| Calendar alma::acs::logging::table::LogEntryTableModelBase::getTimeFrame | ( | ) | [inline] |
References allLogs, and com::cosylab::logging::client::cache::LogCache::getTimeFrame().
Referenced by com::cosylab::logging::stats::StatsDlg::refreshGUI().
| synchronized Object alma::acs::logging::table::LogEntryTableModelBase::getValueAt | ( | int | row, | |
| int | column | |||
| ) | [inline] |
Returns an item according to the row and the column of its position.
| row | int | |
| column | int |
References allLogs, com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::client::cache::LogCache::getLogTimestamp(), com::cosylab::logging::client::cache::LogCache::getLogType(), getVisibleLogEntry(), com::cosylab::logging::engine::log::ILogEntry::hasDatas(), and rows.
| synchronized ILogEntry alma::acs::logging::table::LogEntryTableModelBase::getVisibleLogEntry | ( | int | row | ) | [inline] |
Return the log shown in the passed row.
| row | The row of the table containing the log |
References allLogs, closed, com::cosylab::logging::client::cache::LogCache::getLog(), and rows.
Referenced by alma::acs::logging::table::TablePopupMenu::actionPerformed(), alma::acs::logging::table::LogEntryTable::changeSelection(), alma::acs::logging::table::TablePopupMenu::copyToClipboard(), com::cosylab::logging::search::SearchEngine::find(), alma::acs::logging::table::LogEntryTable::getExtraInfo(), getValueAt(), alma::acs::logging::errorbrowser::ErrorTab::initialize(), alma::acs::logging::errorbrowser::Engine::run(), alma::acs::logging::table::TablePopupMenu::saveSelectedLogs(), 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 | ( | ) | [inline] |
References allLogs, and com::cosylab::logging::client::cache::LogMultiFileCache::getNumberOfCacheFiles().
Referenced by com::cosylab::logging::stats::StatsDlg::refreshGUI().
| synchronized void alma::acs::logging::table::LogEntryTableModelBase::replaceLog | ( | int | pos, | |
| ILogEntry | newEntry | |||
| ) | [inline] |
Replace a log entry with another
| pos | The position in the cache of the log to replace | |
| newEntry | The new LogEntryXML |
References allLogs, and com::cosylab::logging::client::cache::LogMultiFileCache::replaceLog().
Referenced by alma::acs::logging::table::TablePopupMenu::actionPerformed().
| long alma::acs::logging::table::LogEntryTableModelBase::totalLogNumber | ( | ) | [inline] |
References allLogs, and com::cosylab::logging::client::cache::LogMultiFileCache::getSize().
Referenced by com::cosylab::logging::stats::StatsDlg::refreshGUI(), and alma::acs::logging::errorbrowser::Engine::run().
| void alma::acs::logging::table::LogEntryTableModelBase::updateTableEntries | ( | ) | [inline, 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.
References flushLogs().
Referenced by alma::acs::logging::table::LogEntryTableModelBase::TableUpdater::run().
| long alma::acs::logging::table::LogEntryTableModelBase::usedDiskSpace | ( | ) | throws IOException [inline] |
| IOException | In case of error getting the size of at least one of the used cache files |
References allLogs, and com::cosylab::logging::client::cache::LogMultiFileCache::getFilesSize().
Referenced by com::cosylab::logging::stats::StatsDlg::refreshGUI().
LogCache alma::acs::logging::table::LogEntryTableModelBase::allLogs = null [protected] |
The cache of all the logs received.
Referenced by appendLog(), alma::acs::logging::table::LogTableDataModel::checkTimeFrame(), clearAll(), alma::acs::logging::table::LogTableDataModel::deleteLogs(), getTimeFrame(), getValueAt(), getVisibleLogEntry(), LogEntryTableModelBase(), numberOfUsedFiles(), replaceLog(), alma::acs::logging::table::LogTableDataModel::saveFile(), totalLogNumber(), and usedDiskSpace().
boolean alma::acs::logging::table::LogEntryTableModelBase::closed = false [private] |
true if the model has been closed
Referenced by appendLog(), close(), and getVisibleLogEntry().
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 clearAll(), alma::acs::logging::table::LogTableDataModel::deleteLogsFromTable(), findKeyPos(), flushLogs(), getLogKey(), getRowCount(), getValueAt(), and getVisibleLogEntry().
Vector<Integer> alma::acs::logging::table::LogEntryTableModelBase::rowsToAdd = new Vector<Integer>() [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 appendLog(), clearAll(), alma::acs::logging::table::LogTableDataModel::deleteLogsFromTable(), and flushLogs().
The thread to refresh the content of the table
Referenced by close(), and LogEntryTableModelBase().
1.6.2