com.ibm.websphere.management.cmdframework.provider

Class CommandResultImpl

  1. java.lang.Object
  2. extended bycom.ibm.websphere.management.cmdframework.provider.CommandResultImpl
All implemented interfaces:
CommandResult, java.io.Serializable
Direct known subclasses:
TaskCommandResultImpl

  1. public class CommandResultImpl
  2. extends java.lang.Object
  3. implements CommandResult
Provide a basic implementation for CommandResult.
See Also:
Serialized Form

Constructor Summary

Constructor and Description
CommandResultImpl()

Method Summary

Modifier and Type Method and Description
  1. void
addWarnings(java.lang.String msg)
Adds a localized warning message.
  1. java.lang.Throwable
getException()
  1. java.util.Collection
getMessages()
  1. java.lang.Object
getResult()
  1. boolean
isSuccessful()
  1. void
reset()
This method should be called first to fill in the execution result.
  1. void
setException(java.lang.Throwable thisThrowable)
Sets the exception for result if any exception is thrown.
  1. void
setResult(java.lang.Object obj)
Adds an object command execution result.
  1. java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

CommandResultImpl

  1. public CommandResultImpl()

Method Detail

reset

  1. public void reset()
This method should be called first to fill in the execution result.

isSuccessful

  1. public boolean isSuccessful()
Description copied from interface: CommandResult
Returns if the last command execution is successful or not.
Specified by:
Returns:
true if command is executed successfully; false otherwise.

getMessages

  1. public java.util.Collection getMessages( )
Description copied from interface: CommandResult
Gets warning messages if there is any.
Specified by:
getMessages in interface CommandResult
Returns:
a collection of messages.

getException

  1. 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:
Returns:
the exception thrown during the command execution.

getResult

  1. 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 interface CommandResult
Returns:
the result of the command execution.

setException

  1. public void setException(java.lang.Throwable thisThrowable)
Sets the exception for result if any exception is thrown.

addWarnings

  1. public void addWarnings(java.lang.String msg)
Adds a localized warning message.

setResult

  1. 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

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object