com.sun.enterprise.v3.common
Class ActionReporter

java.lang.Object
  extended by org.glassfish.api.ActionReport
      extended by com.sun.enterprise.v3.common.ActionReporter
Direct Known Subclasses:
DoNothingActionReporter, HTMLActionReporter, JsonActionReporter, PlainTextActionReporter, PropsFileActionReporter, XMLActionReporter, XMLContentActionReporter

public abstract class ActionReporter
extends ActionReport

Superclass for common ActionReport extension.

Author:
Jerome Dochez

Nested Class Summary
 
Nested classes/interfaces inherited from class org.glassfish.api.ActionReport
ActionReport.ExitCode, ActionReport.MessagePart
 
Field Summary
protected  String actionDescription
           
protected  String contentType
           
protected static String EOL_MARKER
           
protected  Throwable exception
           
protected  ActionReport.ExitCode exitCode
           
protected  List<ActionReporter> subActions
           
protected  ActionReport.MessagePart topMessage
           
 
Constructor Summary
ActionReporter()
          Creates a new instance of HTMLActionReporter
 
Method Summary
 ActionReport addSubActionsReport()
           
 void appendMessage(String message)
           
 String getActionDescription()
           
 ActionReport.ExitCode getActionExitCode()
           
protected  void getCombinedMessages(ActionReporter aReport, StringBuilder sb)
          Returns combined messages.
 String getContentType()
          Returns the content type to be used in sending the response back to the client/caller.
 Throwable getFailureCause()
           
 String getMessage()
           
 List<ActionReporter> getSubActionsReport()
           
 ActionReport.MessagePart getTopMessagePart()
           
 boolean hasFailures()
           
 boolean hasSuccesses()
           
 boolean hasWarnings()
           
 boolean isFailure()
           
 boolean isSuccess()
           
 boolean isWarning()
           
 void setActionDescription(String message)
           
 void setActionExitCode(ActionReport.ExitCode exitCode)
           
 void setContentType(String s)
           
 void setFailure()
           
 void setFailureCause(Throwable t)
           
 void setMessage(InputStream in)
           
 void setMessage(String message)
           
 void setSuccess()
           
 void setWarning()
           
 
Methods inherited from class org.glassfish.api.ActionReport
failure, failure, getExtraProperties, getResultType, setExtraProperties, setResultType, writeReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

protected static final String EOL_MARKER
See Also:
Constant Field Values
Constructor Detail

ActionReporter

public ActionReporter()
Creates a new instance of HTMLActionReporter

Method Detail

setFailure

public void setFailure()

isFailure

public boolean isFailure()

setWarning

public void setWarning()

isWarning

public boolean isWarning()

isSuccess

public boolean isSuccess()

setSuccess

public void setSuccess()

setActionDescription

public void setActionDescription(String message)
Specified by:
setActionDescription in class ActionReport

getActionDescription

public String getActionDescription()

setFailureCause

public void setFailureCause(Throwable t)
Specified by:
setFailureCause in class ActionReport

getFailureCause

public Throwable getFailureCause()
Specified by:
getFailureCause in class ActionReport

getTopMessagePart

public ActionReport.MessagePart getTopMessagePart()
Specified by:
getTopMessagePart in class ActionReport

addSubActionsReport

public ActionReport addSubActionsReport()
Specified by:
addSubActionsReport in class ActionReport

getSubActionsReport

public List<ActionReporter> getSubActionsReport()
Specified by:
getSubActionsReport in class ActionReport

setActionExitCode

public void setActionExitCode(ActionReport.ExitCode exitCode)
Specified by:
setActionExitCode in class ActionReport

getActionExitCode

public ActionReport.ExitCode getActionExitCode()
Specified by:
getActionExitCode in class ActionReport

setMessage

public void setMessage(String message)
Specified by:
setMessage in class ActionReport

appendMessage

public void appendMessage(String message)
Specified by:
appendMessage in class ActionReport

getMessage

public String getMessage()
Specified by:
getMessage in class ActionReport

setMessage

public void setMessage(InputStream in)
Specified by:
setMessage in class ActionReport

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:
getContentType in class ActionReport
Returns:
content type to be used in formatting the command response to the client

setContentType

public void setContentType(String s)
Specified by:
setContentType in class ActionReport

getCombinedMessages

protected 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 instance
sb - StringBuilder instance that contains all the messages

hasSuccesses

public boolean hasSuccesses()
Specified by:
hasSuccesses in class ActionReport

hasWarnings

public boolean hasWarnings()
Specified by:
hasWarnings in class ActionReport

hasFailures

public boolean hasFailures()
Specified by:
hasFailures in class ActionReport


Copyright © 2012. All Rights Reserved.