

Public Member Functions | |
| final boolean | getSuspended () |
| LogTableDataModel (LoggingClient client) throws Exception | |
| void | setMaxLog (int max) |
| void | setTimeFrame (long timeframe) |
| void | loadFromURL () |
| void | loadFromFile (String fileName) |
| void | saveFile () |
| boolean | IOInProgress () |
| void | close (boolean sync) |
| int | getFieldSortNumber () |
| boolean | sortedAscending () |
| void | setSortComparator (int index, boolean ascending) |
Public Attributes | |
| File | currentDir = null |
Protected Member Functions | |
| void | updateTableEntries () |
Private Member Functions | |
| void | saveFile (String fileName, boolean compress, int level) |
| IOLogsHelper | getIOHelper () |
| void | checkTimeFrame () |
| void | deleteLogs (Integer[] keys) |
| void | deleteLogsFromTable () |
Private Attributes | |
| LoggingClient | loggingClient = null |
| boolean | isSuspended = true |
| IOLogsHelper | ioHelper = null |
| int | maxLog = 0 |
| long | timeFrame = 0 |
| final int | DELETION_INTERVAL_TIME = 30*1000 |
| Thread | deleterThread = null |
| long | nextDeletionCheckTime = System.currentTimeMillis()+DELETION_INTERVAL_TIME |
Extends the LogEntryTableModelBase adding I/O, deletion of logs and so on.
| alma::acs::logging::table::LogTableDataModel::LogTableDataModel | ( | LoggingClient | client | ) | throws Exception [inline] |
LCLogTableDataModel constructor comment. Gets updated logs.
References loggingClient.
| void alma::acs::logging::table::LogTableDataModel::checkTimeFrame | ( | ) | [inline, private] |
Check if the time frame of the logs in cache exceeds the limit and if it is the case, deletes the oldest logs
References alma::acs::logging::table::LogEntryTableModelBase::allLogs, com::cosylab::logging::client::cache::LogCache::getLogExceedingTimeFrame(), and timeFrame.
Referenced by setTimeFrame().
| void alma::acs::logging::table::LogTableDataModel::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 from alma::acs::logging::table::LogEntryTableModelBase.
References alma::acs::logging::io::IOLogsHelper::done(), and ioHelper.
Referenced by com::cosylab::logging::LoggingClient::close().
| void alma::acs::logging::table::LogTableDataModel::deleteLogs | ( | Integer[] | keys | ) | [inline, private] |
Delete the first logsToDelete logs from the data structures of the model.
| The | keys to remove from the cache |
References alma::acs::logging::table::LogEntryTableModelBase::allLogs, and com::cosylab::logging::client::cache::LogCache::deleteLog().
Referenced by deleteLogsFromTable().
| void alma::acs::logging::table::LogTableDataModel::deleteLogsFromTable | ( | ) | [inline, private] |
References deleteLogs(), deleterThread, DELETION_INTERVAL_TIME, com::cosylab::logging::LoggingClient::isPaused(), loggingClient, maxLog, nextDeletionCheckTime, alma::acs::logging::table::RowEntries::removeLastEntries(), alma::acs::logging::table::LogEntryTableModelBase::rows, and alma::acs::logging::table::LogEntryTableModelBase::rowsToAdd.
Referenced by updateTableEntries().
| int alma::acs::logging::table::LogTableDataModel::getFieldSortNumber | ( | ) | [inline] |
| IOLogsHelper alma::acs::logging::table::LogTableDataModel::getIOHelper | ( | ) | [inline, private] |
A getter method that created the helper only when needed
References ioHelper, and loggingClient.
Referenced by loadFromFile(), loadFromURL(), and saveFile().
| final boolean alma::acs::logging::table::LogTableDataModel::getSuspended | ( | ) | [inline] |
Returns whether the saving/loading of the file has been cancelled or not that reflects on the status of the JToggleButton of the GUI. If canceled, then the button should be released.
References isSuspended.
| boolean alma::acs::logging::table::LogTableDataModel::IOInProgress | ( | ) | [inline] |
Return true if an async load/save is in progress
References ioHelper, and alma::acs::logging::io::IOLogsHelper::isPerformingIO().
Referenced by com::cosylab::logging::LoggingClient::EventHandler::menuSelected().
| void alma::acs::logging::table::LogTableDataModel::loadFromFile | ( | String | fileName | ) | [inline] |
Loads logs from a file. If the name of the file is null, a dialog to choose the file is shown.
| filename | The name of the file to load |
References currentDir, alma::acs::logging::io::LoadFileChooser::execute(), alma::acs::logging::io::LogsFileChooser::getCurrentDirectory(), getIOHelper(), com::cosylab::logging::LoggingClient::getLogEntryTable(), alma::acs::logging::io::LogsFileChooser::getSelectedFile(), isSuspended, alma::acs::logging::io::IOLogsHelper::loadLogs(), and loggingClient.
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().
| void alma::acs::logging::table::LogTableDataModel::loadFromURL | ( | ) | [inline] |
References alma::acs::logging::table::LogEntryTableModelBase::clearAll(), getIOHelper(), alma::acs::logging::dialogs::LoadURLDlg::getURL(), isSuspended, alma::acs::logging::io::IOLogsHelper::loadLogs(), and loggingClient.
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().
| void alma::acs::logging::table::LogTableDataModel::saveFile | ( | String | fileName, | |
| boolean | compress, | |||
| int | level | |||
| ) | [inline, private] |
Save the logs in a file
| fileName | The name of the file to save logs into | |
| compress | true if the file must be compressed (GZIP) | |
| level | The level of compression (ignored if compress is false) |
References alma::acs::logging::table::LogEntryTableModelBase::allLogs, getIOHelper(), and alma::acs::logging::io::IOLogsHelper::saveLogs().
| void alma::acs::logging::table::LogTableDataModel::saveFile | ( | ) | [inline] |
Saves input logs into a file.
References currentDir, alma::acs::logging::io::SaveFileChooser::getCompressionLevel(), alma::acs::logging::io::LogsFileChooser::getCurrentDirectory(), alma::acs::logging::io::LogsFileChooser::getSelectedFile(), isSuspended, and alma::acs::logging::io::SaveFileChooser::mustBeCompressed().
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().
| void alma::acs::logging::table::LogTableDataModel::setMaxLog | ( | int | max | ) | [inline] |
Set the max number of logs to keep in cache This is the max number of logs stored in cache (the visible logs can be less)
| max | The max number of logs 0 means unlimited |
References maxLog.
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), and com::cosylab::logging::LoggingClient::initialize().
| void alma::acs::logging::table::LogTableDataModel::setSortComparator | ( | int | index, | |
| boolean | ascending | |||
| ) | [inline] |
| void alma::acs::logging::table::LogTableDataModel::setTimeFrame | ( | long | timeframe | ) | [inline] |
Set the time frame of the logs in the cache The time frame if the amount of time we want to keep in the table for example the last 2hr (the visible logs can be less)
| timeframe | The time frame in milliseconds 0 means unlimited |
References checkTimeFrame(), and timeFrame.
Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), and com::cosylab::logging::LoggingClient::initialize().
| boolean alma::acs::logging::table::LogTableDataModel::sortedAscending | ( | ) | [inline] |
| void alma::acs::logging::table::LogTableDataModel::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 from alma::acs::logging::table::LogEntryTableModelBase.
References deleteLogsFromTable(), and nextDeletionCheckTime.
Contains references to the filters that are currently applied to logs. Actual filters are stored in filters. private final Vector appliedFilters = new Vector();
Stores the current directory which is being accessed.
Referenced by loadFromFile(), and saveFile().
Thread alma::acs::logging::table::LogTableDataModel::deleterThread = null [private] |
The thread removing logs from the cache.
During a deletion of logs, logs are immediately removed by the table (i.e. from the rows vector) but they are removed from the cache by this thread.
Referenced by deleteLogsFromTable().
final int alma::acs::logging::table::LogTableDataModel::DELETION_INTERVAL_TIME = 30*1000 [private] |
The time interval between 2 removal of logs from the table
Referenced by deleteLogsFromTable().
IOLogsHelper alma::acs::logging::table::LogTableDataModel::ioHelper = null [private] |
An object to load and save logs
Referenced by close(), getIOHelper(), and IOInProgress().
boolean alma::acs::logging::table::LogTableDataModel::isSuspended = true [private] |
Referenced by getSuspended(), loadFromFile(), loadFromURL(), and saveFile().
LoggingClient alma::acs::logging::table::LogTableDataModel::loggingClient = null [private] |
The LoggingClient that owns this table model
Referenced by deleteLogsFromTable(), getIOHelper(), loadFromFile(), loadFromURL(), and LogTableDataModel().
int alma::acs::logging::table::LogTableDataModel::maxLog = 0 [private] |
The max number of logs in cache This limit is not for the buffer but for the size of the whole cache A value of 0 means unlimited
Referenced by deleteLogsFromTable(), and setMaxLog().
long alma::acs::logging::table::LogTableDataModel::nextDeletionCheckTime = System.currentTimeMillis()+DELETION_INTERVAL_TIME [private] |
The time to check for deletion.
The deletion is triggered by the calling of updateTableEntries() by LogEntryTableModelBase.TableUpdater.
Referenced by deleteLogsFromTable(), and updateTableEntries().
long alma::acs::logging::table::LogTableDataModel::timeFrame = 0 [private] |
The time frame of the logs to keep in cache This limit is not for the buffer but for the timeframe of the whole cache A value of 0 means unlimited
Referenced by checkTimeFrame(), and setTimeFrame().
1.6.2