org.opensaml
Class SAMLAuthorizationDecisionQuery

java.lang.Object
  extended by org.opensaml.SAMLObject
      extended by org.opensaml.SAMLQuery
          extended by org.opensaml.SAMLSubjectQuery
              extended by org.opensaml.SAMLAuthorizationDecisionQuery
All Implemented Interfaces:
Cloneable

public class SAMLAuthorizationDecisionQuery
extends SAMLSubjectQuery
implements Cloneable

Represents a SAML AuthorizationDecisionQuery

Author:
Helen Rehn, Scott Cantor

Field Summary
protected  ArrayList actions
           
protected  ArrayList evidence
           
protected  String resource
           
 
Fields inherited from class org.opensaml.SAMLSubjectQuery
subject
 
Fields inherited from class org.opensaml.SAMLQuery
queryTypeMap
 
Fields inherited from class org.opensaml.SAMLObject
config, dirty, log, parentObject, root
 
Constructor Summary
SAMLAuthorizationDecisionQuery()
          Default constructor
SAMLAuthorizationDecisionQuery(Element e)
          Reconstructs a query from a DOM tree
SAMLAuthorizationDecisionQuery(InputStream in)
          Reconstructs a query from a stream
SAMLAuthorizationDecisionQuery(SAMLSubject subject, String resource, Collection actions, Collection evidence)
          Builds an AuthorizationDecisionQuery out of its component parts
 
Method Summary
 void addAction(SAMLAction action)
          Adds an action to the query
 void addEvidence(Object evidence)
          Adds an evidence element
protected  Element buildRoot(Document doc, boolean xmlns)
          Delegates the process of building the root element of an object and inserting appropriate namespaces.
 void checkValidity()
          Evaluates the object's content to see if it is currently valid if serialized.
 Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy
 void fromDOM(Element e)
          Initialization of an object from a DOM element
 Iterator getActions()
          Gets the actions inside the query
 Iterator getEvidence()
          Gets the evidence inside the query
 String getResource()
          Gets the resource URI inside the query
 void removeAction(int index)
          Removes an action by position (zero-based)
 void removeEvidence(int index)
          Removes an evidence element by position (zero-based)
 void setActions(Collection actions)
          Sets the actions to include in the query
 void setEvidence(Collection evidence)
          Sets the evidence to include in the query
 void setResource(String resource)
          Sets the resource URI inside the query
 Node toDOM(Document doc, boolean xmlns)
          Transforms the object into a DOM tree using an existing document context
 
Methods inherited from class org.opensaml.SAMLSubjectQuery
getSubject, setSubject
 
Methods inherited from class org.opensaml.SAMLQuery
getInstance, getInstance, regFactory, unregFactory
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, fromStream, getParent, plantRoot, setDirty, setParent, toBase64, toDOM, toDOM, toDOM, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resource

protected String resource

actions

protected ArrayList actions

evidence

protected ArrayList evidence
Constructor Detail

SAMLAuthorizationDecisionQuery

public SAMLAuthorizationDecisionQuery()
Default constructor


SAMLAuthorizationDecisionQuery

public SAMLAuthorizationDecisionQuery(SAMLSubject subject,
                                      String resource,
                                      Collection actions,
                                      Collection evidence)
                               throws SAMLException
Builds an AuthorizationDecisionQuery out of its component parts

Parameters:
subject - subject of the query
resource - URI of the resource being accessed at the time of the query
actions - specific actions being queried for, must contain SAMLAction objects
evidence - evidence which may be considered, must contain String or SAMLAssertion objects
Throws:
SAMLException - Raised if an AuthorizationDecisionQuery cannot be constructed from the supplied information

SAMLAuthorizationDecisionQuery

public SAMLAuthorizationDecisionQuery(Element e)
                               throws SAMLException
Reconstructs a query from a DOM tree

Parameters:
e - The root of a DOM tree
Throws:
SAMLException - Thrown if the object cannot be constructed

SAMLAuthorizationDecisionQuery

public SAMLAuthorizationDecisionQuery(InputStream in)
                               throws SAMLException
