Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.ctx
Class Status  view Status download Status.java

java.lang.Object
  extended bycom.sun.xacml.ctx.Status

public class Status
extends java.lang.Object

Represents the status data that is included in a ResultType. By default, the status is OK.

Since:
1.0

Field Summary
private  java.util.List code
           
private  StatusDetail detail
           
private  java.lang.String message
           
private static Status okStatus
           
static java.lang.String STATUS_MISSING_ATTRIBUTE
          Standard identifier for the MissingAttribute status
static java.lang.String STATUS_OK
          Standard identifier for the OK status
static java.lang.String STATUS_PROCESSING_ERROR
          Standard identifier for the ProcessingError status
static java.lang.String STATUS_SYNTAX_ERROR
          Standard identifier for the SyntaxError status
 
Constructor Summary
Status(java.util.List code)
          Constructor that takes only the status code.
Status(java.util.List code, java.lang.String message)
          Constructor that takes both the status code and a message to include with the status.
Status(java.util.List code, java.lang.String message, StatusDetail detail)
          Constructor that takes the status code, an optional message, and some detail to include with the status.
 
Method Summary
 void encode(java.io.OutputStream output)
          Encodes this status data into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(java.io.OutputStream output, com.sun.xacml.Indenter indenter)
          Encodes this status data into its XML representation and writes this encoding to the given OutputStream with indentation.
private  void encodeStatusCode(java.io.PrintStream out, com.sun.xacml.Indenter indenter, java.util.Iterator iterator)
          Encodes the object in XML
 java.util.List getCode()
          Returns the status code.
 StatusDetail getDetail()
          Returns the status detail or null if there is none.
static Status getInstance(org.w3c.dom.Node root)
          Creates a new instance of Status based on the given DOM root node.
 java.lang.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.
private static java.util.List parseStatusCode(org.w3c.dom.Node root)
          Private helper that parses the status code
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_OK

public static final java.lang.String STATUS_OK
Standard identifier for the OK status

See Also:
Constant Field Values

STATUS_MISSING_ATTRIBUTE

public static final java.lang.String STATUS_MISSING_ATTRIBUTE
Standard identifier for the MissingAttribute status

See Also:
Constant Field Values

STATUS_SYNTAX_ERROR

public static final java.lang.String STATUS_SYNTAX_ERROR
Standard identifier for the SyntaxError status

See Also:
Constant Field Values

STATUS_PROCESSING_ERROR

public static final java.lang.String STATUS_PROCESSING_ERROR
Standard identifier for the ProcessingError status

See Also:
Constant Field Values

code

private java.util.List code

message

private java.lang.String message

detail

private StatusDetail detail

okStatus

private static Status okStatus
Constructor Detail

Status

public Status(java.util.List code)
Constructor that takes only the status code.


Status

public Status(java.util.List code,
              java.lang.String message)
Constructor that takes both the status code and a message to include with the status.


Status

public Status(java.util.List code,
              java.lang.String message,
              StatusDetail detail)
       throws java.lang.IllegalArgumentException
Constructor that takes the status code, an optional message, and some detail to include with the status. Note that the specification explicitly says that a status code of OK, SyntaxError or ProcessingError may not appear with status detail, so an exception is thrown if one of these status codes is used and detail is included.

Method Detail

getCode

public java.util.List getCode()
Returns the status code.


getMessage

public java.lang.String getMessage()
Returns the status message or null if there is none.


getDetail

public StatusDetail getDetail()
Returns the status detail or null if there is none.


getOkInstance

public static Status getOkInstance()
Gets a Status instance that has the OK status and no other information. This is the default status data for all responses except Indeterminate ones.


getInstance

public static Status getInstance(org.w3c.dom.Node root)
                          throws com.sun.xacml.ParsingException
Creates a new instance of Status based on the given DOM root node. A ParsingException is thrown if the DOM root doesn't represent a valid StatusType.


parseStatusCode

private static java.util.List parseStatusCode(org.w3c.dom.Node root)
Private helper that parses the status code


encode

public void encode(java.io.OutputStream output)
Encodes this status data into its XML representation and writes this encoding to the given OutputStream with no indentation.


encode

public void encode(java.io.OutputStream output,
                   com.sun.xacml.Indenter indenter)
Encodes this status data into its XML representation and writes this encoding to the given OutputStream with indentation.


encodeStatusCode

private void encodeStatusCode(java.io.PrintStream out,
                              com.sun.xacml.Indenter indenter,
                              java.util.Iterator iterator)
Encodes the object in XML