qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r796212 - in /qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui: ServerRegistry.java jmx/JMXServerRegistry.java model/NotificationObject.java views/VHNotificationsTabControl.java
Date Tue, 21 Jul 2009 09:32:54 GMT
Author: robbie
Date: Tue Jul 21 09:32:53 2009
New Revision: 796212

URL: http://svn.apache.org/viewvc?rev=796212&view=rev
Log:
QPID-1969: restrict the Notifications areas in each VirtualHost tree to only show the notifications
from that VirtualHost, instead of those from the entire server.

Modified:
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
    qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java?rev=796212&r1=796211&r2=796212&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
(original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
Tue Jul 21 09:32:53 2009
@@ -169,6 +169,8 @@
     
     public abstract List<NotificationObject> getNotifications(ManagedBean mbean);
     
+    public abstract List<NotificationObject> getNotifications(String virtualhost);
+    
     public abstract boolean hasSubscribedForNotifications(ManagedBean mbean, String name,
String type);
     
     public abstract void clearNotifications(ManagedBean mbean, List<NotificationObject>
list);

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java?rev=796212&r1=796211&r2=796212&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
(original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
Tue Jul 21 09:32:53 2009
@@ -248,6 +248,33 @@
         }
     }
     
+    public List<NotificationObject> getNotifications(String virtualhost)
+    {
+        List<NotificationObject> vhostNotificationsList = new ArrayList<NotificationObject>();
+
+        //iterate over all the notification lists for mbeans with subscribed notifications
+        for (List<NotificationObject> list : _notificationsMap.values())
+        {
+            //Check the source vhost of the first notification
+            NotificationObject notification  = list.get(0);
+            
+            if (notification != null)
+            {
+                String sourceVhost = notification.getSourceVirtualHost();
+                if(sourceVhost != null)
+                {
+                    if(sourceVhost.equalsIgnoreCase(virtualhost))
+                    {
+                        //If it matches, add the entire list as they are from the same vhost
(same source mbean)
+                        vhostNotificationsList.addAll(list);
+                    }
+                }
+            }
+        }
+
+        return vhostNotificationsList;
+    }
+    
     public void clearNotifications(ManagedBean mbean, List<NotificationObject> list)
     {
         if (mbean == null)

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java?rev=796212&r1=796211&r2=796212&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
(original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
Tue Jul 21 09:32:53 2009
@@ -26,6 +26,8 @@
 
 import javax.management.ObjectName;
 
+import static org.apache.qpid.management.ui.Constants.VIRTUAL_HOST;
+
 public class NotificationObject
 {
 
@@ -65,6 +67,16 @@
         return null;
     }
     
+    public String getSourceVirtualHost()
+    {
+        if (_source instanceof ObjectName)
+        {
+            return ((ObjectName)_source).getKeyProperty(VIRTUAL_HOST);
+        }
+        
+        return null;
+    }
+    
     public String getMessage()
     {
         return _message;

Modified: qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java?rev=796212&r1=796211&r2=796212&view=diff
==============================================================================
--- qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
(original)
+++ qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
Tue Jul 21 09:32:53 2009
@@ -466,16 +466,16 @@
     }
     
     /**
-     * Updates the table with new notifications received from mbean server for all mbeans
+     * Updates the table with new notifications received from mbean server for all mbeans
in this virtual host
      */
     protected void updateTableViewer()
     {
-        ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
       
-        List<NotificationObject> newList = serverRegistry.getNotifications(null);
-        if (newList == null)
-            return;
+        String virtualhost = MBeanView.getVirtualHost();
         
+        ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
       
+        List<NotificationObject> newList = serverRegistry.getNotifications(virtualhost);
         _notifications = newList;
+        
         _tableViewer.setInput(_notifications);
         _tableViewer.refresh();
     }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message