Class AudienceRestrictionCondition


  • @SupportedAll
    public class AudienceRestrictionCondition
    extends Condition
    This is an implementation of the abstract Condition class, which specifes that the assertion this AuthenticationCondition is part of, is addressed to one or more specific audience.
    • Constructor Detail

      • AudienceRestrictionCondition

        public AudienceRestrictionCondition​(Element audienceRestrictionConditionElement)
                                     throws SAMLException
        Constructs an AudienceRestrictionCondition element from an existing XML block.
        Parameters:
        audienceRestrictionConditionElement - A org.w3c.dom.Element representing DOM tree for AudienceRestrictionCondition object.
        Throws:
        SAMLException - if it could not process the org.w3c.dom.Element properly, implying that there is an error in the sender or in the element definition.
      • AudienceRestrictionCondition

        public AudienceRestrictionCondition​(List audience)
                                     throws SAMLException
        Constructs AudienceRestrictionCondition with a List of 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 the List is empty or if there is some error in processing the contents of the List
    • 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 a List of audience held within this Condition element
        Parameters:
        audience - A List of 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 List of Audience within this Condition element
      • containsAudience

        public boolean containsAudience​(String audience)
        Returns true if a particular audience string is contained within this AudienceRestrictionCondition object
        Parameters:
        audience - audience to be checked
        Returns:
        true if the audience exists.
      • removeAudience

        public boolean removeAudience​(String audience)
        Removes an audience from the List within 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.
        Overrides:
        toString in class Object
        Returns:
        A string containing the valid XML for this element By default name space name is prepended to the element name example <saml:AudienceRestrictionCondition>.
      • toString

        public String toString​(boolean includeNS,
                               boolean declareNS)
        Returns a String representation of the <AudienceRestrictionCondition> element.
        Specified by:
        toString in class Condition
        Parameters:
        includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
        declareNS - Determines whether or not the namespace is declared within the Element.
        Returns:
        A string containing the valid XML for this element
      • evaluate

        public int evaluate()
        Evaluates this condition This method can be overridden by a plug-in which provides means of evaluating this condition
        Specified by:
        evaluate in class Condition
        Returns:
        evaluation status.