Package com.sun.enterprise.admin.report
Class ActionReporter
- java.lang.Object
-
- org.glassfish.api.ActionReport
-
- com.sun.enterprise.admin.report.ActionReporter
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DoNothingActionReporter,HTMLActionReporter,JsonActionReporter,PlainTextActionReporter,PropsFileActionReporter,RestActionReporter,XMLActionReporter,XMLContentActionReporter
public abstract class ActionReporter extends ActionReport
Superclass for common ActionReport extension.- Author:
- Jerome Dochez
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.api.ActionReport
ActionReport.ExitCode, ActionReport.MessagePart
-
-
Field Summary
Fields Modifier and Type Field Description protected StringactionDescriptionprotected StringcontentTypestatic StringEOL_MARKERprotected Throwableexceptionprotected ActionReport.ExitCodeexitCodeprotected List<ActionReporter>subActionsprotected ActionReport.MessageParttopMessage
-
Constructor Summary
Constructors Constructor Description ActionReporter()Creates a new instance of HTMLActionReporter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionReportaddSubActionsReport()voidappendMessage(String message)StringgetActionDescription()ActionReport.ExitCodegetActionExitCode()voidgetCombinedMessages(ActionReporter aReport, StringBuilder sb)Returns combined messages.StringgetContentType()Returns the content type to be used in sending the response back to the client/caller.ThrowablegetFailureCause()StringgetMessage()List<ActionReporter>getSubActionsReport()ActionReport.MessagePartgetTopMessagePart()booleanhasFailures()return true if the action report or a subaction report has ExitCode.FAILURE.booleanhasSuccesses()return true if the action report or a subaction report has ExitCode.SUCCESS.booleanhasWarnings()return true if the action report or a subaction report has ExitCode.WARNING.booleanisFailure()booleanisSuccess()booleanisWarning()voidsetActionDescription(String message)voidsetActionExitCode(ActionReport.ExitCode exitCode)Sets the exit code for the report.voidsetContentType(String s)voidsetFailure()Sets the exit code of the report to failurevoidsetFailureCause(Throwable t)voidsetMessage(InputStream in)voidsetMessage(String message)voidsetSuccess()voidsetWarning()-
Methods inherited from class org.glassfish.api.ActionReport
failure, failure, findProperty, getExtraProperties, getResultType, setExtraProperties, setResultType, toString, writeReport
-
-
-
-
Field Detail
-
exception
protected Throwable exception
-
actionDescription
protected String actionDescription
-
subActions
protected List<ActionReporter> subActions
-
exitCode
protected ActionReport.ExitCode exitCode
-
topMessage
protected ActionReport.MessagePart topMessage
-
contentType
protected String contentType
-
EOL_MARKER
public static final String EOL_MARKER
- See Also:
- Constant Field Values
-
-
Method Detail
-
setFailure
public void setFailure()
Sets the exit code of the report to failure
-
isFailure
public boolean isFailure()
- Returns:
-
setWarning
public void setWarning()
-
isWarning
public boolean isWarning()
-
isSuccess
public boolean isSuccess()
-
setSuccess
public void setSuccess()
-
setActionDescription
public void setActionDescription(String message)
- Specified by:
setActionDescriptionin classActionReport
-
getActionDescription
public String getActionDescription()
-
setFailureCause
public void setFailureCause(Throwable t)
- Specified by:
setFailureCausein classActionReport
-
getFailureCause
public Throwable getFailureCause()
- Specified by:
getFailureCausein classActionReport
-
getTopMessagePart
public ActionReport.MessagePart getTopMessagePart()
- Specified by:
getTopMessagePartin classActionReport
-
addSubActionsReport
public ActionReport addSubActionsReport()
- Specified by:
addSubActionsReportin classActionReport
-
getSubActionsReport
public List<ActionReporter> getSubActionsReport()
- Specified by:
getSubActionsReportin classActionReport
-
setActionExitCode
public void setActionExitCode(ActionReport.ExitCode exitCode)
Description copied from class:ActionReportSets the exit code for the report. Note that subreports may have a different exitcode.- Specified by:
setActionExitCodein classActionReport
-
getActionExitCode
public ActionReport.ExitCode getActionExitCode()
- Specified by:
getActionExitCodein classActionReport
-
setMessage
public void setMessage(String message)
- Specified by:
setMessagein classActionReport
-
appendMessage
public void appendMessage(String message)
- Specified by:
appendMessagein classActionReport
-
getMessage
public String getMessage()
- Specified by:
getMessagein classActionReport
-
setMessage
public void setMessage(InputStream in)
- Specified by:
setMessagein classActionReport
-
getContentType
public String getContentType()
Returns the content type to be used in sending the response back to the client/caller.This is the default type. Specific subclasses of ActionReporter might override the method to return a different valid type.
- Specified by:
getContentTypein classActionReport- Returns:
- content type to be used in formatting the command response to the client
-
setContentType
public void setContentType(String s)
- Specified by:
setContentTypein classActionReport
-
getCombinedMessages
public void getCombinedMessages(ActionReporter aReport, StringBuilder sb)
Returns combined messages. Meant mainly for long running operations where some of the intermediate steps can go wrong, although overall operation succeeds. Does nothing if either of the arguments are null. The traversal visits the message of current reporter first. The various parts of the message are separated by EOL_MARKERs.Note: This method is a recursive implementation.
- Parameters:
aReport- a given (usually top-level) ActionReporter instancesb- StringBuilder instance that contains all the messages
-
hasSuccesses
public boolean hasSuccesses()
Description copied from class:ActionReportreturn true if the action report or a subaction report has ExitCode.SUCCESS.- Specified by:
hasSuccessesin classActionReport- Returns:
-
hasWarnings
public boolean hasWarnings()
Description copied from class:ActionReportreturn true if the action report or a subaction report has ExitCode.WARNING.- Specified by:
hasWarningsin classActionReport- Returns:
-
hasFailures
public boolean hasFailures()
Description copied from class:ActionReportreturn true if the action report or a subaction report has ExitCode.FAILURE.- Specified by:
hasFailuresin classActionReport- Returns:
-
-