/**
* 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: SessionContextStatement.java,v 1.2 2008/06/25 05:47:22 qcheng Exp $
*
*/
/**
* The <code>SessionContextStatement</code> element conveys session status
* of an entity to another system entity within the body of an
* <code><saml:assertion></code> element.
*
* @supported.all.api
*/
/**
* The Statement is an Session Context Statement.
*/
/**
* Constructs a <code>SessionContextStatement</code> object from a
* <code>SessionContext</code> object and a <code>Subject</code> object.
*
* @param sessionContext <code>SessionContext</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if <code>sessionContext</code> is null or subject
* is null.
*/
throws SAMLException {
"SessionContext is null!");
throw new SAMLRequesterException(
}
}
/**
* Constructs a <code>SessionContextStatement</code> object from a
* <code>SessionContext</code> object, a <code>proxySubject</code> and
* a <code>Subject</code> object.
*
* @param sessionContext <code>SessionContext</code> object.
* @param proxySubject <code>ProxySubject</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if <code>sessionContext</code> is null or
* subject is null.
*/
throws SAMLException {
"SessionContext is null!");
throw new SAMLRequesterException(
}
}
/**
* Constructs a <code>SessionContextStatement</code> object from a DOM
* element.
*
* @param element the Document Element
* @throws SAMLException if there is an error in the sender or in
* the element definition.
*/
// make sure input is not null
throw new SAMLRequesterException(
}
// check if it's an SessionContextStatement
"SessionContextStatement");
if (!valid) {
throw new SAMLRequesterException(
}
//Handle the children elements of SessionContextStatement
if (nodeCount > 0) {
for (int i = 0; i < nodeCount; i++) {
+ " The tag name or tag namespace of child"
+ " element is either null or empty.");
}
throw new SAMLRequesterException(
}
"Statement should only contain " +
"one subject");
}
throw new SAMLRequesterException(
} else {
}
if (_proxySubject != null) {
"Statement should only contain " +
"one ProxySubject");
}
throw new SAMLRequesterException(
} else {
}
if (_sessionContext != null) {
"Statement should only contain " +
"one SessionContext");
}
throw new SAMLRequesterException(
} else {
}
} else {
}
throw new SAMLRequesterException(
}
} // end of if (currentNode.getNodeType() == Node.ELEMENT_NODE)
} // end of for loop
} // end of if (nodeCount > 0)
}
/**
* Return the <code>ProxySubject</code> in the
* <code>SessionContextStatement</code>.
*
* @return <code>ProxySubject</code>.
*/
return _proxySubject;
}
/**
* Returns the <code>SessionContext</code> in the
* <code>SessionContextStatement</code>.
*
* @return <code>SessionContext</code>
*/
return _sessionContext;
}
/**
* Sets the <code>ProxySubject</code> for
* <code>SessionContextStatement</code>.
*
* @param proxySubject the object to be set.
* @return true if the operation is successful.
*/
if (proxySubject == null) {
"setResourceID:Input is null.");
}
return false;
}
return true;
}
/**
* Returns the real type of the Statement.
*
* @return An integer which represents <code>SessionContextStatement</code>
* internally.
*/
public int getStatementType() {
return SESSIONCONTEXT_STATEMENT;
}
/**
* Returns a String representation of <code>SessionContextStatement</code>.
*
* @return String representation of the <code>SessionContextStatement</code>.
* object.
*/
return toString(true, false);
}
/**
* Returns a String representation of the
* <code>ResourceAccessStatement</code>.
*
* @param includeNS Determines whether or not the namespace qualifier is
* prepended to the Element when converted.
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @return String representation of the
* <code><saml:ResourceAccessStatement></code> element.
*/
if (includeNS) {
}
if (declareNS) {
}
try {
if (_proxySubject != null) {
}
append("SessionContextStatement>");
} catch (Exception e) {
return null;
}
}
}