Class ActionReport

java.lang.Object
org.glassfish.api.ActionReport
All Implemented Interfaces:
Serializable

@Contract public abstract class ActionReport extends Object implements Serializable
An action report is an abstract class allowing any type of server side action like a service execution, a command execution to report on its execution to the originator of the action. Implementations of this interface should provide a good reporting experience based on the user's interface like a browser or a command line shell.
Author:
Jerome Dochez
See Also:
  • Constructor Details

    • ActionReport

      public ActionReport()
  • Method Details

    • setActionDescription

      public abstract void setActionDescription(String message)
    • setFailureCause

      public abstract void setFailureCause(Throwable t)
    • getFailureCause

      public abstract Throwable getFailureCause()
    • setMessage

      public abstract void setMessage(String message)
    • appendMessage

      public abstract void appendMessage(String message)
    • writeReport

      public abstract void writeReport(OutputStream os) throws IOException
      Throws:
      IOException
    • setMessage

      public abstract void setMessage(InputStream in)
    • getMessage

      public abstract String getMessage()
    • getTopMessagePart

      public abstract ActionReport.MessagePart getTopMessagePart()
    • addSubActionsReport

      public abstract ActionReport addSubActionsReport()
    • setActionExitCode

      public abstract void setActionExitCode(ActionReport.ExitCode exitCode)
    • getActionExitCode

      public abstract ActionReport.ExitCode getActionExitCode()
    • getContentType

      public abstract String getContentType()
    • setContentType

      public abstract void setContentType(String s)
    • getSubActionsReport

      public abstract List<? extends ActionReport> getSubActionsReport()
    • failure

      public final void failure(Logger logger, String message, Throwable e)
      Report a failure to the logger and ActionReport. This is more of a convenience to the caller.
    • failure

      public final void failure(Logger logger, String message)
      Short for failure(logger,message,null)
    • hasSuccesses

      public abstract boolean hasSuccesses()
      return true if the action report or a subaction report has ExitCode.SUCCESS.
    • hasWarnings

      public abstract boolean hasWarnings()
      return true if the action report or a subaction report has ExitCode.WARNING.
    • hasFailures

      public abstract boolean hasFailures()
      return true if the action report or a subaction report has ExitCode.FAILURE.
    • getExtraProperties

      public final Properties getExtraProperties()
    • setExtraProperties

      public void setExtraProperties(Properties properties)
    • getResultType

      public <T> T getResultType(Class<T> resultType)
      Gets a type that was set by the command implementation
      Parameters:
      resultType - the type requested
      Returns:
      the actual instance that was set
    • setResultType

      public <T> void setResultType(Class<T> resultType, T resultTypeInstance)
      Stores the supplies type and its instance. This is a way for the command implementation to pass information between Supplemental command(s) and the main command. For example, the Supplemental command for DeployCommand requires information on pay load, generated directories etc. In this case, the DeployCommand will be expected to set this information in, for example DeployResult, and set it in the ActionReport. The Supplemental Command will then retrieve the DeployResult for its use.
      Parameters:
      resultType - the type
      resultTypeInstance - the actual instance
    • findProperty

      public String findProperty(String key)
      Search in message parts properties then in extra properties and then in sub reports. Returns first occurrence of the key.