juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r962411 - /webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java
Date Fri, 09 Jul 2010 05:17:06 GMT
Author: tcunning
Date: Fri Jul  9 05:17:06 2010
New Revision: 962411

URL: http://svn.apache.org/viewvc?rev=962411&view=rev
Log:
JUDDI-398
Only return serviceInfos that reflect data that contains a matching
bindingTemplate if a TModelBag or find_tmodel is present.

Modified:
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java?rev=962411&r1=962410&r2=962411&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java
(original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java
Fri Jul  9 05:17:06 2010
@@ -207,9 +207,31 @@ public class InquiryHelper {
 
 		// Sort and retrieve the final results taking paging into account
 		List<?> queryResults = FetchBusinessEntitiesQuery.select(em, findQualifiers, keysFound,
body.getMaxRows(), body.getListHead(), listDesc);
+		List<?> serviceResults = null;
+		for (int i = 0; i<queryResults.size(); i++) {
+			org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i);
+			
+			List<Object> keysIn = new ArrayList<Object>();
+			List<org.apache.juddi.model.BusinessService> services = be.getBusinessServices();
+			for (int j = 0; j<services.size(); j++) {
+				keysIn.add(services.get(j).getEntityKey());
+			}
+
+			serviceResults = FindServiceByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(),
null, keysIn);
+			if (serviceResults == null) {
+				be.setBusinessServices(null);
+			} else { 
+				ListDescription ldesc = new ListDescription();
+				result.setListDescription(listDesc);
+				List<?> srvcs = FetchBusinessServicesQuery.select(em, findQualifiers, serviceResults,
body.getMaxRows(), 
+						body.getListHead(), ldesc);
+				be.setBusinessServices((List<org.apache.juddi.model.BusinessService>)srvcs);
+			}
+		}
+			
 		if (queryResults != null && queryResults.size() > 0)
 			result.setBusinessInfos(new org.uddi.api_v3.BusinessInfos());
-
+		
 		// Set the currentIndex to 0 or the value of the subscriptionStartIndex
 		int currentIndex = 0;
 		if (subscriptionStartIndex != null && subscriptionStartIndex.value != null)



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


Mime
View raw message