Package com.sun.identity.saml.assertion
Class EvidenceBase
- java.lang.Object
-
- com.sun.identity.saml.assertion.EvidenceBase
-
- Direct Known Subclasses:
Evidence
@SupportedAll public abstract class EvidenceBase extends Object
TheEvidenceelement specifies an assertion either by reference or by value. An assertion is specified by reference to the value of the assertion'sAssertionIDReferenceelement. An assertion is specified by value by including the entireAssertionobject This class is an abstract base class for all Evidence implementations and encapsulates common functionality.
-
-
Constructor Summary
Constructors Constructor Description EvidenceBase(Set evidenceContent)Constructs a newEvidenceelement containing a set ofAssertionobjects.EvidenceBase(Set assertionIDRef, Set assertion)Constructs an Evidence from a Set ofAssertionandAssertionIDReferenceobjects.EvidenceBase(Element assertionSpecifierElement)Constructs anEvidenceobject from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddAssertion(AssertionBase assertion)Adds anAssertionobject into the Evidence object.booleanaddAssertionIDReference(AssertionIDReference assertionIDRef)Adds anAssertionIDReferenceobject into theEvidenceobject.protected abstract AssertionBasecreateAssertion(Element assertionElement)Creates appropriate Assertion Instanceprotected abstract AssertionIDReferencecreateAssertionIDReference(String assertionID)Creates appropriate AssertionIDReference InstanceSetgetAssertion()Getjava.util.SetofAssertionobjects in theEvidenceSetgetAssertionIDReference()Getjava.util.SetofAssertionIDReferenceobjects in theEvidencebooleanremoveAssertion(AssertionBase assertion)Removes anAssertionobject from theEvidenceobject.booleanremoveAssertionIDReference(AssertionIDReference assertionIDRef)Removes anAssertionIDReferenceobject from theEvidenceobject.StringtoString()Returns a String representation of the element.StringtoString(boolean includeNS, boolean declareNS)Returns a String representation of the<Evidence>element (or of the<Evidence>element).
-
-
-
Constructor Detail
-
EvidenceBase
public EvidenceBase(Element assertionSpecifierElement) throws SAMLException
Constructs anEvidenceobject from a block of existing XML that has already been built into a DOM.- Parameters:
assertionSpecifierElement- Aorg.w3c.dom.Elementrepresenting DOM tree forEvidenceobject.- Throws:
SAMLException- if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
-
EvidenceBase
public EvidenceBase(Set evidenceContent) throws SAMLException
Constructs a newEvidenceelement containing a set ofAssertionobjects.- Parameters:
evidenceContent- A set ofAssertionandAssertionIDReferenceobjects to be put within theEvidenceelement. The same Set contains both type of elements.- Throws:
SAMLException- if the Set is empty or has invalid object.
-
EvidenceBase
public EvidenceBase(Set assertionIDRef, Set assertion) throws SAMLException
Constructs an Evidence from a Set ofAssertionandAssertionIDReferenceobjects.- Parameters:
assertionIDRef- Set ofAssertionIDReferenceobjects.assertion- Set ofAssertionobjects.- Throws:
SAMLException- if either Set is empty or has invalid object.
-
-
Method Detail
-
addAssertion
public boolean addAssertion(AssertionBase assertion)
Adds anAssertionobject into the Evidence object.- Parameters:
assertion-Assertionto be added- Returns:
- true if operation succeeds.
-
addAssertionIDReference
public boolean addAssertionIDReference(AssertionIDReference assertionIDRef)
Adds anAssertionIDReferenceobject into theEvidenceobject.- Parameters:
assertionIDRef-AssertionIDReferenceto be added.- Returns:
- true if operation succeeds.
-
removeAssertion
public boolean removeAssertion(AssertionBase assertion)
Removes anAssertionobject from theEvidenceobject.- Parameters:
assertion-Assertionto be removed.- Returns:
- true if the operation succeeds, Returns failure of the
Assertionis the only element inside theEvidence.
-
removeAssertionIDReference
public boolean removeAssertionIDReference(AssertionIDReference assertionIDRef)
Removes anAssertionIDReferenceobject from theEvidenceobject.- Parameters:
assertionIDRef-AssertionIDReferenceto be removed- Returns:
- true if the operation succeeds, Returns false if the
AssertionIDReferenceis the only element inside theEvidence.
-
getAssertionIDReference
public Set getAssertionIDReference()
Getjava.util.SetofAssertionIDReferenceobjects in theEvidence- Returns:
java.util.SetofAssertionIDReferenceobjects within this Evidence.
-
getAssertion
public Set getAssertion()
Getjava.util.SetofAssertionobjects in theEvidence- Returns:
java.util.SetofAssertionobjects within this Evidence.
-
toString
public String toString()
Returns a String representation of the element.
-
toString
public String toString(boolean includeNS, boolean declareNS)
Returns a String representation of the<Evidence>element (or of the<Evidence>element).- Parameters:
includeNS- Determines whether or not the namespace qualifier is prepended to theElementwhen converted.declareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- The string containing the valid XML for this element .The top
level element is
Evidence.
-
createAssertion
protected abstract AssertionBase createAssertion(Element assertionElement) throws SAMLException
Creates appropriate Assertion Instance- Parameters:
assertionElement- the assertion Element- Returns:
- the assertion instance
- Throws:
SAMLException
-
createAssertionIDReference
protected abstract AssertionIDReference createAssertionIDReference(String assertionID) throws SAMLException
Creates appropriate AssertionIDReference Instance- Parameters:
assertionID- the assertion ID String- Returns:
- the AssertionIDReference instance
- Throws:
SAMLException
-
-