Package com.sun.identity.saml.assertion
Class AudienceRestrictionCondition
- java.lang.Object
-
- com.sun.identity.saml.assertion.Condition
-
- com.sun.identity.saml.assertion.AudienceRestrictionCondition
-
@SupportedAll public class AudienceRestrictionCondition extends Condition
This is an implementation of the abstractConditionclass, which specifes that the assertion this AuthenticationCondition is part of, is addressed to one or more specific audience.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.saml.assertion.Condition
INDETERMINATE, INVALID, VALID
-
-
Constructor Summary
Constructors Constructor Description AudienceRestrictionCondition(List audience)ConstructsAudienceRestrictionConditionwith aListof audience for this condition, each of them being a String.AudienceRestrictionCondition(Element audienceRestrictionConditionElement)Constructs anAudienceRestrictionConditionelement from an existing XML block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAudience(String audience)Adds an audience to this Condition elementbooleancontainsAudience(String audience)Returns true if a particular audience string is contained within thisAudienceRestrictionConditionobjectintevaluate()Evaluates this condition This method can be overridden by a plug-in which provides means of evaluating this conditionListgetAudience()Returns list of Audience held within this Condition elementbooleanremoveAudience(String audience)Removes an audience from theListwithin this Condition elementbooleansetAudience(List audience)Adds aListof audience held within this Condition elementStringtoString()Returns a String representation of the element.StringtoString(boolean includeNS, boolean declareNS)Returns a String representation of the<AudienceRestrictionCondition>element.
-
-
-
Constructor Detail
-
AudienceRestrictionCondition
public AudienceRestrictionCondition(Element audienceRestrictionConditionElement) throws SAMLException
Constructs anAudienceRestrictionConditionelement from an existing XML block.- Parameters:
audienceRestrictionConditionElement- Aorg.w3c.dom.Elementrepresenting DOM tree forAudienceRestrictionConditionobject.- Throws:
SAMLException- if it could not process theorg.w3c.dom.Elementproperly, implying that there is an error in the sender or in the element definition.
-
AudienceRestrictionCondition
public AudienceRestrictionCondition(List audience) throws SAMLException
ConstructsAudienceRestrictionConditionwith aListof audience for this condition, each of them being a String.- Parameters:
audience- A List of audience to be included within this condition- Throws:
SAMLException- if theListis empty or if there is some error in processing the contents of theList
-
-
Method Detail
-
addAudience
public boolean addAudience(String audience)
Adds an audience to this Condition element- Parameters:
audience- audience to be added- Returns:
- boolean indicating success or failure of operation
-
setAudience
public boolean setAudience(List audience)
Adds aListof audience held within this Condition element- Parameters:
audience- AListof audience to be included within this condition- Returns:
- boolean indicating success or failure of operation.
-
getAudience
public List getAudience()
Returns list of Audience held within this Condition element- Returns:
- An the
Listof Audience within this Condition element
-
containsAudience
public boolean containsAudience(String audience)
Returns true if a particular audience string is contained within thisAudienceRestrictionConditionobject- Parameters:
audience- audience to be checked- Returns:
- true if the audience exists.
-
removeAudience
public boolean removeAudience(String audience)
Removes an audience from theListwithin this Condition element- Parameters:
audience- A string representing the value of the Audience- Returns:
- boolean true/false representing success or failure of the operation
-
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<AudienceRestrictionCondition>element.- Specified by:
toStringin classCondition- Parameters:
includeNS- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- A string containing the valid XML for this element
-
-