/**
* 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: AdviceBase.java,v 1.2 2008/06/25 05:47:31 qcheng Exp $
*
*/
/**
*The <code>Advice</code> element contains additional information
*that the issuer wish to provide.
*This information MAY be ignored by applications without affecting
*either the semantics or validity. Advice elements MAY be specified in
*an extension schema.
*
* This class is an abstract base class for all Advice implementations and
* encapsulates common functionality.
*
*@supported.all.api
*/
public abstract class AdviceBase {
/**
* Constructs an Advice element from an existing XML block.
*
* @param element representing a DOM tree element
* @exception SAMLException if there is an error in the sender or in the
* element definition.
*/
// Make sure the input is not null.
throw new SAMLRequesterException(
}
// Make sure this element is an Advice element.
throw new SAMLRequesterException(
}
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(
}
if (_assertionIDRef == null) {
_assertionIDRef = new ArrayList();
}
"Advice:failed to add" +
" to AssertionIDReference List.");
}
throw new SAMLRequesterException(
"addListError"));
}
if (_assertion == null) {
_assertion = new ArrayList();
}
"Advice:failed to add" +
" to Assertion List.");
}
throw new SAMLRequesterException(
"addListError"));
}
} else {
if (_otherElements == null)
_otherElements = new ArrayList();
if (( _otherElements.add(
(Element)currentNode))==false) {
+ "to add to other elements list.");
}
throw new SAMLRequesterException(
"addListError"));
}
}
}
} // end of for loop
} // end of if (nodeCount > 0)
}
/**
* Constructor
*
* @param assertionidreference A List of <code>AssertionIDReference</code>.
* @param assertion A List of Assertion
* @param otherelement A List of any element defined as
* <code>any namespace="##other" processContents="lax"</code>;
*/
List otherelement) {
if (_assertionIDRef == null) {
_assertionIDRef = new ArrayList();
}
}
if (_assertion == null) {
_assertion = new ArrayList();
}
}
if (otherelement != null) {
if (_otherElements == null) {
_otherElements = new ArrayList();
}
}
}
/**
* Creates appropriate Assertion Instance
* @param assertionElement the assertion Element
* @return the assertion instance
*/
protected abstract AssertionBase
/**
* Creates appropriate AssertionIDReference Instance
* @param assertionIDRefElement the assertion ID reference Element
* @return the assertion ID reference instance
*/
protected abstract AssertionIDReference
throws SAMLException;
/**
* Returns access to the <code>AssertionIDReference</code> in this
* Advice element.
*
* @return A list of <code>AssertionIDReference</code> in this Advice
* element.
*/
return _assertionIDRef;
}
/**
*Gets access to the Assertion in this Advice element
*@return A list of Assertion in this Advice element
*/
return _assertion;
}
/**
*Gets other element contained within the Advice element
*@return A list of other elements.
*/
return _otherElements;
}
/**
*Creates a String representation of the <code>Advice</code> element
*@return A String representing the valid XML for this element
*/
return toString(true, false);
}
/**
* Returns a String representation of the
* <code><saml:Advice></code> element.
*
* @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 A string containing the valid XML for this element
*/
if (includeNS) {
}
if (declareNS) {
}
append(">\n");
}
}
}
}
}
}
}
}