juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r941305 - /webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
Date Wed, 05 May 2010 14:22:03 GMT
Author: kstam
Date: Wed May  5 14:22:02 2010
New Revision: 941305

URL: http://svn.apache.org/viewvc?rev=941305&view=rev
Log:
JUDDI-376, leaving the create and lastNotified date on renewals.

Modified:
    webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java?rev=941305&r1=941304&r2=941305&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
(original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
Wed May  5 14:22:02 2010
@@ -802,10 +802,16 @@ public class UDDISubscriptionImpl extend
 				
 				org.apache.juddi.model.Subscription modelSubscription = new org.apache.juddi.model.Subscription();
 				
-				Object existingEntity = em.find(org.apache.juddi.model.Subscription.class, apiSubscription.getSubscriptionKey());
-				if (existingEntity != null) {
-					doRenewal((org.apache.juddi.model.Subscription)existingEntity, apiSubscription);
-					em.remove(existingEntity);
+				Object existing = em.find(org.apache.juddi.model.Subscription.class, apiSubscription.getSubscriptionKey());
+				if (existing != null) {
+					org.apache.juddi.model.Subscription existingEntity = (org.apache.juddi.model.Subscription)
existing;
+					doRenewal(existingEntity, apiSubscription);
+					//carrying over the created and last notified dates if this is a renewal.
+					modelSubscription.setCreateDate(existingEntity.getCreateDate());
+					modelSubscription.setLastNotified(existingEntity.getLastNotified());
+					em.remove(existing);
+				} else {
+					modelSubscription.setCreateDate(new Date());
 				}
 	
 				doSubscriptionExpirationDate(apiSubscription);
@@ -813,8 +819,7 @@ public class UDDISubscriptionImpl extend
 				MappingApiToModel.mapSubscription(apiSubscription, modelSubscription);
 				
 				modelSubscription.setAuthorizedName(publisher.getAuthorizedName());
-				modelSubscription.setCreateDate(new Date());
-	
+				
 				// Add the matching keys to the match collection
 				List<?> keys = getSubscriptionMatches(apiSubscription.getSubscriptionFilter(),
em);
 				if (keys != null && keys.size() > 0) {



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