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

svn commit: r775285 - in /webservices/juddi/branches/v3_trunk: juddi-core/src/main/java/org/apache/juddi/api/impl/ juddi-core/src/main/resources/ uddi-ws/src/main/java/org/uddi/subr_v3/

Author: tcunning
Date: Fri May 15 18:49:11 2009
New Revision: 775285

URL: http://svn.apache.org/viewvc?rev=775285&view=rev
Log:
JUDDI-196
Marshal the object before notifying the console.

Modified:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties
    webservices/juddi/branches/v3_trunk/uddi-ws/src/main/java/org/uddi/subr_v3/NotifySubscriptionListener.java

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java?rev=775285&r1=775284&r2=775285&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java Fri May 15 18:49:11 2009
@@ -17,10 +17,18 @@
 
 package org.apache.juddi.api.impl;
 
+import java.io.StringWriter;
+import java.util.ArrayList;
+
 import javax.jws.WebService;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
 
+import org.apache.juddi.error.ErrorMessage;
+import org.apache.juddi.error.FatalErrorException;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.query.PersistenceManager;
 import org.apache.juddi.validation.ValidateSubscriptionListener;
@@ -38,17 +46,33 @@
 		UDDISubscriptionListenerPortType {
 	
 	private static Logger logger = Logger.getLogger(UDDISubscriptionListenerImpl.class);
-	
+		
 	public DispositionReport notifySubscriptionListener(
 			NotifySubscriptionListener body)
 			throws DispositionReportFaultMessage {
-		logger.error(body.toString());
+		try {
+			JAXBContext context = JAXBContext.newInstance(body.getClass());
+			Marshaller marshaller = context.createMarshaller();
+			StringWriter sw = new StringWriter();
+			marshaller.marshal(body, sw);
+
+			logger.info("Notification received by UDDISubscriptionListenerService : " + sw.toString());
+			System.out.println("Notification received by UDDISubscriptionListenerService : " 
+					+ sw.toString());
+
+		} catch (JAXBException jaxbe) {
+			logger.error("", jaxbe);
+			throw new FatalErrorException(new ErrorMessage("errors.subscriptionnotifier.client"));
+		}
+		
 		
 		
 		new ValidateSubscriptionListener().validateNotification(body);
+			
 		DispositionReport dr = new DispositionReport();
 		Result res = new Result();
 		dr.getResult().add(res);
 		return dr;
 	}
+
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties?rev=775285&r1=775284&r2=775285&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/resources/messages_en.properties Fri May 15 18:49:11 2009
@@ -159,6 +159,7 @@
 errors.getsubscriptionresult.InvalidChunkToken=You have provided an invalid chunk token
 errors.getsubscriptionresult.NonMatchingChunkToken=The provided chunk token does not match the subscription parameters
 errors.getsubscriptionresult.ExpiredChunkToken=The provided chunk token has expired
+errors.subscriptionnotifier.client=Client did not receive notification data
 
 #-- jUDDI-specific publisher messages
 errors.savepublisher.NoInput=At least one Publisher must be provided

Modified: webservices/juddi/branches/v3_trunk/uddi-ws/src/main/java/org/uddi/subr_v3/NotifySubscriptionListener.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/uddi-ws/src/main/java/org/uddi/subr_v3/NotifySubscriptionListener.java?rev=775285&r1=775284&r2=775285&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/uddi-ws/src/main/java/org/uddi/subr_v3/NotifySubscriptionListener.java (original)
+++ webservices/juddi/branches/v3_trunk/uddi-ws/src/main/java/org/uddi/subr_v3/NotifySubscriptionListener.java Fri May 15 18:49:11 2009
@@ -21,6 +21,7 @@
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.uddi.sub_v3.SubscriptionResultsList;
 
@@ -50,6 +51,7 @@
     "authInfo",
     "subscriptionResultsList"
 })
+@XmlRootElement(name="notify_subscriptionListener")
 public class NotifySubscriptionListener {
 
     @XmlElement(namespace = "urn:uddi-org:api_v3")



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