org.rhq.enterprise.server.plugin.pc
Class ControlResults

java.lang.Object
  extended by org.rhq.enterprise.server.plugin.pc.ControlResults
All Implemented Interfaces:
Serializable

public class ControlResults
extends Object
implements Serializable

Represents the results of a control operation invocation that a server plugin component performed.

Author:
John Mazzitell
See Also:
Serialized Form

Constructor Summary
ControlResults()
           
 
Method Summary
 org.rhq.core.domain.configuration.Configuration getComplexResults()
          Returns the Configuration object that is used to contain all the complex data that resulted from the invocation.
 String getError()
          Returns the error message that describes why the invocation failed.
 boolean isSuccess()
          Indicates if the control operation invocation was a success.
 void setError(String errorMessage)
          If the invocation was a failure, call this method to mark it as such.
 void setError(Throwable exception)
          Convienence method to indicate a failure due to an exception.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlResults

public ControlResults()
Method Detail

isSuccess

public boolean isSuccess()
Indicates if the control operation invocation was a success. If this returns false, call getError() to get the error message describing the error.

Returns:
true if the invocation was a success; false on failure

getComplexResults

public org.rhq.core.domain.configuration.Configuration getComplexResults()
Returns the Configuration object that is used to contain all the complex data that resulted from the invocation. The returned object is not a copy, so you can use this object to populate the complex results.

Returns:
the object that will contain the complex results

getError

public String getError()
Returns the error message that describes why the invocation failed. If the invocation was a success, this will return a null.

Returns:
error message if invocation failed; null if success

setError

public void setError(String errorMessage)
If the invocation was a failure, call this method to mark it as such. The caller must provide a non-null error message.

Parameters:
errorMessage - error message describing the failure, must not be null

setError

public void setError(Throwable exception)
Convienence method to indicate a failure due to an exception.

Parameters:
exception - exception describing the failure, must not be null

toString

public String toString()
Overrides:
toString in class Object


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