AttributeStatementImpl.java revision a688bcbb4bcff5398fdd29b86f83450257dc0df4
/**
* 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: AttributeStatementImpl.java,v 1.2 2008/06/25 05:47:42 qcheng Exp $
*
*/
/**
* This is a default implementation of <code>AttributeStatement</code>.
*
* The <code>AttributeStatement</code> element describes a statement by
* the SAML authority asserting that the assertion subject is associated with
* the specified attributes. It is of type <code>AttributeStatementType</code>.
* <p>
* <pre>
* <complexType name="AttributeStatementType">
* <complexContent>
* <extension base="{urn:oasis:names:tc:SAML:2.0:assertion}
* StatementAbstractType">
* <choice maxOccurs="unbounded">
* <element ref="{urn:oasis:names:tc:SAML:2.0:assertion}Attribute"/>
* <element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
* EncryptedAttribute"/>
* </choice>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*/
public class AttributeStatementImpl implements AttributeStatement {
private boolean mutable = true;
// Validate the object according to the schema.
private void validateData()
throws SAML2Exception
{
{
+ "validateData: missing Attribute or"
+ " EncryptedAttribute element.");
}
throw new SAML2Exception(
}
}
// used by the constructors.
throws SAML2Exception
{
// make sure that the input xml block is not null
+ "parseElement: Input is null.");
}
throw new SAML2Exception(
}
// Make sure this is an AttributeStatement.
+"parseElement: not AttributeStatement.");
}
throw new SAML2Exception(
}
// handle the sub elementsof the AuthnStatment
for (int i = 0; i < length; i++) {
}
}
} else {
+ "parse Element: Invalid element:" + childName);
}
throw new SAML2Exception(
}
}
}
validateData();
}
}
mutable = false;
}
/**
* Class constructor. Caller may need to call setters to populate the
* object.
*/
public AttributeStatementImpl() {
}
/**
* Class constructor with <code>AttributeStatement</code> in
* <code>Element</code> format.
*/
{
}
/**
* Class constructor with <code>AttributeStatement</code> in xml string
* format.
*/
{
throw new SAML2Exception(
}
}
/**
* Returns <code>Attribute</code>(s) of the statement.
*
* @return List of <code>Attribute</code>(s) in the statement.
* @see #setAttribute(List)
*/
public List getAttribute() {
return attrs;
}
/**
* Sets <code>Attribute</code>(s) of the statement.
*
* @param value List of new <code>Attribute</code>(s).
* @throws SAML2Exception if the object is immutable.
* @see #getAttribute()
*/
throws SAML2Exception
{
if (!mutable) {
throw new SAML2Exception(
}
}
/**
* Returns <code>EncryptedAttribute</code>(s) of the statement.
*
* @return List of <code>EncryptedAttribute</code>(s) in the statement.
* @see #setEncryptedAttribute(List)
*/
public List getEncryptedAttribute() {
return encAttrs;
}
/**
* Sets <code>EncryptedAttribute</code>(s) of the statement.
*
* @param value List of new <code>EncryptedAttribute</code>(s).
* @throws SAML2Exception if the object is immutable.
* @see #getEncryptedAttribute()
*/
throws SAML2Exception
{
if (!mutable) {
throw new SAML2Exception(
}
}
/**
* Makes the object immutable.
*/
public void makeImmutable() {
if (mutable) {
}
}
}
mutable = false;
}
}
/**
* Returns the mutability of the object.
*
* @return <code>true</code> if the object is mutable;
* <code>false</code> otherwise.
*/
public boolean isMutable() {
return mutable;
}
/**
* 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.
* @throws SAML2Exception if the object does not conform to the schema.
*/
throws SAML2Exception
{
return this.toXMLString(true, false);
}
/**
* Returns a String representation of the 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
* @throws SAML2Exception if the object does not conform to the schema.
*/
throws SAML2Exception
{
validateData();
if (includeNS) {
}
if (declareNS) {
}
}
}
}
}
}
}