ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r765475 - in /webservices/scout/trunk/scout/src: main/java/org/apache/ws/scout/registry/ test/java/org/apache/ws/scout/registry/
Date Thu, 16 Apr 2009 05:52:26 GMT
Author: tcunning
Date: Thu Apr 16 05:52:25 2009
New Revision: 765475

URL: http://svn.apache.org/viewvc?rev=765475&view=rev
Log:
SCOUT-55
Use GetRegisteredInfo to grab the organizations owned.

Modified:
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/IRegistry.java
    webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java
    webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/BusinessQueryManager2Test.java

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java?rev=765475&r1=765474&r2=765475&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/BusinessQueryManagerImpl.java
Thu Apr 16 05:52:25 2009
@@ -57,6 +57,7 @@
 import org.apache.ws.scout.uddi.BusinessDetail;
 import org.apache.ws.scout.uddi.BusinessEntity;
 import org.apache.ws.scout.uddi.BusinessInfo;
+import org.apache.ws.scout.uddi.BusinessInfos;
 import org.apache.ws.scout.uddi.BusinessList;
 import org.apache.ws.scout.uddi.BusinessService;
 import org.apache.ws.scout.uddi.FindQualifiers;
@@ -64,6 +65,7 @@
 import org.apache.ws.scout.uddi.Name;
 import org.apache.ws.scout.uddi.PublisherAssertion;
 import org.apache.ws.scout.uddi.PublisherAssertions;
+import org.apache.ws.scout.uddi.RegisteredInfo;
 import org.apache.ws.scout.uddi.ServiceDetail;
 import org.apache.ws.scout.uddi.ServiceInfo;
 import org.apache.ws.scout.uddi.ServiceInfos;
@@ -718,8 +720,7 @@
                 throw new JAXRException(e.getLocalizedMessage());
             }
         }
-        else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {
-
+        else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType)) {        	
             try
             {
                 BusinessDetail orgdetail = registry.getBusinessDetail(id);
@@ -729,6 +730,7 @@
                 e.printStackTrace();
                 throw new JAXRException(e.getLocalizedMessage());
             }
+
         }
         else if (LifeCycleManager.CONCEPT.equalsIgnoreCase(objectType)) {
 
@@ -861,18 +863,27 @@
         }
         else if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(objectType))
         {
-            //Get the Organization from the uddi registry
+        	ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
+            AuthToken auth = this.getAuthToken(con,registry);
+        	
             try
             {
-                BusinessDetail orgdetail = registry.getBusinessDetail(keys);
-                BusinessEntity[] bizarr = orgdetail.getBusinessEntityArray();
-                for (int i = 0; bizarr != null && i < bizarr.length; i++)
-                {
-                    col.add(ScoutUddiJaxrHelper.getOrganization(bizarr[i], lcm));
-                }
-            } catch (RegistryException e)
-            {
-                throw new JAXRException(e.getLocalizedMessage());
+            	RegisteredInfo ri = registry.getRegisteredInfo(auth.getAuthInfo());
+            	BusinessInfos infos = null;
+            	BusinessInfo[] biarr = null;
+            	
+            	if (ri != null) infos = ri.getBusinessInfos();
+            	if (infos != null) biarr = infos.getBusinessInfoArray();
+            	            	
+            	for (int i = 0; i < biarr.length; i++) {
+            		BusinessInfo info = biarr[i];
+            		BusinessDetail detail = registry.getBusinessDetail(info.getBusinessKey());
+
+                    col.add(registryService.getLifeCycleManagerImpl().createOrganization(detail));
+            	}
+            } catch (RegistryException e) {
+                    e.printStackTrace();
+                    throw new JAXRException(e.getLocalizedMessage());
             }
         }
         else if (LifeCycleManager.CONCEPT.equalsIgnoreCase(objectType))
