alma::acs::logging::table::LogTableDataModel Class Reference

Inheritance diagram for alma::acs::logging::table::LogTableDataModel:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::table::LogTableDataModel:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Extends the LogEntryTableModelBase adding I/O, deletion of logs and so on.

Author:
: Ales Pucelj (ales.pucelj@kgb.ijs.si)

Constructor & Destructor Documentation

alma::acs::logging::table::LogTableDataModel::LogTableDataModel ( LoggingClient  client  )  throws Exception [inline]

LCLogTableDataModel constructor comment. Gets updated logs.

References loggingClient.


Member Function Documentation

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

Parameters:
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.

Parameters:
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]
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

Returns:
The IOLogsHelper object

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

Returns:

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]
void alma::acs::logging::table::LogTableDataModel::loadFromURL (  )  [inline]
void alma::acs::logging::table::LogTableDataModel::saveFile ( String  fileName,
boolean  compress,
int  level 
) [inline, private]

Save the logs in a file

Parameters:
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]
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)

Parameters:
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)

Parameters:
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

Returns:
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.


Member Data Documentation

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().

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().

The time interval between 2 removal of logs from the table

Referenced by deleteLogsFromTable().

An object to load and save logs

Referenced by close(), getIOHelper(), and IOInProgress().

The LoggingClient that owns this table model

Referenced by deleteLogsFromTable(), getIOHelper(), loadFromFile(), loadFromURL(), and LogTableDataModel().

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().

The time to check for deletion.

The deletion is triggered by the calling of updateTableEntries() by LogEntryTableModelBase.TableUpdater.

Referenced by deleteLogsFromTable(), and updateTableEntries().

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().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2