public class Status extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Status(List code)
Constructor that takes only the status code.
|
Status(List code,
String message)
Constructor that takes both the status code and a message to include
with the status.
|
Status(List code,
String message,
StatusDetail detail)
Constructor that takes the status code, an optional message, and some
detail to include with the status.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(OutputStream output)
Encodes this status data into its XML representation and writes
this encoding to the given
OutputStream with no
indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this status data into its XML representation and writes
this encoding to the given
OutputStream with
indentation. |
boolean |
equals(Object obj) |
List |
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. |
int |
hashCode() |
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
public Status(List 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 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
detailIllegalArgumentException
- if detail is included for a status
code that doesn't allow detailpublic List 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 StatusTypeStatus
ParsingException
- if the node is invalidpublic void encode(OutputStream output)
OutputStream
with no
indentation.output
- a stream into which the XML-encoded data is writtenpublic void encode(OutputStream output, Indenter indenter)
OutputStream
with
indentation.output
- a stream into which the XML-encoded data is writtenindenter
- an object that creates indentation stringsCopyright © 2023 JBoss by Red Hat. All rights reserved.