You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scout-dev@ws.apache.org by ge...@apache.org on 2005/02/13 00:52:20 UTC

svn commit: r153583 - webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java

Author: geirm
Date: Sat Feb 12 15:52:19 2005
New Revision: 153583

URL: http://svn.apache.org/viewcvs?view=rev&rev=153583
Log:
start of support for getRegistryObjects() methods.  There's a bit of fog
on how to do this correctly - I think that there is no way to get it 
from UDDI in one shot, but I've asked jUDDI what to do.  If not, we 
need to add more types.


Modified:
    webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java?view=diff&r1=153582&r2=153583
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java (original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java Sat Feb 12 15:52:19 2005
@@ -63,6 +63,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Vector;
+import java.util.List;
 
 /**
  * Implements the JAXR BusinessQueryManager Interface
@@ -449,9 +450,16 @@
         try
         {
             /*
-             * hit the registry.
+             * hit the registry.  The key is not required for UDDI2
              */
-            ServiceList l = iRegistry.findService(orgKey.getId(), juddiNames,
+
+            String id = null;
+
+            if (orgKey != null) {
+                id = orgKey.getId();
+            }
+
+            ServiceList l = iRegistry.findService(id, juddiNames,
                     null, null, juddiFindQualifiers, registryService.getMaxRows());
 
             /*
@@ -595,9 +603,39 @@
 
         return service;
     }
+
+    /**
+     * Gets the RegistryObjects owned by the caller. The objects
+     * are returned as their concrete type (e.g. Organization, User etc.)
+     *
+     *  TODO - need to figure out what the set are.  This is just to get some
+     *  basic functionality
+     *
+     * @return
+     * @throws JAXRException
+     */
     public BulkResponse getRegistryObjects() throws JAXRException
     {
-        return null;
+        String types[] = {
+            LifeCycleManager.ORGANIZATION,
+            LifeCycleManager.SERVICE};
+
+        Collection c = new ArrayList();
+
+        for (int i = 0; i < types.length; i++) {
+            try {
+                BulkResponse bk = getRegistryObjects(types[i]);
+
+                if (bk.getCollection() != null) {
+                    c.addAll(bk.getCollection());
+                }
+            }
+            catch(JAXRException e) {
+                // ignore - just a problem with that type?
+            }
+        }
+
+        return new BulkResponseImpl(c);
     }
 
     public BulkResponse getRegistryObjects(Collection objectKeys) throws JAXRException
@@ -702,7 +740,27 @@
 
     public BulkResponse getRegistryObjects(String id) throws JAXRException
     {
-        throw new UnsupportedCapabilityException();
+        if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(id)) {
+            List a = new ArrayList();
+            a.add("%");
+
+            BulkResponse br = findOrganizations(null, a, null, null, null, null);
+
+            return br;
+        }
+        else if (LifeCycleManager.SERVICE.equalsIgnoreCase(id)) {
+            List a = new ArrayList();
+            a.add("%");
+
+            BulkResponse br = this.findServices(null,null, a, null, null);
+
+            return br;
+        }
+        else
+        {
+            throw new JAXRException("Unsupported type for getRegistryObjects() :" + id);
+        }
+
     }
 
     private static final Map findQualifierMapping;



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