SunTM's XACML Implementation for JavaTM

com.sun.xacml.ctx
Class ResponseCtx

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

public class ResponseCtx
extends Object

Represents the response to a request made to the XACML PDP.

Since:
1.0

Constructor Summary
ResponseCtx(Result result)
          Constructor that creates a new ResponseCtx with only a single Result (a common case).
ResponseCtx(Set results)
          Constructor that creates a new ResponseCtx with a Set of Results.
 
Method Summary
 void encode(OutputStream output)
          Encodes this context into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(OutputStream output, Indenter indenter)
          Encodes this context into its XML representation and writes this encoding to the given OutputStream with indentation.
static ResponseCtx getInstance(InputStream input)
          Creates a new ResponseCtx by parsing XML from an input stream.
static ResponseCtx getInstance(Node root)
          Creates a new instance of ResponseCtx based on the given DOM root node.
 Set getResults()
          Get the set of Results from this response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseCtx

public ResponseCtx(Result result)
Constructor that creates a new ResponseCtx with only a single Result (a common case).

Parameters:
result - the single result in the response

ResponseCtx

public ResponseCtx(Set results)
Constructor that creates a new ResponseCtx with a Set of Results. The Set must be non-empty.

Parameters:
results - a Set of Result objects
Method Detail

getInstance

public static ResponseCtx getInstance(Node root)
                               throws ParsingException
Creates a new instance of ResponseCtx based on the given DOM root node. A ParsingException is thrown if the DOM root doesn't represent a valid ResponseType.

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

getInstance

public static ResponseCtx getInstance(InputStream input)
                               throws ParsingException
Creates a new ResponseCtx by parsing XML from an input stream. Note that this is a convenience method, and it will not do schema validation by default. You should be parsing the data yourself, and then providing the root node to the other getInstance method. If you use this convenience method, you probably want to turn on validation by setting the context schema file (see the programmer guide for more information on this).

Parameters:
input - a stream providing the XML data
Returns:
a new ResponseCtx
Throws:
ParserException - if there is an error parsing the input
ParsingException

getResults

public Set getResults()
Get the set of Results from this response.

Returns:
a Set of results

encode

public void encode(OutputStream output)
Encodes this context 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 context 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.