Package org.glassfish.api
Class ActionReport
java.lang.Object
org.glassfish.api.ActionReport
- All Implemented Interfaces:
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ActionReport
abstract void
appendMessage
(String message) final void
Short forfailure(logger,message,null)
final void
Report a failure to the logger andActionReport
.findProperty
(String key) Search in message parts properties then in extra properties and then in sub reports.abstract ActionReport.ExitCode
abstract String
final Properties
abstract Throwable
abstract String
<T> T
getResultType
(Class<T> resultType) Gets a type that was set by the command implementationabstract List<? extends ActionReport>
abstract ActionReport.MessagePart
abstract boolean
return true if the action report or a subaction report has ExitCode.FAILURE.abstract boolean
return true if the action report or a subaction report has ExitCode.SUCCESS.abstract boolean
return true if the action report or a subaction report has ExitCode.WARNING.abstract void
setActionDescription
(String message) abstract void
setActionExitCode
(ActionReport.ExitCode exitCode) abstract void
void
setExtraProperties
(Properties properties) abstract void
abstract void
abstract void
setMessage
(String message) <T> void
setResultType
(Class<T> resultType, T resultTypeInstance) Stores the supplies type and its instance.abstract void
-
Constructor Details
-
ActionReport
public ActionReport()
-
-
Method Details
-
setActionDescription
-
setFailureCause
-
getFailureCause
-
setMessage
-
appendMessage
-
writeReport
- Throws:
IOException
-
setMessage
-
getMessage
-
getTopMessagePart
-
addSubActionsReport
-
setActionExitCode
-
getActionExitCode
-
getContentType
-
setContentType
-
getSubActionsReport
-
failure
Report a failure to the logger andActionReport
. This is more of a convenience to the caller. -
failure
Short forfailure(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
-
setExtraProperties
-
getResultType
Gets a type that was set by the command implementation- Parameters:
resultType
- the type requested- Returns:
the actual instance that was set
-
setResultType
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 typeresultTypeInstance
- the actual instance
-
findProperty
Search in message parts properties then in extra properties and then in sub reports. Returns first occurrence of the key.
-