juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcunn...@apache.org
Subject svn commit: r901516 - in /webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi: api/impl/JUDDIApiImpl.java subscription/NotificationList.java
Date Thu, 21 Jan 2010 03:34:53 GMT
Author: tcunning
Date: Thu Jan 21 03:33:58 2010
New Revision: 901516

URL: http://svn.apache.org/viewvc?rev=901516&view=rev
Log:
JUDDI-328
Limit notification list to last 5 entries.

Modified:
    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/subscription/NotificationList.java

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=901516&r1=901515&r2=901516&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
Thu Jan 21 03:33:58 2010
@@ -17,6 +17,7 @@
 
 package org.apache.juddi.api.impl;
 
+import java.util.Vector;
 import java.io.StringWriter;
 import java.rmi.RemoteException;
 import java.util.HashMap;
@@ -81,6 +82,8 @@
 public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortType {
 
 	private Logger log = Logger.getLogger(this.getClass());
+	private static int MAX_NOTIFICATIONS = 5;
+	
 	/**
 	 * Saves publisher(s) to the persistence layer.  This method is specific to jUDDI.
 	 */
@@ -558,7 +561,14 @@
 				log.info("Notification received by UDDISubscriptionListenerService : " + sw.toString());
 				
 				NotificationList nl = NotificationList.getInstance();
-				nl.getNotifications().add(sw.toString());
+				if (nl.getNotifications().size() == MAX_NOTIFICATIONS) {
+					nl.getNotifications().setSize(MAX_NOTIFICATIONS - 1);
+				}
+				nl.getNotifications().add(0, sw.toString());
+				Vector vect = nl.getNotifications();
+				for (int i = 0; i < vect.size(); i++) {
+					String str = (String) vect.get(i);
+				}		
 				
 				//update the registry with the notification list.
 				XRegisterHelper.handle(fromClerk, toClerk, list);

Modified: webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/NotificationList.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/NotificationList.java?rev=901516&r1=901515&r2=901516&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/NotificationList.java
(original)
+++ webservices/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/NotificationList.java
Thu Jan 21 03:33:58 2010
@@ -7,13 +7,13 @@
 	private static Vector<?> list = null;
 	
 	private NotificationList() {	
+		list = new Vector();
 	}
 	
 	@SuppressWarnings("unchecked")
 	public static NotificationList getInstance() {
 		if (nl == null) {
 			nl = new NotificationList();
-			list = new Vector();
 		}
 		return nl;
 	}



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