From 490c95d0105c2e5cb8ce482ee54d73ce89aeb8b3 Mon Sep 17 00:00:00 2001 From: Brad Gonzales Date: Fri, 15 Nov 2013 08:00:47 -0600 Subject: [PATCH] Issue #2545 EdexBandwidthManager check for subsription event types before sending notifications. Added missing comma to com.raytheon.edex.plugin.text. Change-Id: Ifc970d31d8f2db29dc5a4749967cdedad84b6162 Former-commit-id: aa8fb36fc145dcf3af9a4dd19ff1c7887c976787 [formerly f570f6fcd64a96b7c61eecdfae6a765ec643e718] Former-commit-id: 53d4de12d95bae202f85b9d41f94c98c3e11041f --- .../META-INF/MANIFEST.MF | 2 +- .../bandwidth/EdexBandwidthManager.java | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.text/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.text/META-INF/MANIFEST.MF index 41dd748753..7fa37b096c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.text/META-INF/MANIFEST.MF @@ -19,5 +19,5 @@ Export-Package: com.raytheon.edex.plugin.text, Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: com.raytheon.uf.common.dataplugin.text, com.raytheon.uf.common.dataplugin.text.db, - com.raytheon.uf.common.dataplugin.text.request + com.raytheon.uf.common.dataplugin.text.request, org.apache.commons.logging diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java index 5085db74af..e8d28cb27a 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java @@ -107,6 +107,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil; * Nov 04, 2013 2506 bgonzale Added removeBandwidthSubscriptions method. * Added subscriptionNotificationService field. * Send notifications. + * Nov 15, 2013 2545 bgonzale Added check for subscription events before sending + * notifications. * * * @@ -323,10 +325,8 @@ public abstract class EdexBandwidthManager public void subscriptionRemoved(RemoveRegistryEvent event) { String objectType = event.getObjectType(); if (objectType != null) { - if (DataDeliveryRegistryObjectTypes.SITE_SUBSCRIPTION - .equals(objectType) - || DataDeliveryRegistryObjectTypes.SHARED_SUBSCRIPTION - .equals(objectType)) { + if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(event + .getObjectType())) { statusHandler .info("Received Subscription removal notification for Subscription [" + event.getId() + "]"); @@ -386,9 +386,12 @@ public abstract class EdexBandwidthManager + "]"); } } - Subscription sub = getRegistryObjectById(subscriptionHandler, - re.getId()); - sendSubscriptionNotificationEvent(re, sub); + if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(re + .getObjectType())) { + Subscription sub = getRegistryObjectById(subscriptionHandler, + re.getId()); + sendSubscriptionNotificationEvent(re, sub); + } } /** @@ -400,9 +403,12 @@ public abstract class EdexBandwidthManager @Subscribe @AllowConcurrentEvents public void registryEventListener(UpdateRegistryEvent event) { - Subscription sub = getRegistryObjectById(subscriptionHandler, - event.getId()); - sendSubscriptionNotificationEvent(event, sub); + if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(event + .getObjectType())) { + Subscription sub = getRegistryObjectById(subscriptionHandler, + event.getId()); + sendSubscriptionNotificationEvent(event, sub); + } } private void sendSubscriptionNotificationEvent(RegistryEvent event,