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::FilesManager Class Reference

Collaboration diagram for alma::acs::logging::archive::zoom::FilesManager:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

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.

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::logging::archive::zoom::FilesManager::FilesManager String  folder  )  throws ZoomException [inline]
 

Constructor

Parameters:
folder The folder containing files of logs
Exceptions:
ZoomException 


Member Function Documentation

String alma::acs::logging::archive::zoom::FilesManager::checkFolderOfFiles String  folder  )  throws ZoomException [inline, private]
 

Check if the folder where ARCHIVE writes files into is valid and points to a readable directory.

Parameters:
folder The path of folder of log files
Returns:
The absolute path name of the folder of files;
Exceptions:
ZoomException In case the folder is not found or not readable

File [] alma::acs::logging::archive::zoom::FilesManager::getFileList long  start,
long  end
[inline]
 

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

Parameters:
start The start date of the XML file (0 means unbounded)
end The end date of the file
Returns:
A list of files with the given start and end dates in their names. The array can be empty if there are no files in the folder. A value of null means that an error happened during I/O

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 [inline]
 

Get logs from files.

Parameters:
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
Returns:
false in case of errors, false otherwise.
See also:
ACSRemoteLogListener

ZoomProgressListener

boolean alma::acs::logging::archive::zoom::FilesManager::isOperational  )  [inline]
 

Return true if the file manager is operative i.e. if:

  • the folder of files exists and is readable
  • the folder of files contains files of log suitable for zooming

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.

Returns:
true if the file manager is operative

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

Stop loading logs.

stopLoading does nothing if no load is in progress.


Member Data Documentation

IsoDateFormat alma::acs::logging::archive::zoom::FilesManager::dateFormat = new IsoDateFormat() [private]
 

The date format to read ISO dates

FileHelper alma::acs::logging::archive::zoom::FilesManager::fileHelper = null [private]
 

The file where the manager is reading logs

final String alma::acs::logging::archive::zoom::FilesManager::filesFolder
 

The folder containing XML files of logs written by ARCHIVE

volatile boolean alma::acs::logging::archive::zoom::FilesManager::stopLoading [private]
 

Signal that the loading must be interrupted.


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