/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: ResponseImpl.java,v 1.4 2008/11/10 22:57:05 veiming Exp $
*
*/
/**
* The <code>Response</code> element is a container of
* one or more <code>Result</code>s issuded by authorization authority.
*
*
* <p/>
* schema:
* <pre>
* <xs:complexType name="ResponseType">
* <xs:sequence>
* <xs:element ref="xacml-context:Result"
* maxOccurs="unbounded"/>
* <xs:sequence>
* <xs:complexType>
* </pre>
*/
private boolean mutable = true;
/**
* Constructs a <code>Response</code> object
*/
public ResponseImpl() {
}
/**
* Constructs a <code>Response</code> object from an XML string
*
* @param xml string representing a <code>Response</code> object
* @throws SAMLException if the XML string could not be processed
*/
} else {
"ResponseImpl.processElement(): invalid XML input");
throw new XACMLException(
"errorObtainingElement"));
}
}
/**
* Constructs a <code>Response</code> object from an XML DOM element
*
* @param element XML DOM element representing a <code>Response</code>
* object
*
* @throws SAMLException if the DOM element could not be processed
*/
}
/**
* Returns the <code>Result</code>s of this object
*
* @return the <code>Result</code>s of this object
*/
return results;
}
/**
* Sets the <code>Result</code>s of this object
*
* @param values the <code>Result</code>s of this object.
* @throws XACMLException if the object is immutable.
*/
if (!mutable) {
throw new XACMLException(
"objectImmutable"));
}
}
} else {
}
}
/**
* Adds a <code>Result</code> to this object
*
* @param result the <code>Result</code> to add
* @throws XACMLException if the object is immutable
*/
if (!mutable) {
throw new XACMLException(
}
}
}
/**
* Returns a string representation of this object
*
* @return a string representation of this object
* @exception XACMLException if conversion fails for any reason
*/
//top level element, declare namespace
return this.toXMLString(true, true);
}
/**
* Returns a string representation of this object
* @param includeNSPrefix 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 representation of this object
* @exception XACMLException if conversion fails for any reason
*/
throws XACMLException {
if (includeNSPrefix) {
}
if (declareNS) {
}
int length = 0;
for (int i = 0; i < length; i++) {
}
}
}
/**
* Checks if the object is mutable
*
* @return <code>true</code> if the object is mutable,
* <code>false</code> otherwise
*/
public boolean isMutable() {
return mutable;
}
/**
* Makes the object immutable
*/
public void makeImmutable() {
if (mutable) {
for (int i = 0; i < length; i++) {
}
}
mutable = false;
}
}
/**
* Initializes a <code>Response</code> object from an XML DOM element
*
* @param element XML DOM element representing a <code>Response</code>
* object
*
* @throws SAMLException if the DOM element could not be processed
*/
"ResponseImpl.processElement(): invalid root element");
throw new XACMLException(
"invalid_element"));
}
"ResponseImpl.processElement(): local name missing");
throw new XACMLException(
"missing_local_name"));
}
"ResponseImpl.processElement(): invalid local name " + elemName);
throw new XACMLException(
"invalid_local_name"));
}
// starts processing subelements
int nextElem = 0;
while (nextElem < numOfNodes) {
//XMLUtils.getElementValue((Element)child));
} else {
"ResponseImpl.processElement(): "
+ " invalid child element: " + elemName);
throw new XACMLException(
"invalid_child_name")); //FIXME: add i18n key
}
}
}
nextElem++;
}
}
}