juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r826989 - in /webservices/juddi/trunk/juddi-console/uddi-portlets/src/main: java/org/apache/juddi/portlets/client/ java/org/apache/juddi/portlets/client/model/ java/org/apache/juddi/portlets/server/service/ resources/META-INF/
Date Tue, 20 Oct 2009 07:58:44 GMT
Author: kstam
Date: Tue Oct 20 07:58:43 2009
New Revision: 826989

URL: http://svn.apache.org/viewvc?rev=826989&view=rev
Log:
JUDDI-240 adding xregistration

Modified:
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.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/SubscriptionPanel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java?rev=826989&r1=826988&r2=826989&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java
Tue Oct 20 07:58:43 2009
@@ -35,6 +35,7 @@
 
 	private SubscriptionServiceAsync subscriptionServiceAsync = (SubscriptionServiceAsync) GWT.create(SubscriptionService.class);
 	
+	private String toClerkName = null;
 	private TextBox clerkNameBox = new TextBox();
 	private TextBox bindingKeyBox = new TextBox();
 	private CheckBox isBriefBox = new CheckBox();
@@ -67,6 +68,7 @@
 	
 	public void drawPanel() {
 		
+		toClerkName = subscription.getToClerkName();
 		Label clerkName = new Label ("Clerk:");
 		clerkName.setStyleName("portlet-form-field-label-right");
 		flexTable.setWidget(0, 0, clerkName);
@@ -163,7 +165,7 @@
 	protected void invokeSyncSubscription(String authToken) {
 		if (subscription!=null) {
 			subscription.setSubscriptionKey(subscriptionKeyBox.getText());
-			subscription.setClerkName(clerkNameBox.getText());
+			subscription.setFromClerkName(clerkNameBox.getText());
 			subscription.setCoverageStart(coverageStartBox.getText());
 			subscription.setCoverageEnd(coverageEndBox.getText());
 			
@@ -188,7 +190,7 @@
 	protected void deleteSubscription(String authToken){
 		if (subscription!=null) {
 			subscription.setSubscriptionKey(subscriptionKeyBox.getText());
-			subscription.setClerkName(clerkNameBox.getText());
+			subscription.setFromClerkName(clerkNameBox.getText());
 			
 			subscriptionServiceAsync.deleteSubscription(authToken, subscription, new AsyncCallback<SubscriptionResponse>()
 					{
@@ -240,7 +242,8 @@
 			subscription.setNotificationInterval(notificationIntervalBox.getText());
 			subscription.setSubscriptionFilter(subscriptionFilterBox.getText());
 			subscription.setSubscriptionKey(subscriptionKeyBox.getText());
-			subscription.setClerkName(clerkNameBox.getText());
+			subscription.setFromClerkName(clerkNameBox.getText());
+			subscription.setToClerkName(toClerkName);
 			
 			subscriptionServiceAsync.saveSubscription(authToken, subscription, new AsyncCallback<SubscriptionResponse>()
 			{

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java?rev=826989&r1=826988&r2=826989&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java
(original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java
Tue Oct 20 07:58:43 2009
@@ -42,7 +42,8 @@
 	private String coverageEnd;
     
     private Node node;
-    private String clerkName;
+    private String fromClerkName;
+    private String toClerkName;
     
 	public Subscription() {
 		super();
@@ -125,11 +126,17 @@
 	public void setNode(Node node) {
 		this.node = node;
 	}
-	public String getClerkName() {
-		return clerkName;
+	public String getFromClerkName() {
+		return fromClerkName;
 	}
-	public void setClerkName(String clerkName) {
-		this.clerkName = clerkName;
+	public void setFromClerkName(String fromClerkName) {
+		this.fromClerkName = fromClerkName;
+	}
+	public String getToClerkName() {
+		return toClerkName;
+	}
+	public void setToClerkName(String toClerkName) {
+		this.toClerkName = toClerkName;
 	}
 	public String getCoverageStart() {
 		return coverageStart;

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=826989&r1=826988&r2=826989&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
Tue Oct 20 07:58:43 2009
@@ -83,14 +83,18 @@
 		logger.debug("Publisher " + publisher + " sending getSubscription request..");
 		try {
 			boolean isMatchingClerk=false;
+			UDDIClerk toClerk = null;
 			Map<String, UDDIClerk> clerks = UDDIClerkManager.getClientConfig().getUDDIClerks();
 			for (UDDIClerk clerk : clerks.values()) {
+				if (publisher.equals(clerk.getPublisher()) 
+						&& Constants.NODE_NAME.equals(clerk.getUDDINode().getName())) {
+					toClerk = clerk;
+				}
+			}
+			for (UDDIClerk clerk : clerks.values()) {
 				if (publisher.equals(clerk.getPublisher())) {
 					isMatchingClerk = true;
-					Node modelNode = getSubscriptions(session, clerk);
-					//if (UP.equals(modelNode.getStatus())) {
-						
-					//}
+					Node modelNode = getSubscriptions(session, clerk, toClerk);
 					modelNode.setClerkName(clerk.getName());
 					response.getNodes().add(modelNode);
 				}
@@ -106,7 +110,7 @@
 		return response;
 	}
 
-	private Node getSubscriptions(HttpSession session, UDDIClerk clerk) {
+	private Node getSubscriptions(HttpSession session, UDDIClerk clerk, UDDIClerk toClerk) {
 
 		Node modelNode = new Node();
 		UDDINode node = clerk.getUDDINode();
@@ -134,6 +138,7 @@
 						rawFilter,
 						subscription.getSubscriptionKey());
 				modelSubscription.setNode(modelNode);
+				modelSubscription.setToClerkName(toClerk.getName());
 				modelNode.getSubscriptions().add(modelSubscription);
 			}
 			modelNode.setStatus(UP);
@@ -153,13 +158,15 @@
 		logger.info("Sending saveSubscriptions request..");
 		try {
 			//before sending this we need to ready the listener node 
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getClerkName());
+			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
+			UDDIClerk toClerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getToClerkName());
 			
 			logger.info("Updating default UDDI server..");
 			String defaultClazz = UDDIClerkManager.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();
+			
 			//making sure our node info is there and up to date.
 			SaveNode saveNode = new SaveNode();
 			saveNode.setAuthInfo(userAuthToken);
@@ -170,13 +177,25 @@
 			saveClerk.setAuthInfo(userAuthToken);
 			saveClerk.getClerk().add(clerk.getApiClerk());
 			juddiApiService.saveClerk(saveClerk);
+			//making sure our node info is there and up to date.
+			SaveNode saveToNode = new SaveNode();
+			saveToNode.setAuthInfo(userAuthToken);
+			saveToNode.getNode().add(toClerk.getApiClerk().getNode());
+			juddiApiService.saveNode(saveToNode);
+			//making sure our clerk info is there and up to date
+			SaveClerk saveToClerk = new SaveClerk();
+			saveToClerk.setAuthInfo(userAuthToken);
+			saveToClerk.getClerk().add(toClerk.getApiClerk());
+			juddiApiService.saveClerk(saveToClerk);
 			logger.debug("Updating default UDDI server completed.");
 			
 			SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
 			saveClientSubscriptionInfo.setAuthInfo(userAuthToken);
 			ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
 			clientSubscriptionInfo.setSubscriptionKey(modelSubscription.getSubscriptionKey());
-			clientSubscriptionInfo.setClerk(clerk.getApiClerk());
+			clientSubscriptionInfo.setFromClerk(clerk.getApiClerk());
+			clientSubscriptionInfo.setToClerk(toClerk.getApiClerk());
+			
 			saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
 			//save clientSubscription to the listening UDDI default server.
 			juddiApiService.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
@@ -253,7 +272,7 @@
 		logger.info("Sending deleteSubscriptions request for subscriptionKey=" 
 				+ modelSubscription.getSubscriptionKey());
 		try {
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getClerkName());
+			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
 			String clazz = UDDIClerkManager.getClientConfig().getUDDINode(clerk.getUDDINode().getName()).getProxyTransport();
 			Class<?> transportClass = Loader.loadClass(clazz);
 			Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance(clerk.getUDDINode().getName());

@@ -312,7 +331,7 @@
 			coverage.setEndPoint(calendarEnd);
 			getSubscriptionResults.setCoveragePeriod(coverage);
 			
-			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getClerkName());
+			UDDIClerk clerk = UDDIClerkManager.getClientConfig().getUDDIClerks().get(modelSubscription.getFromClerkName());
 			String authToken = (String) session.getAttribute("token-" + clerk.getName());
 			getSubscriptionResults.setAuthInfo(authToken);
             SyncSubscription syncSubscription = new SyncSubscription();

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=826989&r1=826988&r2=826989&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
Tue Oct 20 07:58:43 2009
@@ -67,7 +67,7 @@
 	       <clerk name="SalesCratchit"     node="sales-ws"   publisher="marketing" password="marketing"/>
 	       <!--  optional 
 	       <xregister>
-		       <servicebinding bindingKey="uddi:marketing.apache.org:servicebindings-subscriptionlistener-ws"
fromClerk="MarketingCratchit" toClerk="SalesCratchit"/>
+		       <servicebinding entityKey="uddi:marketing.apache.org:servicebindings-subscriptionlistener-ws"
fromClerk="MarketingCratchit" toClerk="SalesCratchit"/>
 		   </xregister>
 		   -->
 	   </clerks>



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