From 15f50d3f369423ecb8ed8f093f795b7edc8e5196 Mon Sep 17 00:00:00 2001 From: Dave Hladky Date: Mon, 21 Apr 2014 15:08:30 -0500 Subject: [PATCH] Issue #2887 Previously missed check for start/end of sub (isExpired()). Change-Id: I9a720b8db129ff7b82547531240d055499a57cfe Former-commit-id: a3d2d3d6c830d224b79526ca02c878d91a927cdb [formerly f51497a3ce0e4139b640fee718354bb21312fe73] [formerly 5bc1f147c9efd9df2b925d5e733a63c9befd1720] [formerly a3d2d3d6c830d224b79526ca02c878d91a927cdb [formerly f51497a3ce0e4139b640fee718354bb21312fe73] [formerly 5bc1f147c9efd9df2b925d5e733a63c9befd1720] [formerly 0d7854643439a201694ba3232bac48955a66c620 [formerly 5bc1f147c9efd9df2b925d5e733a63c9befd1720 [formerly 9af92514064e0c994be6d285f66f17c922e9d428]]]] Former-commit-id: 0d7854643439a201694ba3232bac48955a66c620 Former-commit-id: 8e538ffe3c320b79edaac3ea6fc42a4c22e17e13 [formerly 8745a877c502512e99b840a3f97bc39deef091f1] [formerly 6ffb4bb2051a3cbe1d8b90bdd14a0e9076a05607 [formerly b1ec77c64ef1083c4e0ccaaacb9d96ea473b99f1]] Former-commit-id: cc474492b77ef77785522f7375a1de2be4468d8a [formerly 909646ec3c32f5698a51eb38e4773307ec6a60de] Former-commit-id: 6e961f70106c35326566a441c6cb4f60fb37a8c4 --- .../uf/common/datadelivery/registry/Subscription.java | 8 ++++++++ .../datadelivery/bandwidth/util/BandwidthDaoUtil.java | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/Subscription.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/Subscription.java index 04df1eca63..533463d2cb 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/Subscription.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/Subscription.java @@ -50,6 +50,7 @@ import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus; * Jan 24, 2013 2709 bgonzale Added method inActivePeriodWindow. * Feb 05, 2014 2677 mpduff Add subscription state getter/setter. * Apr 02, 2014 2810 dhladky Priority sorting of subscriptions. + * Apr 21, 2014 2887 dhladky Added shouldScheduleForTime() to interface. * * * @@ -730,4 +731,11 @@ public interface Subscription extends Compar * @return This subscrition's state */ SubscriptionState getSubscriptionState(); + + /** + * Check against activePeriod and Start/End of subscription + * @param checkCal + * @return + */ + boolean shouldScheduleForTime(Calendar checkCal); } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java index ad879e6701..dbaf01baeb 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java @@ -84,6 +84,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus; * active period. * Jan 29, 2014 2636 mpduff Scheduling refactor. * Feb 11, 2014 2636 mpduff Change how retrieval times are calculated. + * Apr 21, 2014 2887 dhladky Missed start/end in previous call, needs shouldScheduleForTime(); * * * @author djohnson @@ -229,8 +230,13 @@ public class BandwidthDaoUtil { * Fine grain check by hour and minute, for * subscription(start/end), activePeriod(start/end) */ + + // TODO: IMPORTANT NOTE: WHEN 14.2.1 MERGES IN. THIS NEEDS + // TO CHECK AGAINST THE OFFSET BASE REFTIME, THE BASE REFTIME + // WILL BE WHAT IS ADDED IF THE CHECK IS TRUE. DO NOT BLINDLY + // MERGE 14.2.1's CODE OVER THIS. if (!subscription - .inActivePeriodWindow(retrievalTime)) { + .shouldScheduleForTime(retrievalTime)) { // don't schedule this retrieval time, // outside subscription window continue;