|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.pluginapi.util.SnapshotReport
public class SnapshotReport
A common snapshot report that allows you to prepare a zip'ed file containing a snapshot of content belonging to a resource. This report contains a snapshot configuration, log and data files along with a customizable set of additional files. Users of this object can pick and choose which types of files to snapshot and filter the files of those types. This class can be subclassed if you wish to alter the way it collects and stores the snapshot content. For example, if the configuration is not stored as files, but instead stored in memory, you can subclass this to obtain the configuration by reading memory, writing that data to a temporary file and then having this class add that temporary file to the snapshot zip file.
Nested Class Summary | |
---|---|
protected static class |
SnapshotReport.RegexFilenameFilter
Filename filter that matches the filename if it matches a given regular expression. |
Field Summary | |
---|---|
static String |
PROP_ADDITIONAL_FILES_DIRECTORY
A config property whose value is a directory relative to the base directory where additional files are located. |
static String |
PROP_ADDITIONAL_FILES_LIST
The property name for the list of of additional files. |
static String |
PROP_ADDITIONAL_FILES_RECURSIVE
A config property whose value is the boolean flag to indicate if the snapshot should include files found in subdirectories of the additional files directory. |
static String |
PROP_ADDITIONAL_FILES_REGEX
A config property whose value is a regular expression that matches all additional files that are to be snapshotted. |
static String |
PROP_BASE_DIRECTORY
A config property whose value is the base directory where all config, logs and data files are under. |
static String |
PROP_CONFIG_DIRECTORY
A config property whose value is the directory relative to the base directory where the configuration files are located. |
static String |
PROP_CONFIG_RECURSIVE
A config property whose value is the boolean flag to indicate if the snapshot should include files found in subdirectories of the config directory. |
static String |
PROP_CONFIG_REGEX
A config property whose value is a regular expression that matches all config files that are to be snapshotted. |
static String |
PROP_DATA_DIRECTORY
A config property whose value is the directory relative to the base directory where the data files are located. |
static String |
PROP_DATA_RECURSIVE
A config property whose value is the boolean flag to indicate if the snapshot should include files found in subdirectories of the data directory. |
static String |
PROP_DATA_REGEX
A config property whose value is a regular expression that matches all data files that are to be snapshotted. |
static String |
PROP_LOG_DIRECTORY
A config property whose value is the directory relative to the base directory where the log files are located. |
static String |
PROP_LOG_RECURSIVE
A config property whose value is the boolean flag to indicate if the snapshot should include files found in subdirectories of the log directory. |
static String |
PROP_LOG_REGEX
A config property whose value is a regular expression that matches all log files that are to be snapshotted. |
static String |
PROP_REPORT_OUTPUT_DIRECTORY
Optional property that can be specified to define where to store the output snapshot report. |
static String |
PROP_SNAPSHOT_ADDITIONAL_FILES
A boolean config property that dictates if a snapshot of the additional files should be in the report. |
static String |
PROP_SNAPSHOT_CONFIG_FILES
A boolean config property that dictates if a snapshot of config files should be in the report. |
static String |
PROP_SNAPSHOT_DATA_FILES
A boolean config property that dictates if a snapshot of data files should be in the report. |
static String |
PROP_SNAPSHOT_LOG_FILES
A boolean config property that dictates if a snapshot of log files should be in the report. |
static String |
REPORT_CONFIG_DIRECTORY
The relative directory under the report where the config files can be found. |
static String |
REPORT_DATA_DIRECTORY
The relative directory under the report where the data files can be found. |
static String |
REPORT_LOG_DIRECTORY
The relative directory under the report where the log files can be found. |
Constructor Summary | |
---|---|
SnapshotReport(String name,
String description,
Configuration config)
|
Method Summary | |
---|---|
File |
generate()
|
protected Map<String,URL> |
getAdditionalFilesToSnapshot()
|
protected Map<String,URL> |
getAllFilesToSnapshot()
|
protected Map<String,URL> |
getConfigFilesToSnapshot()
|
protected Configuration |
getConfiguration()
|
protected Map<String,URL> |
getDataFilesToSnapshot()
|
protected String |
getDescription()
|
protected Map<String,URL> |
getLogFilesToSnapshot()
|
protected String |
getName()
|
protected File |
getSnapshotReportFile()
This only returns the file where the snapshot will be stored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REPORT_CONFIG_DIRECTORY
public static final String REPORT_LOG_DIRECTORY
public static final String REPORT_DATA_DIRECTORY
public static final String PROP_SNAPSHOT_CONFIG_FILES
public static final String PROP_CONFIG_DIRECTORY
public static final String PROP_CONFIG_REGEX
public static final String PROP_CONFIG_RECURSIVE
public static final String PROP_SNAPSHOT_LOG_FILES
public static final String PROP_LOG_DIRECTORY
public static final String PROP_LOG_REGEX
public static final String PROP_LOG_RECURSIVE
public static final String PROP_SNAPSHOT_DATA_FILES
public static final String PROP_DATA_DIRECTORY
public static final String PROP_DATA_REGEX
public static final String PROP_DATA_RECURSIVE
public static final String PROP_SNAPSHOT_ADDITIONAL_FILES
public static final String PROP_ADDITIONAL_FILES_LIST
public static final String PROP_ADDITIONAL_FILES_DIRECTORY
public static final String PROP_ADDITIONAL_FILES_REGEX
public static final String PROP_ADDITIONAL_FILES_RECURSIVE
public static final String PROP_BASE_DIRECTORY
public static final String PROP_REPORT_OUTPUT_DIRECTORY
Constructor Detail |
---|
public SnapshotReport(String name, String description, Configuration config)
Method Detail |
---|
public File generate() throws Exception
Exception
protected String getName()
protected String getDescription()
protected Configuration getConfiguration()
protected File getSnapshotReportFile() throws Exception
generate()
to get the full snapshot content.
Exception
- if the file could not be determined for some reasonprotected Map<String,URL> getAllFilesToSnapshot() throws Exception
Exception
protected Map<String,URL> getConfigFilesToSnapshot() throws Exception
Exception
protected Map<String,URL> getLogFilesToSnapshot() throws Exception
Exception
protected Map<String,URL> getDataFilesToSnapshot() throws Exception
Exception
protected Map<String,URL> getAdditionalFilesToSnapshot() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |