Classes | Public Member Functions | Public Attributes

alma.acs.logging.archive.zoom.FilesManager Class Reference

List of all members.

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

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

Constructor

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

References alma.acs.logging.archive.zoom.FilesManager.filesFolder.


Member Function Documentation

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

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

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.

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

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

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().


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties