Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::logging::client::cache::MultiFileTableRecord Class Reference

Collaboration diagram for com::cosylab::logging::client::cache::MultiFileTableRecord:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MultiFileTableRecord () throws LogCacheException
int getNumOfLogs ()
long getFileSize () throws IOException
void addLog (ILogEntry log, int key) throws LogCacheException
int getMinLogIdx ()
int getMaxLogIdx ()
ILogEntry getLog (Integer key) throws LogCacheException
void flushBuffer () throws LogCacheException
void deleteLog (Integer key) throws LogCacheException
void clear () throws LogCacheException
boolean isEmpty ()
Integer getFirstLog ()
Integer getLastLog ()
int getFirstLogs (int n, Collection< Integer > keys)
Set< Integer > keySet ()
void replaceLog (Integer key, ILogEntry log) throws LogCacheException

Private Attributes

LogBufferedFileCache lbfc
int minLogIdx
int maxLogIdx

Detailed Description

This class defines a data set providing information on a single LogBufferedFileCache object. Each time a new file is created we also create an instance of this class.

LogFileTableRecord objects are organized in a vector to form the log file table used to retrieve the logs according to the user's defined keyword.

Author:
mcomin


Constructor & Destructor Documentation

com::cosylab::logging::client::cache::MultiFileTableRecord::MultiFileTableRecord  )  throws LogCacheException [inline]
 

Build a new object

Exceptions:
LogCacheException 


Member Function Documentation

void com::cosylab::logging::client::cache::MultiFileTableRecord::addLog ILogEntry  log,
int  key
throws LogCacheException [inline]
 

Add a log to the cache and updates the max and min indexes

Parameters:
log The log to add to the cache
key The key of the new log
Exceptions:
LogCacheException If an error happens while adding the log

void com::cosylab::logging::client::cache::MultiFileTableRecord::clear  )  throws LogCacheException [inline]
 

Remove all the logs and free the resources by delegating to the LogBufferedFileCache

Exceptions:
<code>LogCacheException</code> in case of error clearing the buffer

void com::cosylab::logging::client::cache::MultiFileTableRecord::deleteLog Integer  key  )  throws LogCacheException [inline]
 

Delete the log with the given key

Parameters:
key The not null key of identifying the log
Exceptions:
<code>LogCacheException</code> in case of error deleting the log

void com::cosylab::logging::client::cache::MultiFileTableRecord::flushBuffer  )  throws LogCacheException [inline]
 

Flush the buffer on disk delegating to the LogBufferedFileCache

Exceptions:
LogCacheException In case of error flushing on disk

long com::cosylab::logging::client::cache::MultiFileTableRecord::getFileSize  )  throws IOException [inline]
 

return the size of the file on disk

Returns:
The size of the file
Exceptions:
IOException In case of error getting the size of the file

Integer com::cosylab::logging::client::cache::MultiFileTableRecord::getFirstLog  )  [inline]
 

Return the key of the first log in this record

Returns:
The key of the first log in this record
See also:
ILogMap

int com::cosylab::logging::client::cache::MultiFileTableRecord::getFirstLogs int  n,
Collection< Integer >  keys
[inline]
 

Append at most n keys from the first valid logs to the collection. First here means first in the FIFO policy.

The number of added keys can be less then n if the cache doesn't contain enough logs.

See also:
com.cosylab.logging.client.cache.ILogMap

Integer com::cosylab::logging::client::cache::MultiFileTableRecord::getLastLog  )  [inline]
 

Return the key of the last log in this record

Returns:
The key of the last log in this record
See also:
ILogMap

ILogEntry com::cosylab::logging::client::cache::MultiFileTableRecord::getLog Integer  key  )  throws LogCacheException [inline]
 

Return the log with the given key

Parameters:
key The not null key of identifying the log
Returns:
the log with the given key

int com::cosylab::logging::client::cache::MultiFileTableRecord::getMaxLogIdx  )  [inline]
 

Returns:
the maxLogIdx

int com::cosylab::logging::client::cache::MultiFileTableRecord::getMinLogIdx  )  [inline]
 

Returns:
the minLogIdx

int com::cosylab::logging::client::cache::MultiFileTableRecord::getNumOfLogs  )  [inline]
 

Returns:
The number of logs in this record

boolean com::cosylab::logging::client::cache::MultiFileTableRecord::isEmpty  )  [inline]
 

Returns:
true if the record contains no log

Set<Integer> com::cosylab::logging::client::cache::MultiFileTableRecord::keySet  )  [inline]
 

The keys in the map

Returns:
The key in the map
See also:
com.cosylab.logging.client.cache.ILogMap

void com::cosylab::logging::client::cache::MultiFileTableRecord::replaceLog Integer  key,
ILogEntry  log
throws LogCacheException [inline]
 

Replace the log with the given key

Parameters:
key The key of the log to replace
log The new log
See also:
com.cosylab.logging.client.cache.ILogMap


Member Data Documentation

LogBufferedFileCache com::cosylab::logging::client::cache::MultiFileTableRecord::lbfc [private]
 

int com::cosylab::logging::client::cache::MultiFileTableRecord::maxLogIdx [private]
 

int com::cosylab::logging::client::cache::MultiFileTableRecord::minLogIdx [private]
 

Minimum and maximum log keys stored in the LogBufferedFileCache These two numbers are used to locate a given log by its keyword.

NOTE: These numbers are updated only while adding logs i.e. if a log is deleted it can happen that is not in the record even if its key is in the range [minLogIdx,maxLogIdx]


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:13:05 2009 for ACS Java API by doxygen 1.3.8