|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.pluginapi.operation.OperationResult
public class OperationResult
An object that encapsulates the results of a single operation invocation. Since this class contains a
Configuration object
, it can be used to store complex results. However, if an operation
needs to only return a single string result, use the convenience constructor
OperationResult(String)
or the method setSimpleResult(String)
to pass in that simple
string value without the need to use the more complex Configuration
API.
Configuration
,
OperationFacet
Field Summary | |
---|---|
static String |
SIMPLE_OPERATION_RESULT_NAME
|
Constructor Summary | |
---|---|
OperationResult()
Constructor that builds an empty result. |
|
OperationResult(String simpleResult)
Convenience constructor that builds a result that contains a single, simple result string. |
Method Summary | |
---|---|
Configuration |
getComplexResults()
Returns the Configuration object that is used to contain all the complex data that resulted from an
operation invocation. |
String |
getErrorMessage()
Returns the plugin-specific error message for this operation, or null if the operation was successful. |
String |
getSimpleResult()
Gets the simple string result that was stored in this object. |
void |
setErrorMessage(String errorMessage)
Sets whether or not this operation was successful. |
void |
setSimpleResult(String simpleResult)
Use this method if an operation returned a simple string result. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SIMPLE_OPERATION_RESULT_NAME
Constructor Detail |
---|
public OperationResult()
getComplexResults()
to obtain the
Configuration
object in order to populate it with complex results returned by the operation. You are also
free to store a simple result by using setSimpleResult(String)
. Typically, you will normally want to
store either a simple result or a complex result, but not both (although technically you are not prohibited from
using both).
getComplexResults()
public OperationResult(String simpleResult)
getComplexResults()
to obtain the Configuration
object in order to populate it with
additional, complex results returned by the operation but, typically, callers that use this constructor only need
to store a single result string in the results.
simpleResult
- the single, simple result string to store in the results objectgetSimpleResult()
Method Detail |
---|
public String getSimpleResult()
OperationResult(String)
,
setSimpleResult(String)
public void setSimpleResult(String simpleResult)
getComplexResults()
object under the name
SIMPLE_OPERATION_RESULT_NAME
.
simpleResult
- a simple string resultpublic String getErrorMessage()
public void setErrorMessage(String errorMessage)
errorMessage
- a plugin specific error that indicates why this operation has failedpublic Configuration getComplexResults()
Configuration
object that is used to contain all the complex data that resulted from an
operation invocation. The returned object is not a copy, so you can use this object to populate the complex
results.
Note that this is the same object that will be populated by the convenience method
setSimpleResult(String)
.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |