/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SessionSubject.java,v 1.2 2008/06/25 05:47:22 qcheng Exp $
*
*/
/**
* The <code>SessionSubject</code> class represents a liberty subject
* with associated session status.
*
* @supported.all.api
*/
/**
* Constructs a <code>SessionSubject<code> object from a
* <code>NameIdentifier</code> object, <code>SubjectConfirmation</code> and
* <code>IDPProvidedNameIdentifier</code> object.
*
* @param nameIdentifier <code>NameIdentifier</code> object.
* @param subjectConfirmation <code>SubjectConfirmation</code> object.
* @param idpNameIdentifier <code>IDPProvidedNameIdentifier</code> object.
* @throws FSMsgException if <code>idpNameIdentifier</code> is null.
* @throws SAMLException if both <code>nameIdentifier</code> and
* <code>subjectConfirmation</code> are null.
*/
public SessionSubject(
) throws FSMsgException, SAMLException {
}
/**
* Constructs a <code>SessionSubject</code> object from a
* <code>NameIdentifier</code> object and a
* <code>IDPProvidedNameIdentifier</code> object.
*
* @param nameIdentifier <code>NameIdentifier</code> object.
* @param idpNameIdentifier <code>IDPProvidedNameIdentifier</code> object.
* @throws FSMsgException if <code>idpNameIdentifier</code> is null.
* @throws SAMLException if <code>nameIdentifier</code> is null.
*/
public SessionSubject(
) throws FSMsgException, SAMLException {
super(nameIdentifier, idpNameIdentifier);
}
/**
* Constructs a <code>SessionSubject</code> object from a DOM element.
* which has already been built into a DOM.
*
* @param subjectElement An Element representing DOM tree for Subject object
* @throws SAMLException if can not create the object of
* <code>NameIdentifier</code> or
* <code>SubjectConfirmation</code> inside the DOM element.
* @throws FSMsgException if it could not process the Element properly,
* implying that there is an error in the sender or in the
* element definition.
*/
public SessionSubject(
) throws FSMsgException, SAMLException {
int elementCount=0;
if (rootTagName == null) {
"SessionSubject: local name missing");
}
("nullInput")) ;
}
"SessionSubject: invalid root element");
}
"invalidElement")) ;
}
if (length == 0 ) {
"SessionSubject: No sub elements found");
}
"emptyElement")) ;
}
for (int n=0; n < length; n++) {
continue;
}
elementCount++;
super.setSubjectConfirmation(
elementCount++;
elementCount++;
}else {
"SessionSubject: Invalid element encountered.");
}
"invalidElement")) ;
}
}
if (elementCount > 3 ) {
"SessionSubject: more than allowed elements passed");
}
"moreElement")) ;
}
if (_idpNameIdentifier == null) {
"SessionSubject: mandatory IDPProvidedNameIdentifier "
+ "missing");
}
"missingElement")) ;
}
}
/**
* Constructs a <code>SessionSubject</code> object from a
* <code>SubjectConfirmation</code> object.
*
* @param subjectConfirmation <code>SubjectConfirmation</code> object to be
* added to the object.
* @throws SAMLException if <code>subjectConfirmation</code> is null.
*/
throws SAMLException {
super(subjectConfirmation);
}
/**
* Returns a String representation of the element.
*
* @return a string containing the valid XML for this element
* By default name space name is prepended to the element name
* example <code><saml:Subject></code>.
* @throws FSMsgException if could not create a String
* representation of this element.
*/
return this.toXMLString(true, false);
}
/**
* Returns a String representation of the <code><Subject></code>
* element.
*
* @param includeNS if true prepends all elements by their Namespace
* name example <code><saml:Subject></code>
*
* @param declareNS if true includes the namespace within the
* generated XML.
* @return a string containing the valid XML for this element.
* @throws FSMsgException if could not create a String
* representation of this element.
*/
boolean includeNS,
boolean declareNS
) throws FSMsgException {
if (includeNS) {
}
if (declareNS) {
}
if (getNameIdentifier() != null ) {
}
if (getSubjectConfirmation() != null) {
}
if (_idpNameIdentifier != null ) {
}
}
}