[java-opensaml COMMIT] in /trunk: opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java opensaml-...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Jul 12 12:17:18 EDT 2012
Author: rdw
Date: Thu Jul 12 12:17:18 2012
New Revision: 3088
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3088&view=rev
Log:
https://issues.shibboleth.net/jira/browse/OSJ-16 A <xacml-ctx:Response/> can have more than one <Result/>
Modified:
trunk/opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java
trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeImpl.java
trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeUnmarshaller.java
Modified: trunk/opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java?rev=3088&r1=3087&r2=3088&view=diff
==============================================================================
--- trunk/opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java (original)
+++ trunk/opensaml-xacml-api/src/main/java/org/opensaml/xacml/ctx/ResponseType.java Thu Jul 12 12:17:18 2012
@@ -16,6 +16,8 @@
*/
package org.opensaml.xacml.ctx;
+
+import java.util.List;
import javax.xml.namespace.QName;
@@ -40,16 +42,9 @@
XACMLConstants.XACMLCONTEXT_PREFIX);
/**
- * Returns the result of the response.
+ * Returns the list of results for the response.
*
- * @return the result of the response
+ * @return the list of result for the response
*/
- public ResultType getResult();
-
- /**
- * Sets the result of the response.
- *
- * @param newResult result of the response
- */
- public void setResult(ResultType newResult);
+ public List<ResultType> getResults();
}
Modified: trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeImpl.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeImpl.java?rev=3088&r1=3087&r2=3088&view=diff
==============================================================================
--- trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeImpl.java (original)
+++ trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeImpl.java Thu Jul 12 12:17:18 2012
@@ -22,16 +22,16 @@
import java.util.List;
import org.opensaml.core.xml.XMLObject;
-import org.opensaml.xacml.ctx.ResourceType;
+import org.opensaml.core.xml.util.XMLObjectChildrenList;
import org.opensaml.xacml.ctx.ResponseType;
import org.opensaml.xacml.ctx.ResultType;
import org.opensaml.xacml.impl.AbstractXACMLObject;
-/** Concrete implementation of {@link ResourceType}. */
+/** Concrete implementation of {@link ResponseType}. */
public class ResponseTypeImpl extends AbstractXACMLObject implements ResponseType {
- /** The result of the response. */
- private ResultType result;
+ /** The results of the response. */
+ private final XMLObjectChildrenList<ResultType> results;
/**
* Constructor.
@@ -42,26 +42,21 @@
*/
protected ResponseTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
super(namespaceURI, elementLocalName, namespacePrefix);
+ results = new XMLObjectChildrenList<ResultType>(this);
}
/** {@inheritDoc} */
public List<XMLObject> getOrderedChildren() {
ArrayList<XMLObject> children = new ArrayList<XMLObject>();
- if (result != null) {
- children.add(result);
- }
+ children.addAll(results);
return Collections.unmodifiableList(children);
}
/** {@inheritDoc} */
- public ResultType getResult() {
- return result;
+ public List<ResultType> getResults() {
+ return results;
}
- /** {@inheritDoc} */
- public void setResult(ResultType result) {
- this.result = prepareForAssignment(this.result, result);
- }
}
Modified: trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeUnmarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeUnmarshaller.java?rev=3088&r1=3087&r2=3088&view=diff
==============================================================================
--- trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeUnmarshaller.java (original)
+++ trunk/opensaml-xacml-impl/src/main/java/org/opensaml/xacml/ctx/impl/ResponseTypeUnmarshaller.java Thu Jul 12 12:17:18 2012
@@ -48,7 +48,7 @@
throws UnmarshallingException {
ResponseType response = (ResponseType) parentXMLObject;
if (childXMLObject instanceof ResultType) {
- response.setResult((ResultType) childXMLObject);
+ response.getResults().add((ResultType) childXMLObject);
} else {
super.processChildElement(parentXMLObject, childXMLObject);
}
More information about the commits
mailing list