Issue #2677 - Don't do overlap checks when updating subs to deactivated.
Change-Id: Ia974111d9810f27ef2b073304cd248de292275bd Former-commit-id: 2e406f02b0abbdeee0f553df430f5a58977d9af2
This commit is contained in:
parent
844f05e1ef
commit
101c08818d
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,28 +543,42 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
final IForceApplyPromptDisplayText displayTextStrategy)
|
final IForceApplyPromptDisplayText displayTextStrategy)
|
||||||
throws RegistryHandlerException {
|
throws RegistryHandlerException {
|
||||||
|
|
||||||
SubscriptionOverlapRequest request = new SubscriptionOverlapRequest(
|
if (subscriptions == null || subscriptions.isEmpty()) {
|
||||||
subscriptions);
|
return new SubscriptionServiceResult(false,
|
||||||
|
"No subscriptions submitted.");
|
||||||
|
}
|
||||||
|
|
||||||
SubscriptionOverlapResponse response = null;
|
/*
|
||||||
try {
|
* If activating the subscriptions check for overlaps.
|
||||||
response = (SubscriptionOverlapResponse) RequestRouter.route(
|
*
|
||||||
request, DataDeliveryConstants.DATA_DELIVERY_SERVER);
|
* Only need to check one because all are being updated the same way.
|
||||||
if (response.isDuplicate()) {
|
*/
|
||||||
return new SubscriptionServiceResult(true,
|
if (subscriptions.get(0).getSubscriptionState() == SubscriptionState.ON) {
|
||||||
StringUtil.createMessage(DUPLICATE_SUBSCRIPTIONS,
|
SubscriptionOverlapRequest request = new SubscriptionOverlapRequest(
|
||||||
response.getSubscriptionNameList()));
|
subscriptions);
|
||||||
}
|
|
||||||
|
|
||||||
if (response.isOverlap()) {
|
SubscriptionOverlapResponse response = null;
|
||||||
List<String> subNames = response.getSubscriptionNameList();
|
try {
|
||||||
Collections.sort(subNames);
|
response = (SubscriptionOverlapResponse) RequestRouter.route(
|
||||||
forceApplyPrompt.displayMessage(displayTextStrategy, StringUtil
|
request, DataDeliveryConstants.DATA_DELIVERY_SERVER);
|
||||||
.createMessage(OVERLAPPING_SUBSCRIPTIONS, subNames));
|
if (response.isDuplicate()) {
|
||||||
|
return new SubscriptionServiceResult(true,
|
||||||
|
StringUtil.createMessage(DUPLICATE_SUBSCRIPTIONS,
|
||||||
|
response.getSubscriptionNameList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.isOverlap()) {
|
||||||
|
List<String> subNames = response.getSubscriptionNameList();
|
||||||
|
Collections.sort(subNames);
|
||||||
|
forceApplyPrompt.displayMessage(displayTextStrategy,
|
||||||
|
StringUtil.createMessage(OVERLAPPING_SUBSCRIPTIONS,
|
||||||
|
subNames));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
statusHandler.error("Error checking subscription overlapping",
|
||||||
|
e);
|
||||||
|
return new SubscriptionServiceResult(false);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
statusHandler.error("Error checking subscription overlapping", e);
|
|
||||||
return new SubscriptionServiceResult(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -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