org.rhq.core.domain.content
Class ContentServiceRequest

java.lang.Object
  extended by org.rhq.core.domain.content.ContentServiceRequest
All Implemented Interfaces:
Serializable

public class ContentServiceRequest
extends Object
implements Serializable

Represents a user initiated request against an agent's content subsystem. This instance will be used to convey both the request parameters as well as any response values that are provided from the operation. Additionally, the state in this instance will indicate success or failure of the request. This object represents both the status of currently executing requests as well as providing a history of all previous requests for conetent subsystem operations.

See Also:
Serialized Form

Field Summary
static String QUERY_DELETE_BY_RESOURCES
           
static String QUERY_FIND_BY_ID
           
static String QUERY_FIND_BY_RESOURCE
           
static String QUERY_FIND_BY_RESOURCE_WITH_NOT_STATUS
           
static String QUERY_FIND_BY_RESOURCE_WITH_STATUS
           
static String QUERY_FIND_WITH_STATUS
           
 
Constructor Summary
ContentServiceRequest()
           
ContentServiceRequest(Resource resource, String subjectName, ContentRequestType contentRequestType)
           
 
Method Summary
 void addInstalledPackageHistory(InstalledPackageHistory installedPackage)
           
 boolean equals(Object obj)
           
 ContentRequestType getContentRequestType()
          Describes the type of service being tracked by this request.
 Date getCreatedDate()
           
 long getCreatedTime()
           
 long getCtime()
           
 long getDuration()
          The duration of the configuration update request which simply is the difference between the getCreatedTime() and the getLastModifiedTime().
 String getErrorMessage()
           
 int getId()
           
 Set<InstalledPackageHistory> getInstalledPackageHistory()
          Conveys which packages are being manipulated in this request.
 Date getLastModifiedDate()
           
 long getLastModifiedTime()
           
 String getNotes()
           
 Resource getResource()
           
 ContentRequestStatus getStatus()
           
 String getSubjectName()
           
 int hashCode()
           
 void setContentRequestType(ContentRequestType contentRequestType)
           
 void setErrorMessage(String errorMessage)
           
 void setErrorMessageFromThrowable(Throwable t)
          Convienence method that sets the error message to the given throwable's stack trace dump.
 void setId(int id)
           
 void setInstalledPackageHistory(Set<InstalledPackageHistory> installedPackageHistory)
           
 void setNotes(String notes)
           
 void setResource(Resource resource)
           
 void setStatus(ContentRequestStatus 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_RESOURCE_WITH_STATUS

public static final String QUERY_FIND_BY_RESOURCE_WITH_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_WITH_NOT_STATUS

public static final String QUERY_FIND_BY_RESOURCE_WITH_NOT_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE

public static final String QUERY_FIND_BY_RESOURCE
See Also:
Constant Field Values

QUERY_FIND_BY_ID

public static final String QUERY_FIND_BY_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

ContentServiceRequest

public ContentServiceRequest()

ContentServiceRequest

public ContentServiceRequest(Resource resource,
                             String subjectName,
                             ContentRequestType contentRequestType)
Method Detail

getId

public int getId()

setId

public void setId(int id)

getResource

public Resource getResource()

setResource

public void setResource(Resource resource)

getStatus

public ContentRequestStatus getStatus()

setStatus

public void setStatus(ContentRequestStatus status)

getErrorMessage

public String getErrorMessage()

setErrorMessage

public void setErrorMessage(String errorMessage)

getNotes

public String getNotes()

setNotes

public void setNotes(String notes)

getSubjectName

public String getSubjectName()

setSubjectName

public void setSubjectName(String subjectName)

getCtime

public long getCtime()

getCreatedTime

public long getCreatedTime()

getCreatedDate

public Date getCreatedDate()

getLastModifiedTime

public long getLastModifiedTime()

getLastModifiedDate

public Date getLastModifiedDate()

getContentRequestType

public ContentRequestType getContentRequestType()
Describes the type of service being tracked by this request.


setContentRequestType

public void setContentRequestType(ContentRequestType contentRequestType)

getInstalledPackageHistory

public Set<InstalledPackageHistory> getInstalledPackageHistory()
Conveys which packages are being manipulated in this request.


addInstalledPackageHistory

public void addInstalledPackageHistory(InstalledPackageHistory installedPackage)

setInstalledPackageHistory

public void setInstalledPackageHistory(Set<InstalledPackageHistory> installedPackageHistory)

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)

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.