Merge "Issue #2548 - Add a subscription type slot for uniqueness." into development
Former-commit-id:157e739623
[formerly14b1e924a1
] [formerly0bb5e2a61e
[formerly dba301df2f593baa951c14b684e7ce4794e32019]] Former-commit-id:0bb5e2a61e
Former-commit-id:1a7dd7723b
This commit is contained in:
commit
65e8ad1a62
8 changed files with 109 additions and 38 deletions
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.datadelivery.registry.Network;
|
|||
import com.raytheon.uf.common.datadelivery.registry.PointDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||
|
@ -133,9 +134,13 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* Jun 14, 2013 2108 mpduff Refactored DataSizeUtils.
|
||||
* Oct 11, 2013 2386 mpduff Refactor DD Front end.
|
||||
* Oct 15, 2013 2477 mpduff Remove debug code.
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Oct 25, 2013 2292 mpduff Move overlap processing to edex.
|
||||
<<<<<<< HEAD
|
||||
* Nov 14, 2013 2538 mpduff Added check for duplicate subscription.
|
||||
=======
|
||||
* Nov 14, 2013 2548 mpduff Set the subscription type (QUERY OR RECURRING)
|
||||
>>>>>>> Issue #2548 - Add a subscription type slot for uniqueness.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -525,6 +530,7 @@ public abstract class SubsetManagerDlg extends CaveSWTDialog implements
|
|||
return;
|
||||
}
|
||||
try {
|
||||
as.setSubscriptionType(SubscriptionType.QUERY);
|
||||
SubscriptionServiceResult result = subscriptionService.store(
|
||||
as, this);
|
||||
|
||||
|
@ -562,6 +568,7 @@ public abstract class SubsetManagerDlg extends CaveSWTDialog implements
|
|||
.getCurrentUser() : this.subscription.getOwner());
|
||||
sub.setOriginatingSite(LocalizationManager.getInstance()
|
||||
.getCurrentSite());
|
||||
sub.setSubscriptionType(SubscriptionType.RECURRING);
|
||||
|
||||
return setupCommonSubscriptionAttributes(sub, defaultRoute);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Oct 2, 2013 1797 dhladky Generics start
|
||||
* Oct 11, 2013 2460 dhladky Restored Adhoc's to registryObject store, WFO only
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,8 +59,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
@RegistryObject({ Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT, Subscription.ORIGINATING_SITE_SLOT })
|
||||
public class AdhocSubscription<T extends Time, C extends Coverage> extends SiteSubscription<T, C> {
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT,
|
||||
Subscription.ORIGINATING_SITE_SLOT, Subscription.SUBSCRIPTION_TYPE_SLOT })
|
||||
public class AdhocSubscription<T extends Time, C extends Coverage> extends
|
||||
SiteSubscription<T, C> {
|
||||
|
||||
private static final long serialVersionUID = -2200080380095632486L;
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Apr 02, 2013 1841 djohnson Initial creation
|
||||
* Sept 30, 2013 1797 dhladky Generics
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -55,9 +56,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
Subscription.NAME_SLOT, Subscription.DATA_SET_SLOT,
|
||||
Subscription.OWNER_SLOT,
|
||||
InitialPendingSubscription.CHANGE_REQUEST_ID_SLOT,
|
||||
Subscription.ORIGINATING_SITE_SLOT})
|
||||
public class InitialPendingSharedSubscription<T extends Time, C extends Coverage> extends SharedSubscription<T, C>
|
||||
implements InitialPendingSubscription<T, C> {
|
||||
Subscription.ORIGINATING_SITE_SLOT, Subscription.SUBSCRIPTION_TYPE_SLOT })
|
||||
public class InitialPendingSharedSubscription<T extends Time, C extends Coverage>
|
||||
extends SharedSubscription<T, C> implements
|
||||
InitialPendingSubscription<T, C> {
|
||||
private static final long serialVersionUID = 2779084460608459754L;
|
||||
|
||||
/** ID of the user requesting the change */
|
||||
|
@ -86,8 +88,8 @@ public class InitialPendingSharedSubscription<T extends Time, C extends Coverage
|
|||
* @param user
|
||||
* user
|
||||
*/
|
||||
public InitialPendingSharedSubscription(SharedSubscription<T, C> subscription,
|
||||
String user) {
|
||||
public InitialPendingSharedSubscription(
|
||||
SharedSubscription<T, C> subscription, String user) {
|
||||
super(subscription);
|
||||
|
||||
this.setChangeReqId(user);
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Apr 02, 2013 1841 djohnson InitialPendingSubscription is now InitialPendingUserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Sept 30, 2013 1797 dhladky Some Generics
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -59,8 +60,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
Subscription.NAME_SLOT, Subscription.DATA_SET_SLOT,
|
||||
Subscription.OWNER_SLOT,
|
||||
InitialPendingSubscription.CHANGE_REQUEST_ID_SLOT,
|
||||
Subscription.ORIGINATING_SITE_SLOT})
|
||||
public class InitialPendingSiteSubscription<T extends Time, C extends Coverage> extends SiteSubscription<T, C> implements
|
||||
Subscription.ORIGINATING_SITE_SLOT, Subscription.SUBSCRIPTION_TYPE_SLOT })
|
||||
public class InitialPendingSiteSubscription<T extends Time, C extends Coverage>
|
||||
extends SiteSubscription<T, C> implements
|
||||
InitialPendingSubscription<T, C> {
|
||||
private static final long serialVersionUID = 2779084460608459754L;
|
||||
|
||||
|
@ -79,18 +81,19 @@ public class InitialPendingSiteSubscription<T extends Time, C extends Coverage>
|
|||
* Constructor
|
||||
*/
|
||||
public InitialPendingSiteSubscription() {
|
||||
//empty
|
||||
// empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param subscription
|
||||
* subscription object
|
||||
* subscription object
|
||||
* @param user
|
||||
* user
|
||||
* user
|
||||
*/
|
||||
public InitialPendingSiteSubscription(SiteSubscription<T, C> subscription, String user) {
|
||||
public InitialPendingSiteSubscription(SiteSubscription<T, C> subscription,
|
||||
String user) {
|
||||
super(subscription);
|
||||
|
||||
this.setChangeReqId(user);
|
||||
|
@ -98,10 +101,9 @@ public class InitialPendingSiteSubscription<T extends Time, C extends Coverage>
|
|||
this.setId(RegistryUtil.getRegistryObjectKey(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param changeReqId the changeReqId to set
|
||||
* @param changeReqId
|
||||
* the changeReqId to set
|
||||
*/
|
||||
@Override
|
||||
public void setChangeReqId(String changeReqId) {
|
||||
|
@ -125,7 +127,8 @@ public class InitialPendingSiteSubscription<T extends Time, C extends Coverage>
|
|||
}
|
||||
|
||||
/**
|
||||
* @param changeReason the changeReason to set
|
||||
* @param changeReason
|
||||
* the changeReason to set
|
||||
*/
|
||||
@Override
|
||||
public void setChangeReason(String changeReason) {
|
||||
|
|
|
@ -61,7 +61,8 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Sept 30,2013 1797 dhladky Generics
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Oct 30, 2013 2448 dhladky Fixed pulling data before and after activePeriod starting and ending.
|
||||
* Oct 30, 2013 2448 dhladky Fixed pulling data before and after activePeriod starting and ending.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -72,8 +73,8 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
@XmlSeeAlso({ PendingSiteSubscription.class, PendingSharedSubscription.class,
|
||||
AdhocSubscription.class, SiteSubscription.class,
|
||||
SharedSubscription.class })
|
||||
public abstract class RecurringSubscription<T extends Time, C extends Coverage> implements
|
||||
Serializable, Subscription<T, C> {
|
||||
public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
||||
implements Serializable, Subscription<T, C> {
|
||||
|
||||
private static final long serialVersionUID = -6422673887457060034L;
|
||||
|
||||
|
@ -118,6 +119,7 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
this.setLatencyInMinutes(sub.getLatencyInMinutes());
|
||||
this.setEnsemble(sub.getEnsemble());
|
||||
this.setOriginatingSite(sub.getOriginatingSite());
|
||||
this.setSubscriptionType(sub.getSubscriptionType());
|
||||
|
||||
// Set the registry id
|
||||
this.setId(RegistryUtil.getRegistryObjectKey(this));
|
||||
|
@ -259,6 +261,11 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
@SlotAttribute(Subscription.ORIGINATING_SITE_SLOT)
|
||||
private String originatingSite;
|
||||
|
||||
@XmlAttribute
|
||||
@DynamicSerializeElement
|
||||
@SlotAttribute(Subscription.SUBSCRIPTION_TYPE_SLOT)
|
||||
private SubscriptionType subscriptionType;
|
||||
|
||||
/**
|
||||
* Get subscription name.
|
||||
*
|
||||
|
@ -813,7 +820,8 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
@Override
|
||||
public String toString() {
|
||||
return getName() + "::" + getProvider() + "::" + getDataSetName()
|
||||
+ "::" + getOwner()+ "::"+getOriginatingSite();
|
||||
+ "::" + getOwner() + "::" + getOriginatingSite() + "::"
|
||||
+ getSubscriptionType().name();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -949,11 +957,30 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
this.ensemble = ensemble;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOriginatingSite(String originatingSite) {
|
||||
this.originatingSite = originatingSite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOriginatingSite() {
|
||||
return originatingSite;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the subscriptionType
|
||||
*/
|
||||
@Override
|
||||
public SubscriptionType getSubscriptionType() {
|
||||
return subscriptionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param subscriptionType
|
||||
* the subscriptionType to set
|
||||
*/
|
||||
@Override
|
||||
public void setSubscriptionType(SubscriptionType subscriptionType) {
|
||||
this.subscriptionType = subscriptionType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* May 29, 2013 1650 djohnson Add setOwner() so reflection works.
|
||||
* Sept 30, 2013 1797 dhladky Generics
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,10 +51,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@RegistryObject(value = { Subscription.PROVIDER_NAME_SLOT,
|
||||
Subscription.NAME_SLOT, Subscription.DATA_SET_SLOT,
|
||||
Subscription.OWNER_SLOT,
|
||||
Subscription.ORIGINATING_SITE_SLOT})
|
||||
Subscription.OWNER_SLOT, Subscription.ORIGINATING_SITE_SLOT,
|
||||
Subscription.SUBSCRIPTION_TYPE_SLOT })
|
||||
@DynamicSerialize
|
||||
public class SharedSubscription<T extends Time, C extends Coverage> extends RecurringSubscription<T, C> {
|
||||
public class SharedSubscription<T extends Time, C extends Coverage> extends
|
||||
RecurringSubscription<T, C> {
|
||||
|
||||
private static final long serialVersionUID = -7221500266253493273L;
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Jun 24, 2013 2106 djohnson Add copy constructor.
|
||||
* Sept 30, 2013 1797 dhladky Some Generics
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,9 +75,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@RegistryObject({ Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT,
|
||||
Subscription.ORIGINATING_SITE_SLOT})
|
||||
Subscription.ORIGINATING_SITE_SLOT, Subscription.SUBSCRIPTION_TYPE_SLOT })
|
||||
@DynamicSerialize
|
||||
public class SiteSubscription<T extends Time, C extends Coverage> extends RecurringSubscription<T, C> {
|
||||
public class SiteSubscription<T extends Time, C extends Coverage> extends
|
||||
RecurringSubscription<T, C> {
|
||||
private static final long serialVersionUID = -6422673887457060034L;
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
|
|||
* Jul 11, 2013 2106 djohnson SubscriptionPriority allows comparison.
|
||||
* Sept 30,2013 1797 dhladky Abstracted and genericized.
|
||||
* Oct 23, 2013 2484 dhladky Unique ID for subscriptions updated.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type information.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,6 +51,11 @@ import javax.xml.bind.annotation.XmlEnumValue;
|
|||
|
||||
public interface Subscription<T extends Time, C extends Coverage> {
|
||||
|
||||
@XmlEnum
|
||||
public enum SubscriptionType {
|
||||
QUERY, RECURRING;
|
||||
}
|
||||
|
||||
/** Enumeration to use for subscription priorities */
|
||||
@XmlEnum
|
||||
public static enum SubscriptionPriority {
|
||||
|
@ -146,6 +152,9 @@ public interface Subscription<T extends Time, C extends Coverage> {
|
|||
/** Originating Site slot */
|
||||
String ORIGINATING_SITE_SLOT = "originatingSite";
|
||||
|
||||
/** Subscription type slot (query, recurring) */
|
||||
String SUBSCRIPTION_TYPE_SLOT = "subscriptionType";
|
||||
|
||||
/**
|
||||
* Get subscription name.
|
||||
*
|
||||
|
@ -621,13 +630,29 @@ public interface Subscription<T extends Time, C extends Coverage> {
|
|||
|
||||
/**
|
||||
* Gets the original site the subscription was created as
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getOriginatingSite();
|
||||
|
||||
/**
|
||||
* Sets the originating Site the subscription was created as
|
||||
*
|
||||
* @param originatingSite
|
||||
*/
|
||||
void setOriginatingSite(String originatingSite);
|
||||
|
||||
/**
|
||||
* Get the subscription type (Recurring or Query)
|
||||
*
|
||||
* @return the SubscriptionType
|
||||
*/
|
||||
SubscriptionType getSubscriptionType();
|
||||
|
||||
/**
|
||||
* Set the subscription type.
|
||||
*
|
||||
* @param subType
|
||||
*/
|
||||
void setSubscriptionType(SubscriptionType subType);
|
||||
}
|
Loading…
Add table
Reference in a new issue