Issue #3891 Special overlap handling for promotion of sub from site to shared

Change-Id: Ifa8f4be3e9e0f172ee54c5ef7021b912d45c5de2

Former-commit-id: 4b7557498f [formerly e897cb40df] [formerly d81e3b0efa] [formerly 8796705c6b [formerly d81e3b0efa [formerly 9a31befafe66a677b744fa9ae9ef7e134a758bd9]]]
Former-commit-id: 8796705c6b
Former-commit-id: 95be4db4f3feed3848fe1af3c5e26e5143c88aa2 [formerly 072c6223ef]
Former-commit-id: c57d63dbc5
This commit is contained in:
Dave Hladky 2014-12-08 14:09:15 -06:00
parent 227b2898f7
commit 3b279c5c46

View file

@ -28,6 +28,8 @@ import java.util.Set;
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
import com.raytheon.uf.common.datadelivery.registry.DataType;
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
@ -48,6 +50,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil;
* Oct 24, 2013 2292 mpduff Initial creation
* Nov 01, 2013 2292 dhladky Don't check against yourself for duplication
* Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site.
* Dec 08, 2014 3891 dhladky Allow for promotion of site subscriptions to shared.
*
* </pre>
*
@ -80,9 +83,21 @@ public class SubscriptionOverlapHandler implements
DataType dataType = subscription.getDataSetType();
Set<String> overlappingSubscriptions = new HashSet<String>();
for (Subscription potentialDuplicate : potentialDuplicates) {
// don't check against yourself
if (potentialDuplicate.getId().equals(subscription.getId())) {
continue;
// Check for special promotion case
if (subscription instanceof SharedSubscription
&& potentialDuplicate instanceof SiteSubscription) {
// Not as stringent a check as the ID's won't be equal
// but the names still will
if (potentialDuplicate.getName().equals(
subscription.getName())) {
continue;
}
} else {
// Normal sequence, don't check self
if (potentialDuplicate.getId().equals(
subscription.getId())) {
continue;
}
}
OverlapData od = OverlapDataFactory.getOverlapData(
subscription, potentialDuplicate);