public class ZoomManager
extends java.lang.Object
A ZoomManager objects is the entity that perform the zooming
by delegating to other classes of the zoom package.
The min and max levels, if not passed in the constructor, are initialized from java properties and if those properties does not exist from default values.
Note: only one loading operation is possible at the same time.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FILES_LOCATION_PROPERTY_NAME
The name of the property containing the folder where ARCHIVES writes
files into.
|
static java.lang.String |
MAX_LEVEL_PROPERTY_NAME
The name of the property of the min log level of the zoom
|
static java.lang.String |
MIN_LEVEL_PROPERTY_NAME
The name of the property of the min log level of the zoom
|
| Constructor and Description |
|---|
ZoomManager()
Constructor.
|
ZoomManager(java.lang.String folder,
LogTypeHelper min,
LogTypeHelper max)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
LogTypeHelper |
getMaxLevel() |
LogTypeHelper |
getMinLevel() |
java.lang.String |
getRepository()
Return the path of the folder containing XML log files.
|
boolean |
isAvailable()
Check if the zoom feature is available.
|
boolean |
isLoadingLogs()
Return
true if a loading is in progress. |
void |
setFilesRepository(java.lang.String folder)
Set the folder to read XML files of logs from.
|
void |
setLevels(LogTypeHelper min,
LogTypeHelper max)
Set the levels of the logs to read while zooming
|
void |
stopZoom()
Interrupt the zoom.
|
void |
zoom(java.lang.String startDate,
java.lang.String endDate,
ACSRemoteLogListener logListener,
ZoomProgressListener zoomListener,
ACSRemoteErrorListener errorListener)
Load the logs.
|
public static final java.lang.String MIN_LEVEL_PROPERTY_NAME
public static final java.lang.String MAX_LEVEL_PROPERTY_NAME
public static final java.lang.String FILES_LOCATION_PROPERTY_NAME
Note: this way of getting the folder could change in further releases.
public ZoomManager()
The folder is retrieved from a java property and the levels are set to defaults.
FilesManager}public ZoomManager(java.lang.String folder,
LogTypeHelper min,
LogTypeHelper max)
throws ZoomException
folder - The folder with XML files of logsmin - The min log level of logs to readmax - The max log level of logs to readZoomException - If the folder or the levels are invalidpublic boolean isAvailable()
The zoom is available if the files manager and the levels are valid. In particular, the files manager must have a valid folder with a valid set of XML files. The folder is valid if there are XML files to read.
true if the zoom is available; false otherwise.public void setFilesRepository(java.lang.String folder)
throws ZoomException
folder - The folder of XML files of logsZoomException - If the folder is invalid.public void setLevels(LogTypeHelper min, LogTypeHelper max)
min - The minimum log level (can be null)max - The max log level (must be greater then the min;
can't be null)public java.lang.String getRepository()
If the folder is invalid
null if no folder (or an invalid one) is in usepublic LogTypeHelper getMinLevel()
public LogTypeHelper getMaxLevel()
public void zoom(java.lang.String startDate,
java.lang.String endDate,
ACSRemoteLogListener logListener,
ZoomProgressListener zoomListener,
ACSRemoteErrorListener errorListener)
throws java.io.FileNotFoundException,
ZoomException
java.io.FileNotFoundExceptionZoomExceptionFilesManager}public boolean isLoadingLogs()
true if a loading is in progress.true if a loading is in progresspublic void stopZoom()
The method does nothing if no zoom is currently in progress.