Class AdviceImpl

  • All Implemented Interfaces:
    Advice

    public class AdviceImpl
    extends Object
    implements Advice
    The Advice contains any additional information that the SAML authority wishes to provide. This information may be ignored by applications without affecting either the semantics or the validity of the assertion. An Advice contains a mixture of zero or more Assertion, EncryptedAssertion, AssertionIDRef, and AssertionURIRef.
    • Field Detail

      • ADVICE_ELEMENT

        public static String ADVICE_ELEMENT
      • ASSERTION_URI_REF_ELEMENT

        public static String ASSERTION_URI_REF_ELEMENT
      • ASSERTION_ID_REF_ELEMENT

        public static String ASSERTION_ID_REF_ELEMENT
      • ASSERTION_ELEMENT

        public static String ASSERTION_ELEMENT
      • ENCRYPTED_ASSERTION_ELEMENT

        public static String ENCRYPTED_ASSERTION_ELEMENT
    • Constructor Detail

      • AdviceImpl

        public AdviceImpl()
        Default constructor
      • AdviceImpl

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

        public AdviceImpl​(Element element)
                   throws SAML2Exception
        This constructor is used to build Advice 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 Advice object
        Throws:
        SAMLException - if it could not process the Element
        SAML2Exception
    • Method Detail

      • getAssertions

        public List getAssertions()
        Returns a list of Assertion
        Specified by:
        getAssertions in interface Advice
        Returns:
        a list of Assertion
      • setAssertions

        public void setAssertions​(List assertions)
                           throws SAML2Exception
        Sets a list of Assertion
        Specified by:
        setAssertions in interface Advice
        Parameters:
        assertions - a list of Assertion
        Throws:
        SAML2Exception - if the object is immutable
      • getAssertionIDRefs

        public List getAssertionIDRefs()
        Returns a list of AssertionIDRef
        Specified by:
        getAssertionIDRefs in interface Advice
        Returns:
        a list of AssertionIDRef
      • getAssertionURIRefs

        public List getAssertionURIRefs()
        Returns a list of AssertionURIRef
        Specified by:
        getAssertionURIRefs in interface Advice
        Returns:
        a list of AssertionURIRef
      • getEncryptedAssertions

        public List getEncryptedAssertions()
        Returns a list of EncryptedAssertion
        Specified by:
        getEncryptedAssertions in interface Advice
        Returns:
        a list of EncryptedAssertion
      • setEncryptedAssertions

        public void setEncryptedAssertions​(List encryptedAssertions)
                                    throws SAML2Exception
        Sets a list of EncryptedAssertion
        Specified by:
        setEncryptedAssertions in interface Advice
        Parameters:
        encryptedAssertions - a list of EncryptedAssertion
        Throws:
        SAML2Exception - if the object is immutable
      • getAdditionalInfo

        public List getAdditionalInfo()
        Returns a list of additional information
        Specified by:
        getAdditionalInfo in interface Advice
        Returns:
        a list of additional information
      • setAdditionalInfo

        public void setAdditionalInfo​(List info)
                               throws SAML2Exception
        Sets a list of additional information
        Specified by:
        setAdditionalInfo in interface Advice
        Parameters:
        info - a list of additional information
        Throws:
        SAML2Exception - if the object is immutable
      • toXMLString

        public String toXMLString​(boolean includeNSPrefix,
                                  boolean declareNS)
                           throws SAML2Exception
        Returns a String representation
        Specified by:
        toXMLString in interface Advice
        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 Advice
      • isMutable

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