diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/DataDeliveryUtils.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/DataDeliveryUtils.java index 04e2e64aac..20bfe2c73c 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/DataDeliveryUtils.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/utils/DataDeliveryUtils.java @@ -35,8 +35,8 @@ import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import com.raytheon.uf.common.auth.resp.SuccessfulExecution; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.registry.Coverage; import com.raytheon.uf.common.datadelivery.registry.DataLevelType; import com.raytheon.uf.common.datadelivery.registry.DataType; @@ -47,9 +47,8 @@ import com.raytheon.uf.common.datadelivery.registry.PointTime; import com.raytheon.uf.common.datadelivery.registry.Subscription; import com.raytheon.uf.common.datadelivery.registry.Time; import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants; +import com.raytheon.uf.common.registry.ebxml.RegistryUtil; import com.raytheon.uf.common.serialization.comm.RequestRouter; -import com.raytheon.uf.common.site.SiteData; -import com.raytheon.uf.common.site.SiteMap; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.CollectionUtil; import com.raytheon.uf.common.util.SizeUtil; @@ -93,6 +92,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Nov 07, 2013 2291 skorolev Added showText() method for messages with many lines. * Feb 11, 2014 2771 bgonzale Added Data Delivery ID, getter, and retrieval method. * Apr 2, 2014 2974 dhladky DD ID added to list for dropdowns in DD. + * Apr 22, 2014 2992 dhladky Unique list of all registries with data in this node. * * * @author mpduff @@ -849,7 +849,7 @@ public class DataDeliveryUtils { } private static String retrieveDataDeliveryId() { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.GET_DATADELIVERY_ID); try { SuccessfulExecution response = (SuccessfulExecution) RequestRouter @@ -865,16 +865,28 @@ public class DataDeliveryUtils { * Gets the DD id containing site List. * @return */ + @SuppressWarnings("unchecked") public static List getDataDeliverySiteList() { - Map siteData = SiteMap.getInstance().getSiteData(); - Set sites = siteData.keySet(); - List siteList = new ArrayList(sites); - String DDid = DataDeliveryUtils.getDataDeliveryId(); + BandwidthRequest request = new BandwidthRequest(); + List siteList = null; + request.setRequestType(RequestType.GET_DATADELIVERY_REGISTRIES); + try { + SuccessfulExecution response = (SuccessfulExecution) RequestRouter + .route(request, DataDeliveryConstants.DATA_DELIVERY_SERVER); + siteList = (List) response.getResponse(); + } catch (Exception e) { + throw new RuntimeException( + "Unable to retrieve Data Delivery Registry list from EDEX.", e); + } + // Should return itself, but just in case. + String DDid = getDataDeliveryId(); if (!siteList.contains(DDid)) { siteList.add(DDid); Collections.sort(siteList); } + // remove "NCF", CAVE users don't care about things owned by NCF + siteList.remove(RegistryUtil.defaultUser); return siteList; } diff --git a/deltaScripts/14.3.1/datadelivery/README b/deltaScripts/14.3.1/datadelivery/README new file mode 100644 index 0000000000..3cebb6e265 --- /dev/null +++ b/deltaScripts/14.3.1/datadelivery/README @@ -0,0 +1,12 @@ +# README, DO NOT RUN THIS SCRIPT UNLESS YOU READ THIS!!!!!!!!!!!!!!! +# This update needs to be performed with build 14.3.1. +# This update is only for edex servers which have run DD and have subscriptions loaded. + +1.) Backup your subscriptions from the Registry Web Interface, + http://$REGISTRY_HOST:8082/registry/RegistryInterface.html. + hit the button. +2.) Then run this update script, updateSubscriptionOwners.sh +3.) If you are satisfied the subs are correct, either clean up the backup files by running + the deleteBackupSubs.sh or move them to a different directory for storage. +3.) After script runs, hit the button + That will update the subscriptions will reflect the correct ownership at the registry level. \ No newline at end of file diff --git a/deltaScripts/14.3.1/datadelivery/deleteBackupSubs.sh b/deltaScripts/14.3.1/datadelivery/deleteBackupSubs.sh new file mode 100644 index 0000000000..5e76269c59 --- /dev/null +++ b/deltaScripts/14.3.1/datadelivery/deleteBackupSubs.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# +# Deletes the backuped up subscriptions *.bak files + +echo "" +echo "Press Enter to perform the updates Ctrl-C to quit." +read done + +rm -rf /awips2/edex/data/registrySubscriptionBackup/*.bak diff --git a/deltaScripts/14.3.1/datadelivery/updateSubscriptionOwners.sh b/deltaScripts/14.3.1/datadelivery/updateSubscriptionOwners.sh new file mode 100644 index 0000000000..ce2452be40 --- /dev/null +++ b/deltaScripts/14.3.1/datadelivery/updateSubscriptionOwners.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# DO NOT RUN THIS SCRIPT UNLESS YOU READ THIS!!!!!!!!!!!!!!! +# This update needs to be performed with build 14.3.1. +# This update is only for edex servers which have run DD and have subscriptions loaded. +# FIRST! Backup your subscriptions from the Registry Web Interface, +# http://$REGISTRY_HOST:8082/registry/RegistryInterface.html. +# Then run this update script, after script runs, +# That will update the subscriptions to reflect the correct ownership at the registry level. + +echo "" +echo "Press Enter to perform the updates Ctrl-C to quit." +read done + +files=`find /awips2/edex/data/registrySubscriptionBackup -iname \*-RECURRING` + +if [[ -z "$files" ]]; then +echo "FATAL: Update Subscriptions has Failed, No subscription backup files found!" +exit 1 +fi + +for f in $files; do + echo Updating $f + bf=$f.bak.`date +%m%d%y` + cp $f $bf + perl updateSubscriptionOwners.pl $f; + done + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/IBandwidthRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthRequest.java similarity index 94% rename from edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/IBandwidthRequest.java rename to edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthRequest.java index 80ebe75dab..acd65cd78e 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/IBandwidthRequest.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthRequest.java @@ -28,6 +28,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Jul 18, 2013 1653 mpduff Add GET_SUBSCRIPTION_STATUS. * Oct 2 2013 1797 dhladky generic attempt * Feb 11, 2014 2771 bgonzale Added GET_DATADELIVERY_ID to RequestTypes. + * Apr 22, 2014 2992 dhladky This is not an interface, changed to be correct naming. * * * @@ -35,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -public class IBandwidthRequest extends AbstractPrivilegedRequest { +public class BandwidthRequest extends AbstractPrivilegedRequest { public static enum RequestType { // Get the current retrieval plan for the @@ -48,7 +49,7 @@ public class IBandwidthRequest extends Abstr /** * Request information. */ - GET_ESTIMATED_COMPLETION, GET_BANDWIDTH_GRAPH_DATA, GET_SUBSCRIPTION_STATUS, GET_DATADELIVERY_ID + GET_ESTIMATED_COMPLETION, GET_BANDWIDTH_GRAPH_DATA, GET_SUBSCRIPTION_STATUS, GET_DATADELIVERY_ID, GET_DATADELIVERY_REGISTRIES } @DynamicSerializeElement diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthService.java index d91588ecab..1f8dd2b3b9 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthService.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.bandwidth/src/com/raytheon/uf/common/datadelivery/bandwidth/BandwidthService.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Set; import com.raytheon.uf.common.auth.req.BasePrivilegedServerService; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.bandwidth.data.BandwidthGraphData; import com.raytheon.uf.common.datadelivery.bandwidth.data.SubscriptionStatusSummary; import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription; @@ -57,6 +57,7 @@ import com.raytheon.uf.common.util.LogUtil; * Oct 2, 2013 1797 dhladky Generics * Oct 01, 2013 2267 bgonzale Log error response from proposed scheduling. * Dec 11, 2013 2625 mpduff Fix error handling to not return null. + * Apr 22, 2014 2992 dhladky renamed BandwidthRequest * * * @@ -64,7 +65,7 @@ import com.raytheon.uf.common.util.LogUtil; * @version 1.0 */ public abstract class BandwidthService - extends BasePrivilegedServerService> implements + extends BasePrivilegedServerService> implements IBandwidthService { private static final IUFStatusHandler statusHandler = UFStatus @@ -84,7 +85,7 @@ public abstract class BandwidthService */ @Override public final int getBandwidthForNetworkInKilobytes(Network network) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.GET_BANDWIDTH); request.setNetwork(network); @@ -105,7 +106,7 @@ public abstract class BandwidthService @SuppressWarnings("unchecked") public Set proposeBandwidthForNetworkInKilobytes(Network network, int bandwidth) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.PROPOSE_SET_BANDWIDTH); request.setNetwork(network); request.setBandwidth(bandwidth); @@ -126,7 +127,7 @@ public abstract class BandwidthService @Override public final boolean setBandwidthForNetworkInKilobytes(Network network, int bandwidth) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.FORCE_SET_BANDWIDTH); request.setNetwork(network); request.setBandwidth(bandwidth); @@ -161,7 +162,7 @@ public abstract class BandwidthService */ @Override public Set schedule(List> subscriptions) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.SCHEDULE_SUBSCRIPTION); request.setSubscriptions(subscriptions); @@ -195,7 +196,7 @@ public abstract class BandwidthService @Override public IProposeScheduleResponse proposeSchedule( List> subscriptions) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.PROPOSE_SCHEDULE_SUBSCRIPTION); request.setSubscriptions(subscriptions); @@ -217,7 +218,7 @@ public abstract class BandwidthService */ @Override public void reinitialize() { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.REINITIALIZE); try { @@ -234,7 +235,7 @@ public abstract class BandwidthService @SuppressWarnings("unchecked") @Override public Date getEstimatedCompletionTime(AdhocSubscription sub) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setSubscriptions(Arrays.> asList(sub)); request.setRequestType(RequestType.GET_ESTIMATED_COMPLETION); try { @@ -253,7 +254,7 @@ public abstract class BandwidthService */ @Override public BandwidthGraphData getBandwidthGraphData() { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.GET_BANDWIDTH_GRAPH_DATA); try { return sendRequest(request, BandwidthGraphData.class); @@ -268,7 +269,7 @@ public abstract class BandwidthService @Override public SubscriptionStatusSummary getSubscriptionStatusSummary( Subscription subscription) { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setSubscriptions(Arrays .> asList(subscription)); request.setRequestType(RequestType.GET_SUBSCRIPTION_STATUS); diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java index 114c69a6d0..8801a167b4 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java @@ -54,6 +54,7 @@ import com.raytheon.uf.common.registry.ebxml.slots.SlotConverter; import com.raytheon.uf.common.registry.ebxml.slots.StringSlotConverter; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.time.util.ImmutableDate; +import com.raytheon.uf.common.util.ClusterIdUtil; import com.raytheon.uf.common.util.CollectionUtil; import com.raytheon.uf.common.util.ReflectionException; import com.raytheon.uf.common.util.ReflectionUtil; @@ -79,7 +80,8 @@ import com.raytheon.uf.common.util.ReflectionUtil; * Jun 03, 2013 2038 djohnson Allow setting the same encoder strategy. * Jun 24, 2013 2106 djohnson Remove encoder strategy from instance variables. * Dec 04, 2013 2584 dhladky Versions for Registry objects - * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Apr 24, 2014 2992 dhladky fixed all objects in ebxml owned by NCF, bad. * * * @@ -99,6 +101,8 @@ public final class RegistryUtil { public static final String registryObjectDefaultVersion = "1.0"; public static final String registryUser = "Registry"; + + public static final String defaultUser = "NCF"; static { if (System.getenv("EBXML_REGISTRY_HOST") != null @@ -113,9 +117,9 @@ public final class RegistryUtil { public static final String CALLING_REGISTRY_SOAP_HEADER_NAME = "Calling_Registry"; /** - * The default internal owner + * The default internal owner is the local registry ID */ - public static final String DEFAULT_OWNER = "NCF"; + public static final String DEFAULT_OWNER = ClusterIdUtil.getId(); // A private mapping of attribute types to slot types, used when storing an // object to the registry to map QueryableAttributes to SlotConverters. diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/META-INF/MANIFEST.MF index c574d10d32..1ea2fc5447 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/META-INF/MANIFEST.MF @@ -17,7 +17,8 @@ Require-Bundle: com.raytheon.uf.common.datadelivery.bandwidth;bundle-version="1. com.google.guava;bundle-version="1.0.0", com.raytheon.uf.edex.core;bundle-version="1.12.1174", com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0", - com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0" + com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0", + com.raytheon.uf.edex.registry.ebxml;bundle-version="1.0.0" Import-Package: com.raytheon.edex.site, - com.raytheon.uf.common.event, - com.raytheon.uf.edex.datadelivery.util + com.raytheon.uf.common.event + diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/MonolithicBandwidthManagerCreator.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/MonolithicBandwidthManagerCreator.java index ed144881a9..b7e2f5d3b2 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/MonolithicBandwidthManagerCreator.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/MonolithicBandwidthManagerCreator.java @@ -33,6 +33,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * {@link IEdexBandwidthManagerCreator} A bandwidth manager creator for @@ -53,6 +54,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * Dec 04, 2013 2566 bgonzale use bandwidthmanager method to retrieve spring files. * Jan 14, 2014 2692 dhladky AdhocSubscription handler * Jan 30, 2014 2636 mpduff Scheduling refactor. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -85,12 +87,13 @@ public class MonolithicBandwidthManagerCreator bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); @@ -110,13 +113,14 @@ public class MonolithicBandwidthManagerCreator getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { return new MonolithicBandwidthManager(dbInit, bandwidthDao, - retrievalManager, bandwidthDaoUtil, dataSetMetaDataHandler, + retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerCreator.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerCreator.java index 76e94e6929..89ba693a61 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerCreator.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerCreator.java @@ -44,6 +44,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * {@link IEdexBandwidthManagerCreator} for an NCF bandwidth manager. @@ -65,6 +66,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * Reschedule updated shared subscriptions. * Dec 04, 2013 2566 bgonzale use bandwidthmanager method to retrieve spring files. * Jan 14, 2014 2692 dhladky AdhocSubscription handler + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -97,12 +99,13 @@ public class NcfBandwidthManagerCreator IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); @@ -160,13 +163,14 @@ public class NcfBandwidthManagerCreator public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { return new NcfBandwidthManager(dbInit, bandwidthDao, retrievalManager, - bandwidthDaoUtil, dataSetMetaDataHandler, subscriptionHandler, + bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/sbn/SbnSimulator.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/sbn/SbnSimulator.java index e0b1d8ca53..0b21e2f38b 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/sbn/SbnSimulator.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth.ncf/src/com/raytheon/uf/edex/datadelivery/bandwidth/sbn/SbnSimulator.java @@ -29,7 +29,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.edex.core.EDEXUtil; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * The SBN simulator. Reads files from a configured directory, and then places @@ -103,7 +103,7 @@ public class SbnSimulator { */ public SbnSimulator() { this(new File(System.getProperty("sbn.retrieval.transfer.directory")), - new CopyFileToManualIngest(), DataDeliveryIdUtil.getId()); + new CopyFileToManualIngest(), RegistryIdUtil.getId()); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/META-INF/MANIFEST.MF index 9d3f5605c9..49bf6012a4 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/META-INF/MANIFEST.MF @@ -45,5 +45,4 @@ Export-Package: com.raytheon.uf.edex.datadelivery.bandwidth, com.raytheon.uf.edex.datadelivery.bandwidth.util Import-Package: com.raytheon.uf.common.datadelivery.event.retrieval, com.raytheon.uf.common.datadelivery.registry, - com.raytheon.uf.common.stats, - com.raytheon.uf.edex.datadelivery.util + com.raytheon.uf.common.stats diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/bandwidth-datadelivery.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/bandwidth-datadelivery.xml index 316759038f..ea435c54b9 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/bandwidth-datadelivery.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/bandwidth-datadelivery.xml @@ -31,7 +31,7 @@ - + @@ -39,10 +39,11 @@ + - + diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/thrift-bandwidth.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/thrift-bandwidth.xml index 286d6764dc..a4f34019a3 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/thrift-bandwidth.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/res/spring/thrift-bandwidth.xml @@ -7,7 +7,7 @@ + value="com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest" /> diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/BandwidthManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/BandwidthManager.java index 9a66c98561..b708c44fee 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/BandwidthManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/BandwidthManager.java @@ -22,8 +22,8 @@ import com.google.common.collect.Sets; import com.raytheon.edex.util.Util; import com.raytheon.uf.common.auth.exception.AuthorizationException; import com.raytheon.uf.common.auth.user.IUser; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse; import com.raytheon.uf.common.datadelivery.bandwidth.ProposeScheduleResponse; import com.raytheon.uf.common.datadelivery.bandwidth.data.BandwidthGraphData; @@ -80,8 +80,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * Abstract {@link IBandwidthManager} implementation which provides core @@ -148,6 +148,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; * Feb 11, 2014 2771 bgonzale Added handler for GET_DATADELIVERY_ID request. * Feb 10, 2014 2636 mpduff Changed how retrieval plan is updated over time. * Apr 02, 2014 2810 dhladky Priority sorting of subscriptions. + * Apr 22, 2014 2992 dhladky Ability to get list of all registry nodes containing data. * * * @@ -155,13 +156,16 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; * @version 1.0 */ public abstract class BandwidthManager - extends AbstractPrivilegedRequestHandler> + extends AbstractPrivilegedRequestHandler> implements IBandwidthManager { protected static final IUFStatusHandler statusHandler = UFStatus .getHandler(BandwidthManager.class); private static final Pattern RES_PATTERN = Pattern.compile("^res"); + + /** used to query for registry subscription object owners **/ + private static final String objectType = "'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:com.raytheon.uf.common.datadelivery.registry.%Subscription'"; // Requires package access so it can be accessed from the maintenance task final IBandwidthDao bandwidthDao; @@ -173,6 +177,8 @@ public abstract class BandwidthManager protected final BandwidthDaoUtil bandwidthDaoUtil; private final IBandwidthDbInit dbInit; + + private final RegistryIdUtil idUtil; // Instance variable and not static, because there are multiple child // implementation classes which should each have a unique prefix @@ -185,11 +191,13 @@ public abstract class BandwidthManager public BandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, - BandwidthDaoUtil bandwidthDaoUtil) { + BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil) { this.dbInit = dbInit; this.bandwidthDao = bandwidthDao; this.retrievalManager = retrievalManager; this.bandwidthDaoUtil = bandwidthDaoUtil; + this.idUtil = idUtil; } /** @@ -878,7 +886,7 @@ public abstract class BandwidthManager * {@inheritDoc} */ @Override - public Object handleRequest(IBandwidthRequest request) + public Object handleRequest(BandwidthRequest request) throws Exception { ITimer timer = TimeUtil.getTimer(); @@ -982,7 +990,10 @@ public abstract class BandwidthManager response = getBandwidthGraphData(); break; case GET_DATADELIVERY_ID: - response = DataDeliveryIdUtil.getId(); + response = RegistryIdUtil.getId(); + break; + case GET_DATADELIVERY_REGISTRIES: + response = idUtil.getUniqueRegistries(objectType); break; case GET_SUBSCRIPTION_STATUS: Subscription sub = null; @@ -1440,7 +1451,7 @@ public abstract class BandwidthManager */ @Override public AuthorizationResponse authorized(IUser user, - IBandwidthRequest request) throws AuthorizationException { + BandwidthRequest request) throws AuthorizationException { return new AuthorizationResponse(true); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthContextFactory.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthContextFactory.java index 193fe7521f..fc8a88469a 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthContextFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthContextFactory.java @@ -41,6 +41,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsF import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializer; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * {@link BandwidthContextFactory} for running in EDEX. Intentionally @@ -59,6 +60,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * Nov 07, 2013 2506 bgonzale Added notification handler to bandwidth context. * Jan 14, 2014 2692 dhladky AdhocSubscription handler * Jan 30, 2014 2636 mpduff Scheduling refactor. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -81,6 +83,7 @@ public class EdexBandwidthContextFactory * @param bandwidthDao * @param retrievalManager * @param bandwidthDaoUtil + * @param idUtil * @param dataSetMetaDataHandler * @param subscriptionHandler * @return the bandwidth manager @@ -89,6 +92,7 @@ public class EdexBandwidthContextFactory IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, @@ -253,9 +257,9 @@ public class EdexBandwidthContextFactory @Override public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, - BandwidthDaoUtil bandwidthDaoUtil) { + BandwidthDaoUtil bandwidthDaoUtil,RegistryIdUtil idUtil) { return bandwidthManagerCreator.getBandwidthManager(dbInit, - bandwidthDao, retrievalManager, bandwidthDaoUtil, + bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, notificationService, findSubscriptionsStrategy); diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java index d3d446965f..b6eb345463 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/EdexBandwidthManager.java @@ -40,8 +40,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.bandwidth.ProposeScheduleResponse; import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription; import com.raytheon.uf.common.datadelivery.registry.Coverage; @@ -87,7 +87,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalFulfilled; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * Implementation of {@link BandwidthManager} that isolates EDEX specific @@ -128,6 +128,7 @@ import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; * Feb 10, 2014 2636 mpduff Pass Network map to be scheduled. * Feb 21, 2014, 2636 dhladky Try catch to keep MaintTask from dying. * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @author djohnson @@ -177,12 +178,13 @@ public abstract class EdexBandwidthManager IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil); + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil); this.dataSetMetaDataHandler = dataSetMetaDataHandler; this.subscriptionHandler = subscriptionHandler; @@ -401,7 +403,7 @@ public abstract class EdexBandwidthManager if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(objectType)) { if (sub != null) { boolean isApplicableForTheLocalSite = sub.getOfficeIDs() - .contains(DataDeliveryIdUtil.getId()); + .contains(RegistryIdUtil.getId()); if (isApplicableForTheLocalSite) { switch (event.getAction()) { case UPDATE: @@ -798,7 +800,7 @@ public abstract class EdexBandwidthManager * reinitialize operation. */ private void bandwidthMapConfigurationUpdated() { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.REINITIALIZE); try { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthContextFactory.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthContextFactory.java index 3396acc151..c58424c202 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthContextFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthContextFactory.java @@ -33,6 +33,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializer; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * Implementation of {@link BandwidthContextFactory} that returns DAO classes @@ -47,6 +48,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * ------------ ---------- ----------- -------------------------- * Oct 24, 2012 1286 djohnson Initial creation * Jun 24, 2013 2106 djohnson Add {@link #getBandwidthBucketDao()}. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -123,9 +125,9 @@ class InMemoryBandwidthContextFactory implements BandwidthContextFactory { @Override public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, - BandwidthDaoUtil bandwidthDaoUtil) { + BandwidthDaoUtil bandwidthDaoUtil, RegistryIdUtil idUtil) { return new InMemoryBandwidthManager(dbInit, bandwidthDao, - retrievalManager, bandwidthDaoUtil); + retrievalManager, bandwidthDaoUtil, idUtil); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthManager.java index 3e42fc482d..f0e920fd23 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/InMemoryBandwidthManager.java @@ -38,6 +38,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializer; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * An in-memory {@link IBandwidthManager} that does not communicate with an @@ -59,6 +60,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * Dec 04, 2013 2566 bgonzale use bandwidthmanager method to retrieve spring files. * Feb 06, 2014 2636 bgonzale added initializeScheduling method. * Feb 12, 2014 2636 mpduff Override getSubscriptionsToSchedule + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -122,11 +124,12 @@ class InMemoryBandwidthManager extends * @param bandwidthDao * @param retrievalManager * @param bandwidthDaoUtil + * @param IdUtil */ public InMemoryBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, - RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil); + RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, RegistryIdUtil idUtil) { + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerCreator.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerCreator.java index 193edf93ef..cdd3507cf8 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerCreator.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerCreator.java @@ -43,7 +43,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * {@link IEdexBandwidthManagerCreator} for a WFO bandwidth manager. @@ -70,6 +70,7 @@ import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; * Jan 14, 2014 2692 dhladky AdhocSubscription handler * Jan 30, 2014 2636 mpduff Scheduling refactor. * Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -99,6 +100,7 @@ public class WfoBandwidthManagerCreator * @param bandwidthDao * @param retrievalManager * @param bandwidthDaoUtil + * @param idUtil * @param dataSetMetaDataHandler * @param subscriptionHandler * @param adhocSubscriptionHandler @@ -110,12 +112,13 @@ public class WfoBandwidthManagerCreator IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); @@ -137,7 +140,7 @@ public class WfoBandwidthManagerCreator Subscription subscription = getRegistryObjectById( getSubscriptionHandler(), event.getId()); boolean isLocalOrigination = subscription.getOriginatingSite() - .equals(DataDeliveryIdUtil.getId()); + .equals(RegistryIdUtil.getId()); if (isLocalOrigination) { subscriptionUpdated(subscription); @@ -204,13 +207,14 @@ public class WfoBandwidthManagerCreator public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + RegistryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionsStrategy) { return new WfoBandwidthManager(dbInit, bandwidthDao, - retrievalManager, bandwidthDaoUtil, dataSetMetaDataHandler, + retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionsStrategy); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/dao/BandwidthContextFactory.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/dao/BandwidthContextFactory.java index fd16ca21d1..80d8d58da0 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/dao/BandwidthContextFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/dao/BandwidthContextFactory.java @@ -28,6 +28,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.HibernateBandwidthD import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializer; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * Factory used to produce contextual differences in the @@ -44,6 +45,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; * ------------ ---------- ----------- -------------------------- * Oct 24, 2012 1286 djohnson Initial creation * Jun 24, 2013 2106 djohnson Add {@link #getBandwidthBucketDao()}. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @@ -98,9 +100,10 @@ public interface BandwidthContextFactory { * the retrieval manager * @param bandwidthDaoUtil * the dao util instance + * @param RegistryIdUtil finds DD server nodes * @return the {@link BandwidthManager} reference */ IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, - BandwidthDaoUtil bandwidthDaoUtil); + BandwidthDaoUtil bandwidthDaoUtil, RegistryIdUtil idUtil); } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/handler/LocalSiteSubscriptionHandler.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/handler/LocalSiteSubscriptionHandler.java index 830b901dab..dc327e7330 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/handler/LocalSiteSubscriptionHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/handler/LocalSiteSubscriptionHandler.java @@ -23,7 +23,7 @@ import com.raytheon.uf.common.datadelivery.registry.SiteSubscription; import com.raytheon.uf.common.datadelivery.registry.ebxml.SiteSubscriptionQuery; import com.raytheon.uf.common.datadelivery.registry.handlers.SiteSubscriptionHandler; import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * {@link IRegistryObjectHandler} implementation for {@link SiteSubscription}. @@ -52,7 +52,7 @@ public class LocalSiteSubscriptionHandler extends SiteSubscriptionHandler { * Default Constructor. */ public LocalSiteSubscriptionHandler() { - this(DataDeliveryIdUtil.getId()); + this(RegistryIdUtil.getId()); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializer.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializer.java index c0c8d6fb46..e8629dac0b 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializer.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/hibernate/HibernateBandwidthInitializer.java @@ -13,7 +13,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.IBandwidthManager; import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializer; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * @@ -60,7 +60,7 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer { */ public HibernateBandwidthInitializer( IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - this(findSubscriptionsStrategy, DataDeliveryIdUtil.getId()); + this(findSubscriptionsStrategy, RegistryIdUtil.getId()); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml index fc13101211..39a7af36bd 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.core.feature/feature.xml @@ -88,13 +88,6 @@ version="0.0.0" unpack="false"/> - - subscriptions = request.getSubscriptionList(); List duplicateList = new LinkedList(); SubscriptionOverlapResponse response = new SubscriptionOverlapResponse(); diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/.classpath b/edexOsgi/com.raytheon.uf.edex.datadelivery/.classpath deleted file mode 100644 index ad32c83a78..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/.project b/edexOsgi/com.raytheon.uf.edex.datadelivery/.project deleted file mode 100644 index 5923a1fb1a..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - com.raytheon.uf.edex.datadelivery - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.uf.edex.datadelivery/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f13006b4b2..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Thu Apr 11 12:14:11 CDT 2013 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery/META-INF/MANIFEST.MF deleted file mode 100644 index 5f539fcc27..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Registry -Bundle-SymbolicName: com.raytheon.uf.edex.datadelivery -Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: RAYTHEON -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: com.raytheon.edex.site, - com.raytheon.uf.common.site, - com.raytheon.uf.common.util -Export-Package: com.raytheon.uf.edex.datadelivery.util diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/build.properties b/edexOsgi/com.raytheon.uf.edex.datadelivery/build.properties deleted file mode 100644 index 34d2e4d2da..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/src/.gitignore b/edexOsgi/com.raytheon.uf.edex.datadelivery/src/.gitignore deleted file mode 100644 index d14dd1cd51..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -# Required to keep the empty directory present \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml index 717407dfbd..0df075866c 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml @@ -56,5 +56,12 @@ + + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryDao.java index b20d05f41b..dc8f2efdc0 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryDao.java @@ -35,7 +35,7 @@ import org.springframework.transaction.annotation.Transactional; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 5/21/2013 2022 bphillip Initial implementation - * + * * * @author bphillip * @version 1 diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectDao.java index 3836d3f030..5b60dc71dd 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectDao.java @@ -45,6 +45,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; * 8/1/2013 1693 bphillip Added methods to facilitate implementation of the lifecyclemanager according to the 4.0 spec * 2/13/2014 2769 bphillip Added read only flags to query methods * 4/11/2014 3011 bphillip Changed merge to not delete unused slots + * 4/21/2014 2992 dhladky General list of Registry server nodes. * * * @@ -57,6 +58,9 @@ public class RegistryObjectDao extends /** Delete object type parameterized statement */ private static final String GET_IDS_BY_OBJECT_TYPE = "SELECT regObj.id FROM RegistryObjectType regObj WHERE regObj.objectType=:objectType"; + /** Get the unique list of registry nodes with subscriptions **/ + private static final String QUERY_UNIQUE_REGISTRIES = "SELECT DISTINCT regObj.owner FROM RegistryObjectType regObj WHERE regObj.objectType LIKE "; + /** Query to determine if an object id exists in the registry */ private static final String ID_EXISTS_QUERY = "select count(obj.id) from RegistryObjectType obj where id=:id"; @@ -66,6 +70,8 @@ public class RegistryObjectDao extends /** Query to get all sub versions beneath the given version */ private static String GET_SUB_VERSION_QUERY = "select obj.versionInfo.versionName from RegistryObjectType obj where obj.lid=:lid and obj.versionInfo.versionName like :version"; + private SlotTypeDao slotDao; + /** * Creates a new RegistryObjectDao */ @@ -191,4 +197,18 @@ public class RegistryObjectDao extends return RegistryObjectType.class; } + public void setSlotDao(SlotTypeDao slotDao) { + this.slotDao = slotDao; + } + + /** + * Gets a list of unique registry ID's with data on this node for this objectType. + * @param objectType + * @return + */ + @Transactional(propagation = Propagation.REQUIRED, readOnly = true) + public List getUniqueRegistries(String objectType) { + return this.executeHQLQuery(QUERY_UNIQUE_REGISTRIES+" "+objectType); + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery/src/com/raytheon/uf/edex/datadelivery/util/DataDeliveryIdUtil.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/RegistryIdUtil.java similarity index 57% rename from edexOsgi/com.raytheon.uf.edex.datadelivery/src/com/raytheon/uf/edex/datadelivery/util/DataDeliveryIdUtil.java rename to edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/RegistryIdUtil.java index 55ce7da142..fca39b1817 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery/src/com/raytheon/uf/edex/datadelivery/util/DataDeliveryIdUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/RegistryIdUtil.java @@ -17,12 +17,15 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.edex.datadelivery.util; +package com.raytheon.uf.edex.registry.ebxml.util; + +import java.util.List; import com.raytheon.uf.common.util.ClusterIdUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; /** - * Common Utility class specifically for Data Delivery that currently just + * Common Utility class specifically for Registry that currently just * returns the Cluster ID. * *
@@ -32,21 +35,43 @@ import com.raytheon.uf.common.util.ClusterIdUtil;
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Feb 06, 2014 2771       bgonzale     Initial creation
+ * Apr 23, 2014 2992       dhladky      General way to get all registries.
  * 
  * 
* * @author bgonzale * @version 1.0 */ -public class DataDeliveryIdUtil { +public class RegistryIdUtil { + // connection to the registry DAO object + private RegistryObjectDao rdo; + + // public constructor + public RegistryIdUtil() { + + } + + // public spring constructor + public RegistryIdUtil(RegistryObjectDao rdo) { + this.rdo = rdo; + } + /** - * Return the Data Delivery ID for this running instance of Data Delivery. + * Return the Registry ID for this running instance of Registry. * - * @return Data Delivery ID. + * @return Registry ID. */ public static String getId() { return ClusterIdUtil.getId(); } - + + /** + * Gets the list of unique registry nodes that have data in this node. + * @return + */ + public List getUniqueRegistries(String objectType) { + return rdo.getUniqueRegistries(objectType); + } + } diff --git a/tests/.classpath b/tests/.classpath index 497a20cda6..a9b0fefae7 100644 --- a/tests/.classpath +++ b/tests/.classpath @@ -162,5 +162,6 @@ + diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManager.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManager.java index 79c52878c2..3d4ab619f9 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManager.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManager.java @@ -31,6 +31,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; /** * A WFO {@link IBandwidthManager} that runs as an integration test, outside of @@ -76,12 +77,13 @@ public class IntegrationTestWfoBandwidthManager extends WfoBandwidthManager { public IntegrationTestWfoBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + DataDeliveryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionStrategy); diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManagerCreator.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManagerCreator.java index 74d211bbaa..2439b7e880 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManagerCreator.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/IntegrationTestWfoBandwidthManagerCreator.java @@ -29,6 +29,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; /** * Creates {@link IntegrationTestWfoBandwidthManager} instances. @@ -60,13 +61,14 @@ public class IntegrationTestWfoBandwidthManagerCreator implements public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + DataDeliveryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionStrategy) { return new IntegrationTestWfoBandwidthManager(dbInit, bandwidthDao, - retrievalManager, bandwidthDaoUtil, dataSetMetaDataHandler, + retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionStrategy); } diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerIntTest.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerIntTest.java index 00eb2795f5..e33008f84d 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerIntTest.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoBandwidthManagerIntTest.java @@ -21,8 +21,8 @@ package com.raytheon.uf.edex.datadelivery.bandwidth; import org.junit.Test; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.registry.Network; import com.raytheon.uf.common.datadelivery.registry.Subscription; @@ -80,7 +80,7 @@ public class WfoBandwidthManagerIntTest extends @Test public void testReinitializeUsesCorrectSpringFiles() throws Exception { - final IBandwidthRequest request = new IBandwidthRequest(); + final BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.REINITIALIZE); bandwidthManager.handleRequest(request); diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoNcfBandwidthManagerIntTest.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoNcfBandwidthManagerIntTest.java index 240fefe26d..728fe9f288 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoNcfBandwidthManagerIntTest.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/WfoNcfBandwidthManagerIntTest.java @@ -31,8 +31,8 @@ import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.registry.Network; import com.raytheon.uf.common.datadelivery.registry.Subscription; import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants; @@ -101,7 +101,7 @@ public class WfoNcfBandwidthManagerIntTest extends public Object route(IServerRequest request) throws Exception { return ncfBandwidthManager - .handleRequest((IBandwidthRequest) request); + .handleRequest((BandwidthRequest) request); } }); } catch (RegistryException e) { @@ -217,7 +217,7 @@ public class WfoNcfBandwidthManagerIntTest extends */ private void scheduleSbnSubscription(Subscription subscription, RequestType requestType) throws Exception { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(requestType); request.setNetwork(subscription.getRoute()); request.setSubscriptions(Arrays.asList(subscription)); diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManager.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManager.java index a71ce1b6f2..8a5eb559bc 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManager.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManager.java @@ -32,6 +32,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsF import com.raytheon.uf.edex.datadelivery.bandwidth.ncf.NcfBandwidthManagerCreator.NcfBandwidthManager; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; /** * An NCF {@link IBandwidthManager} that runs as an integration test, outside of @@ -76,12 +77,13 @@ public class IntegrationTestNcfBandwidthManager extends NcfBandwidthManager { public IntegrationTestNcfBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + DataDeliveryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionStrategy) { - super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, + super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionStrategy); diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManagerCreator.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManagerCreator.java index 1be425b45e..f02cd083e2 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManagerCreator.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/IntegrationTestNcfBandwidthManagerCreator.java @@ -30,6 +30,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit; import com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.IFindSubscriptionsForScheduling; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil; +import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; /** * Creates {@link IntegrationTestNcfBandwidthManager} instances. @@ -61,13 +62,14 @@ public class IntegrationTestNcfBandwidthManagerCreator implements public IBandwidthManager getBandwidthManager(IBandwidthDbInit dbInit, IBandwidthDao bandwidthDao, RetrievalManager retrievalManager, BandwidthDaoUtil bandwidthDaoUtil, + DataDeliveryIdUtil idUtil, IDataSetMetaDataHandler dataSetMetaDataHandler, ISubscriptionHandler subscriptionHandler, IAdhocSubscriptionHandler adhocSubscriptionHandler, ISubscriptionNotificationService subscriptionNotificationService, IFindSubscriptionsForScheduling findSubscriptionStrategy) { return new IntegrationTestNcfBandwidthManager(dbInit, bandwidthDao, - retrievalManager, bandwidthDaoUtil, dataSetMetaDataHandler, + retrievalManager, bandwidthDaoUtil, idUtil, dataSetMetaDataHandler, subscriptionHandler, adhocSubscriptionHandler, subscriptionNotificationService, findSubscriptionStrategy); } diff --git a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerIntTest.java b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerIntTest.java index 31fcc278c6..b0d16e5d56 100644 --- a/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerIntTest.java +++ b/tests/integration/com/raytheon/uf/edex/datadelivery/bandwidth/ncf/NcfBandwidthManagerIntTest.java @@ -22,8 +22,8 @@ package com.raytheon.uf.edex.datadelivery.bandwidth.ncf; import org.junit.Test; import org.springframework.test.context.ContextConfiguration; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest.RequestType; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest.RequestType; import com.raytheon.uf.common.datadelivery.registry.Network; import com.raytheon.uf.common.datadelivery.registry.Subscription; import com.raytheon.uf.common.util.SpringFiles; @@ -82,7 +82,7 @@ public class NcfBandwidthManagerIntTest extends AbstractBandwidthManagerIntTest @Test public void testReinitializeUsesCorrectSpringFiles() throws Exception { - final IBandwidthRequest request = new IBandwidthRequest(); + final BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.REINITIALIZE); bandwidthManager.handleRequest(request); diff --git a/tests/unit/com/raytheon/uf/edex/auth/RemoteServerRequestRouterTest.java b/tests/unit/com/raytheon/uf/edex/auth/RemoteServerRequestRouterTest.java index a105279e4a..4eb7cf5d9d 100644 --- a/tests/unit/com/raytheon/uf/edex/auth/RemoteServerRequestRouterTest.java +++ b/tests/unit/com/raytheon/uf/edex/auth/RemoteServerRequestRouterTest.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; import com.raytheon.uf.common.localization.msgs.GetServersRequest; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivilegedRequest; @@ -48,7 +48,7 @@ import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivil */ public class RemoteServerRequestRouterTest { - private static final IBandwidthRequest PRIVILEGED_REQUEST = new IBandwidthRequest(); + private static final BandwidthRequest PRIVILEGED_REQUEST = new BandwidthRequest(); private static final GetServersRequest UNPRIVILEGED_REQUEST = new GetServersRequest(); diff --git a/tests/unit/com/raytheon/uf/edex/auth/ServerRequestRouterTest.java b/tests/unit/com/raytheon/uf/edex/auth/ServerRequestRouterTest.java index a7ce6867c3..9c981430ed 100644 --- a/tests/unit/com/raytheon/uf/edex/auth/ServerRequestRouterTest.java +++ b/tests/unit/com/raytheon/uf/edex/auth/ServerRequestRouterTest.java @@ -27,7 +27,7 @@ import static org.mockito.Mockito.when; import org.junit.Before; import org.junit.Test; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; import com.raytheon.uf.common.localization.msgs.GetServersRequest; import com.raytheon.uf.common.serialization.comm.IRequestHandler; import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler; @@ -54,7 +54,7 @@ public class ServerRequestRouterTest { private static final ServerRequestRouter ROUTER = new ServerRequestRouter(); - private static final IBandwidthRequest PRIVILEGED_REQUEST = new IBandwidthRequest(); + private static final BandwidthRequest PRIVILEGED_REQUEST = new BandwidthRequest(); private static final GetServersRequest UNPRIVILEGED_REQUEST = new GetServersRequest(); diff --git a/tests/unit/com/raytheon/uf/edex/auth/req/ServerPrivilegedRequestHandlerTest.java b/tests/unit/com/raytheon/uf/edex/auth/req/ServerPrivilegedRequestHandlerTest.java index ead193d916..30c6a70945 100644 --- a/tests/unit/com/raytheon/uf/edex/auth/req/ServerPrivilegedRequestHandlerTest.java +++ b/tests/unit/com/raytheon/uf/edex/auth/req/ServerPrivilegedRequestHandlerTest.java @@ -31,7 +31,7 @@ import org.junit.Before; import org.junit.Test; import com.raytheon.uf.common.auth.resp.SuccessfulExecution; -import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthRequest; +import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest; import com.raytheon.uf.common.localization.msgs.GetServersRequest; import com.raytheon.uf.common.serialization.comm.IRequestHandler; import com.raytheon.uf.common.serialization.comm.IServerRequest; @@ -58,7 +58,7 @@ import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivil @SuppressWarnings({ "unchecked", "rawtypes" }) public class ServerPrivilegedRequestHandlerTest { - private static final IBandwidthRequest BANDWIDTH_REQUEST = new IBandwidthRequest(); + private static final BandwidthRequest BANDWIDTH_REQUEST = new BandwidthRequest(); private final HandlerRegistry registry = mock(HandlerRegistry.class); @@ -72,7 +72,7 @@ public class ServerPrivilegedRequestHandlerTest { RemoteRequestServer.getInstance().setRegistry(registry); when( - registry.getRequestHandler(IBandwidthRequest.class + registry.getRequestHandler(BandwidthRequest.class .getCanonicalName())).thenReturn(bandwidthHandler); } diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/MockGridMetaDataAdapter.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/MockGridMetaDataAdapter.java index 0afbcce386..9a96c6d452 100644 --- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/MockGridMetaDataAdapter.java +++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/metadata/adapters/MockGridMetaDataAdapter.java @@ -58,7 +58,7 @@ public class MockGridMetaDataAdapter extends GridMetadataAdapter { /** * {@inheritDoc} */ - @Override + GridCoverage getCoverageFromCache(GridCoverage coverage) { return GriddedCoverageFixture.INSTANCE.get().getGridCoverage(); }