@@ -925,12 +936,37 @@
     public BulkResponse getRegistryObjects(String id) throws JAXRException
     {
         if (LifeCycleManager.ORGANIZATION.equalsIgnoreCase(id)) {
-            List<String> a = new ArrayList<String>();
-            a.add("%");
+            IRegistry registry = registryService.getRegistry();
 
-            BulkResponse br = findOrganizations(null, a, null, null, null, null);
+        	ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
+            AuthToken auth = this.getAuthToken(con,registry);
 
-            return br;
+            BulkResponse br = null;
+    		LinkedHashSet<Organization> orgs = null;
+            
+            try
+            {
+            	RegisteredInfo ri = registry.getRegisteredInfo(auth.getAuthInfo());
+            	BusinessInfos infos = null;
+            	BusinessInfo[] biarr = null;
+            	
+            	if (ri != null) infos = ri.getBusinessInfos();
+            	if (infos != null) biarr = infos.getBusinessInfoArray();
+            	
+            	if (biarr != null) {
+                    orgs = new LinkedHashSet<Organization>();
+            	}
+            	
+            	for (int i = 0; i < biarr.length; i++) {
+            		BusinessInfo info = biarr[i];
+            		BusinessDetail detail = registry.getBusinessDetail(info.getBusinessKey());
+
+                    orgs.add(registryService.getLifeCycleManagerImpl().createOrganization(detail));
+            	}
+            } catch (RegistryException re) {
+            	throw new JAXRException(re);
+            }
+            return new BulkResponseImpl(orgs);
         }
         else if (LifeCycleManager.SERVICE.equalsIgnoreCase(id)) {
             List<String> a = new ArrayList<String>();

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/IRegistry.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/IRegistry.java?rev=765475&r1=765474&r2=765475&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/IRegistry.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/IRegistry.java
Thu Apr 16 05:52:25 2009
@@ -34,6 +34,7 @@
 import org.apache.ws.scout.uddi.Name;
 import org.apache.ws.scout.uddi.PublisherAssertion;
 import org.apache.ws.scout.uddi.PublisherAssertions;
+import org.apache.ws.scout.uddi.RegisteredInfo;
 import org.apache.ws.scout.uddi.ServiceDetail;
 import org.apache.ws.scout.uddi.ServiceList;
 import org.apache.ws.scout.uddi.TModel;
@@ -68,7 +69,7 @@
 	/**
 	 * @return Returns the publishURL.
 	 */
-	URI getPublishURI();
+	URI getPublishURI();	
 	
 	/**
 	 * @param publishURL The publishURL to set.
@@ -223,6 +224,12 @@
 	    throws RegistryException;
 	  
 	  /**
+	   * @exception RegistryException;
+	   */
+	  RegisteredInfo getRegisteredInfo(String authInfo)
+	  	throws RegistryException;
+	  
+	  /**
 	   * "Used to locate one or more tModel information structures. Returns a
 	   *  tModelList structure."
 	   *

Modified: webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java?rev=765475&r1=765474&r2=765475&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java
(original)
+++ webservices/scout/trunk/scout/src/main/java/org/apache/ws/scout/registry/RegistryImpl.java
Thu Apr 16 05:52:25 2009
@@ -70,6 +70,8 @@
 import org.apache.ws.scout.uddi.GetBusinessDetailDocument;
 import org.apache.ws.scout.uddi.GetPublisherAssertions;
 import org.apache.ws.scout.uddi.GetPublisherAssertionsDocument;
+import org.apache.ws.scout.uddi.GetRegisteredInfo;
+import org.apache.ws.scout.uddi.GetRegisteredInfoDocument;
 import org.apache.ws.scout.uddi.GetServiceDetail;
 import org.apache.ws.scout.uddi.GetServiceDetailDocument;
 import org.apache.ws.scout.uddi.GetTModelDetail;
@@ -79,6 +81,8 @@
 import org.apache.ws.scout.uddi.PublisherAssertion;
 import org.apache.ws.scout.uddi.PublisherAssertions;
 import org.apache.ws.scout.uddi.PublisherAssertionsDocument;
+import org.apache.ws.scout.uddi.RegisteredInfo;
+import org.apache.ws.scout.uddi.RegisteredInfoDocument;
 import org.apache.ws.scout.uddi.SaveBinding;
 import org.apache.ws.scout.uddi.SaveBindingDocument;
 import org.apache.ws.scout.uddi.SaveBusiness;
@@ -920,6 +924,27 @@
 	}
 
 	/**
+	 * @exception RegistryException;
+	 */
+	public RegisteredInfo getRegisteredInfo(String authInfo)
+			throws RegistryException {
+		GetRegisteredInfoDocument doc = GetRegisteredInfoDocument.Factory
+				.newInstance();
+		GetRegisteredInfo request = doc.addNewGetRegisteredInfo();
+
+		if (authInfo != null) {
+			request.setAuthInfo(authInfo);
+		}
+
+        RegisteredInfo ri;
+        XmlObject o = execute(doc, this.getPublishURI()).changeType(
+                RegisteredInfoDocument.type);
+        ri = ((RegisteredInfoDocument) o).getRegisteredInfo();
+
+        return ri;
+	}
+	
+	/**
 	 * "Used to get full details for a particular registered businessService.
 	 * Returns a serviceDetail message."
 	 * 

Modified: webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/BusinessQueryManager2Test.java
URL: http://svn.apache.org/viewvc/webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/BusinessQueryManager2Test.java?rev=765475&r1=765474&r2=765475&view=diff
==============================================================================
--- webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/BusinessQueryManager2Test.java
(original)
+++ webservices/scout/trunk/scout/src/test/java/org/apache/ws/scout/registry/BusinessQueryManager2Test.java
Thu Apr 16 05:52:25 2009
@@ -63,6 +63,7 @@
         super.tearDown();
     }
 	
+    @Test
 	public void testGetRegistryObjects() {
         login();
         try {



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