

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 |
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.
| alma::acs::logging::archive::zoom::FileHelper::FileHelper | ( | File | inFile, | |
| long | start, | |||
| long | end, | |||
| LogTypeHelper | lowLvl, | |||
| LogTypeHelper | hiLvl | |||
| ) | throws ZoomException [inline] |
Constructor
| 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) |
| IOException | If the file is unreadable |
References endTime, inputFile, maxLogLevel, minLogLevel, and startTime.
| void alma::acs::logging::archive::zoom::FileHelper::errorReceived | ( | String | xml | ) | [inline] |
Implements com::cosylab::logging::engine::ACS::ACSRemoteErrorListener.
References errorParsingLogs, com::cosylab::logging::engine::ACS::ACSRemoteErrorListener::errorReceived(), and externalErrorListener.
| 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:
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.
| 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) |
false in case of errors loading logs; true otherwise| 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;:
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().
The end time of the logs to read from file
Referenced by FileHelper(), and setupFilters().
boolean alma::acs::logging::archive::zoom::FileHelper::errorParsingLogs = false [private] |
Remembers if there were error while parsing logs read from the file.
Referenced by errorReceived(), and 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.
Referenced by errorReceived(), and loadLogs().
final File alma::acs::logging::archive::zoom::FileHelper::inputFile [private] |
The file to read logs from
Referenced by FileHelper(), and loadLogs().
The helper to read logs from a file
Referenced by loadLogs(), and stopLoading().
| final LogTypeHelper alma::acs::logging::archive::zoom::FileHelper::maxLogLevel |
The max log level to read from the file (inclusive)
Referenced by FileHelper(), and setupFilters().
| final LogTypeHelper alma::acs::logging::archive::zoom::FileHelper::minLogLevel |
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().
1.6.2