Classes | |
class | FileNameFilter |
class | ProgressListener |
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 |
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
Current version bases the selection of the files on the requested interval and the timestamp in the name of the files i.e. there is a chance to miss logs.
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.
alma.acs.logging.archive.zoom.FilesManager.FilesManager | ( | String | folder | ) | throws ZoomException |
Constructor
folder | The folder containing files of logs |
ZoomException |
References alma.acs.logging.archive.zoom.FilesManager.filesFolder.
File [] alma.acs.logging.archive.zoom.FilesManager.getFileList | ( | long | start, | |
long | end | |||
) |
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
start | The start date of the XML file (0 means unbounded) | |
end | The end date of the file |
null
means that an error happened during I/O References alma.acs.logging.archive.zoom.FilesManager.filesFolder.
Referenced by alma.acs.logging.archive.zoom.FilesManager.getLogs(), and alma.acs.logging.archive.zoom.FilesManager.isOperational().
boolean alma.acs.logging.archive.zoom.FilesManager.getLogs | ( | String | startDate, | |
String | endDate, | |||
ACSRemoteLogListener | logListener, | |||
LogTypeHelper | minLevel, | |||
LogTypeHelper | maxLevel, | |||
ZoomProgressListener | zoomListener, | |||
ACSRemoteErrorListener | errorListener | |||
) | throws FileNotFoundException, ZoomException |
Get logs from files.
startDate | The start date of the loading (ISO format); if null the start date is not limited (i.e. the start date will be that of the first available log in the files) | |
endDate | The end date of the loading (ISO format); if null the current time is used | |
logListener | The listener to send logs to | |
minLevel | The min log level of logs to read from files (inclusive); if null , the lowest level (TRACE ) is used | |
maxLevel | The max log level of logs to read from files (inclusive); if null , the highest log level (EMERGENCY ) is used | |
zoomListener | The listener for monitoring the activity of the zoom engine. It can be null . | |
errorListener | The listener to be notified about logs that was not possible to parse |
false
in case of errors, false
otherwise.References alma.acs.logging.archive.zoom.FilesManager.getFileList(), and alma.acs.logging.archive.zoom.FilesManager.stopLoading().
Referenced by alma.acs.logging.archive.zoom.ZoomManager.zoom().
boolean alma.acs.logging.archive.zoom.FilesManager.isOperational | ( | ) |
Return true
if the file manager is operative i.e. if:
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.
true
if the file manager is operative References alma.acs.logging.archive.zoom.FilesManager.filesFolder, and alma.acs.logging.archive.zoom.FilesManager.getFileList().
Referenced by alma.acs.logging.archive.zoom.ZoomManager.isAvailable().
void alma.acs.logging.archive.zoom.FilesManager.stopLoading | ( | ) |
Stop loading logs.
stopLoading
does nothing if no load is in progress.
Referenced by alma.acs.logging.archive.zoom.FilesManager.getLogs().
The folder containing XML files of logs written by ARCHIVE
Referenced by alma.acs.logging.archive.zoom.FilesManager.FilesManager(), alma.acs.logging.archive.zoom.FilesManager.getFileList(), alma.acs.logging.archive.zoom.ZoomManager.getRepository(), and alma.acs.logging.archive.zoom.FilesManager.isOperational().