You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by ks...@apache.org on 2009/10/20 05:01:50 UTC

svn commit: r826933 - in /webservices/juddi/trunk: juddi-client/src/main/java/org/apache/juddi/v3/client/transport/ juddi-core/src/main/java/org/apache/juddi/api/impl/ juddi-core/src/main/java/org/apache/juddi/mapping/ juddi-core/src/main/java/org/apac...

Author: kstam
Date: Tue Oct 20 03:01:49 2009
New Revision: 826933

URL: http://svn.apache.org/viewvc?rev=826933&view=rev
Log:
JUDDI-240 adding sync subscription

Added:
    webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscription.java
    webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscriptionDetail.java
Modified:
    webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/InVMTransport.java
    webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java
    webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/RMITransport.java
    webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
    webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/JUDDIApiPortType.java

Modified: webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/InVMTransport.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/InVMTransport.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/InVMTransport.java (original)
+++ webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/InVMTransport.java Tue Oct 20 03:01:49 2009
@@ -26,7 +26,7 @@
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 
-public class InVMTransport implements Transport {
+public class InVMTransport extends Transport {
 
 	private String nodeName = null;
 	UDDIInquiryPortType inquiryService = null;
@@ -47,10 +47,10 @@
 		this.nodeName = nodeName;
 	}
 	
-	public UDDIInquiryPortType getUDDIInquiryService() throws TransportException {
+	public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
 		if (inquiryService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
 				Class<?> c = Class.forName(endpointURL);
 				inquiryService = (UDDIInquiryPortType) c.newInstance();
 			} catch (Exception e) {
@@ -60,10 +60,10 @@
 		return inquiryService;
 	}
 	
-	public UDDISecurityPortType getUDDISecurityService() throws TransportException {
+	public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
 		if (securityService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
 				Class<?> c = Class.forName(endpointURL);
 				securityService = (UDDISecurityPortType) c.newInstance();
 			} catch (Exception e) {
@@ -73,10 +73,10 @@
 		return securityService;
 	}
 	
-	public UDDIPublicationPortType getUDDIPublishService() throws TransportException {
+	public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
 		if (publishService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
 				Class<?> c = Class.forName(endpointURL);
 				publishService = (UDDIPublicationPortType) c.newInstance();
 			} catch (Exception e) {
@@ -86,10 +86,10 @@
 		return publishService;
 	}
 	
-	public UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException {
+	public UDDISubscriptionPortType getUDDISubscriptionService(String endpointURL) throws TransportException {
 		if (subscriptionService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
 				Class<?> c = Class.forName(endpointURL);
 				subscriptionService = (UDDISubscriptionPortType) c.newInstance();
 			} catch (Exception e) {
@@ -99,10 +99,10 @@
 		return subscriptionService;
 	}
 	
-	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException {
+	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String endpointURL) throws TransportException {
 		if (subscriptionListenerService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
 				Class<?> c = Class.forName(endpointURL);
 				subscriptionListenerService = (UDDISubscriptionListenerPortType) c.newInstance();
 			} catch (Exception e) {
@@ -112,10 +112,10 @@
 		return subscriptionListenerService;
 	}
 	
-	public UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException {
+	public UDDICustodyTransferPortType getUDDICustodyTransferService(String endpointURL) throws TransportException {
 		if (custodyTransferService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
 				Class<?> c = Class.forName(endpointURL);
 				custodyTransferService = (UDDICustodyTransferPortType) c.newInstance();
 			} catch (Exception e) {
@@ -125,10 +125,10 @@
 		return custodyTransferService;
 	}
 	
-	public JUDDIApiPortType getJUDDIApiService() throws TransportException {
+	public JUDDIApiPortType getJUDDIApiService(String endpointURL) throws TransportException {
 		if (publisherService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
 				Class<?> c = Class.forName(endpointURL);
 				publisherService = (JUDDIApiPortType) c.newInstance();
 			} catch (Exception e) {

Modified: webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java (original)
+++ webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java Tue Oct 20 03:01:49 2009
@@ -31,7 +31,7 @@
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 
-public class JAXWSTransport implements Transport {
+public class JAXWSTransport extends Transport {
 
 	String nodeName = null;
 	UDDIInquiryPortType inquiryService = null;
@@ -51,12 +51,12 @@
 		super();
 		this.nodeName = nodeName;
 	}
-
-	public UDDIInquiryPortType getUDDIInquiryService() throws TransportException {
+	
+	public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
 
 		if (inquiryService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
 				QName qName = new QName(Transport.API_V3_NAMESPACE, Transport.INQUIRY_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				inquiryService = (UDDIInquiryPortType) service.getPort(UDDIInquiryPortType.class);
@@ -67,11 +67,11 @@
 		return inquiryService;
 	}
 	
-	public UDDISecurityPortType getUDDISecurityService() throws TransportException {
+	public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
 
 		if (securityService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
 				QName qName = new QName(Transport.API_V3_NAMESPACE, Transport.SECURITY_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				securityService = (UDDISecurityPortType) service.getPort(UDDISecurityPortType.class);
@@ -82,11 +82,11 @@
 		return securityService;
 	}
 	
-	public UDDIPublicationPortType getUDDIPublishService() throws TransportException {
+	public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
 
 		if (publishService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
 				QName qName = new QName(Transport.API_V3_NAMESPACE, Transport.PUBLISH_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				publishService = (UDDIPublicationPortType) service.getPort(UDDIPublicationPortType.class);
@@ -97,11 +97,11 @@
 		return publishService;
 	}
 	
-	public UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException {
+	public UDDISubscriptionPortType getUDDISubscriptionService(String endpointURL) throws TransportException {
 
 		if (subscriptionService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
 				QName qName = new QName(Transport.SUB_V3_NAMESPACE, Transport.SUBSCRIPTION_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				subscriptionService = (UDDISubscriptionPortType) service.getPort(UDDISubscriptionPortType.class);
@@ -112,10 +112,10 @@
 		return subscriptionService;
 	}
 	
-	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException {
+	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String endpointURL) throws TransportException {
 		if (subscriptionListenerService == null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
 				QName qName = new QName(Transport.SUBR_V3_NAMESPACE, Transport.SUBSCRIPTION_LISTENER_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				subscriptionListenerService = (UDDISubscriptionListenerPortType) service.getPort(UDDISubscriptionListenerPortType.class);
@@ -126,10 +126,10 @@
 		return subscriptionListenerService;
 	}
 	
-	public UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException {
+	public UDDICustodyTransferPortType getUDDICustodyTransferService(String endpointURL) throws TransportException {
 		if (custodyTransferService == null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
 				QName qName = new QName(Transport.CUSTODY_V3_NAMESPACE, Transport.CUSTODY_TRANSFER_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				custodyTransferService = (UDDICustodyTransferPortType) service.getPort(UDDICustodyTransferPortType.class);
@@ -140,10 +140,10 @@
 		return custodyTransferService;
 	}
 	
-	public JUDDIApiPortType getJUDDIApiService() throws TransportException {
+	public JUDDIApiPortType getJUDDIApiService(String endpointURL) throws TransportException {
 		if (publisherService == null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
 				QName qName = new QName(Transport.JUDDI_API_V3_NAMESPACE, Transport.PUBLISHER_SERVICE);
 				Service service = Service.create(new URL(endpointURL), qName);
 				publisherService = (JUDDIApiPortType) service.getPort(JUDDIApiPortType.class);

Modified: webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/RMITransport.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/RMITransport.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/RMITransport.java (original)
+++ webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/RMITransport.java Tue Oct 20 03:01:49 2009
@@ -35,7 +35,7 @@
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 
-public class RMITransport implements Transport {
+public class RMITransport extends Transport {
 
 	InitialContext context = null;
 	private Logger logger = Logger.getLogger(this.getClass());
@@ -73,10 +73,10 @@
 	private JUDDIApiPortType publisherService = null;
 	
 
-	public UDDIInquiryPortType getUDDIInquiryService() throws TransportException {
+	public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
 		if (inquiryService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
+				if (endpointURL==null)  endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -89,10 +89,10 @@
 		return inquiryService;
 	}
 	
-	public UDDISecurityPortType getUDDISecurityService() throws TransportException {
+	public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
 		if (securityService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -105,10 +105,10 @@
 		return securityService;
 	}
 	
-	public UDDIPublicationPortType getUDDIPublishService() throws TransportException {
+	public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
 		if (publishService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getPublishUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -121,10 +121,10 @@
 		return publishService;
 	}
 	
-	public UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException {
+	public UDDISubscriptionPortType getUDDISubscriptionService(String endpointURL) throws TransportException {
 		if (subscriptionService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -137,10 +137,10 @@
 		return subscriptionService;
 	}
 	
-	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException {
+	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String endpointURL) throws TransportException {
 		if (subscriptionListenerService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -153,10 +153,10 @@
 		return subscriptionListenerService;
 	}
 	
-	public UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException {
+	public UDDICustodyTransferPortType getUDDICustodyTransferService(String endpointURL) throws TransportException {
 		if (custodyTransferService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);
@@ -169,10 +169,10 @@
 		return custodyTransferService;
 	}
 	
-	public JUDDIApiPortType getJUDDIApiService() throws TransportException {
+	public JUDDIApiPortType getJUDDIApiService(String endpointURL) throws TransportException {
 		if (publisherService==null) {
 			try {
-				String endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
+				if (endpointURL==null) endpointURL = UDDIClerkManager.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
 				URI endpointURI = new URI(endpointURL);
 		    	String service    = endpointURI.getPath();
 		    	logger.debug("Looking up service=" + service);

Modified: webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java (original)
+++ webservices/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/Transport.java Tue Oct 20 03:01:49 2009
@@ -24,7 +24,7 @@
 import org.uddi.v3_service.UDDISubscriptionListenerPortType;
 import org.uddi.v3_service.UDDISubscriptionPortType;;
 
-public interface Transport {
+public abstract class Transport {
 	
 	public final static String API_V3_NAMESPACE              = "urn:uddi-org:api_v3_portType";
 	public final static String SUB_V3_NAMESPACE              = "urn:uddi-org:sub_v3_portType";
@@ -41,12 +41,33 @@
 	public final static String CUSTODY_TRANSFER_SERVICE      = "UDDICustodyTransferService";
 	public final static String PUBLISHER_SERVICE             = "JUDDIApiService";
 	
-	UDDIInquiryPortType getUDDIInquiryService()           throws TransportException;
-	UDDISecurityPortType getUDDISecurityService()         throws TransportException;
-	UDDIPublicationPortType getUDDIPublishService()       throws TransportException;
-	UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException;
-	UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException;
-	UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException;
-	JUDDIApiPortType getJUDDIApiService() throws TransportException;
+	public abstract UDDIInquiryPortType getUDDIInquiryService(String enpointURL)           throws TransportException;
+	public abstract UDDISecurityPortType getUDDISecurityService(String enpointURL)         throws TransportException;
+	public abstract UDDIPublicationPortType getUDDIPublishService(String enpointURL)       throws TransportException;
+	public abstract UDDISubscriptionPortType getUDDISubscriptionService(String enpointURL) throws TransportException;
+	public abstract UDDICustodyTransferPortType getUDDICustodyTransferService(String enpointURL) throws TransportException;
+	public abstract UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String enpointURL) throws TransportException;
+	public abstract JUDDIApiPortType getJUDDIApiService(String enpointURL) throws TransportException;
 	
+	public UDDIInquiryPortType getUDDIInquiryService() throws TransportException {
+		return getUDDIInquiryService(null);
+	}
+	public UDDISecurityPortType getUDDISecurityService() throws TransportException {
+		return getUDDISecurityService(null);
+	}
+	public UDDIPublicationPortType getUDDIPublishService() throws TransportException {
+		return getUDDIPublishService(null);
+	}
+	public UDDISubscriptionPortType getUDDISubscriptionService() throws TransportException {
+		return getUDDISubscriptionService(null);
+	}
+	public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService() throws TransportException {
+		return getUDDISubscriptionListenerService(null);
+	}
+	public UDDICustodyTransferPortType getUDDICustodyTransferService() throws TransportException {
+		return getUDDICustodyTransferService(null);
+	}
+	public JUDDIApiPortType getJUDDIApiService() throws TransportException {
+		return getJUDDIApiService(null);
+	}
 }

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java (original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java Tue Oct 20 03:01:49 2009
@@ -17,6 +17,7 @@
 
 package org.apache.juddi.api.impl;
 
+import java.io.StringWriter;
 import java.rmi.RemoteException;
 import java.util.List;
 
@@ -24,7 +25,10 @@
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
 
+import org.apache.juddi.api_v3.Clerk;
 import org.apache.juddi.api_v3.ClerkDetail;
 import org.apache.juddi.api_v3.ClientSubscriptionInfoDetail;
 import org.apache.juddi.api_v3.DeleteClientSubscriptionInfo;
@@ -39,6 +43,8 @@
 import org.apache.juddi.api_v3.SaveClientSubscriptionInfo;
 import org.apache.juddi.api_v3.SaveNode;
 import org.apache.juddi.api_v3.SavePublisher;
+import org.apache.juddi.api_v3.SyncSubscription;
+import org.apache.juddi.api_v3.SyncSubscriptionDetail;
 import org.apache.juddi.config.PersistenceManager;
 import org.apache.juddi.error.ErrorMessage;
 import org.apache.juddi.error.InvalidKeyPassedException;
@@ -47,14 +53,21 @@
 import org.apache.juddi.model.ClientSubscriptionInfo;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.subscription.NotificationList;
+import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.apache.juddi.validation.ValidateClerk;
 import org.apache.juddi.validation.ValidateClientSubscriptionInfo;
 import org.apache.juddi.validation.ValidateNode;
 import org.apache.juddi.validation.ValidatePublish;
 import org.apache.juddi.validation.ValidatePublisher;
+import org.apache.log4j.Logger;
+import org.apache.log4j.helpers.Loader;
 import org.uddi.api_v3.DeleteTModel;
+import org.uddi.sub_v3.GetSubscriptionResults;
+import org.uddi.sub_v3.SubscriptionResultsList;
 import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
@@ -65,6 +78,7 @@
 			targetNamespace = "urn:juddi-apache-org:api_v3_portType")
 public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortType {
 
+	private Logger log = Logger.getLogger(this.getClass());
 	/**
 	 * Saves publisher(s) to the persistence layer.  This method is specific to jUDDI.
 	 */
@@ -482,6 +496,84 @@
 		}
 	}
 
+	/**
+	 * Instructs the registry to perform a synchronous subscription response.
+	 */
+	@SuppressWarnings("unchecked")
+	public SyncSubscriptionDetail invokeSyncSubscription(
+			SyncSubscription body) throws DispositionReportFaultMessage,
+			RemoteException {
+		
+		//validate
+		
+		SyncSubscriptionDetail syncSubscriptionDetail = new SyncSubscriptionDetail();
+		
+		//find the clerks to go with these subscriptions
+		EntityManager em = PersistenceManager.getEntityManager();
+		EntityTransaction tx = em.getTransaction();
+		try {
+			tx.begin();
+	
+			this.getEntityPublisher(em, body.getAuthInfo());
+			for (GetSubscriptionResults getSubscriptionResult : body.getGetSubscriptionResultsList()) {
+				String subscriptionKey = getSubscriptionResult.getSubscriptionKey();
+				org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo =
+					em.find(org.apache.juddi.model.ClientSubscriptionInfo.class, subscriptionKey);
+				if (modelClientSubscriptionInfo == null) {
+					throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscripKeyNotFound", subscriptionKey));
+				}
+				org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo = new org.apache.juddi.api_v3.ClientSubscriptionInfo();
+				MappingModelToApi.mapClientSubscriptionInfo(modelClientSubscriptionInfo, apiClientSubscriptionInfo);
+				syncSubscriptionDetail.getClientSubscriptionInfoMap().put(apiClientSubscriptionInfo.getSubscriptionKey(),apiClientSubscriptionInfo);
+			}
+	
+			tx.commit();
+		} finally {
+			if (tx.isActive()) {
+				tx.rollback();
+			}
+			em.close();
+		}
+		
+		for (GetSubscriptionResults getSubscriptionResult : body.getGetSubscriptionResultsList()) {
+			try {
+				String subscriptionKey = getSubscriptionResult.getSubscriptionKey();
+				Clerk clerk = syncSubscriptionDetail.getClientSubscriptionInfoMap().get(subscriptionKey).getClerk();
+				String clazz = clerk.getNode().getProxyTransport();
+				Class<?> transportClass = Loader.loadClass(clazz);
+				Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(clerk.getNode().getName()); 
+				UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService(clerk.getNode().getSubscriptionUrl());
+				SubscriptionResultsList list = subscriptionService.getSubscriptionResults(getSubscriptionResult);
+				
+				JAXBContext context = JAXBContext.newInstance(list.getClass());
+				Marshaller marshaller = context.createMarshaller();
+				StringWriter sw = new StringWriter();
+				marshaller.marshal(body, sw);
+
+				log.info("Notification received by UDDISubscriptionListenerService : " + sw.toString());
+				
+				NotificationList nl = NotificationList.getInstance();
+				nl.getNotifications().add(sw.toString());
+				
+				//update the registry with the notification list.
+				//TODO
+				
+				
+				syncSubscriptionDetail.getSubscriptionResultsList().add(list);
+			} catch (Exception ce) {
+				log.error(ce.getMessage(),ce);
+				if (ce instanceof DispositionReportFaultMessage) {
+					throw (DispositionReportFaultMessage) ce;
+				}
+				if (ce instanceof RemoteException) {
+					throw (RemoteException) ce;
+				}
+			}
+		}
+		
+		return syncSubscriptionDetail;
+	}
+
 	
 	
 }

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java (original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java Tue Oct 20 03:01:49 2009
@@ -764,6 +764,7 @@
 		if (modelClientSubscriptionInfo.getClerk()!=null) {
 			org.apache.juddi.api_v3.Clerk apiClerk = new org.apache.juddi.api_v3.Clerk();
 			mapClerk(modelClientSubscriptionInfo.getClerk(), apiClerk);
+			apiClientSubscriptionInfo.setClerk(apiClerk);
 		}
 	}
 	
@@ -775,8 +776,9 @@
 		apiClerk.setPassword(modelClerk.getCred());
 		apiClerk.setPublisher(modelClerk.getPublisherId());
 		if (modelClerk.getNode()!=null) {
-			org.apache.juddi.api_v3.Node node = new org.apache.juddi.api_v3.Node();
-			mapNode(modelClerk.getNode(), node);
+			org.apache.juddi.api_v3.Node apiNode = new org.apache.juddi.api_v3.Node();
+			mapNode(modelClerk.getNode(), apiNode);
+			apiClerk.setNode(apiNode);
 		}
 	}
 

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java (original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java Tue Oct 20 03:01:49 2009
@@ -32,6 +32,8 @@
 import org.apache.juddi.api_v3.SaveClientSubscriptionInfo;
 import org.apache.juddi.api_v3.SaveNode;
 import org.apache.juddi.api_v3.SavePublisher;
+import org.apache.juddi.api_v3.SyncSubscription;
+import org.apache.juddi.api_v3.SyncSubscriptionDetail;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.DeleteTModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
@@ -97,6 +99,11 @@
 		return juddiAPI.saveNode(body);
 	
 	}
+
+	public SyncSubscriptionDetail invokeSyncSubscription(SyncSubscription body)
+			throws DispositionReportFaultMessage, RemoteException {
+		return juddiAPI.invokeSyncSubscription(body);
+	}
 	
 	
 

Added: webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscription.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscription.java?rev=826933&view=auto
==============================================================================
--- webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscription.java (added)
+++ webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscription.java Tue Oct 20 03:01:49 2009
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+package org.apache.juddi.api_v3;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.uddi.sub_v3.GetSubscriptionResults;
+
+
+/**
+ * <p>Java class for publisherDetail type. Specific to juddi.
+ * 
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "syncSubscription", propOrder = {
+	"authInfo",
+    "list"
+})
+public class SyncSubscription implements Serializable{
+	
+	@XmlTransient
+	private static final long serialVersionUID = -8839314757295513399L;
+	private String authInfo;
+	private List<GetSubscriptionResults> list;
+	
+	/**
+     * Gets the value of the authInfo property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAuthInfo() {
+        return authInfo;
+    }
+
+    /**
+     * Sets the value of the authInfo property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAuthInfo(String value) {
+        this.authInfo = value;
+    }
+    
+	public List<GetSubscriptionResults> getGetSubscriptionResultsList() {
+		if (this.list==null) {
+			this.list = new ArrayList<GetSubscriptionResults>();
+		}
+		return list;
+	}
+
+	
+
+}
+
\ No newline at end of file

Added: webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscriptionDetail.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscriptionDetail.java?rev=826933&view=auto
==============================================================================
--- webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscriptionDetail.java (added)
+++ webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/api_v3/SyncSubscriptionDetail.java Tue Oct 20 03:01:49 2009
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2001-2008 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+package org.apache.juddi.api_v3;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.uddi.sub_v3.SubscriptionResultsList;
+
+
+/**
+ * <p>Java class for publisherDetail type. Specific to juddi.
+ * 
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "syncSubscriptionDetail", propOrder = {
+    "list",
+	"clientSubcriptionInfoMap"
+})
+public class SyncSubscriptionDetail implements Serializable{
+	
+	@XmlTransient
+	private static final long serialVersionUID = -4039550325209019888L;
+	private List<SubscriptionResultsList> list;
+	private Map<String,ClientSubscriptionInfo> clientSubcriptionInfoMap;
+
+	public List<SubscriptionResultsList> getSubscriptionResultsList() {
+		if (this.list==null) {
+			this.list = new ArrayList<SubscriptionResultsList>();
+		}
+        return this.list;
+    }
+	
+	public Map<String,ClientSubscriptionInfo> getClientSubscriptionInfoMap() {
+		if (this.clientSubcriptionInfoMap==null) {
+			this.clientSubcriptionInfoMap = new HashMap<String,ClientSubscriptionInfo>();
+		}
+        return this.clientSubcriptionInfoMap;
+    }
+
+}
+
\ No newline at end of file

Modified: webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/JUDDIApiPortType.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/JUDDIApiPortType.java?rev=826933&r1=826932&r2=826933&view=diff
==============================================================================
--- webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/JUDDIApiPortType.java (original)
+++ webservices/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/v3_service/JUDDIApiPortType.java Tue Oct 20 03:01:49 2009
@@ -40,6 +40,8 @@
 import org.apache.juddi.api_v3.SaveClientSubscriptionInfo;
 import org.apache.juddi.api_v3.SaveNode;
 import org.apache.juddi.api_v3.SavePublisher;
+import org.apache.juddi.api_v3.SyncSubscription;
+import org.apache.juddi.api_v3.SyncSubscriptionDetail;
 import org.uddi.api_v3.DeleteTModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 
@@ -171,7 +173,16 @@
         throws DispositionReportFaultMessage, RemoteException
     ;
     
-    
-    
+    /**
+     * @param body
+     * @throws DispositionReportFaultMessage, RemoteException
+     */
+    @WebMethod(operationName = "invoke_SyncSubscription", action = "invoke_SyncSubscription")
+    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+    public SyncSubscriptionDetail  invokeSyncSubscription(
+		@WebParam(name = "invoke_SyncSubscription", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
+        SyncSubscription body)
+        throws DispositionReportFaultMessage, RemoteException
+    ;
 }
 
\ No newline at end of file



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