Class SubjectImpl

  • All Implemented Interfaces:
    Subject

    public class SubjectImpl
    extends Object
    implements Subject
    The Subject specifies the principal that is the subject of all of the statements in the assertion. It contains an identifier, a series of one or more subject confirmations, or both.
    • Constructor Detail

      • SubjectImpl

        public SubjectImpl()
        Default constructor
      • SubjectImpl

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

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

      • getEncryptedID

        public EncryptedID getEncryptedID()
        Returns the encrypted identifier
        Specified by:
        getEncryptedID in interface Subject
        Returns:
        the encrypted identifier
      • getNameID

        public NameID getNameID()
        Returns the identifier in NameID format
        Specified by:
        getNameID in interface Subject
        Returns:
        the identifier in NameID format
      • setNameID

        public void setNameID​(NameID value)
                       throws SAML2Exception
        Sets the identifier in NameID format
        Specified by:
        setNameID in interface Subject
        Parameters:
        value - the identifier in NameID format
        Throws:
        SAML2Exception - if the object is immutable
      • getSubjectConfirmation

        public List getSubjectConfirmation()
        Returns a list of subject confirmations
        Specified by:
        getSubjectConfirmation in interface Subject
        Returns:
        a list of subject confirmations
      • setSubjectConfirmation

        public void setSubjectConfirmation​(List confirmations)
                                    throws SAML2Exception
        Sets a list of subject confirmations
        Specified by:
        setSubjectConfirmation in interface Subject
        Parameters:
        confirmations - a list of subject confirmations
        Throws:
        SAML2Exception - if the object is immutable
      • getBaseID

        public BaseID getBaseID()
        Returns the identifier in BaseID format
        Specified by:
        getBaseID in interface Subject
        Returns:
        the identifier in BaseID format
      • setBaseID

        public void setBaseID​(BaseID value)
                       throws SAML2Exception
        Sets the identifier in BaseID format
        Specified by:
        setBaseID in interface Subject
        Parameters:
        value - the identifier in BaseID format
        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 Subject
        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 Subject
      • isMutable

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