Class SessionSubject


  • public class SessionSubject
    extends FSSubject
    The SessionSubject class represents a liberty subject with associated session status.
    • Constructor Detail

      • SessionSubject

        public SessionSubject​(NameIdentifier nameIdentifier,
                              SubjectConfirmation subjectConfirmation,
                              IDPProvidedNameIdentifier idpNameIdentifier)
                       throws FSMsgException,
                              SAMLException
        Constructs a SessionSubject object from a NameIdentifier object, SubjectConfirmation and IDPProvidedNameIdentifier object.
        Parameters:
        nameIdentifier - NameIdentifier object.
        subjectConfirmation - SubjectConfirmation object.
        idpNameIdentifier - IDPProvidedNameIdentifier object.
        Throws:
        FSMsgException - if idpNameIdentifier is null.
        SAMLException - if both nameIdentifier and subjectConfirmation are null.
      • SessionSubject

        public SessionSubject​(NameIdentifier nameIdentifier,
                              IDPProvidedNameIdentifier idpNameIdentifier)
                       throws FSMsgException,
                              SAMLException
        Constructs a SessionSubject object from a NameIdentifier object and a IDPProvidedNameIdentifier object.
        Parameters:
        nameIdentifier - NameIdentifier object.
        idpNameIdentifier - IDPProvidedNameIdentifier object.
        Throws:
        FSMsgException - if idpNameIdentifier is null.
        SAMLException - if nameIdentifier is null.
      • SessionSubject

        public SessionSubject​(Element subjectElement)
                       throws FSMsgException,
                              SAMLException
        Constructs a SessionSubject object from a DOM element. which has already been built into a DOM.
        Parameters:
        subjectElement - An Element representing DOM tree for Subject object
        Throws:
        SAMLException - if can not create the object of NameIdentifier or SubjectConfirmation inside the DOM element.
        FSMsgException - if it could not process the Element properly, implying that there is an error in the sender or in the element definition.
      • SessionSubject

        public SessionSubject​(SubjectConfirmation subjectConfirmation)
                       throws SAMLException
        Constructs a SessionSubject object from a SubjectConfirmation object.
        Parameters:
        subjectConfirmation - SubjectConfirmation object to be added to the object.
        Throws:
        SAMLException - if subjectConfirmation is null.
    • Method Detail

      • toXMLString

        public String toXMLString()
                           throws FSMsgException
        Returns a String representation of the element.
        Overrides:
        toXMLString in class FSSubject
        Returns:
        a string containing the valid XML for this element By default name space name is prepended to the element name example <saml:Subject>.
        Throws:
        FSMsgException - if could not create a String representation of this element.
      • toXMLString

        public String toXMLString​(boolean includeNS,
                                  boolean declareNS)
                           throws FSMsgException
        Returns a String representation of the <Subject> element.
        Overrides:
        toXMLString in class FSSubject
        Parameters:
        includeNS - if true prepends all elements by their Namespace name example <saml:Subject>
        declareNS - if true includes the namespace within the generated XML.
        Returns:
        a string containing the valid XML for this element.
        Throws:
        FSMsgException - if could not create a String representation of this element.