public class OperationResult extends Object
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| Modifier and Type | Field and Description |
|---|---|
static String |
SIMPLE_OPERATION_RESULT_NAME |
| Constructor and Description |
|---|
OperationResult()
Constructor that builds an empty result.
|
OperationResult(String simpleResult)
Convenience constructor that builds a result that contains a single, simple result string.
|
| Modifier and Type | Method and Description |
|---|---|
org.rhq.core.domain.configuration.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() |
public static final String SIMPLE_OPERATION_RESULT_NAME
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()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 org.rhq.core.domain.configuration.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).
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.