Public Member Functions | |
FilesManager (String folder) throws ZoomException | |
boolean | getLogs (String startDate, String endDate, ACSRemoteLogListener logListener, LogTypeHelper minLevel, LogTypeHelper maxLevel, ZoomProgressListener zoomListener, ACSRemoteErrorListener errorListener) throws FileNotFoundException, ZoomException |
File[] | getFileList (long start, long end) |
boolean | isOperational () |
void | stopLoading () |
Public Attributes | |
final String | filesFolder |
Private Member Functions | |
String | checkFolderOfFiles (String folder) throws ZoomException |
Private Attributes | |
IsoDateFormat | dateFormat = new IsoDateFormat() |
volatile boolean | stopLoading |
FileHelper | fileHelper = null |
FilesManager
organizes the files for the zooming: The folder to access files in this version is read from a java property. In future releases it could be read out of the CDB.
Implementation note: To reduce memory usage, objects of this class do not read the list of files in the folder until a request of loading is issued.
File names have the following format: logOutput<StartDate>--<EndDate>.xml
ARCHIVE does not ensure that the logs in a file are only those having the timestamp between the start and the end date in the name of the file. This means that
This has been agreed with ARCHIVE. They claim that there is a constant to tune in the CDB that should avoid this problem. See http://almasw.hq.eso.org/almasw/bin/view/Archive/ArchiveEightDotZero for further details.
|
Constructor
|
|
Check if the folder where ARCHIVE writes files into is valid and points to a readable directory.
|
|
Get the XML files of logs between the start and the end date (in msec as defined in Date). TODO: use a better heuristic here instead of plain starts/end dates
|
|
Get logs from files.
|
|
Return
The folder of files is checked when the object is created too. However someone from outside could have deleted, renamed or changed the accessing properties of the folder. Note: this method could be slow if the folder contains a big number of files.
|
|
Stop loading logs.
|
|
The date format to read ISO dates |
|
The file where the manager is reading logs |
|
The folder containing XML files of logs written by ARCHIVE |
|
Signal that the loading must be interrupted. |