org.wso2.balana.ctx.xacml2
Class RequestCtx

java.lang.Object
  extended by org.wso2.balana.ctx.AbstractRequestCtx
      extended by org.wso2.balana.ctx.xacml2.RequestCtx

public class RequestCtx
extends AbstractRequestCtx

Represents a XACML2 request made to the PDP. This is the class that contains all the data used to start a policy evaluation.

Since:
1.0
Author:
Seth Proctor, Marco Barreno

Field Summary
 
Fields inherited from class org.wso2.balana.ctx.AbstractRequestCtx
attributesSet, documentRoot, isSearch, xacmlVersion
 
Constructor Summary
RequestCtx(Set<Attributes> attributesSet, Node documentRoot)
          Constructor that creates a RequestCtx from components.
RequestCtx(Set<Attributes> attributesSet, Node documentRoot, int version)
          Constructor that creates a RequestCtx from components.
RequestCtx(Set<Attributes> attributesSet, Node documentRoot, Set<Subject> subjects, Set<Attribute> resource, Set<Attribute> action, Set<Attribute> environment, String resourceContent)
          Constructor that creates a RequestCtx from components.
RequestCtx(Set<Attributes> attributesSet, Node documentRoot, String resourceContent)
          Constructor that creates a RequestCtx from components.
RequestCtx(Set<Attributes> attributesSet, String resourceContent)
          Constructor that creates a RequestCtx from components.
RequestCtx(Set<Subject> subjects, Set<Attribute> resource, Set<Attribute> action, Set<Attribute> environment)
           
 
Method Summary
 void encode(OutputStream output)
          Encodes this AbstractRequestCtx into its XML representation and writes this encoding to the given OutputStream.
 void encode(OutputStream output, Indenter indenter)
          Encodes this AbstractRequestCtx into its XML representation and writes this encoding to the given OutputStream with indentation.
 Set getAction()
          Returns a Set containing Attribute objects.
 Node getDocumentRoot()
          Returns the root DOM node of the document used to create this object, or null if this object was created by hand (ie, not through the getInstance method) or if the root node was not provided to the constructor.
 Set getEnvironmentAttributes()
          Returns a Set containing Attribute objects.
static RequestCtx getInstance(Node root)
          Create a new RequestCtx by parsing a node.
 Set getResource()
          Returns a Set containing Attribute objects.
 Set getSubjects()
          Returns a Set containing Subject objects.
 
Methods inherited from class org.wso2.balana.ctx.AbstractRequestCtx
getAttributesSet, getXacmlVersion, isSearch, setSearch, setXacmlVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestCtx

public RequestCtx(Set<Attributes> attributesSet,
                  Node documentRoot)
Constructor that creates a RequestCtx from components.


RequestCtx

public RequestCtx(Set<Attributes> attributesSet,
                  Node documentRoot,
                  int version)
Constructor that creates a RequestCtx from components.

Parameters:
documentRoot - the root node of the DOM tree for this request
version - xacml version of the request

RequestCtx

public RequestCtx(Set<Attributes> attributesSet,
                  String resourceContent)
Constructor that creates a RequestCtx from components.

Parameters:
resourceContent - a text-encoded version of the content, suitable for including in the RequestType, including the root RequestContent node

RequestCtx

public RequestCtx(Set<Attributes> attributesSet,
                  Node documentRoot,
                  String resourceContent)
           throws IllegalArgumentException
Constructor that creates a RequestCtx from components.

Parameters:
attributesSet -
documentRoot - the root node of the DOM tree for this request
resourceContent - a text-encoded version of the content, suitable for including in the RequestType, including the root RequestContent node
Throws:
IllegalArgumentException - if the inputs are not well formed

RequestCtx

public RequestCtx(Set<Subject> subjects,
                  Set<Attribute> resource,
                  Set<Attribute> action,
                  Set<Attribute> environment)
           throws IllegalArgumentException
Parameters:
subjects -
resource -
action -
environment -
Throws:
IllegalArgumentException

RequestCtx

public RequestCtx(Set<Attributes> attributesSet,
                  Node documentRoot,
                  Set<Subject> subjects,
                  Set<Attribute> resource,
                  Set<Attribute> action,
                  Set<Attribute> environment,
                  String resourceContent)
           throws IllegalArgumentException
Constructor that creates a RequestCtx from components.

Parameters:
attributesSet -
documentRoot - the root node of the DOM tree for this request
resourceContent - a text-encoded version of the content, suitable for including in the RequestType, including the root RequestContent node
Throws:
IllegalArgumentException - if the inputs are not well formed
Method Detail

getInstance

public static RequestCtx getInstance(Node root)
                              throws ParsingException
Create a new RequestCtx by parsing a node. This node should be created by schema-verified parsing of an XML document.

Parameters:
root - the node to parse for the RequestCtx
Returns:
a new RequestCtx constructed by parsing
Throws:
ParsingException - if the DOM node is invalid

getSubjects

public Set getSubjects()
Returns a Set containing Subject objects.

Returns:
the request's subject attributes

getResource

public Set getResource()
Returns a Set containing Attribute objects.

Returns:
the request's resource attributes

getAction

public Set getAction()
Returns a Set containing Attribute objects.

Returns:
the request's action attributes

getEnvironmentAttributes

public Set getEnvironmentAttributes()
Returns a Set containing Attribute objects.

Returns:
the request's environment attributes

getDocumentRoot

public Node getDocumentRoot()
Returns the root DOM node of the document used to create this object, or null if this object was created by hand (ie, not through the getInstance method) or if the root node was not provided to the constructor.

Overrides:
getDocumentRoot in class AbstractRequestCtx
Returns:
the root DOM node or null

encode

public void encode(OutputStream output)
Encodes this AbstractRequestCtx into its XML representation and writes this encoding to the given OutputStream. No indentation is used.

Specified by:
encode in class AbstractRequestCtx
Parameters:
output - a stream into which the XML-encoded data is written

encode

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

Specified by:
encode in class AbstractRequestCtx
Parameters:
output - a stream into which the XML-encoded data is written
indenter - an object that creates indentation strings


Copyright © 2015 WSO2. All rights reserved.