juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r901517 - in /webservices/juddi/trunk/juddi-console/uddi-portlets/src/main: java/org/apache/juddi/portlets/client/ java/org/apache/juddi/portlets/server/service/ resources/META-INF/
Date Thu, 21 Jan 2010 03:36:39 GMT
Author: kstam
Date: Thu Jan 21 03:35:05 2010
New Revision: 901517

URL: http://svn.apache.org/viewvc?rev=901517&view=rev
Log:
JUDDI-318, Need a way of passing UDDI configs into a map rather than just passing a single
config into the singleton.

Modified:
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/DetailPanel.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/Constants.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/DetailPanel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/DetailPanel.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/DetailPanel.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/DetailPanel.java
Thu Jan 21 03:35:05 2010
@@ -16,8 +16,6 @@
  */
 package org.apache.juddi.portlets.client;
 
-import java.util.ArrayList;
-
 import org.apache.juddi.portlets.client.model.Business;
 import org.apache.juddi.portlets.client.model.Service;
 import org.apache.juddi.portlets.client.model.ServiceBinding;

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/Constants.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/Constants.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/Constants.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/Constants.java
Thu Jan 21 03:35:05 2010
@@ -19,4 +19,5 @@
 public interface Constants {
 
 	public final static String NODE_NAME = "default-ws";
+	public final static String MANAGER_NAME = "uddi-portlet-manager";
 }

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -26,6 +26,7 @@
 import org.apache.juddi.portlets.client.service.FindResponse;
 import org.apache.juddi.portlets.client.service.FindService;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
@@ -48,8 +49,8 @@
 
 	private static final long serialVersionUID = 1939609260067702168L;
 	private Logger logger = Logger.getLogger(this.getClass());
-	
-	
+
+
 	public FindResponse getBusinesses(String nameStr, String[] findQualifyers) 
 	{
 		HttpServletRequest request = this.getThreadLocalRequest();
@@ -62,21 +63,22 @@
 				findQualifiers.getFindQualifier().add(string);
 			}
 			findBusiness.setFindQualifiers(findQualifiers);
-			
+
 			Name name = new Name();
 			name.setValue(nameStr);
 			findBusiness.getName().add(name);
-			
-			
+
+
 			logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
 			List<Business> businesses = new ArrayList<Business>();
-		
-	    	 String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
-	         Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
 
-        	 UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();
-        	 BusinessList businessList = inquiryService.findBusiness(findBusiness);
-        	 for (BusinessInfo businessInfo : businessList.getBusinessInfos().getBusinessInfo())
{
+
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			Class<?> transportClass = Loader.loadClass(clazz);
+			Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
 
+			UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();
+			BusinessList businessList = inquiryService.findBusiness(findBusiness);
+			for (BusinessInfo businessInfo : businessList.getBusinessInfos().getBusinessInfo()) {
 				Business business = new Business(
 						businessInfo.getBusinessKey(),
 						EntityForLang.getName(businessInfo.getName(),lang).getValue(),
@@ -90,20 +92,20 @@
 				}
 				business.setServices(services);
 				businesses.add(business);
-			 }
-        	 response.setSuccess(true);
-        	 response.setBusinesses(businesses);
-	     } catch (Exception e) {
-	    	 logger.error("Could not obtain token. " + e.getMessage(), e);
-	    	 response.setSuccess(false);
-	    	 response.setMessage(e.getMessage());
-	    	 response.setErrorCode("102");
-	     }  catch (Throwable t) {
-	    	 logger.error("Could not obtain token. " + t.getMessage(), t);
-	    	 response.setSuccess(false);
-	    	 response.setMessage(t.getMessage());
-	    	 response.setErrorCode("102");
-	     } 
-		 return response;
+			}
+			response.setSuccess(true);
+			response.setBusinesses(businesses);
+		} catch (Exception e) {
+			logger.error("Could not obtain token. " + e.getMessage(), e);
+			response.setSuccess(false);
+			response.setMessage(e.getMessage());
+			response.setErrorCode("102");
+		}  catch (Throwable t) {
+			logger.error("Could not obtain token. " + t.getMessage(), t);
+			response.setSuccess(false);
+			response.setMessage(t.getMessage());
+			response.setErrorCode("102");
+		} 
+		return response;
 	}
 }

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -29,6 +29,7 @@
 import org.apache.juddi.portlets.client.service.InquiryResponse;
 import org.apache.juddi.portlets.client.service.InquiryService;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.portlets.client.service.SearchResponse;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
