org.rhq.core.clientapi.server.content
Class ContentServiceResponse

java.lang.Object
  extended by org.rhq.core.clientapi.server.content.ContentServiceResponse
All Implemented Interfaces:
Serializable

public class ContentServiceResponse
extends Object
implements Serializable

Server/agent communications object to convey the result of a request for a content subsystem operation.

See Also:
Serialized Form

Constructor Summary
ContentServiceResponse(int requestId)
          Convenience constructor for a response that conveys a success.
ContentServiceResponse(int requestId, String errorMessage)
          Convenience constructor for a response that conveys an error.
ContentServiceResponse(int requestId, Throwable error)
          Convenience constructor for a response that conveys an error.
 
Method Summary
 String getErrorMessage()
           
 int getRequestId()
           
 ContentRequestStatus getStatus()
           
 void setErrorMessage(String errorMessage)
           
 void setErrorMessageFromThrowable(Throwable t)
          Convienence method that sets the error message to the given throwable's stack trace dump.
 void setRequestId(int requestId)
           
 void setStatus(ContentRequestStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentServiceResponse

public ContentServiceResponse(int requestId)
Convenience constructor for a response that conveys a success. The status will be set to successful.

Parameters:
requestId - ID of the original request

ContentServiceResponse

public ContentServiceResponse(int requestId,
                              String errorMessage)
Convenience constructor for a response that conveys an error. The status will be set to error and the message will be captured.

Parameters:
requestId - request the response applies to
errorMessage - message of the error encountered

ContentServiceResponse

public ContentServiceResponse(int requestId,
                              Throwable error)
Convenience constructor for a response that conveys an error. The status will be set to error and the message will be that of the exception's stack trace.

Parameters:
requestId - request the response applies to
error - exception that occurred
Method Detail

getRequestId

public int getRequestId()

setRequestId

public void setRequestId(int requestId)

getStatus

public ContentRequestStatus getStatus()

setStatus

public void setStatus(ContentRequestStatus status)

getErrorMessage

public String getErrorMessage()

setErrorMessage

public void setErrorMessage(String errorMessage)

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)


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