Issue #1906 Remove new registry plugin from datadelivery feature

Change-Id: I3ca4e0335af4b7d0de195f84fe4b3ae9c6fb8598

Former-commit-id: c8241840c5 [formerly 71b4bb07870f5490d89a1fe657429444c54a2689]
Former-commit-id: 977702e876
This commit is contained in:
Dustin Johnson 2013-04-16 09:34:02 -05:00
parent 80ff75c473
commit 8170693941
7 changed files with 48 additions and 2478 deletions

File diff suppressed because it is too large Load diff

View file

@ -29,7 +29,8 @@ Require-Bundle: com.raytheon.uf.common.status;bundle-version="1.12.1174",
com.raytheon.uf.edex.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174",
com.raytheon.uf.common.util,
com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0"
com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0",
com.raytheon.uf.edex.registry.ebxml;bundle-version="1.0.0"
Export-Package: com.raytheon.uf.edex.datadelivery.bandwidth,
com.raytheon.uf.edex.datadelivery.bandwidth.dao,
com.raytheon.uf.edex.datadelivery.bandwidth.interfaces,

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil;
* Oct 30, 2012 1286 djohnson Initial creation
* Feb 20, 2013 1543 djohnson For now assume all in-memory bandwidth managers are WFOs.
* Feb 27, 2013 1644 djohnson Schedule SBN subscriptions.
* Apr 16, 2013 1906 djohnson Implements RegistryInitializedListener.
*
* </pre>
*
@ -92,6 +93,14 @@ class InMemoryBandwidthManager extends BandwidthManager {
return false;
}
}
/**
* {@inheritDoc}
*/
@Override
public void executeAfterRegistryInit() {
// Nothing to do
}
}
/**

View file

@ -29,6 +29,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializ
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 20, 2013 1543 djohnson Add SW history, separate how to find subscriptions.
* Apr 16, 2013 1906 djohnson Implements RegistryInitializedListener.
*
* </pre>
*
@ -42,6 +43,8 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
private final IFindSubscriptionsForScheduling findSubscriptionsStrategy;
private IBandwidthManager instance;
/**
* @param strategy
*/
@ -53,6 +56,8 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
@Override
public boolean init(IBandwidthManager instance, IBandwidthDbInit dbInit) {
this.instance = instance;
// TODO: Need to resolve how to load Subscriptions that SHOULD have been
// fulfilled. In the case were DD has been down for a while
// BEFORE removing the tables...
@ -72,6 +77,14 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@Override
public void executeAfterRegistryInit() {
Set<Subscription> activeSubscriptions = Collections.emptySet();
try {
// Load active subscriptions
@ -80,7 +93,6 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
} catch (Exception e) {
statusHandler.error(
"Failed to query for subscriptions to schedule", e);
return false;
}
List<BandwidthAllocation> unscheduled = new ArrayList<BandwidthAllocation>();
@ -92,40 +104,11 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
+ subscription.getName() + "]");
unscheduled.addAll(instance.schedule(subscription));
// TODO: Investigate the various strategies for "filling" in the
// gaps of
// data (and how to determine such gaps)
/*
* // For coverage purposes, attempt to add an AdhocSubscription for
* the cycle of // Data previous to the first scheduled cycle of
* data.
*
* Calendar first = times.first(); int hour =
* first.get(Calendar.HOUR_OF_DAY); // Find the cycle 'previous' to
* the first times cycle SortedSet<Integer> cycles = new
* TreeSet<Integer>(subscription.getTime().getCycleTimes()); if
* (hour == cycles.first()) { // Have to back up to the previous
* days last cycle. first.add(Calendar.DAY_OF_YEAR, -1);
* first.set(Calendar.HOUR_OF_DAY, cycles.last()); } else { // We
* are somewhere in the current days cycles.. Integer c =
* cycles.first(); for (Integer cycle : cycles) { // As long as the
* cycle in less than the hour we are looking for // keep moving
* forward. if (cycle < hour) c = cycle; else break; } // c should
* now be pointing to the cycle before the first times cycle...
* first.set(Calendar.HOUR_OF_DAY, c); }
*/
}
// TODO DPJ: Do something more useful other than logging when unable to
// schedule all subscriptions... maybe send a notification for a ride on
// the EventBus?
for (BandwidthAllocation allocation : unscheduled) {
statusHandler.handle(Priority.PROBLEM,
"The following bandwidth allocation is in an unscheduled state:\n "
+ allocation);
}
return true;
}
}
}

View file

@ -2,6 +2,7 @@ package com.raytheon.uf.edex.datadelivery.bandwidth.interfaces;
import com.raytheon.uf.edex.datadelivery.bandwidth.IBandwidthManager;
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit;
import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
/**
* * An interface for initialization of the BandwidthManager instance. The
@ -16,13 +17,14 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 26, 2012 1286 djohnson Initial creation
* Apr 16, 2013 1906 djohnson Extends RegistryInitializedListener.
*
* </pre>
*
* @author djohnson
* @version 1.0
*/
public interface BandwidthInitializer {
public interface BandwidthInitializer extends RegistryInitializedListener {
/**
* Initialize the instance of BandwidthManager.

View file

@ -121,11 +121,4 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.datadelivery.registry"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -32,6 +32,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.BandwidthInitializ
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 12, 2012 0726 djohnson Initial creation
* Apr 16, 2013 1906 djohnson Implements RegistryInitializedListener.
*
* </pre>
*
@ -50,4 +51,12 @@ public class IntegrationTestBandwidthInitializer implements
return true;
}
/**
* {@inheritDoc}
*/
@Override
public void executeAfterRegistryInit() {
// Nothing to do
}
}