org.rhq.core.domain.bundle
Class BundleDeployment

java.lang.Object
  extended by org.rhq.core.domain.bundle.BundleDeployment
All Implemented Interfaces:
Serializable

public class BundleDeployment
extends Object
implements Serializable

Defines a set of configuration values that can be used to deploy a bundle version somewhere. Once set the configuration should not be changed. Also stores any other deployment settings to be applied to deployments using this def.

See Also:
Serialized Form

Field Summary
protected  String errorMessage
           
static String QUERY_FIND_ALL
           
static String QUERY_UPDATE_FOR_DESTINATION_REMOVE
           
static String QUERY_UPDATE_FOR_VERSION_REMOVE
           
protected  BundleDeploymentStatus status
           
protected  String subjectName
           
 
Constructor Summary
BundleDeployment()
           
BundleDeployment(BundleVersion bundleVersion, BundleDestination destination, String name)
           
 
Method Summary
 void addResourceDeployment(BundleResourceDeployment resourceDeployment)
           
 void addTag(Tag tag)
           
 boolean equals(Object obj)
           
 BundleVersion getBundleVersion()
           
 Configuration getConfiguration()
           
 long getCtime()
           
 String getDescription()
           
 BundleDestination getDestination()
           
 long getDuration()
          The duration of the configuration update request which simply is the difference between the #getCreatedTime() and the #getModifiedTime().
 String getErrorMessage()
          If not null, this is an error message (possibly a full stack trace) to indicate the overall error that occurred when the configuration update failed.
 int getId()
           
 long getMtime()
          The time that any part of this entity was updated in the database.
 String getName()
           
 Integer getReplacedBundleDeploymentId()
           
 List<BundleResourceDeployment> getResourceDeployments()
           
 BundleDeploymentStatus getStatus()
          The status of the request which indicates that the request is either still in progress, or it has completed and either succeeded or failed.
 String getSubjectName()
          For auditing purposes, this method tells you the username of the person that created the request.
 Set<Tag> getTags()
           
 int hashCode()
           
 boolean isLive()
           
 boolean removeTag(Tag tag)
           
 void setBundleVersion(BundleVersion bundleVersion)
           
 void setConfiguration(Configuration config)
           
 void setDescription(String description)
           
 void setDestination(BundleDestination destination)
           
 void setErrorMessage(String errorMessage)
          Calling this method with a non-null error message implies that the request's status is ConfigurationUpdateStatus.FAILURE.
 void setId(int id)
           
 void setLive(boolean isLive)
           
 void setMtime(long mtime)
           
 void setName(String name)
           
 void setReplacedBundleDeploymentId(Integer replacedBundleDeploymentId)
           
 void setResourceDeployments(List<BundleResourceDeployment> resourceDeployments)
           
 void setStatus(BundleDeploymentStatus status)
           
 void setSubjectName(String subjectName)
           
 void setTags(Set<Tag> tags)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_ALL

public static final String QUERY_FIND_ALL
See Also:
Constant Field Values

QUERY_UPDATE_FOR_DESTINATION_REMOVE

public static final String QUERY_UPDATE_FOR_DESTINATION_REMOVE
See Also:
Constant Field Values

QUERY_UPDATE_FOR_VERSION_REMOVE

public static final String QUERY_UPDATE_FOR_VERSION_REMOVE
See Also:
Constant Field Values

status

protected BundleDeploymentStatus status

errorMessage

protected String errorMessage

subjectName

protected String subjectName
Constructor Detail

BundleDeployment

public BundleDeployment()

BundleDeployment

public BundleDeployment(BundleVersion bundleVersion,
                        BundleDestination destination,
                        String name)
Method Detail

getId

public int getId()

setId

public void setId(int id)

getName

public String getName()

setName

public void setName(String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getCtime

public long getCtime()

getMtime

public long getMtime()
The time that any part of this entity was updated in the database.

Returns:
entity modified time

setMtime

public void setMtime(long mtime)

getStatus

public BundleDeploymentStatus getStatus()
The status of the request which indicates that the request is either still in progress, or it has completed and either succeeded or failed.

Returns:
the request status

setStatus

public void setStatus(BundleDeploymentStatus status)

getErrorMessage

public String getErrorMessage()
If not null, this is an error message (possibly a full stack trace) to indicate the overall error that occurred when the configuration update failed. This will normally be null unless the status indicates a BundleDeploymentStatus.FAILURE.

Returns:
overall error that occurred

setErrorMessage

public void setErrorMessage(String errorMessage)
Calling this method with a non-null error message implies that the request's status is ConfigurationUpdateStatus.FAILURE. The inverse is not true - that is, if you set the error message to null, the status is left as-is; it will not assume that a null error message means the status is successful.

Parameters:
errorMessage -

getSubjectName

public String getSubjectName()
For auditing purposes, this method tells you the username of the person that created the request. This is not a relationship to an actual Subject because we want to maintain the audit trail, even if a Subject has been deleted from the database.

Returns:
the actual name string of the submitter of the request

setSubjectName

public void setSubjectName(String subjectName)

isLive

public boolean isLive()

setLive

public void setLive(boolean isLive)

getDuration

public long getDuration()
The duration of the configuration update request which simply is the difference between the #getCreatedTime() and the #getModifiedTime(). If the request hasn't completed yet, this will be the difference between the current time and the created time.

Returns:
the duration of time that the request took or is taking to complete

getReplacedBundleDeploymentId

public Integer getReplacedBundleDeploymentId()
Returns:
The previously "live" BundleDeployment.

setReplacedBundleDeploymentId

public void setReplacedBundleDeploymentId(Integer replacedBundleDeploymentId)

getConfiguration

public Configuration getConfiguration()

setConfiguration

public void setConfiguration(Configuration config)

getBundleVersion

public BundleVersion getBundleVersion()

setBundleVersion

public void setBundleVersion(BundleVersion bundleVersion)

getDestination

public BundleDestination getDestination()

setDestination

public void setDestination(BundleDestination destination)

getResourceDeployments

public List<BundleResourceDeployment> getResourceDeployments()

setResourceDeployments

public void setResourceDeployments(List<BundleResourceDeployment> resourceDeployments)

addResourceDeployment

public void addResourceDeployment(BundleResourceDeployment resourceDeployment)

getTags

public Set<Tag> getTags()

setTags

public void setTags(Set<Tag> tags)

addTag

public void addTag(Tag tag)

removeTag

public boolean removeTag(Tag tag)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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