com.ibm.websphere.management.cmdframework.provider
Class CommandResultImpl
- java.lang.Object
-
- com.ibm.websphere.management.cmdframework.provider.CommandResultImpl
-
- All Implemented Interfaces:
- CommandResult, java.io.Serializable
- Direct Known Subclasses:
- TaskCommandResultImpl
public class CommandResultImpl extends java.lang.Object implements CommandResult
Provide a basic implementation for CommandResult.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description CommandResultImpl()
-
Method Summary
Methods Modifier and Type Method and Description void
addWarnings(java.lang.String msg)
Adds a localized warning message.java.lang.Throwable
getException()
Gets the exception if the command execution failed.java.util.Collection
getMessages()
Gets warning messages if there is any.java.lang.Object
getResult()
Gets the result of the command execution if the execution is successful.boolean
isSuccessful()
Returns if the last command execution is successful or not.void
reset()
This method should be called first to fill in the execution result.void
setException(java.lang.Throwable thisThrowable)
Sets the exception for result if any exception is thrown.void
setResult(java.lang.Object obj)
Adds an object command execution result.java.lang.String
toString()
-
-
-
Method Detail
-
reset
public void reset()
This method should be called first to fill in the execution result.
-
isSuccessful
public boolean isSuccessful()
Description copied from interface:CommandResult
Returns if the last command execution is successful or not.- Specified by:
isSuccessful
in interfaceCommandResult
- Returns:
- true if command is executed successfully; false otherwise.
-
getMessages
public java.util.Collection getMessages()
Description copied from interface:CommandResult
Gets warning messages if there is any.- Specified by:
getMessages
in interfaceCommandResult
- Returns:
- a collection of messages.
-
getException
public java.lang.Throwable getException()
Description copied from interface:CommandResult
Gets the exception if the command execution failed. This returns null if the command is executed successfully.- Specified by:
getException
in interfaceCommandResult
- Returns:
- the exception thrown during the command execution.
-
getResult
public java.lang.Object getResult()
Description copied from interface:CommandResult
Gets the result of the command execution if the execution is successful. This method returns null if the command execution failed.- Specified by:
getResult
in interfaceCommandResult
- Returns:
- the result of the command execution.
-
setException
public void setException(java.lang.Throwable thisThrowable)
Sets the exception for result if any exception is thrown.
-
addWarnings
public void addWarnings(java.lang.String msg)
Adds a localized warning message.
-
setResult
public void setResult(java.lang.Object obj)
Adds an object command execution result. In most of cases, there should only be one object, but there might be multiple objects too.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-