org.rhq.core.domain.resource
Class DeleteResourceHistory

java.lang.Object
  extended by org.rhq.core.domain.resource.DeleteResourceHistory

public class DeleteResourceHistory
extends Object

Describes one requests that a resource be deleted. The actual resource will be deleted by the plugin.


Field Summary
static String QUERY_DELETE_BY_RESOURCES
           
static String QUERY_FIND_BY_PARENT_RESOURCE_ID
           
static String QUERY_FIND_WITH_STATUS
           
 
Constructor Summary
DeleteResourceHistory()
           
DeleteResourceHistory(Resource resource, String subjectName)
          Creates a new history instance representing a request to delete the specified resource.
 
Method Summary
 boolean equals(Object obj)
           
 Date getCreatedDate()
           
 long getCreatedTime()
           
 long getDuration()
          The duration of the configuration update request which simply is the difference between the getCreatedTime() and the getLastModifiedTime().
 String getErrorMessage()
           
 int getId()
           
 Date getLastModifiedDate()
           
 long getLastModifiedTime()
           
 Resource getResource()
           
 DeleteResourceStatus getStatus()
           
 String getSubjectName()
           
 int hashCode()
           
 void setErrorMessage(String errorMessage)
          Calling this method with a non-null error message implies that the request's status is CreateResourceStatus.FAILURE.
 void setErrorMessageFromThrowable(Throwable t)
          Convienence method that sets the error message to the given throwable's stack trace dump.
 void setId(int id)
           
 void setResource(Resource resource)
           
 void setStatus(DeleteResourceStatus status)
           
 void setSubjectName(String subjectName)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_FIND_WITH_STATUS

public static final String QUERY_FIND_WITH_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_RESOURCE_ID

public static final String QUERY_FIND_BY_PARENT_RESOURCE_ID
See Also:
Constant Field Values

QUERY_DELETE_BY_RESOURCES

public static final String QUERY_DELETE_BY_RESOURCES
See Also:
Constant Field Values
Constructor Detail

DeleteResourceHistory

public DeleteResourceHistory()

DeleteResourceHistory

public DeleteResourceHistory(Resource resource,
                             String subjectName)
Creates a new history instance representing a request to delete the specified resource.

Parameters:
resource - being deleted
Method Detail

getId

public int getId()

setId

public void setId(int id)

getErrorMessage

public String getErrorMessage()

setErrorMessage

public void setErrorMessage(String errorMessage)
Calling this method with a non-null error message implies that the request's status is CreateResourceStatus.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 - description of the error

setErrorMessageFromThrowable

public void setErrorMessageFromThrowable(Throwable t)
Convienence method that sets the error message to the given throwable's stack trace dump. If the given throwable is null, the error message will be set to null as if passing null to setErrorMessage(String).

Parameters:
t - throwable whose message and stack trace will make up the error message (may be null)

getSubjectName

public String getSubjectName()

setSubjectName

public void setSubjectName(String subjectName)

getCreatedTime

public long getCreatedTime()

getCreatedDate

public Date getCreatedDate()

getLastModifiedTime

public long getLastModifiedTime()

getLastModifiedDate

public Date getLastModifiedDate()

getStatus

public DeleteResourceStatus getStatus()

setStatus

public void setStatus(DeleteResourceStatus status)

getResource

public Resource getResource()

setResource

public void setResource(Resource resource)

getDuration

public long getDuration()
The duration of the configuration update request which simply is the difference between the getCreatedTime() and the getLastModifiedTime(). 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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.