org.opensaml
Class SAMLAudienceRestrictionCondition

java.lang.Object
  extended byorg.opensaml.SAMLObject
      extended byorg.opensaml.SAMLCondition
          extended byorg.opensaml.SAMLAudienceRestrictionCondition
All Implemented Interfaces:
java.lang.Cloneable

public class SAMLAudienceRestrictionCondition
extends SAMLCondition
implements java.lang.Cloneable

Represents a SAML AudienceRestrictionCondition

Author:
Scott Cantor

Field Summary
protected  java.util.ArrayList audiences
           
 
Fields inherited from class org.opensaml.SAMLCondition
conditionTypeMap
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLAudienceRestrictionCondition()
          Default constructor
SAMLAudienceRestrictionCondition(java.util.Collection audiences)
          Builds a condition out of its component parts
SAMLAudienceRestrictionCondition(org.w3c.dom.Element e)
          Reconstructs a condition from a DOM tree
SAMLAudienceRestrictionCondition(java.io.InputStream in)
          Reconstructs a condition from a stream
 
Method Summary
 void addAudience(java.lang.String audience)
          Adds an audience to the condition
 void checkValidity()
          Evaluates the object's content to see if it is currently valid if serialized.
 java.lang.Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy
 boolean eval(java.util.Collection audiences)
          Evaluates the condition
 void fromDOM(org.w3c.dom.Element e)
          Initialization of an object from a DOM element
 java.util.Iterator getAudiences()
          Gets the audiences included in the condition
 void removeAudience(int index)
          Removes an audience by position (zero-based)
 void setAudiences(java.util.Collection audiences)
          Sets the audiences to include in the condition
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc, boolean xmlns)
          Transforms the object into a DOM tree using an existing document context
 
Methods inherited from class org.opensaml.SAMLCondition
getInstance, getInstance, regFactory, unregFactory
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, plantRoot, toBase64, toDOM, toDOM, toDOM, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

audiences

protected java.util.ArrayList audiences
Constructor Detail

SAMLAudienceRestrictionCondition

public SAMLAudienceRestrictionCondition()
Default constructor


SAMLAudienceRestrictionCondition

public SAMLAudienceRestrictionCondition(java.util.Collection audiences)
                                 throws SAMLException
Builds a condition out of its component parts

Parameters:
audiences - Array of audiences to embed in condition
Throws:
SAMLException - Raised if a condition cannot be constructed from the supplied information

SAMLAudienceRestrictionCondition

public SAMLAudienceRestrictionCondition(org.w3c.dom.Element e)
                                 throws SAMLException
Reconstructs a condition from a DOM tree

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

SAMLAudienceRestrictionCondition

public SAMLAudienceRestrictionCondition(java.io.InputStream in)
                                 throws SAMLException
Reconstructs a condition 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(org.w3c.dom.Element e)
             throws SAMLException
Description copied from class: SAMLObject
Initialization of an object from a DOM element

Overrides:
fromDOM in class SAMLObject
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)

getAudiences

public java.util.Iterator getAudiences()
Gets the audiences included in the condition

Returns:
The audiences in the condition

setAudiences

public void setAudiences(java.util.Collection audiences)
Sets the audiences to include in the condition

Parameters:
audiences - The audiences to include

addAudience

public void addAudience(java.lang.String audience)
Adds an audience to the condition

Parameters:
audience - The audience to add

removeAudience

public void removeAudience(int index)
Removes an audience by position (zero-based)

Parameters:
index - The position of the audience to remove

toDOM

public org.w3c.dom.Node toDOM(org.w3c.dom.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 SAMLObject
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)

eval

public boolean eval(java.util.Collection audiences)
Evaluates the condition

Parameters:
audiences - A collection of audiences deemed acceptable by the evaluator
Returns:
Returns true iff the condition's audiences intersect with those of the evaluator

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.isValid() would succeed, while SAMLStatement.isValid would raise an exception.

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

clone

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

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


Copyright ? 2002 UCAID. All Rights Reserved.