[java-openws COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java ...

noreply at shibboleth.net noreply at shibboleth.net
Wed Mar 28 20:02:57 BST 2012


Author: putmanb
Date: Wed Mar 28 20:02:57 2012
New Revision: 432

URL: http://svn.shibboleth.net/view/java-openws?rev=432&view=rev
Log:
JOWS-36: WS-Trust OnBehalfOf provider is misimplemented, should support a sequence of wildcard children rather than a single child.

Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java
    branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfImpl.java
    branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfUnmarshaller.java

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-openws/branches/REL_1/doc/RELEASE-NOTES.txt?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Wed Mar 28 20:02:57 2012
@@ -1,3 +1,7 @@
+Changes in Release 1.4.5
+==============================================
+[JOWS-36] - WS-Trust OnBehalfOf provider is misimplemented, should support a sequence of wildcard children rather than a single child.
+
 Changes in Release 1.4.4
 ==============================================
 [JOWS-33] - HttpResource does not properly release HTTP connnections

Modified: branches/REL_1/src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java
URL: http://svn.shibboleth.net/view/java-openws/branches/REL_1/src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/REL_1/src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java (original)
+++ branches/REL_1/src/main/java/org/opensaml/ws/wstrust/OnBehalfOf.java Wed Mar 28 20:02:57 2012
@@ -19,6 +19,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.opensaml.xml.ElementExtensibleXMLObject;
 import org.opensaml.xml.XMLObject;
 
 /**
@@ -27,7 +28,7 @@
  * @see "WS-Trust 1.3, Chapter 9.1 On-Behalf-Of Parameters."
  * 
  */
-public interface OnBehalfOf extends WSTrustObject {
+public interface OnBehalfOf extends ElementExtensibleXMLObject, WSTrustObject {
 
     /** Element local name. */
     public static final String ELEMENT_LOCAL_NAME = "OnBehalfOf";
@@ -47,6 +48,8 @@
      * Get the unknown child element.
      * 
      * @return the child element
+     * 
+     * @deprecated Use instead {@link #getUnknownXMLObjects()}
      */
     public XMLObject getUnknownXMLObject();
     
@@ -54,6 +57,8 @@
      * Set the unknown child element.
      * 
      * @param unknownObject the new child element
+     * 
+     * @deprecated Use instead {@link #getUnknownXMLObjects()}
      */
     public void setUnknownXMLObject(XMLObject unknownObject);
     

Modified: branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfImpl.java
URL: http://svn.shibboleth.net/view/java-openws/branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfImpl.java?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfImpl.java (original)
+++ branches/REL_1/src/main/java/org/opensaml/ws/wstrust/impl/OnBehalfOfImpl.java Wed Mar 28 20:02:57 2012
@@ -21,8 +21,11 @@
 import java.util.Collections;
 import java.util.List;
 
+import javax.xml.namespace.QName;
+
 import org.opensaml.ws.wstrust.OnBehalfOf;
 import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
 
 /**
  * OnBehalfOfImpl.
@@ -30,8 +33,13 @@
  */
 public class OnBehalfOfImpl extends AbstractWSTrustObject implements OnBehalfOf {
     
-    /** Wildcard child element. */
+    /** Wildcard child element.
+     * @deprecated This was an schema implementation mistake, should have implemented a sequence.
+     * */
     private XMLObject unknownChild;
+    
+    /** Wildcard child elements. */
+    private IndexedXMLObjectChildrenList<XMLObject> unknownChildren;
 
     /**
      * Constructor.
@@ -42,11 +50,20 @@
      */
     public OnBehalfOfImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
         super(namespaceURI, elementLocalName, namespacePrefix);
+        unknownChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
     }
 
     /** {@inheritDoc} */
     public XMLObject getUnknownXMLObject() {
-        return unknownChild;
+        // Have to do this b/c don't want to break existing code for both the
+        // setUnknownXMLObject case as well as the unmarshalling case, which will be in the list.
+        if (unknownChild != null) {
+            return unknownChild;
+        } else if (!unknownChildren.isEmpty()) {
+            return unknownChildren.get(0);
+        } else {
+            return null;
+        }
     }
 
     /** {@inheritDoc} */
@@ -60,6 +77,17 @@
         if (unknownChild != null) {
             children.add(unknownChild);
         }
+        children.addAll(unknownChildren);
         return Collections.unmodifiableList(children);
     }
+
+    /** {@inheritDoc} */

[... 25 lines stripped ...]


More information about the commits mailing list