@@ -66,7 +67,8 @@
 	private Transport getTransport() 
 		throws ConfigurationException, ClassNotFoundException, InstantiationException, IllegalAccessException,
IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException
{
 		if (transport==null) {
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
 	         transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
 
 		}

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -33,6 +33,7 @@
 import org.apache.juddi.portlets.client.service.JUDDIApiResponse;
 import org.apache.juddi.portlets.client.service.JUDDIApiService;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.apache.log4j.Logger;
@@ -60,9 +61,10 @@
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		List<Publisher> publishers = new ArrayList<Publisher>();
 		try {
-	    	 String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
  
+	         Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
  
         	 JUDDIApiPortType apiService = transport.getJUDDIApiService();
         	 PublisherDetail publisherDetail = apiService.getPublisherDetail(getPublisherDetail);
         	 //if the publisher is an admin, then return ALL publishers
@@ -97,9 +99,10 @@
 	public JUDDIApiResponse savePublisher(String token, Publisher publisher) {
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		try {
-			 String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
  
+	         Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
  
 	       	 JUDDIApiPortType apiService = transport.getJUDDIApiService();
 	       	 SavePublisher savePublisher = new SavePublisher();
 	       	 savePublisher.setAuthInfo(token);
@@ -132,9 +135,10 @@
 	public JUDDIApiResponse deletePublisher(String token, String publisherId) {
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		try {
-			 String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
 
+	         Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
 
 	       	 JUDDIApiPortType apiService = transport.getJUDDIApiService();
 	       	 DeletePublisher deletePublisher = new DeletePublisher();
 	         deletePublisher.setAuthInfo(token);
@@ -173,15 +177,16 @@
 		getPublisherDetail.getPublisherId().add(username);
 		
 		try {
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
-	        Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
  
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+	         Class<?> transportClass = Loader.loadClass(clazz);
+	         Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
  
 	         JUDDIApiPortType apiService = transport.getJUDDIApiService();
 	         PublisherDetail publisherDetail = apiService.getPublisherDetail(getPublisherDetail);
        	     org.apache.juddi.api_v3.Publisher publisher = publisherDetail.getPublisher().get(0);
        	     if ("true".equalsIgnoreCase(publisher.getIsAdmin())) {
-       	    	logger.info("managerName=" + UDDIClerkManager.getClientConfig().getManagerName());
-       	    	UDDIClerkManager.restart();
+       	    	logger.info("managerName=" + manager.getClientConfig().getManagerName());
+       	    	manager.restart();
        	    	response.setMessage("Successfull manager restart.");
        	    	response.setSuccess(true);
        	     } else {

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -26,6 +26,7 @@
 import org.apache.juddi.portlets.client.service.PublicationResponse;
 import org.apache.juddi.portlets.client.service.PublicationService;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
@@ -62,9 +63,10 @@
 		logger.debug("GetRegistrationInfo " + getRegistrationInfo + " sending get Busineses request..");
 		List<Business> businesses = new ArrayList<Business>();
 		try {
-			 String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			 UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			 String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
-	         Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
 
+	         Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
 
         	 UDDIPublicationPortType publicationService = transport.getUDDIPublishService();
         	 RegisteredInfo info = publicationService.getRegisteredInfo(getRegistrationInfo);
         	 for (BusinessInfo businessInfo : info.getBusinessInfos().getBusinessInfo()) {

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -29,6 +29,7 @@
 import org.apache.juddi.portlets.client.service.SecurityService;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3.client.transport.TransportException;
 import org.apache.log4j.Logger;
@@ -73,7 +74,7 @@
 				return response;
 			} else {
 				try {
-					AuthToken authToken = login(username, password,Constants.NODE_NAME);
+					AuthToken authToken = login(username, password, Constants.MANAGER_NAME, Constants.NODE_NAME);
 					response.setSuccess(true);
 					response.setResponse(authToken.getAuthInfo());
 					
@@ -81,11 +82,12 @@
 					session.setAttribute("UserName", username);
 				
 					//upon success obtain tokens from other registries
-					Map<String, UDDIClerk> clerks = UDDIClerkManager.getClientConfig().getUDDIClerks();
+					UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+					Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
 					for (UDDIClerk clerk : clerks.values()) {
 						if (username.equals(clerk.getPublisher())) {
 							try {
-								AuthToken clerkToken = login(clerk.getPublisher(), clerk.getPassword(), clerk.getUDDINode().getName());
+								AuthToken clerkToken = login(clerk.getPublisher(), clerk.getPassword(), clerk.getManagerName(),clerk.getUDDINode().getName());
 								//set the clerkToken into the session
 								session.setAttribute("token-" + clerk.getName(), clerkToken.getAuthInfo());
 							} catch (Exception e) {
@@ -114,13 +116,14 @@
 		return response;
 	}
 	
-	private AuthToken login(String username, String password, String node) throws ConfigurationException,
ClassNotFoundException,
+	private AuthToken login(String username, String password, String managerName, String node)
throws ConfigurationException, ClassNotFoundException,
 		InstantiationException, IllegalAccessException, TransportException, DispositionReportFaultMessage,
RemoteException, 
 		IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException
{
 		
-		String clazz = UDDIClerkManager.getClientConfig().getUDDINode(node).getProxyTransport();
+		UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+		String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
         Class<?> transportClass = Loader.loadClass(clazz);
-        Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(node);
 
+        Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(managerName,
node);  
 		UDDISecurityPortType securityService = transport.getUDDISecurityService();
 		GetAuthToken getAuthToken = new GetAuthToken();
 		getAuthToken.setUserID(username);

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
Thu Jan 21 03:35:05 2010
@@ -42,6 +42,7 @@
 import org.apache.juddi.portlets.client.service.SubscriptionService;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClerkManager;
+import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.config.UDDINode;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
@@ -84,7 +85,8 @@
 		try {
 			boolean isMatchingClerk=false;
 			UDDIClerk toClerk = null;
-			Map<String, UDDIClerk> clerks = UDDIClerkManager.getClientConfig().getUDDIClerks();
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
 			for (UDDIClerk clerk : clerks.values()) {
 				if (publisher.equals(clerk.getPublisher()) 
 						&& Constants.NODE_NAME.equals(clerk.getUDDINode().getName())) {
@@ -118,9 +120,10 @@
 		modelNode.setClerkName(clerk.getName());
 		modelNode.setDescription(node.getDescription());
 		try {
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(clerk.getManagerName());
+			String clazz = manager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
 			Class<?> transportClass = Loader.loadClass(clazz);
-			Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(clerk.getUDDINode().getName());
 
+			Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(clerk.getManagerName(),clerk.getUDDINode().getName());
 
 			String authToken = (String) session.getAttribute("token-" + clerk.getName());
 
 			UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
@@ -157,12 +160,13 @@
 
 		logger.info("Sending saveSubscriptions request..");
 		try {
-			//before sending this we need to ready the listener node 
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
-			UDDIClerk toClerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getToClerkName());
+			//before sending this we need to ready the listener node
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
+			UDDIClerk toClerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getToClerkName());
 			if (toClerk==null) {
 				String publisher = (String) session.getAttribute("UserName"); 
-				Map<String, UDDIClerk> clerks = UDDIClerkManager.getClientConfig().getUDDIClerks();
+				Map<String, UDDIClerk> clerks = manager.getClientConfig().getUDDIClerks();
 				for (UDDIClerk uddiClerk : clerks.values()) {
 					if (publisher.equals(uddiClerk.getPublisher()) 
 							&& Constants.NODE_NAME.equals(uddiClerk.getUDDINode().getName())) {
@@ -172,9 +176,9 @@
 			}
 			
 			logger.info("Updating default UDDI server..");
-			String defaultClazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			String defaultClazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 			Class<?> defaultTransportClass = Loader.loadClass(defaultClazz); 
-			Transport defaultTransport = (Transport) defaultTransportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);

+			Transport defaultTransport = (Transport) defaultTransportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);

 			JUDDIApiPortType juddiApiService = defaultTransport.getJUDDIApiService();
 			
 			//making sure our node info is there and up to date.
@@ -212,7 +216,8 @@
 			logger.debug("Saved ClientSubscriptionInfo to the default UDDI server");
 			
 			//the listening server is ready; now add the subscription
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
+			
+			String clazz = manager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
 			Class<?> transportClass = Loader.loadClass(clazz); 
 			Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(clerk.getUDDINode().getName());

 			UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
@@ -282,10 +287,11 @@
 		logger.info("Sending deleteSubscriptions request for subscriptionKey=" 
 				+ modelSubscription.getSubscriptionKey());
 		try {
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
+			String clazz = manager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
 			Class<?> transportClass = Loader.loadClass(clazz);
-			Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(clerk.getUDDINode().getName());

+			Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(clerk.getManagerName(),clerk.getUDDINode().getName());

 			UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
 			DeleteSubscription deleteSubscription = new DeleteSubscription();
 			String authToken = (String) session.getAttribute("token-" + clerk.getName());
@@ -294,7 +300,7 @@
 			subscriptionService.deleteSubscription(deleteSubscription);
 			
 			//now remove it from the listener UDDI server too
-			String defaultClazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			String defaultClazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 			Class<?> defaultTransportClass = Loader.loadClass(defaultClazz); 
 			Transport defaultTransport = (Transport) defaultTransportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);

 			JUDDIApiPortType juddiApiService = defaultTransport.getJUDDIApiService();
@@ -341,15 +347,16 @@
 			coverage.setEndPoint(calendarEnd);
 			getSubscriptionResults.setCoveragePeriod(coverage);
 			
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
+			UDDIClerkManager manager = UDDIClientContainer.getUDDIClerkManager(Constants.MANAGER_NAME);
+			UDDIClerk clerk = manager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
 			String authToken = (String) session.getAttribute("token-" + clerk.getName());
 			getSubscriptionResults.setAuthInfo(authToken);
             SyncSubscription syncSubscription = new SyncSubscription();
             syncSubscription.getGetSubscriptionResultsList().add(getSubscriptionResults);
 			
-			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
+			String clazz = manager.getClientConfig().getUDDINode(Constants.NODE_NAME).getProxyTransport();
 	        Class<?> transportClass = Loader.loadClass(clazz);
-	        Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(Constants.NODE_NAME);
  
+	        Transport transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(Constants.MANAGER_NAME,Constants.NODE_NAME);
  
        	    JUDDIApiPortType apiService = transport.getJUDDIApiService();
 			
        	    syncSubscription.setAuthInfo(userAuthToken);

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml?rev=901517&r1=901516&r2=901517&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml
Thu Jan 21 03:35:05 2010
@@ -4,10 +4,10 @@
     <reloadDelay>5000</reloadDelay>
     <manager name="uddi-portlet-manager">
 		<nodes>
-			<node>
+			<node allowJUDDIApi="true">
 				<name>default-ws</name>
 				<properties>
-					<property name="serverName" value="marketing"/>
+					<property name="serverName" value="localhost"/>
 					<property name="serverPort" value="8080"/>
 					<property name="rmiPort" value="1099"/>
 				</properties>
@@ -45,6 +45,7 @@
 				<javaNamingProviderUrl>jnp://${serverName}:${rmiPort}</javaNamingProviderUrl>
 				-->
 			</node>
+			<!--  
 			<node>
 				<name>sales-ws</name>
 				<properties>
@@ -61,10 +62,13 @@
 				<subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
 				<juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api?wsdl</juddiApiUrl>
 			</node>
+			-->
 		</nodes>
 		<clerks registerOnStartup="false">
 		   <clerk name="MarketingCratchit" node="default-ws" publisher="marketing" password="marketing"/>
+		   <!--  
 	       <clerk name="SalesCratchit"     node="sales-ws"   publisher="marketing" password="marketing"/>
+	       -->
 	       <!--  optional 
 	       <xregister>
 		       <servicebinding entityKey="uddi:marketing.apache.org:servicebindings-subscriptionlistener-ws"
fromClerk="MarketingCratchit" toClerk="SalesCratchit"/>



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