|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.ctx.Status
public class Status
Represents the status data that is included in a ResultType. By default, the status is OK.
Field Summary | |
---|---|
static String |
STATUS_MISSING_ATTRIBUTE
Standard identifier for the MissingAttribute status |
static String |
STATUS_OK
Standard identifier for the OK status |
static String |
STATUS_PROCESSING_ERROR
Standard identifier for the ProcessingError status |
static String |
STATUS_SYNTAX_ERROR
Standard identifier for the SyntaxError status |
Constructor Summary | |
---|---|
Status(List<String> code)
Constructor that takes only the status code. |
|
Status(List<String> code,
String message,
StatusDetail detail)
Constructor that takes the status code, an optional message, and some detail to include with the status. |
|
Status(List code,
String message)
Constructor that takes both the status code and a message to include with the status. |
Method Summary | |
---|---|
String |
encode()
Encodes this Status into its XML form |
void |
encode(StringBuilder builder)
Encodes this Status into its XML form and writes this out to the provided
StringBuilder |
List<String> |
getCode()
Returns the status code. |
StatusDetail |
getDetail()
Returns the status detail or null if there is none. |
static Status |
getInstance(Node root)
Creates a new instance of Status based on the given DOM root node. |
String |
getMessage()
Returns the status message or null if there is none. |
static Status |
getOkInstance()
Gets a Status instance that has the OK status and no other information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STATUS_OK
public static final String STATUS_MISSING_ATTRIBUTE
public static final String STATUS_SYNTAX_ERROR
public static final String STATUS_PROCESSING_ERROR
Constructor Detail |
---|
public Status(List<String> code)
code
- a List
of String
codes, typically just one code, but
this may contain any number of minor codes after the first item in the list, which
is the major codepublic Status(List code, String message)
code
- a List
of String
codes, typically just one code, but
this may contain any number of minor codes after the first item in the list, which
is the major codemessage
- a message to include with the codepublic Status(List<String> code, String message, StatusDetail detail) throws IllegalArgumentException
code
- a List
of String
codes, typically just one code, but
this may contain any number of minor codes after the first item in the list, which
is the major codemessage
- a message to include with the code, or null if there should be no messagedetail
- the status detail to include, or null if there is no detail
IllegalArgumentException
- if detail is included for a status code that doesn't allow
detailMethod Detail |
---|
public List<String> getCode()
public String getMessage()
public StatusDetail getDetail()
StatusDetail
or nullpublic static Status getOkInstance()
Status
instance that has the OK status and no other information. This is
the default status data for all responses except Indeterminate ones.
STATUS_OK
public static Status getInstance(Node root) throws ParsingException
Status
based on the given DOM root node. A
ParsingException
is thrown if the DOM root doesn't represent a valid StatusType.
root
- the DOM root of a StatusType
Status
ParsingException
- if the node is invalidpublic String encode()
Status
into its XML form
String
public void encode(StringBuilder builder)
Status
into its XML form and writes this out to the provided
StringBuilder
- Parameters:
builder
- string stream into which the XML-encoded data is written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |