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

alma::acs::logging::archive::zoom::FileHelper Class Reference

List of all members.

Public Member Functions

 FileHelper (File inFile, long start, long end, LogTypeHelper lowLvl, LogTypeHelper hiLvl) throws ZoomException
boolean loadLogs (ACSRemoteLogListener logListener, IOPorgressListener ioListener, ACSRemoteErrorListener errorListener) throws ZoomException, FileNotFoundException
Override void errorReceived (String xml)
void stopLoading ()

Public Attributes

final LogTypeHelper minLogLevel
final LogTypeHelper maxLogLevel
final long startTime
final long endTime

Private Member Functions

FiltersVector setupFilters () throws ZoomException

Private Attributes

final File inputFile
IOHelper ioHelper
boolean errorParsingLogs = false
ACSRemoteErrorListener externalErrorListener = null

Detailed Description

An helper glass to get logs from a file..

The class read a file with the help of IOHelper and adds a filter for the start and end dates and another one for the levels.

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::logging::archive::zoom::FileHelper::FileHelper File  inFile,
long  start,
long  end,
LogTypeHelper  lowLvl,
LogTypeHelper  hiLvl
throws ZoomException [inline]
 

Constructor

Parameters:
inFile The file to read logs from
start The start time (>=0)
end The ending time
lowlvl The lowest log level to read (inclusive)
hiLvl The highest level to read (inclusive)
Exceptions:
IOException If the file is unreadable


Member Function Documentation

Override void alma::acs::logging::archive::zoom::FileHelper::errorReceived String  xml  )  [inline]
 

See also:
com.cosylab.logging.engine.ACS.ACSRemoteErrorListener::errorReceived(java.lang.String)

boolean alma::acs::logging::archive::zoom::FileHelper::loadLogs ACSRemoteLogListener  logListener,
IOPorgressListener  ioListener,
ACSRemoteErrorListener  errorListener
throws ZoomException, FileNotFoundException [inline]
 

Load the logs for the file.

This method return errors in two ways:

  • with an exception when the error arise while setting up the file and the filters for loading while reading the file
  • returning false in case of errors parsing logs read from file

The error listener passed as parameter can be null. In fact the error listener gets the strings of the logs that returned an error while parsing. If the caller is not interested in those strings but only to know if there were parsing errors then it will be enough for the caller to check the value of the returned boolean.

Parameters:
logListener The listener of the logs read from the file
ioListener The listener for the progress of loading
errorListener The listener of errors parsing logs (can'be null)
Returns:
false in case of errors loading logs; true otherwise
Exceptions:
ZoomException In case of errors creating filters
FileNotFoundException If the file was not found

FiltersVector alma::acs::logging::archive::zoom::FileHelper::setupFilters  )  throws ZoomException [inline, private]
 

Create the filters for loading logs;:

  • time range
  • min and max log levels
Returns:

void alma::acs::logging::archive::zoom::FileHelper::stopLoading  )  [inline]
 

Stop loading logs.

stopLoading does nothing if no load is in progress.


Member Data Documentation

final long alma::acs::logging::archive::zoom::FileHelper::endTime
 

The end time of the logs to read from file

boolean alma::acs::logging::archive::zoom::FileHelper::errorParsingLogs = false [private]
 

Remembers if there were error while parsing logs read from the file.

See also:
loadLogs(...)

ACSRemoteErrorListener alma::acs::logging::archive::zoom::FileHelper::externalErrorListener = null [private]
 

While loading logs, the caller can set a listener for errors.

This is the lister that receives the string of an XML log that returned an error while parsing.

See also:
ACSRemoteErrorListener

final File alma::acs::logging::archive::zoom::FileHelper::inputFile [private]
 

The file to read logs from

IOHelper alma::acs::logging::archive::zoom::FileHelper::ioHelper [private]
 

The helper to read logs from a file

final LogTypeHelper alma::acs::logging::archive::zoom::FileHelper::maxLogLevel
 

The max log level to read from the file (inclusive)

final LogTypeHelper alma::acs::logging::archive::zoom::FileHelper::minLogLevel
 

The min log level to read from the file (inclusive)

final long alma::acs::logging::archive::zoom::FileHelper::startTime
 

The start time of the logs to read from file (>=0)


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