SunTM's XACML Implementation for JavaTM

com.sun.xacml.ctx
Class Status

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

public class Status
extends Object

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

Since:
1.0

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 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.
 
Method Summary
 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.
 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.
 
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 String STATUS_OK
Standard identifier for the OK status

See Also:
Constant Field Values

STATUS_MISSING_ATTRIBUTE

public static final String STATUS_MISSING_ATTRIBUTE
Standard identifier for the MissingAttribute status

See Also:
Constant Field Values

STATUS_SYNTAX_ERROR

public static final String STATUS_SYNTAX_ERROR
Standard identifier for the SyntaxError status

See Also:
Constant Field Values

STATUS_PROCESSING_ERROR

public static final String STATUS_PROCESSING_ERROR
Standard identifier for the ProcessingError status

See Also:
Constant Field Values
Constructor Detail

Status

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

Parameters:
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 code

Status

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

Parameters:
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 code
message - a message to include with the code

Status

public Status(List code,
              String message,
              StatusDetail detail)
       throws 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.

Parameters:
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 code
message - a message to include with the code, or null if there should be no message
detail - the status detail to include, or null if there is no detail
Throws:
IllegalArgumentException - if detail is included for a status code that doesn't allow detail
Method Detail

getCode

public List getCode()
Returns the status code.

Returns:
the status code

getMessage

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

Returns:
the status message or null

getDetail

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

Returns:
a StatusDetail or null

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.

Returns:
an instance with STATUS_OK

getInstance

public static Status getInstance(Node root)
                          throws 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.

Parameters:
root - the DOM root of a StatusType
Returns:
a new Status
Throws:
ParsingException - if the node is invalid

encode

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

Parameters:
output - a stream into which the XML-encoded data is written

encode

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

Parameters:
output - a stream into which the XML-encoded data is written
indenter - an object that creates indentation strings

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.