Issue #2677 - Don't do overlap checks when updating subs to deactivated.
Change-Id: Ia974111d9810f27ef2b073304cd248de292275bd Former-commit-id:6b01c2957f
[formerly101c08818d
[formerly 2e406f02b0abbdeee0f553df430f5a58977d9af2]] Former-commit-id:101c08818d
Former-commit-id:bafe19bbd5
This commit is contained in:
parent
57402adccf
commit
3691146e34
2 changed files with 51 additions and 19 deletions
|
@ -97,6 +97,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
* Oct 22, 2013 2292 mpduff Removed subscriptionOverlapService.
|
* Oct 22, 2013 2292 mpduff Removed subscriptionOverlapService.
|
||||||
* Nov 07, 2013 2291 skorolev Used showText() method for "Shared Subscription" message.
|
* Nov 07, 2013 2291 skorolev Used showText() method for "Shared Subscription" message.
|
||||||
* Jan 26, 2014 2259 mpduff Turn off subs to be deactivated.
|
* Jan 26, 2014 2259 mpduff Turn off subs to be deactivated.
|
||||||
|
* Feb 04, 2014 2677 mpduff Don't do overlap checks when deactivating subs.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -542,6 +543,17 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
final IForceApplyPromptDisplayText displayTextStrategy)
|
final IForceApplyPromptDisplayText displayTextStrategy)
|
||||||
throws RegistryHandlerException {
|
throws RegistryHandlerException {
|
||||||
|
|
||||||
|
if (subscriptions == null || subscriptions.isEmpty()) {
|
||||||
|
return new SubscriptionServiceResult(false,
|
||||||
|
"No subscriptions submitted.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If activating the subscriptions check for overlaps.
|
||||||
|
*
|
||||||
|
* Only need to check one because all are being updated the same way.
|
||||||
|
*/
|
||||||
|
if (subscriptions.get(0).getSubscriptionState() == SubscriptionState.ON) {
|
||||||
SubscriptionOverlapRequest request = new SubscriptionOverlapRequest(
|
SubscriptionOverlapRequest request = new SubscriptionOverlapRequest(
|
||||||
subscriptions);
|
subscriptions);
|
||||||
|
|
||||||
|
@ -558,13 +570,16 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
if (response.isOverlap()) {
|
if (response.isOverlap()) {
|
||||||
List<String> subNames = response.getSubscriptionNameList();
|
List<String> subNames = response.getSubscriptionNameList();
|
||||||
Collections.sort(subNames);
|
Collections.sort(subNames);
|
||||||
forceApplyPrompt.displayMessage(displayTextStrategy, StringUtil
|
forceApplyPrompt.displayMessage(displayTextStrategy,
|
||||||
.createMessage(OVERLAPPING_SUBSCRIPTIONS, subNames));
|
StringUtil.createMessage(OVERLAPPING_SUBSCRIPTIONS,
|
||||||
|
subNames));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.error("Error checking subscription overlapping", e);
|
statusHandler.error("Error checking subscription overlapping",
|
||||||
|
e);
|
||||||
return new SubscriptionServiceResult(false);
|
return new SubscriptionServiceResult(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final ProposeResult result = proposeScheduleAndAction(
|
final ProposeResult result = proposeScheduleAndAction(
|
||||||
|
|
|
@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlEnum;
|
||||||
import javax.xml.bind.annotation.XmlEnumValue;
|
import javax.xml.bind.annotation.XmlEnumValue;
|
||||||
|
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Definition of a subscription.
|
* Definition of a subscription.
|
||||||
*
|
*
|
||||||
|
@ -47,6 +48,7 @@ import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||||
* Jan 08, 2014 2615 bgonzale Added calculate start and calculate end methods.
|
* Jan 08, 2014 2615 bgonzale Added calculate start and calculate end methods.
|
||||||
* Jan 14, 2014 2459 mpduff Change Subscription status code
|
* Jan 14, 2014 2459 mpduff Change Subscription status code
|
||||||
* Jan 24, 2013 2709 bgonzale Added method inActivePeriodWindow.
|
* Jan 24, 2013 2709 bgonzale Added method inActivePeriodWindow.
|
||||||
|
* Feb 05, 2014 2677 mpduff Add subscription state getter/setter.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -704,4 +706,19 @@ public interface Subscription<T extends Time, C extends Coverage> {
|
||||||
* Deactivate the subscription
|
* Deactivate the subscription
|
||||||
*/
|
*/
|
||||||
void deactivate();
|
void deactivate();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the subscription's state
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* The state to set
|
||||||
|
*/
|
||||||
|
void setSubscriptionState(SubscriptionState state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the subscription's state
|
||||||
|
*
|
||||||
|
* @return This subscrition's state
|
||||||
|
*/
|
||||||
|
SubscriptionState getSubscriptionState();
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue