org.rhq.core.util.updater
Class DeploymentProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by org.rhq.core.util.updater.DeploymentProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class DeploymentProperties
extends Properties

Provides properties that define metadata about a deployment. Use the factory method loadFromFile(File) to load deployment properties files. Use saveToFile(File) to store deployment properties.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
DeploymentProperties()
          Creates an empty set of deployment properties.
DeploymentProperties(int deploymentId, String bundleName, String bundleVersion, String description)
          Convenience constructor whose parameters are all the required values that this object needs.
 
Method Summary
 String getBundleName()
           
 String getBundleVersion()
           
 int getDeploymentId()
          This returns a deployment ID that identifies a known deployment.
 String getDescription()
           
 boolean getManageRootDir()
           
 boolean isValid()
          Returns true if this object has everything required to define a valid deployment.
static DeploymentProperties loadFromFile(File file)
           
 void saveToFile(File file)
           
 void setBundleName(String name)
           
 void setBundleVersion(String version)
           
 void setDeploymentId(int id)
           
 void setDescription(String description)
           
 void setManageRootDir(boolean willManageRootDir)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeploymentProperties

public DeploymentProperties()
Creates an empty set of deployment properties. The caller must ensure valid deployment properties are set later.


DeploymentProperties

public DeploymentProperties(int deploymentId,
                            String bundleName,
                            String bundleVersion,
                            String description)
Convenience constructor whose parameters are all the required values that this object needs.

Parameters:
deploymentId - see getDeploymentId()
bundleName - see getBundleName()
bundleVersion - see getBundleVersion()
description - see getDescription()
Method Detail

loadFromFile

public static DeploymentProperties loadFromFile(File file)
                                         throws Exception
Throws:
Exception

isValid

public boolean isValid()
Returns true if this object has everything required to define a valid deployment.

Returns:
true if this is valid

saveToFile

public void saveToFile(File file)
                throws Exception
Throws:
Exception

getDeploymentId

public int getDeploymentId()
This returns a deployment ID that identifies a known deployment. If the deployment is not yet known (that is, its going to be a new deployment added to the system), this will typically return 0.

Returns:
an identifier that uniquely identifies this particular deployment.

setDeploymentId

public void setDeploymentId(int id)

getBundleName

public String getBundleName()
Returns:
the name of the bundle for this deployment

setBundleName

public void setBundleName(String name)

getBundleVersion

public String getBundleVersion()
Returns:
the version of the bundle for this deployment

setBundleVersion

public void setBundleVersion(String version)

getDescription

public String getDescription()
Returns:
the description of this deployment

setDescription

public void setDescription(String description)

getManageRootDir

public boolean getManageRootDir()
Returns:
the flag to indicate if the entire root directory content is to be managed. If there is no property, this method returns a default of true

setManageRootDir

public void setManageRootDir(boolean willManageRootDir)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.