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.
|
||||
* Nov 07, 2013 2291 skorolev Used showText() method for "Shared Subscription" message.
|
||||
* 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>
|
||||
*
|
||||
|
@ -542,28 +543,42 @@ public class SubscriptionService implements ISubscriptionService {
|
|||
final IForceApplyPromptDisplayText displayTextStrategy)
|
||||
throws RegistryHandlerException {
|
||||
|
||||
SubscriptionOverlapRequest request = new SubscriptionOverlapRequest(
|
||||
subscriptions);
|
||||
if (subscriptions == null || subscriptions.isEmpty()) {
|
||||
return new SubscriptionServiceResult(false,
|
||||
"No subscriptions submitted.");
|
||||
}
|
||||
|
||||
SubscriptionOverlapResponse response = null;
|
||||
try {
|
||||
response = (SubscriptionOverlapResponse) RequestRouter.route(
|
||||
request, DataDeliveryConstants.DATA_DELIVERY_SERVER);
|
||||
if (response.isDuplicate()) {
|
||||
return new SubscriptionServiceResult(true,
|
||||
StringUtil.createMessage(DUPLICATE_SUBSCRIPTIONS,
|
||||
response.getSubscriptionNameList()));
|
||||
}
|
||||
/*
|
||||
* 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(
|
||||
subscriptions);
|
||||
|
||||
if (response.isOverlap()) {
|
||||
List<String> subNames = response.getSubscriptionNameList();
|
||||
Collections.sort(subNames);
|
||||
forceApplyPrompt.displayMessage(displayTextStrategy, StringUtil
|
||||
.createMessage(OVERLAPPING_SUBSCRIPTIONS, subNames));
|
||||
SubscriptionOverlapResponse response = null;
|
||||
try {
|
||||
response = (SubscriptionOverlapResponse) RequestRouter.route(
|
||||
request, DataDeliveryConstants.DATA_DELIVERY_SERVER);
|
||||
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 {
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlEnum;
|
|||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
|
||||
|
||||
/**
|
||||
* 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 14, 2014 2459 mpduff Change Subscription status code
|
||||
* Jan 24, 2013 2709 bgonzale Added method inActivePeriodWindow.
|
||||
* Feb 05, 2014 2677 mpduff Add subscription state getter/setter.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -704,4 +706,19 @@ public interface Subscription<T extends Time, C extends Coverage> {
|
|||
* Deactivate the subscription
|
||||
*/
|
||||
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