[riftsaw-commits] riftsaw SVN: r978 - in branches/RiftSaw-2.1.x: runtime/uddi and 1 other directories.

riftsaw-commits at lists.jboss.org riftsaw-commits at lists.jboss.org
Thu Sep 23 05:52:06 EDT 2010


Author: jeff.yuchang
Date: 2010-09-23 05:52:05 -0400 (Thu, 23 Sep 2010)
New Revision: 978

Removed:
   branches/RiftSaw-2.1.x/distribution/src/main/release/db/juddi/esb.juddi300.client.xml
Modified:
   branches/RiftSaw-2.1.x/runtime/uddi/pom.xml
   branches/RiftSaw-2.1.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
Log:
* apply the Kurt's fix into RiftSaw-2.1.x


Deleted: branches/RiftSaw-2.1.x/distribution/src/main/release/db/juddi/esb.juddi300.client.xml
===================================================================
--- branches/RiftSaw-2.1.x/distribution/src/main/release/db/juddi/esb.juddi300.client.xml	2010-09-23 09:30:21 UTC (rev 977)
+++ branches/RiftSaw-2.1.x/distribution/src/main/release/db/juddi/esb.juddi300.client.xml	2010-09-23 09:52:05 UTC (rev 978)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<uddi>
-    <reloadDelay>5000</reloadDelay>
-    <manager name="test-manager">
-        <nodes>
-            <node>
-                <!-- required 'default' node -->
-                <name>default</name> 
-                <description>Main jUDDI node</description>
-                <properties>
-                   <property name="keyDomain"   value="esb.jboss.org"/>
-                   <property name="businessKey" value="redhat-jboss"/>
-                   <property name="serviceDescription" value="BPEL Service deployed by Riftsaw"/>
-                   <property name="bindingDescription" value="BPEL Endpoint deployed by Riftsaw"/>
-                </properties>
-                <!-- JAX-WS Transport
-                <proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
-                <custodyTransferUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/custody-transfer?wsdl</custodyTransferUrl>
-                <inquiryUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/inquiry?wsdl</inquiryUrl>
-                <publishUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/publish?wsdl</publishUrl>
-                <securityUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/security?wsdl</securityUrl>
-                <subscriptionUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/subscription?wsdl</subscriptionUrl>
-                <subscriptionListenerUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
-                <juddiApiUrl>http://${jboss.esb.bind.address}:8080/juddiv3/services/juddi-api?wsdl</juddiApiUrl>
-                -->
-                <!-- In VM Transport Settings -->
-                <proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiInVMTransport</proxyTransport>
-                <custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
-                <inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
-                <publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
-                <securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
-                <subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
-                <subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
-                <juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
-                <!-- RMI Transport Settings
-                <proxyTransport>org.apache.juddi.v3.client.transport.RMITransport</proxyTransport>
-                <custodyTransferUrl>/juddiv3/UDDICustodyTransferService</custodyTransferUrl>
-                <inquiryUrl>/juddiv3/UDDIInquiryService</inquiryUrl>
-                <publishUrl>/juddiv3/UDDIPublicationService</publishUrl>
-                <securityUrl>/juddiv3/UDDISecurityService</securityUrl>
-                <subscriptionUrl>/juddiv3/UDDISubscriptionService</subscriptionUrl>
-                <subscriptionListenerUrl>/juddiv3/UDDISubscriptionListenerService</subscriptionListenerUrl>
-                <juddiApiUrl>/juddiv3/JUDDIApiService</juddiApiUrl>
-                <javaNamingFactoryInitial>org.jnp.interfaces.NamingContextFactory</javaNamingFactoryInitial>
-                <javaNamingFactoryUrlPkgs>org.jboss.naming</javaNamingFactoryUrlPkgs>
-                <javaNamingProviderUrl>jnp://${jboss.esb.bind.address}:1099</javaNamingProviderUrl>
-                -->
-            </node>
-        </nodes>
-        <clerks registerOnStartup="true">
-           <clerk name="BPELClerk" node="default" publisher="jbossesb" password="jbossesb" />
-        </clerks>
-    </manager>
-</uddi>

Modified: branches/RiftSaw-2.1.x/runtime/uddi/pom.xml
===================================================================
--- branches/RiftSaw-2.1.x/runtime/uddi/pom.xml	2010-09-23 09:30:21 UTC (rev 977)
+++ branches/RiftSaw-2.1.x/runtime/uddi/pom.xml	2010-09-23 09:52:05 UTC (rev 978)
@@ -25,7 +25,7 @@
     <dependency>
       <artifactId>juddi-client</artifactId>
       <groupId>org.apache.juddi</groupId>
