ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r123269 - /webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java /webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java
Date Fri, 24 Dec 2004 03:23:53 GMT
Author: anil
Date: Thu Dec 23 19:23:53 2004
New Revision: 123269

URL: http://svn.apache.org/viewcvs?view=rev&rev=123269
Log:
Add DeleteOrg semantics.

Modified:
   webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
   webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java?view=diff&rev=123269&p1=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java&r1=123268&p2=webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java&r2=123269
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessLifeCycleManagerImpl.java
Thu Dec 23 19:23:53 2004
@@ -65,9 +65,49 @@
         return null;
     }
 
-    public BulkResponse deleteOrganizations(Collection organizationKeys) throws JAXRException
+    public BulkResponse deleteOrganizations(Collection orgkeys) throws JAXRException
     {
-        return null;
+        //Now we need to convert the collection into a vector for juddi
+        BulkResponseImpl bulk = new BulkResponseImpl();
+        Vector keyvect = new Vector();
+
+        Collection coll = new ArrayList();
+        Collection exceptions = new ArrayList();
+
+        try
+        {
+            Iterator iter = orgkeys.iterator();
+            while (iter.hasNext())
+            {
+                Key key = (Key)iter.next();
+                keyvect.add(key.getId());
+            }
+            System.out.println("Method:del_business: ENlength=" + keyvect.size());
+            // Save business
+            DispositionReport bd = (DispositionReport) executeOperation(keyvect, "DELETE_ORG");
+
+            keyvect = bd.getResultVector();
+            System.out.println("After deleting Business. Obtained vector size:" + keyvect.size());
+            for (int i = 0; keyvect != null && i < keyvect.size(); i++)
+            {
+                Result result = (Result) keyvect.elementAt(i);
+                int errno = result.getErrno();
+                if(errno == 0) coll.addAll(orgkeys);
+                else
+                {
+                    ErrInfo errinfo = result.getErrInfo();
+                    DeleteException de = new DeleteException(errinfo.getErrCode()+":"+errinfo.getErrMsg());
+                    exceptions.add(de);
+                }
+            }
+
+            bulk.setCollection(coll);
+            bulk.setExceptions(exceptions);
+        } catch (Exception tran)
+        {
+            throw new JAXRException("Apache JAXR Impl:", tran);
+        }
+        return bulk;
     }
 
     public BulkResponse deleteServiceBindings(Collection bindingKeys) throws JAXRException
@@ -303,6 +343,9 @@
         } else if (op.equalsIgnoreCase("SAVE_TMODEL"))
         {
             regobj = ireg.saveTModel(token.getAuthInfo(), datavect);
+        } else if (op.equalsIgnoreCase("DELETE_ORG"))
+        {
+            regobj = ireg.deleteBusiness(token.getAuthInfo(), datavect);
         } else
             throw new JAXRException("Unsupported operation:" + op);
 

Modified: webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java
Url: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java?view=diff&rev=123269&p1=webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java&r1=123268&p2=webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java&r2=123269
==============================================================================
--- webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java
(original)
+++ webservices/scout/trunk/modules/scout/src/test/org/apache/ws/scout/JaxrPublishOrgTest.java
Thu Dec 23 19:23:53 2004
@@ -33,6 +33,7 @@
 public class JaxrPublishOrgTest extends TestCase
 {
     private Connection connection = null;
+    //Tested on a local jboss instance
     private String userid = "jboss";
     private String passwd = "jboss";
     private BusinessLifeCycleManager blm = null;

---------------------------------------------------------------------
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