ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r816437 [1/3] - in /webservices/scout/trunk/src: main/java/org/apache/ws/scout/model/uddi/v2/ main/java/org/apache/ws/scout/registry/ test/java/org/apache/ws/scout/registry/ test/java/org/apache/ws/scout/registry/qa/
Date Fri, 18 Sep 2009 02:15:19 GMT
Author: tcunning
Date: Fri Sep 18 02:15:18 2009
New Revision: 816437

URL: http://svn.apache.org/viewvc?rev=816437&view=rev
Log:
SCOUT-90
Merge over 1.1.1 fixes.

Added:
    webservices/scout/trunk/src/test/java/org/apache/ws/scout/registry/JAXBTest.java
      - copied unchanged from r801696, webservices/scout/branches/scout-1.1/src/test/java/org/apache/ws/scout/registry/JAXBTest.java
Modified:
    webservices/scout/trunk/src/main/java/org/apache/ws/scout/model/uddi/v2/AssertionStatusReport.java
    webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
    webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
    webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java
    webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/RegistryV3Impl.java
    webservices/scout/trunk/src/test/java/org/apache/ws/scout/registry/OwnershipTest.java
    webservices/scout/trunk/src/test/java/org/apache/ws/scout/registry/qa/JAXR030AssociationsTest.java

Modified: webservices/scout/trunk/src/main/java/org/apache/ws/scout/model/uddi/v2/AssertionStatusReport.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/src/main/java/org/apache/ws/scout/model/uddi/v2/AssertionStatusReport.java?rev=816437&r1=816436&r2=816437&view=diff
==============================================================================
--- webservices/scout/trunk/src/main/java/org/apache/ws/scout/model/uddi/v2/AssertionStatusReport.java
(original)
+++ webservices/scout/trunk/src/main/java/org/apache/ws/scout/model/uddi/v2/AssertionStatusReport.java
Fri Sep 18 02:15:18 2009
@@ -14,6 +14,7 @@
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlType;
 
 
@@ -43,7 +44,8 @@
     "assertionStatusItem"
 })
 public class AssertionStatusReport {
-
+	
+	@XmlElement(required = true)
     protected List<AssertionStatusItem> assertionStatusItem;
     @XmlAttribute(required = true)
     protected String generic;

Modified: webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java?rev=816437&r1=816436&r2=816437&view=diff
==============================================================================
--- webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
(original)
+++ webservices/scout/trunk/src/main/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
Fri Sep 18 02:15:18 2009
@@ -619,81 +619,42 @@
 
     private void clearPublisherAssertions( String authinfo,IRegistry ireg)
     {
-       Vector<PublisherAssertion> pasvect  = null;
-       PublisherAssertion[] pasarr  = null;
+       Vector<PublisherAssertion> pasvect  = new Vector<PublisherAssertion>();
+       
        try
        {
           AssertionStatusReport report = ireg.getAssertionStatusReport(authinfo,"status:complete");
           List<AssertionStatusItem> assertionStatusItemList = report.getAssertionStatusItem();
-          AssertionStatusItem[] assertionStatusItemArr = 
-        	  new AssertionStatusItem[assertionStatusItemList.size()];
+          for (AssertionStatusItem assertionStatusItem : assertionStatusItemList) {
+              pasvect.add(this.getPublisherAssertion(assertionStatusItem));
+		  }
 
-          int len = assertionStatusItemArr != null? assertionStatusItemArr.length : 0;
-          for (int i = 0; i < len; i++)
-          {
-                AssertionStatusItem asi = assertionStatusItemArr[i];
-               /* String sourceKey = asi.getFromKey();
-                String targetKey = asi.getToKey();
-                PublisherAssertion pa = new PublisherAssertion();
-                pa.setFromKey(sourceKey);
-                pa.setToKey(targetKey);
-                KeyedReference keyr = asi.getKeyedReference();
-                pa.setKeyedReference(keyr);
-                pa.setTModelKey(keyr.getTModelKey());
-                pa.setKeyName(keyr.getKeyName());
-                pa.setKeyValue(keyr.getKeyValue());
-                if(pasvect == null) pasvect = new Vector(len);
-                pasvect.add(pa);*/
-                if(pasvect == null) pasvect = new Vector<PublisherAssertion>(len);
-                pasvect.add(this.getPublisherAssertion(asi));
-           }
           report = ireg.getAssertionStatusReport(authinfo,"status:toKey_incomplete");
-          assertionStatusItemArr = report.getAssertionStatusItem().toArray(assertionStatusItemArr);
-
-          len = assertionStatusItemArr != null? assertionStatusItemArr.length : 0;
-          for (int i = 0; i < len; i++)
-          {
-                AssertionStatusItem asi = (AssertionStatusItem) assertionStatusItemArr[i];
-                if(pasvect == null) pasvect = new Vector<PublisherAssertion>(len);
-                pasvect.add(this.getPublisherAssertion(asi));
-          }
+          assertionStatusItemList = report.getAssertionStatusItem();
+          for (AssertionStatusItem assertionStatusItem : assertionStatusItemList) {
+              pasvect.add(this.getPublisherAssertion(assertionStatusItem));
+		  }
 
           report = ireg.getAssertionStatusReport(authinfo,"status:fromKey_incomplete");
-          assertionStatusItemArr = report.getAssertionStatusItem().toArray(assertionStatusItemArr);
-
-          len = assertionStatusItemArr != null? assertionStatusItemArr.length : 0;
-          for (int i = 0; i < len; i++)
-          {
-                AssertionStatusItem asi = (AssertionStatusItem) assertionStatusItemArr[i];
-                if(pasvect == null) pasvect = new Vector<PublisherAssertion>(len);
-                pasvect.add(this.getPublisherAssertion(asi));
-          }
-
-          if (pasvect != null) {
-        	  pasarr = new PublisherAssertion[pasvect.size()];
-        	  Iterator iter = pasvect.iterator();
-        	  int pasarrPos = 0;
-        	  while (iter.hasNext()) {
-        		  pasarr[pasarrPos] = ((PublisherAssertion) iter.next());
-        		  pasarrPos++;
-        	  }
+          assertionStatusItemList = report.getAssertionStatusItem();
+          for (AssertionStatusItem assertionStatusItem : assertionStatusItemList) {
+              pasvect.add(this.getPublisherAssertion(assertionStatusItem));
+		  }
+
+          if (pasvect.size() > 0) {
+        	  PublisherAssertion[] pasarr = new PublisherAssertion[pasvect.size()];
+        	  int i=0;
+              for (PublisherAssertion publisherAssertion : pasvect) {
+				  pasarr[i++] = publisherAssertion;
+			  }
+        	  ireg.deletePublisherAssertions(authinfo, pasarr);
           }
        }
        catch (RegistryException e)
        {
           throw new RuntimeException(e);
        }
-
-          if(pasarr != null && pasarr.length > 0)
-             try
-             {
-                ireg.deletePublisherAssertions(authinfo, pasarr);
-             }
-             catch (RegistryException e)
-             { 
-                log.debug("Ignoring exception " + e.getMessage(),e);
-             }
-       }
+    }
 
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message