Class ConditionsImpl

  • All Implemented Interfaces:
    Conditions

    public class ConditionsImpl
    extends Object
    implements Conditions
    The Conditions defines the SAML constructs that place constraints on the acceptable use if SAML Assertions.
    • Constructor Detail

      • ConditionsImpl

        public ConditionsImpl()
        Default constructor
      • ConditionsImpl

        public ConditionsImpl​(String xml)
                       throws SAML2Exception
        This constructor is used to build Conditions object from a XML string.
        Parameters:
        xml - A java.lang.String representing a Conditions object
        Throws:
        SAML2Exception - if it could not process the XML string
      • ConditionsImpl

        public ConditionsImpl​(Element element)
                       throws SAML2Exception
        This constructor is used to build Conditions object from a block of existing XML that has already been built into a DOM.
        Parameters:
        element - A org.w3c.dom.Element representing DOM tree for Conditions object
        Throws:
        SAML2Exception - if it could not process the Element
    • Method Detail

      • getNotOnOrAfter

        public Date getNotOnOrAfter()
        Returns the time instant at which the subject can no longer be confirmed.
        Specified by:
        getNotOnOrAfter in interface Conditions
        Returns:
        the time instant at which the subject can no longer be confirmed.
      • setNotOnOrAfter

        public void setNotOnOrAfter​(Date value)
                             throws SAML2Exception
        Sets the time instant at which the subject can no longer be confirmed.
        Specified by:
        setNotOnOrAfter in interface Conditions
        Parameters:
        value - the time instant at which the subject can no longer be confirmed.
        Throws:
        SAML2Exception - if the object is immutable
      • getConditions

        public List getConditions()
        Returns a list of Condition
        Specified by:
        getConditions in interface Conditions
        Returns:
        a list of Condition
      • getAudienceRestrictions

        public List getAudienceRestrictions()
        Returns a list of AudienceRestriction
        Specified by:
        getAudienceRestrictions in interface Conditions
        Returns:
        a list of AudienceRestriction
      • getOneTimeUses

        public List getOneTimeUses()
        Returns a list of OneTimeUse
        Specified by:
        getOneTimeUses in interface Conditions
        Returns:
        a list of OneTimeUse
      • getProxyRestrictions

        public List getProxyRestrictions()
        Returns a list of ProxyRestriction
        Specified by:
        getProxyRestrictions in interface Conditions
        Returns:
        a list of ProxyRestriction
      • getNotBefore

        public Date getNotBefore()
        Returns the time instant before which the subject cannot be confirmed.
        Specified by:
        getNotBefore in interface Conditions
        Returns:
        the time instant before which the subject cannot be confirmed.
      • setNotBefore

        public void setNotBefore​(Date value)
                          throws SAML2Exception
        Sets the time instant before which the subject cannot be confirmed.
        Specified by:
        setNotBefore in interface Conditions
        Parameters:
        value - the time instant before which the subject cannot be confirmed.
        Throws:
        SAML2Exception - if the object is immutable
      • checkDateValidity

        public boolean checkDateValidity​(long someTime,
                                         int skewSeconds)
        Return true if a specific Date falls within the validity interval of this set of conditions.
        Specified by:
        checkDateValidity in interface Conditions
        Parameters:
        someTime - Any time in milliseconds.
        skewSeconds - Clock skew in seconds.
        Returns:
        true if someTime is within the valid interval of the Conditions.
      • checkDateValidity

        public boolean checkDateValidity​(long someTime)
        Return true if a specific Date falls within the validity interval of this set of conditions.
        Specified by:
        checkDateValidity in interface Conditions
        Parameters:
        someTime - Any time in milliseconds.
        Returns:
        true if someTime is within the valid interval of the Conditions.
      • toXMLString

        public String toXMLString​(boolean includeNSPrefix,
                                  boolean declareNS)
                           throws SAML2Exception
        Returns a String representation
        Specified by:
        toXMLString in interface Conditions
        Parameters:
        includeNSPrefix - 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 representation
        Throws:
        SAML2Exception - if something is wrong during conversion
      • makeImmutable

        public void makeImmutable()
        Makes the object immutable
        Specified by:
        makeImmutable in interface Conditions
      • isMutable

        public boolean isMutable()
        Returns true if the object is mutable
        Specified by:
        isMutable in interface Conditions
        Returns:
        true if the object is mutable