|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.util.updater.DeploymentsMetadata
public class DeploymentsMetadata
This loads and stores metadata about installs of a particular bundle deployment.
| Field Summary | |
|---|---|
static String |
BACKUP_DIR
|
static String |
CURRENT_DEPLOYMENT_FILE
|
static String |
DEPLOYMENT_FILE
|
static String |
EXT_BACKUP_DIR
|
static String |
HASHCODES_FILE
|
static String |
METADATA_DIR
|
static String |
PREVIOUS_DEPLOYMENT_FILE
|
| Constructor Summary | |
|---|---|
DeploymentsMetadata(File rootDirectory)
Creates the metadata object given the root directory where the bundle deployment is installed. |
|
| Method Summary | |
|---|---|
FileHashcodeMap |
getCurrentDeploymentFileHashcodes()
Returns the files and their hashcodes for the current deployment. |
DeploymentProperties |
getCurrentDeploymentProperties()
Returns information about the current deployment. |
File |
getDeploymentBackupDirectory(int deploymentId)
Returns a metadata directory that is appropriate to place backup files for the deployment. |
Map<String,File> |
getDeploymentExternalBackupDirectoriesForWindows(int deploymentId)
Returns all the metadata directories that contain backup files for external directories (i.e. |
File |
getDeploymentExternalBackupDirectory(int deploymentId)
Returns a metadata directory that is appropriate to place backup files for the deployment. |
FileHashcodeMap |
getDeploymentFileHashcodes(int deploymentId)
Returns the files and their hashcodes for the given deployment. |
DeploymentProperties |
getDeploymentProperties(int deploymentId)
Returns information about the deployment with the given ID. |
String |
getExternalBackupDirectoryNameForWindows(String driveLetter)
Given a Windows drive letter, this will return the name of the external backup directory where all backups for external files should be copied to. |
File |
getMetadataDirectory()
|
File |
getMetadataDirectoryOnlyIfExists()
Same as getMetadataDirectory(), however, if the directory doesn't exist, an exception is thrown. |
DeploymentProperties |
getPreviousDeploymentProperties(int deploymentId)
Returns information about the previous deployment given a specific deployment ID. |
File |
getRootDirectory()
|
boolean |
isManaged()
If this object's getRootDirectory() refers to a directory containing managed deployments,
this returns true. |
void |
setCurrentDeployment(DeploymentProperties deploymentProps,
FileHashcodeMap fileHashcodeMap,
boolean rememberPrevious)
Call this when you already know the properties, and files/hashcodes for the current live deployment. |
FileHashcodeMap |
snapshotLiveDeployment(DeploymentProperties deploymentProps,
Pattern ignoreRegex,
Set<String> ignored)
Looks at the live deployment and takes a snapshot of it and stores its metadata in its appropriate deployment metadata directory. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String METADATA_DIR
public static final String CURRENT_DEPLOYMENT_FILE
public static final String PREVIOUS_DEPLOYMENT_FILE
public static final String DEPLOYMENT_FILE
public static final String HASHCODES_FILE
public static final String BACKUP_DIR
public static final String EXT_BACKUP_DIR
| Constructor Detail |
|---|
public DeploymentsMetadata(File rootDirectory)
rootDirectory - the location where the bundle deployments will go and where the metadata directory is located| Method Detail |
|---|
public String toString()
toString in class Objectpublic File getRootDirectory()
public boolean isManaged()
getRootDirectory() refers to a directory containing managed deployments,
this returns true. If that root location is not managed, false is returned.
public File getMetadataDirectory()
public File getMetadataDirectoryOnlyIfExists()
throws Exception
getMetadataDirectory(), however, if the directory doesn't exist, an exception is thrown.
Exception - if the directory does not exist
public DeploymentProperties getCurrentDeploymentProperties()
throws Exception
Exception - if could not determine the current deployment
public DeploymentProperties getDeploymentProperties(int deploymentId)
throws Exception
id - identifies which deployment the caller wants information on
Exception - if could not find the deployment information
public DeploymentProperties getPreviousDeploymentProperties(int deploymentId)
throws Exception
id - identifies which deployment whose previous deployment props are to be returned
null if there was no previous deployment
Exception - if could not load the previous deployment information or the given deployment ID is invalid
public FileHashcodeMap getCurrentDeploymentFileHashcodes()
throws Exception
Exception
public FileHashcodeMap getDeploymentFileHashcodes(int deploymentId)
throws Exception
deploymentId - the ID of the deployment whose files/hashcodes are to be returned
Exception
public File getDeploymentBackupDirectory(int deploymentId)
throws Exception
deploymentId - the ID of the deployment whose backup directory is to be returned
Exception
public File getDeploymentExternalBackupDirectory(int deploymentId)
throws Exception
deploymentId - the ID of the deployment whose backup directory is to be returned
Exception
public Map<String,File> getDeploymentExternalBackupDirectoriesForWindows(int deploymentId)
throws Exception
null is returned.
deploymentId - the ID of the deployment whose backup directories are to be returned
Exceptionpublic String getExternalBackupDirectoryNameForWindows(String driveLetter)
external backup directory
to obtain the full path.
driveLetter -
public void setCurrentDeployment(DeploymentProperties deploymentProps,
FileHashcodeMap fileHashcodeMap,
boolean rememberPrevious)
throws Exception
rememberPrevious is true, this will take the previous
deployment information and backup that data - pass false if you merely want to update
the current deployment properties without affecting anything else, specifically the backed up
previous deployment data.
deploymentProps - identifies the deployment information for the live deploymentfileHashcodeMap - the files and their hashcodes of the current live deploymentrememberPrevious - if true, this will create a backup of the previous deployment data
Exception - if failed to write out the necessary metadata about the given live data information
public FileHashcodeMap snapshotLiveDeployment(DeploymentProperties deploymentProps,
Pattern ignoreRegex,
Set<String> ignored)
throws Exception
deploymentProps - identifies the deployment information for the live dataignoreRegex - the live files/directories to ignoreignored - a set that will contain those files/directories that were ignored while scanning the deployment
Exception - if failed to calculate and store the metadata
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||