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

Inheritance diagram for alma::acs::logging::archive::zoom::FileHelper:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::archive::zoom::FileHelper:
Collaboration graph
[legend]

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

References endTime, inputFile, maxLogLevel, minLogLevel, and startTime.


Member Function Documentation

void alma::acs::logging::archive::zoom::FileHelper::errorReceived ( String  xml  )  [inline]
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

References errorParsingLogs, externalErrorListener, inputFile, ioHelper, alma::acs::logging::engine::io::IOHelper::loadLogs(), com::cosylab::logging::engine::LogMatcher::setFilters(), and setupFilters().

Referenced by alma::acs::logging::archive::zoom::FilesManager::getLogs(), alma::acs::jlog::test::zoom::FileHelperTest::testLoadAll(), alma::acs::jlog::test::zoom::FileHelperTest::testLoadFilterAll(), alma::acs::jlog::test::zoom::FileHelperTest::testLoadLevelRange(), and alma::acs::jlog::test::zoom::FileHelperTest::testLoadTimelRange().

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:

References com::cosylab::logging::engine::FiltersVector::addFilter(), endTime, maxLogLevel, minLogLevel, and startTime.

Referenced by loadLogs().

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

Stop loading logs.

stopLoading does nothing if no load is in progress.

References ioHelper, and alma::acs::logging::engine::io::IOHelper::stopIO().

Referenced by alma::acs::logging::archive::zoom::FilesManager::stopLoading().


Member Data Documentation

The end time of the logs to read from file

Referenced by FileHelper(), and setupFilters().

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

See also:
loadLogs(...)

Referenced by errorReceived(), and loadLogs().

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

Referenced by errorReceived(), and loadLogs().

The file to read logs from

Referenced by FileHelper(), and loadLogs().

The helper to read logs from a file

Referenced by loadLogs(), and stopLoading().

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

Referenced by FileHelper(), and setupFilters().

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

Referenced by FileHelper(), and setupFilters().

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

Referenced by FileHelper(), and setupFilters().


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

Generated by  doxygen 1.6.2