Reconstructs a query from a stream

Parameters:
in - A stream containing XML
Throws:
SAMLException - Raised if an exception occurs while constructing the object.
Method Detail

fromDOM

public void fromDOM(Element e)
             throws SAMLException
Description copied from class: SAMLObject
Initialization of an object from a DOM element

Overrides:
fromDOM in class SAMLSubjectQuery
Parameters:
e - Root element of a DOM tree
Throws:
SAMLException - Raised if an exception occurs while constructing the object
See Also:
SAMLObject.fromDOM(org.w3c.dom.Element)

getResource

public String getResource()
Gets the resource URI inside the query

Returns:
The resource URI

setResource

public void setResource(String resource)
Sets the resource URI inside the query

Parameters:
resource - The resource URI

getActions

public Iterator getActions()
Gets the actions inside the query

Returns:
An iterator over the actions

setActions

public void setActions(Collection actions)
                throws SAMLException
Sets the actions to include in the query

Parameters:
actions - The actions to include
Throws:
SAMLException - Raised if the actions are invalid

addAction

public void addAction(SAMLAction action)
               throws SAMLException
Adds an action to the query

Parameters:
action - The action to add
Throws:
SAMLException - Raised if the action if invalid

removeAction

public void removeAction(int index)
Removes an action by position (zero-based)

Parameters:
index - The position of the action to remove

getEvidence

public Iterator getEvidence()
Gets the evidence inside the query

Returns:
An iterator over the evidence

setEvidence

public void setEvidence(Collection evidence)
                 throws SAMLException
Sets the evidence to include in the query

Parameters:
evidence - The evidence to include
Throws:
SAMLException - Raised if the evidence is invalid

addEvidence

public void addEvidence(Object evidence)
                 throws SAMLException
Adds an evidence element

Parameters:
evidence - a String or SAMLAssertion
Throws:
SAMLException - Raised if an invalid kind of object is provided

removeEvidence

public void removeEvidence(int index)
                    throws IndexOutOfBoundsException
Removes an evidence element by position (zero-based)

Parameters:
index - The position of the element to remove
Throws:
IndexOutOfBoundsException

buildRoot

protected Element buildRoot(Document doc,
                            boolean xmlns)
Description copied from class: SAMLObject
Delegates the process of building the root element of an object and inserting appropriate namespaces.

Specified by:
buildRoot in class SAMLObject
Parameters:
doc - The document context to use
xmlns - Include namespace(s) on root element?
Returns:
A new root element for the object
See Also:
SAMLObject.buildRoot(org.w3c.dom.Document,boolean)

toDOM

public Node toDOM(Document doc,
                  boolean xmlns)
           throws SAMLException
Description copied from class: SAMLObject
Transforms the object into a DOM tree using an existing document context

Overrides:
toDOM in class SAMLSubjectQuery
Parameters:
doc - A Document object to use in manufacturing the tree
xmlns - Include namespace(s) on root element?
Returns:
Root element node of the DOM tree capturing the object
Throws:
SAMLException - Raised if the object is incompletely defined
See Also:
SAMLObject.toDOM(org.w3c.dom.Document,boolean)

checkValidity

public void checkValidity()
                   throws SAMLException
Description copied from class: SAMLObject
Evaluates the object's content to see if it is currently valid if serialized. Does not evaluate embedded objects except on the basis of whether they exist. For example, an Assertion must have a Statement, but if an invalid statement is added, SAMLAssertion.checkValidity() would succeed, while SAMLStatement.checkValidity would raise an exception.

Overrides:
checkValidity in class SAMLSubjectQuery
Throws:
SAMLException - Raised if the serialized object would be invalid SAML, excluding any embedded objects
See Also:
SAMLObject.checkValidity()

clone

public Object clone()
             throws CloneNotSupportedException
Copies a SAML object such that no dependencies exist between the original and the copy

Overrides:
clone in class SAMLSubjectQuery
Returns:
The new object
Throws:
CloneNotSupportedException
See Also:
Object.clone()


Copyright ? 2005 UCAID. All Rights Reserved.