org.opensaml
Class SAMLAuthorizationDecisionStatement

java.lang.Object
  extended by org.opensaml.SAMLObject
      extended by org.opensaml.SAMLStatement
          extended by org.opensaml.SAMLSubjectStatement
              extended by org.opensaml.SAMLAuthorizationDecisionStatement
All Implemented Interfaces:
Cloneable

public class SAMLAuthorizationDecisionStatement
extends SAMLSubjectStatement
implements Cloneable

Represents a SAML authorization decision statement.

Author:
Helen Rehn, Scott Cantor

Field Summary
protected  ArrayList actions
           
protected  String decision
           
protected  ArrayList evidence
           
protected  String resource
           
 
Fields inherited from class org.opensaml.SAMLSubjectStatement
subject
 
Fields inherited from class org.opensaml.SAMLStatement
statementTypeMap
 
Fields inherited from class org.opensaml.SAMLObject
config, dirty, log, parentObject, root
 
Constructor Summary
SAMLAuthorizationDecisionStatement()
          Default constructor
SAMLAuthorizationDecisionStatement(Element e)
          Reconstructs a statement from a DOM tree
SAMLAuthorizationDecisionStatement(InputStream in)
          Reconstructs a statement from a stream
SAMLAuthorizationDecisionStatement(SAMLSubject subject, String resource, String decision, Collection actions, Collection evidence)
          Builds an AuthorizationDecisionStatement out of its component parts
 
Method Summary
 void addAction(SAMLAction action)
          Adds an action to the statement
 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 statement
 String getDecision()
          Gets the decision from inside the statement
 Iterator getEvidence()
          Gets the evidence inside the statement
 String getResource()
          Gets the resource URI inside the statement
 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 statement
 void setDecision(String decision)
          Sets the decision inside the statement
 void setEvidence(Collection evidence)
          Sets the evidence to include in the statement
 void setResource(String resource)
          Sets the resource URI inside the statement
 Node toDOM(Document doc, boolean xmlns)
          Transforms the object into a DOM tree using an existing document context
 
Methods inherited from class org.opensaml.SAMLSubjectStatement
getSubject, setSubject
 
Methods inherited from class org.opensaml.SAMLStatement
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

decision

protected String decision

actions

protected ArrayList actions

evidence

protected ArrayList evidence
Constructor Detail

SAMLAuthorizationDecisionStatement

public SAMLAuthorizationDecisionStatement()
Default constructor


SAMLAuthorizationDecisionStatement

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

Parameters:
subject - subject of the statement
resource - URI of the resource being accessed at the time of the statement
actions - specific actions the decision applies to, must be SAMLAction objects
evidence - evidence which may be considered, must be String or SAMLAssertion objects
Throws:
SAMLException - Raised if an AuthorizationDecisionStatement cannot be constructed from the supplied information

SAMLAuthorizationDecisionStatement

public SAMLAuthorizationDecisionStatement(Element e)
                                   throws SAMLException
Reconstructs a statement from a DOM tree

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

SAMLAuthorizationDecisionStatement

public SAMLAuthorizationDecisionStatement(InputStream in)
                                   throws SAMLException
Reconstructs a statement 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 SAMLSubjectStatement
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 statement

Returns:
the resource URI

setResource

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

Parameters:
resource - The resource URI

getDecision

public String getDecision()
Gets the decision from inside the statement

Returns:
The decision

setDecision

public void setDecision(String decision)
Sets the decision inside the statement

Parameters:
decision - The decision

getActions

public Iterator getActions()
Gets the actions inside the statement

Returns:
An iterator over the actions

setActions

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

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 statement

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 statement

Returns:
An iterator over the evidence

setEvidence

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

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 SAMLSubjectStatement
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 SAMLSubjectStatement
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 SAMLSubjectStatement
Returns:
The new object
Throws:
CloneNotSupportedException
See Also:
Object.clone()


Copyright ? 2005 UCAID. All Rights Reserved.