-      <version>3.0.1</version>
+      <version>3.0.3</version>
       <scope>provided</scope>
     </dependency>
     

Modified: branches/RiftSaw-2.1.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
===================================================================
--- branches/RiftSaw-2.1.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java	2010-09-23 09:30:21 UTC (rev 977)
+++ branches/RiftSaw-2.1.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java	2010-09-23 09:52:05 UTC (rev 978)
@@ -247,32 +247,17 @@
 		try {
 			//Checking if this serviceKey already exist
 			service = clerk.findService(serviceKey, clerk.getUDDINode().getApiNode());
-			log.debug("Service " + serviceName + " already present in the UDDI Registry");
+			if (service==null) {
+				service = createBusinessService(serviceName, serviceKey, properties);
+			} else {
+				log.debug("Service " + serviceName + " already present in the UDDI Registry");
+			}
 		} catch (Exception e) {
-			//If it does not exist construct service information
-			log.debug("Constructing Service UDDI Information for " + serviceName);
-			service = new BusinessService();
-			service.setBusinessKey(TokenResolver.replaceTokens("uddi:${keyDomain}:${businessKey}", properties));
-			service.setServiceKey(serviceKey);
-			if (properties.containsKey(SERVICE_DESCRIPTION)) {
-				Description description = new Description();
-				String lang = "en";
-				if (properties.containsKey(LANG)) lang = properties.getProperty(LANG);
-				description.setLang(lang);
-				description.setValue(properties.getProperty(SERVICE_DESCRIPTION));
-				Name sName = new Name();
-				sName.setLang(lang);
-				sName.setValue(serviceName);
-				service.getName().add(sName);
-				service.getDescription().add(description);
-			}
-			//default categoryBag on the binding
-			if (properties.containsKey(SERVICE_CATEGORY_BAG)) {
-				String defaultCategoryBag = properties.getProperty(SERVICE_CATEGORY_BAG);
-				log.info("Adding categoryBag: " + defaultCategoryBag);
-				CategoryBag categoryBag = parseCategoryBag(defaultCategoryBag);
-		        service.setCategoryBag(categoryBag);
-			}
+			
+			//This is here to support the jUDDI-client code prior to 3.0.3 where an
+			//exception was thrown when a service was not found.
+			//DEPRECATED, please remove when older jUDDI-client versions are no longer supported.
+			service = createBusinessService(serviceName, serviceKey, properties);
 		}
 		//Construct bindingTemplate
 		BindingTemplate binding = createBindingTemplate(clerk, serviceName, portName, accessUrl);
@@ -285,6 +270,34 @@
 		return service;
 	}
 	
+	private BusinessService createBusinessService(String serviceName, String serviceKey, Properties properties) {
+		//If it does not exist construct service information
+		log.debug("Constructing Service UDDI Information for " + serviceName);
+		BusinessService service = new BusinessService();
+		service.setBusinessKey(TokenResolver.replaceTokens("uddi:${keyDomain}:${businessKey}", properties));
+		service.setServiceKey(serviceKey);
+		String lang = "en";
+		if (properties.containsKey(SERVICE_DESCRIPTION)) {
+			Description description = new Description();
+			if (properties.containsKey(LANG)) lang = properties.getProperty(LANG);
+			description.setLang(lang);
+			description.setValue(properties.getProperty(SERVICE_DESCRIPTION));
+			service.getDescription().add(description);
+		}
+		Name sName = new Name();
+		sName.setLang(lang);
+		sName.setValue(serviceName);
+		service.getName().add(sName);
+		//default categoryBag on the binding
+		if (properties.containsKey(SERVICE_CATEGORY_BAG)) {
+			String defaultCategoryBag = properties.getProperty(SERVICE_CATEGORY_BAG);
+			log.info("Adding categoryBag: " + defaultCategoryBag);
+			CategoryBag categoryBag = parseCategoryBag(defaultCategoryBag);
+	        service.setCategoryBag(categoryBag);
+		}
+		return service;
+	}
+	
 	private BindingTemplate createBindingTemplate(UDDIClerk clerk,
 			String serviceName, String portName, URL accessURL) {
 		



More information about the riftsaw-commits mailing list