Issue #2615 Refactored Subscription valid time period calculation from BandwidthDaoUtil to
RecurringSubscription. Add environment configuration files to unit tests setup. Changed the devRegistry debug port to the same port as registry. Amend: Updates from peer review. Change-Id: I4f5a25d4667dc949804b86541a9d9428728b779a Former-commit-id:343a2495e5
[formerly4537513df7
[formerly 33a3dead503276926af71d7355f87242f5250e54]] Former-commit-id:4537513df7
Former-commit-id:8eeb3dc412
This commit is contained in:
parent
434c05b458
commit
2c0c6fbcc7
19 changed files with 715 additions and 150 deletions
|
@ -22,7 +22,8 @@
|
|||
export MAX_MEM=1536 # in Meg
|
||||
export MAX_PERM_SIZE=192m
|
||||
export METADATA_POOL_MIN=10
|
||||
export EDEX_DEBUG_PORT=5013
|
||||
export EDEX_DEBUG_PORT=5012
|
||||
export EDEX_JMX_PORT=1620
|
||||
export LOG_CONF=logback-registry.xml
|
||||
export MGMT_PORT=9605
|
||||
export EBXML_REGISTRY_FEDERATION_ENABLED=false
|
||||
|
|
|
@ -60,9 +60,10 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* May 15, 2013 1040 mpduff Changed to use Set for office id.
|
||||
* 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.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
* 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.
|
||||
* Nov 14, 2013 2548 mpduff Add a subscription type slot.
|
||||
* Jan 08, 2014 2615 bgonzale Implement calculate start and calculate end methods.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -450,6 +451,58 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
this.activePeriodEnd = activePeriodEnd;
|
||||
}
|
||||
|
||||
private Calendar getActivePeriodStart(Calendar base) {
|
||||
// active period values are month and day of month only, use base
|
||||
// Calendar for active period year
|
||||
Calendar activePeriodStartCal = TimeUtil
|
||||
.newCalendar(activePeriodStart);
|
||||
TimeUtil.minCalendarFields(activePeriodStartCal, Calendar.MILLISECOND,
|
||||
Calendar.SECOND, Calendar.MINUTE, Calendar.HOUR_OF_DAY);
|
||||
activePeriodStartCal.set(Calendar.YEAR, base.get(Calendar.YEAR));
|
||||
return activePeriodStartCal;
|
||||
}
|
||||
|
||||
private Calendar getActivePeriodEnd(Calendar base) {
|
||||
// active period values are month and day of month only, use base
|
||||
// Calendar for active period year
|
||||
Calendar activePeriodEndCal = TimeUtil.newCalendar(activePeriodEnd);
|
||||
TimeUtil.maxCalendarFields(activePeriodEndCal, Calendar.MILLISECOND,
|
||||
Calendar.SECOND, Calendar.MINUTE, Calendar.HOUR_OF_DAY);
|
||||
activePeriodEndCal.set(Calendar.YEAR, base.get(Calendar.YEAR));
|
||||
return activePeriodEndCal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Calendar calculateStart(Calendar startConstraint) {
|
||||
Calendar realStart = null;
|
||||
boolean hasActivePeriodStart = activePeriodStart != null;
|
||||
if (hasActivePeriodStart) {
|
||||
realStart = getActivePeriodStart(startConstraint);
|
||||
if (realStart.before(startConstraint)) {
|
||||
realStart = startConstraint;
|
||||
}
|
||||
} else {
|
||||
realStart = startConstraint;
|
||||
}
|
||||
return TimeUtil.newCalendar(TimeUtil.max(subscriptionStart,
|
||||
realStart));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Calendar calculateEnd(Calendar endConstraint) {
|
||||
Calendar realEnd = null;
|
||||
boolean hasActivePeriodEnd = activePeriodEnd != null;
|
||||
if (hasActivePeriodEnd) {
|
||||
realEnd = getActivePeriodEnd(endConstraint);
|
||||
if (realEnd.before(endConstraint)) {
|
||||
realEnd = endConstraint;
|
||||
}
|
||||
} else {
|
||||
realEnd = endConstraint;
|
||||
}
|
||||
return TimeUtil.newCalendar(TimeUtil.min(subscriptionEnd, realEnd));
|
||||
}
|
||||
|
||||
/**
|
||||
* isNotify flag for subscription.
|
||||
*
|
||||
|
@ -819,9 +872,19 @@ public abstract class RecurringSubscription<T extends Time, C extends Coverage>
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName() + "::" + getProvider() + "::" + getDataSetName()
|
||||
+ "::" + getOwner() + "::" + getOriginatingSite() + "::"
|
||||
+ getSubscriptionType().name();
|
||||
SubscriptionType subType = getSubscriptionType();
|
||||
StringBuilder sb = new StringBuilder(getName());
|
||||
sb.append("::");
|
||||
sb.append(getProvider());
|
||||
sb.append("::");
|
||||
sb.append(getDataSetName());
|
||||
sb.append("::");
|
||||
sb.append(getOwner());
|
||||
sb.append("::");
|
||||
sb.append(getOriginatingSite());
|
||||
sb.append("::");
|
||||
sb.append(subType == null ? "null" : subType.name());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.datadelivery.registry;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -42,6 +43,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
|
|||
* 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.
|
||||
* Jan 08, 2014 2615 bgonzale Added calculate start and calculate end methods.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -297,6 +299,28 @@ public interface Subscription<T extends Time, C extends Coverage> {
|
|||
*/
|
||||
void setActivePeriodEnd(Date activePeriodEnd);
|
||||
|
||||
/**
|
||||
* Calculate the earliest that this subscription is valid based on active
|
||||
* period and start time.
|
||||
*
|
||||
* @param startConstraint
|
||||
* the earliest valid time.
|
||||
*
|
||||
* @return the valid subscription start Date.
|
||||
*/
|
||||
Calendar calculateStart(Calendar startConstraint);
|
||||
|
||||
/**
|
||||
* Calculate the latest that this subscription is valid based on active
|
||||
* period and end time.
|
||||
*
|
||||
* @param endConstraint
|
||||
* the latest valid time.
|
||||
*
|
||||
* @return the valid subscription end Date.
|
||||
*/
|
||||
Calendar calculateEnd(Calendar endConstraint);
|
||||
|
||||
/**
|
||||
* isNotify flag for subscription.
|
||||
*
|
||||
|
|
|
@ -54,6 +54,8 @@ import com.raytheon.uf.common.time.domain.api.ITimePoint;
|
|||
* Jun 05, 2013 DR 16279 D. Friedman Add timeOfDayToAbsoluteTime
|
||||
* Oct 30, 2013 2448 dhladky Added current year addition to calendar object.
|
||||
* Nov 05, 2013 2499 rjpeter Added prettyDuration.
|
||||
* Jan 08, 2014 2615 bgonzale Added Calendar min and max methods.
|
||||
* Added newGmtCalendar from a date method.
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -325,6 +327,78 @@ public final class TimeUtil {
|
|||
|| (laterCal.get(Calendar.YEAR) > earlierCal.get(Calendar.YEAR));
|
||||
}
|
||||
|
||||
/**
|
||||
* Min comparison of a Date and a Calendar; returns the lesser.
|
||||
*
|
||||
* @param lhs
|
||||
* @param rhs
|
||||
* @return the lesser of a Data and a Calendar; returns null if either is
|
||||
* null.
|
||||
*/
|
||||
public static Calendar min(Date lhs, Calendar rhs) {
|
||||
return min(TimeUtil.newCalendar(lhs), rhs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Max comparison of a Date and a Calendar; returns the greater.
|
||||
*
|
||||
* @param lhs
|
||||
* @param rhs
|
||||
* @return the greater of a Data and a Calendar; returns null if either is
|
||||
* null.
|
||||
*/
|
||||
public static Calendar max(Date lhs, Calendar rhs) {
|
||||
return max(TimeUtil.newCalendar(lhs), rhs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Max comparison of two Calendars; returns the greater.
|
||||
*
|
||||
* @param lhs
|
||||
* @param rhs
|
||||
* @return the greater of two Calendars; returns null if both are null.
|
||||
*/
|
||||
public static Calendar max(Calendar lhs, Calendar rhs) {
|
||||
if (lhs != null && rhs == null) {
|
||||
return lhs;
|
||||
}
|
||||
if (lhs == null && rhs != null) {
|
||||
return rhs;
|
||||
}
|
||||
if (lhs != null && rhs != null) {
|
||||
if (lhs.equals(rhs)) {
|
||||
return lhs;
|
||||
} else {
|
||||
return lhs.after(rhs) ? lhs : rhs;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Min comparison of two Calendars; returns the lesser.
|
||||
*
|
||||
* @param lhs
|
||||
* @param rhs
|
||||
* @return the lesser of two Calendars; returns null if both are null.
|
||||
*/
|
||||
public static Calendar min(Calendar lhs, Calendar rhs) {
|
||||
if (lhs != null && rhs == null) {
|
||||
return lhs;
|
||||
}
|
||||
if (lhs == null && rhs != null) {
|
||||
return rhs;
|
||||
}
|
||||
if (lhs != null && rhs != null) {
|
||||
if (lhs.equals(rhs)) {
|
||||
return lhs;
|
||||
} else {
|
||||
return lhs.before(rhs) ? lhs : rhs;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new {@link Calendar} instance. This method delegates to the
|
||||
* {@link SimulatedTime} class to determine the currently configured system
|
||||
|
@ -525,8 +599,9 @@ public final class TimeUtil {
|
|||
|
||||
/**
|
||||
* New Calendar from an existing calendar
|
||||
*
|
||||
* @param calendar
|
||||
* @return
|
||||
* @return new calendar
|
||||
*/
|
||||
public static Calendar newCalendar(final Calendar calendar) {
|
||||
Calendar t = null;
|
||||
|
@ -538,9 +613,26 @@ public final class TimeUtil {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds the current year to the calendar object that does not already have it set.
|
||||
* Some calendar objects are only concerned with the day and month. When a
|
||||
* comparison of years is necessary, you must add the current year to that calendar object.
|
||||
* New GMT Calendar from a Date
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Calendar newGmtCalendar(final Date date) {
|
||||
Calendar t = null;
|
||||
if (date != null) {
|
||||
t = TimeUtil.newGmtCalendar();
|
||||
t.setTime(date);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the current year to the calendar object that does not already have
|
||||
* it set. Some calendar objects are only concerned with the day and month.
|
||||
* When a comparison of years is necessary, you must add the current year to
|
||||
* that calendar object.
|
||||
*
|
||||
* @param calendar
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -132,6 +132,8 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* Dec 04, 2013 2566 bgonzale added method to retrieve and parse spring files for a mode.
|
||||
* Dec 11, 2013 2566 bgonzale fix spring resource resolution.
|
||||
* Dec 17, 2013 2636 bgonzale Changed logging to differentiate the output.
|
||||
* Jan 08, 2014 2615 bgonzale getMostRecent checks subscription time constraints before scheduling.
|
||||
* handlePoint method now schedules most recent.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -484,9 +486,19 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
@Override
|
||||
public List<BandwidthAllocation> scheduleAdhoc(
|
||||
AdhocSubscription<T, C> subscription) {
|
||||
return scheduleAdhoc(subscription, BandwidthUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BandwidthAllocation> scheduleAdhoc(
|
||||
AdhocSubscription<T, C> subscription, Calendar now) {
|
||||
|
||||
List<BandwidthSubscription> subscriptions = new ArrayList<BandwidthSubscription>();
|
||||
Calendar now = BandwidthUtil.now();
|
||||
// Store the AdhocSubscription with a base time of now..
|
||||
subscriptions.add(bandwidthDao.newBandwidthSubscription(subscription,
|
||||
now));
|
||||
|
@ -602,8 +614,11 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
*/
|
||||
private List<BandwidthAllocation> handlePoint(
|
||||
Subscription<T, C> subscription) {
|
||||
return schedule(subscription,
|
||||
((PointTime) subscription.getTime()).getInterval());
|
||||
List<BandwidthAllocation> unscheduled = Collections.emptyList();
|
||||
unscheduled.addAll(schedule(subscription,
|
||||
((PointTime) subscription.getTime()).getInterval()));
|
||||
unscheduled.addAll(getMostRecent(subscription, false));
|
||||
return unscheduled;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -628,10 +643,18 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
unscheduled = schedule(subscription, Sets.newTreeSet(cycles));
|
||||
}
|
||||
|
||||
unscheduled.addAll(getMostRecent(subscription,
|
||||
useMostRecentDataSetUpdate));
|
||||
return unscheduled;
|
||||
}
|
||||
|
||||
private List<BandwidthAllocation> getMostRecent(
|
||||
Subscription<T, C> subscription, boolean useMostRecentDataSetUpdate) {
|
||||
List<BandwidthAllocation> unscheduled = Collections.emptyList();
|
||||
// Create an adhoc subscription based on the new subscription,
|
||||
// and set it to retrieve the most recent cycle (or most recent
|
||||
// url if a daily product)
|
||||
if (subscription instanceof SiteSubscription) {
|
||||
if (subscription instanceof SiteSubscription && subscription.isActive()) {
|
||||
AdhocSubscription<T, C> adhoc = new AdhocSubscription<T, C>(
|
||||
(SiteSubscription<T, C>) subscription);
|
||||
adhoc = bandwidthDaoUtil.setAdhocMostRecentUrlAndTime(adhoc,
|
||||
|
@ -644,7 +667,25 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
+ "No adhoc requested.",
|
||||
subscription.getName()));
|
||||
} else {
|
||||
unscheduled = scheduleAdhoc(adhoc);
|
||||
RetrievalPlan plan = retrievalManager.getPlan(subscription.getRoute());
|
||||
if (plan != null) {
|
||||
Date subscriptionValidStart = subscription.calculateStart(
|
||||
plan.getPlanStart()).getTime();
|
||||
Date subscriptionValidEnd = subscription.calculateEnd(
|
||||
plan.getPlanEnd()).getTime();
|
||||
Date now = TimeUtil.newDate();
|
||||
|
||||
if ((now.equals(subscriptionValidStart) || now
|
||||
.after(subscriptionValidStart))
|
||||
&& now.before(subscriptionValidEnd)) {
|
||||
unscheduled = scheduleAdhoc(adhoc);
|
||||
} else {
|
||||
statusHandler.info(String.format(
|
||||
"Time frame outside of subscription active time frame [%s]. "
|
||||
+ "No adhoc requested.",
|
||||
subscription.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
statusHandler
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.edex.datadelivery.bandwidth;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.ISubscriptionAggre
|
|||
* Jul 10, 2013 2106 djohnson Remove EDEX instance specific methods.
|
||||
* 10/23/2013 2385 bphillip Change schedule method to scheduleAdhoc
|
||||
* Jan 06, 2014 2636 mpduff Update javadoc
|
||||
* Jan 08, 2014 2615 bgonzale Added scheduleAdoc method.
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
|
@ -69,6 +71,15 @@ public interface IBandwidthManager<T extends Time, C extends Coverage> {
|
|||
*/
|
||||
List<BandwidthAllocation> scheduleAdhoc(AdhocSubscription<T, C> subscription);
|
||||
|
||||
/**
|
||||
* Schedule AdhocSubscription to run at the given time 'now'.
|
||||
*
|
||||
* @param subscription
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
List<BandwidthAllocation> scheduleAdhoc(
|
||||
AdhocSubscription<T, C> subscription, Calendar now);
|
||||
/**
|
||||
* When a Subscription is updated in the Registry, update the retrieval plan
|
||||
* accordingly to match the updated Subscription.
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthBucketDao;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 27, 2013 1736 dhladky Initial creation
|
||||
* Jan 08, 2014 2615 bgonzale Change calculation of bytesPerSec to make a divide by zero error less likely.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -95,8 +96,9 @@ public class BandwidthUtilizationProcessor implements Job {
|
|||
private int getBytesPerSecondAndReset() {
|
||||
|
||||
long now = TimeUtil.currentTimeMillis();
|
||||
int diffSeconds = (int) (now - lastRun)/1000;
|
||||
int bytesPerSec = totalBytes.getAndSet(0)/diffSeconds;
|
||||
int diffMilliSeconds = (int) (now - lastRun);
|
||||
int bytesPerMillSec = totalBytes.getAndSet(0) / diffMilliSeconds;
|
||||
int bytesPerSec = bytesPerMillSec / 1000;
|
||||
// reset time
|
||||
map.put("lastRun", now);
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Dec 17, 2013 2636 bgonzale Check for removed buckets when removing BandwidthAllocations or
|
||||
* BandwidthReservations. Add constrained bucket addition method.
|
||||
* Added debug logging.
|
||||
* Jan 08, 2014 2615 bgonzale Log registry bandwidth calculation errors.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -151,8 +152,15 @@ public class RetrievalPlan {
|
|||
// subtract registry traffic from total available bytes/per second
|
||||
for (BandwidthBucket bucket : bucketsDao.getAll(network)) {
|
||||
long startMillis = bucket.getBucketStartTime();
|
||||
int registryBytesPerSecond = rbs
|
||||
.getRegistryBandwidth(startMillis);
|
||||
int registryBytesPerSecond = 0;
|
||||
try {
|
||||
registryBytesPerSecond = rbs
|
||||
.getRegistryBandwidth(startMillis);
|
||||
} catch (IllegalArgumentException e) {
|
||||
statusHandler
|
||||
.error("Failed to init registry bandwidth calculation. Registry bandwidth will be ignored.",
|
||||
e);
|
||||
}
|
||||
bucket.setBucketSize(bucket.getBucketSize()
|
||||
- (registryBytesPerSecond * TimeUtil.SECONDS_PER_MINUTE * bucketMinutes));
|
||||
}
|
||||
|
|
|
@ -77,6 +77,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus;
|
|||
* Fix for subscription end time set to end of day.
|
||||
* Dec 02, 2013 2545 mpduff Fix for delay starting retrievals, execute adhoc upon subscribing.
|
||||
* Dec 20, 2013 2636 mpduff Fix dataset offset.
|
||||
* Jan 08, 2014 2615 bgonzale Refactored getRetrievalTimes into RecurringSubscription
|
||||
* calculateStart and calculateEnd methods.
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
|
@ -169,94 +171,33 @@ public class BandwidthDaoUtil<T extends Time, C extends Coverage> {
|
|||
|
||||
Calendar planEnd = plan.getPlanEnd();
|
||||
Calendar planStart = plan.getPlanStart();
|
||||
Calendar activePeriodStart = null;
|
||||
Calendar activePeriodEnd = null;
|
||||
|
||||
// Make sure the RetrievalPlan's start and end times intersect
|
||||
// the Subscription's active period.
|
||||
if (subscription.getActivePeriodEnd() != null
|
||||
&& subscription.getActivePeriodStart() != null) {
|
||||
// starting time when when subscription is first valid for scheduling
|
||||
// based on plan start, subscription start, and active period start.
|
||||
Calendar subscriptionCalculatedStart = subscription
|
||||
.calculateStart(planStart);
|
||||
// end time when when subscription is last valid for scheduling based on
|
||||
// plan end, subscription end, and active period end.
|
||||
Calendar subscriptionCalculatedEnd = subscription.calculateEnd(planEnd);
|
||||
|
||||
activePeriodStart = TimeUtil.newCalendar(subscription
|
||||
.getActivePeriodStart());
|
||||
// Substitute the active periods month and day for the
|
||||
// plan start month and day.
|
||||
Calendar start = BandwidthUtil.planToPeriodCompareCalendar(
|
||||
planStart, activePeriodStart);
|
||||
// If the active period start is outside the plan bounds,
|
||||
// there is no intersection - just return an empty set.
|
||||
if (start.after(planEnd)) {
|
||||
return subscriptionTimes;
|
||||
}
|
||||
|
||||
// Do the same for active plan end..
|
||||
activePeriodEnd = TimeUtil.newCalendar(subscription
|
||||
.getActivePeriodEnd());
|
||||
// Substitute the active periods month and day for the
|
||||
// plan ends month and day.
|
||||
Calendar end = BandwidthUtil.planToPeriodCompareCalendar(planStart,
|
||||
activePeriodEnd);
|
||||
// If the active period end is before the start of the plan,
|
||||
// there is no intersection - just return an empty set.
|
||||
if (end.before(planStart)) {
|
||||
return subscriptionTimes;
|
||||
}
|
||||
}
|
||||
|
||||
// Now check the Subscription start and end times for intersection
|
||||
// with the RetrievalPlan...
|
||||
// Figure out the 'active' period for a subscription..
|
||||
Calendar subscriptionEnd = TimeUtil.newCalendar(subscription
|
||||
.getSubscriptionEnd());
|
||||
Calendar subscriptionStart = null;
|
||||
// Check to see if this is a non-expiring subscription
|
||||
if (subscriptionEnd == null) {
|
||||
// If there is no subscription start end dates then the largest
|
||||
// window that can be scheduled is the RetrievalPlan size..
|
||||
subscriptionEnd = TimeUtil.newCalendar(planEnd);
|
||||
subscriptionStart = TimeUtil.newCalendar(planStart);
|
||||
} else {
|
||||
// If there is a start and end time, then modify the start and
|
||||
// end times to 'fit' within the RetrievalPlan times
|
||||
subscriptionStart = TimeUtil.newCalendar(BandwidthUtil.max(
|
||||
subscription.getSubscriptionStart(), planStart));
|
||||
subscriptionEnd = TimeUtil.newCalendar(BandwidthUtil.min(
|
||||
subscription.getSubscriptionEnd(), planEnd));
|
||||
}
|
||||
|
||||
// setup active period checks if necessary
|
||||
if (activePeriodStart != null && activePeriodEnd != null) {
|
||||
// need to add the current year in order to make the checks relevant
|
||||
activePeriodStart = TimeUtil
|
||||
.addCurrentYearCalendar(activePeriodStart);
|
||||
activePeriodEnd = TimeUtil.addCurrentYearCalendar(activePeriodEnd);
|
||||
|
||||
// Create a Set of Calendars for all the baseReferenceTimes that a
|
||||
// Subscription can contain...
|
||||
TimeUtil.minCalendarFields(activePeriodStart, Calendar.MILLISECOND,
|
||||
Calendar.SECOND, Calendar.MINUTE, Calendar.HOUR_OF_DAY);
|
||||
TimeUtil.maxCalendarFields(activePeriodEnd, Calendar.MILLISECOND,
|
||||
Calendar.SECOND, Calendar.MINUTE, Calendar.HOUR_OF_DAY);
|
||||
}
|
||||
|
||||
Calendar start = (Calendar) subscriptionStart.clone();
|
||||
outerloop: while (!start.after(subscriptionEnd)) {
|
||||
Calendar start = (Calendar) subscriptionCalculatedStart.clone();
|
||||
outerloop: while (!start.after(subscriptionCalculatedEnd)) {
|
||||
|
||||
for (Integer cycle : hours) {
|
||||
start.set(Calendar.HOUR_OF_DAY, cycle);
|
||||
|
||||
// start equal-to-or-after subscriptionStart
|
||||
if (start.compareTo(subscriptionStart) >= 0) {
|
||||
// start base equal-to-or-after subscriptionStart
|
||||
if (start.compareTo(subscriptionCalculatedStart) >= 0) {
|
||||
for (Integer minute : minutes) {
|
||||
start.set(Calendar.MINUTE, minute);
|
||||
|
||||
// start equal-to-or-after subscriptionStart
|
||||
if (start.compareTo(subscriptionStart) >= 0) {
|
||||
// start minutes equal-to-or-after subscriptionStart
|
||||
if (start.compareTo(subscriptionCalculatedStart) >= 0) {
|
||||
// Check for nonsense
|
||||
if (start.after(subscriptionEnd)) {
|
||||
if (start.after(subscriptionCalculatedEnd)) {
|
||||
break outerloop;
|
||||
} else {
|
||||
Calendar time = TimeUtil.newGmtCalendar();
|
||||
Calendar time = TimeUtil.newCalendar();
|
||||
time.setTimeInMillis(start.getTimeInMillis());
|
||||
/**
|
||||
* Fine grain check by hour and minute, for
|
||||
|
@ -264,23 +205,11 @@ public class BandwidthDaoUtil<T extends Time, C extends Coverage> {
|
|||
* activePeriod(start/end)
|
||||
**/
|
||||
// Subscription Start and End time first
|
||||
if (start != null && subscriptionEnd != null) {
|
||||
if (time.after(subscriptionEnd)
|
||||
|| time.before(start)) {
|
||||
// don't schedule this retrieval time,
|
||||
// outside subscription window
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Check Active Period Second
|
||||
if (activePeriodStart != null
|
||||
&& activePeriodEnd != null) {
|
||||
if (time.after(activePeriodEnd)
|
||||
|| time.before(activePeriodStart)) {
|
||||
// don't schedule this retrieval time,
|
||||
// outside activePeriod window
|
||||
continue;
|
||||
}
|
||||
if (time.after(subscriptionCalculatedEnd)
|
||||
|| time.before(start)) {
|
||||
// don't schedule this retrieval time,
|
||||
// outside subscription window
|
||||
continue;
|
||||
}
|
||||
|
||||
subscriptionTimes.add(time);
|
||||
|
|
|
@ -30,8 +30,9 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.BandwidthSubscription;
|
|||
* Jun 13, 2013 2095 djohnson Point subscriptions don't check for dataset updates on aggregation.
|
||||
* Jun 25, 2013 2106 djohnson CheapClone was cheap in ease, not performance.
|
||||
* Jul 11, 2013 2106 djohnson Use SubscriptionPriority enum.
|
||||
* Oct 30, 2013 2448 dhladky Moved methods to TimeUtil.
|
||||
* Oct 30, 2013 2448 dhladky Moved methods to TimeUtil.
|
||||
* Dec 20, 2013 2636 mpduff Changed dataset delay to offset.
|
||||
* Jan 08, 2014 2615 bgonzale Moved Calendar min and max methods to TimeUtil.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,38 +68,6 @@ public class BandwidthUtil {
|
|||
return instance.subscriptionLatencyCalculator.getLatency(subscription);
|
||||
}
|
||||
|
||||
public static Calendar min(Date lhs, Calendar rhs) {
|
||||
return min(TimeUtil.newCalendar(lhs), rhs);
|
||||
}
|
||||
|
||||
public static Calendar max(Date lhs, Calendar rhs) {
|
||||
return max(TimeUtil.newCalendar(lhs), rhs);
|
||||
}
|
||||
|
||||
public static Calendar max(Calendar lhs, Calendar rhs) {
|
||||
Calendar calendar = null;
|
||||
if (lhs != null && rhs != null) {
|
||||
if (lhs.equals(rhs)) {
|
||||
return lhs;
|
||||
} else {
|
||||
return lhs.after(rhs) ? lhs : rhs;
|
||||
}
|
||||
}
|
||||
return calendar;
|
||||
}
|
||||
|
||||
public static Calendar min(Calendar lhs, Calendar rhs) {
|
||||
Calendar calendar = null;
|
||||
if (lhs != null && rhs != null) {
|
||||
if (lhs.equals(rhs)) {
|
||||
return lhs;
|
||||
} else {
|
||||
return lhs.before(rhs) ? lhs : rhs;
|
||||
}
|
||||
}
|
||||
return calendar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seconds and milliseconds on a Calendar are not used in bandwidth
|
||||
* management and can alter some of the time arithmetic that is used
|
||||
|
|
243
tests/conf/res/base/attributeNames.xml
Normal file
243
tests/conf/res/base/attributeNames.xml
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
||||
<properties>
|
||||
<Name>ATTRIBUTE_NAMES</Name>
|
||||
|
||||
<!-- The following list of values are lucene index names.
|
||||
The tag names are used to reference those values in Parser and Decoder classes
|
||||
-->
|
||||
|
||||
<PRODUCTTYPE>product_type</PRODUCTTYPE>
|
||||
<DATATYPE>datatype</DATATYPE>
|
||||
<SATELLITE>satellite</SATELLITE>
|
||||
<AREASUBTYPE>area_subtype</AREASUBTYPE>
|
||||
<PRODUCT>product</PRODUCT>
|
||||
<GOES>parameter</GOES>
|
||||
<NONGOES>non_goes_satellite_product</NONGOES>
|
||||
<SOURCE>source</SOURCE>
|
||||
<CREATINGENTITY>creating_entity</CREATINGENTITY>
|
||||
<SECTORID>locationkey</SECTORID>
|
||||
<PHYSICALELEMENT>physical_element</PHYSICALELEMENT>
|
||||
<PROJECTION>projection</PROJECTION>
|
||||
<RESOLUTION>resolution</RESOLUTION>
|
||||
<LAMBERTSCANNINGMODE1>lambert_scanning_horiz</LAMBERTSCANNINGMODE1>
|
||||
<LAMBERTSCANNINGMODE2>lambert_scanning_vert</LAMBERTSCANNINGMODE2>
|
||||
<LAMBERTSCANNINGMODE3>lambert_scanning_axis</LAMBERTSCANNINGMODE3>
|
||||
<MERCATORSCANNINGMODE1>
|
||||
mercator_scanning_horiz
|
||||
</MERCATORSCANNINGMODE1>
|
||||
<MERCATORSCANNINGMODE2>
|
||||
mercator_scanning_vert
|
||||
</MERCATORSCANNINGMODE2>
|
||||
<MERCATORSCANNINGMODE3>
|
||||
mercator_scanning_axis
|
||||
</MERCATORSCANNINGMODE3>
|
||||
<MERCATORINTERSECTIONLAT>
|
||||
mercator_intersect_lat
|
||||
</MERCATORINTERSECTIONLAT>
|
||||
<NAVIGATIONALINDICATOR>
|
||||
navigational_indicator
|
||||
</NAVIGATIONALINDICATOR>
|
||||
<PROJECTIONCENTER>projection_center</PROJECTIONCENTER>
|
||||
<RECORDS>records</RECORDS>
|
||||
<RECORDSIZE>record_size</RECORDSIZE>
|
||||
<VALIDTIME>valid_time</VALIDTIME>
|
||||
<XPOINTS>Nx</XPOINTS>
|
||||
<YPOINTS>Ny</YPOINTS>
|
||||
<FIRSTPOINTLAT>Lat1</FIRSTPOINTLAT>
|
||||
<FIRSTPOINTLON>Lon1</FIRSTPOINTLON>
|
||||
<ORIENTATION>Lov</ORIENTATION>
|
||||
<XINCREMENT>Dx</XINCREMENT>
|
||||
<YINCREMENT>Dy</YINCREMENT>
|
||||
<TANGENTLATITUDE>Latin1</TANGENTLATITUDE>
|
||||
<IMAGERESOLUTION>image_resolution</IMAGERESOLUTION>
|
||||
<DATACOMPRESSION>data_compression</DATACOMPRESSION>
|
||||
<VERSIONNUMBER>version_number</VERSIONNUMBER>
|
||||
<NAVIGATIONALINDICATOR>
|
||||
navigational_indicator
|
||||
</NAVIGATIONALINDICATOR>
|
||||
<NAVIGATIONALINFO>navigational_info</NAVIGATIONALINFO>
|
||||
<RESOLUTION>resolution</RESOLUTION>
|
||||
<LASTPOINTLAT>Lat2</LASTPOINTLAT>
|
||||
<LASTPOINTLON>Lon2</LASTPOINTLON>
|
||||
<LONGITUDINALINCREMENT>
|
||||
longitudinal_increment
|
||||
</LONGITUDINALINCREMENT>
|
||||
<LATITUDINALINCREMENT>latitudinal_increment</LATITUDINALINCREMENT>
|
||||
<MERCATORINTERSECTINLAT>
|
||||
mercator_intersection_lat
|
||||
</MERCATORINTERSECTINLAT>
|
||||
<IMAGERESOLUTION>image_resolution</IMAGERESOLUTION>
|
||||
<NUMBEROCTETS>number_octets</NUMBEROCTETS>
|
||||
<RESERVED>reserved</RESERVED>
|
||||
<ORIGINALFILENAME>original_filename</ORIGINALFILENAME>
|
||||
<KEY>key</KEY>
|
||||
<PLAINTEXT>plainText</PLAINTEXT>
|
||||
<DECODEMETHOD>decode_method</DECODEMETHOD>
|
||||
<INDEXDIR>indexDir</INDEXDIR>
|
||||
<INDEXTIME>index_time</INDEXTIME>
|
||||
<PERSISTDIR>persistDir</PERSISTDIR>
|
||||
<DECODER>Decoder</DECODER>
|
||||
<PLUGIN>Plugin</PLUGIN>
|
||||
<PLUGINDIR>pluginDirectory</PLUGINDIR>
|
||||
<SERVICEDIR>servicesDirectory</SERVICEDIR>
|
||||
<DEGRIBEXECPATH>degribExecPath</DEGRIBEXECPATH>
|
||||
<HTTPPROXYSET>httpProxySet</HTTPPROXYSET>
|
||||
<HTTPPROXYHOST>httpProxyHost</HTTPPROXYHOST>
|
||||
<HTTPPROXYPORT>httpProxyPort</HTTPPROXYPORT>
|
||||
<FILENAMEDECODER>FilenameDecoder</FILENAMEDECODER>
|
||||
<WRITER>Writer</WRITER>
|
||||
<UENGINEOUTDIR>uengineOutDir</UENGINEOUTDIR>
|
||||
<DEFAULTDATADIR>defaultDataDir</DEFAULTDATADIR>
|
||||
<GRIBJARS>gribJars</GRIBJARS>
|
||||
<BMEXISTS>bms_exists</BMEXISTS>
|
||||
<GDEXISTS>gds_exists</GDEXISTS>
|
||||
<BASETIME>base_time</BASETIME>
|
||||
<CENTERNAME>center_name</CENTERNAME>
|
||||
<DECIMALSCALE>decimal_scale</DECIMALSCALE>
|
||||
<DESCRIPTION>description</DESCRIPTION>
|
||||
<FORECASTTIME>forecast_time</FORECASTTIME>
|
||||
<GRIDID>grid_id</GRIDID>
|
||||
<FIRSTFIXEDSURFACE>first_fixed_surface</FIRSTFIXEDSURFACE>
|
||||
<FIRSTFIXEDVALUE>first_fixed_value</FIRSTFIXEDVALUE>
|
||||
<FIRSTFIXEDSURFACEUNITS>
|
||||
first_fixed_surface_units
|
||||
</FIRSTFIXEDSURFACEUNITS>
|
||||
<SECONDFIXEDSURFACE>second_fixed_surface</SECONDFIXEDSURFACE>
|
||||
<SECONDFIXEDVALUE>second_fixed_value</SECONDFIXEDVALUE>
|
||||
<SECONDFIXEDSURFACEUNITS>
|
||||
second_fixed_surface_units
|
||||
</SECONDFIXEDSURFACEUNITS>
|
||||
<PROCESSID>process_id</PROCESSID>
|
||||
<PRODUCDEFINITIONNAME>product_definition_name</PRODUCDEFINITIONNAME>
|
||||
<REFERENCETIME>reference_time</REFERENCETIME>
|
||||
<SUBCENTERNAME>subcenter_name</SUBCENTERNAME>
|
||||
<TIMERANGE>time_range</TIMERANGE>
|
||||
<TIMEUNITS>time_units</TIMEUNITS>
|
||||
<PARAMETERTYPE>parameter_type</PARAMETERTYPE>
|
||||
<PARAMETERUNITS>parameter_units</PARAMETERUNITS>
|
||||
<ANALYSISGENPROCESS>analysis_gen_process</ANALYSISGENPROCESS>
|
||||
<BACKGENPROCESS>back_gen_process</BACKGENPROCESS>
|
||||
<COORDINATES>coordinates</COORDINATES>
|
||||
<HOURSAFTER>hours_after</HOURSAFTER>
|
||||
<MINUTESAFTER>minutes_after</MINUTESAFTER>
|
||||
<PARAMETERCATEGORY>parameter_category</PARAMETERCATEGORY>
|
||||
<PARAMETERNUMBER>parameter_number</PARAMETERNUMBER>
|
||||
<PRODUCTDEFINITION>product_definition</PRODUCTDEFINITION>
|
||||
<PRODUCTDEFINITIONNAME>
|
||||
product_definition_name
|
||||
</PRODUCTDEFINITIONNAME>
|
||||
<GENPROCESS>gen_process</GENPROCESS>
|
||||
<GRIBTYPE>grib_type</GRIBTYPE>
|
||||
<PROJTYPE>projection</PROJTYPE>
|
||||
<SPATIAL_DESCRIPTOR>spatial_descriptor</SPATIAL_DESCRIPTOR>
|
||||
|
||||
<RED>red</RED>
|
||||
<BLUE>blue</BLUE>
|
||||
<GREEN>green</GREEN>
|
||||
|
||||
<JSLIBRARY>jsLibraryDir</JSLIBRARY>
|
||||
|
||||
<LowLightVis>3</LowLightVis>
|
||||
<IRDefault>7</IRDefault>
|
||||
<WVAlternate>10</WVAlternate>
|
||||
<Linear>57</Linear>
|
||||
<WindModes>16</WindModes>
|
||||
<WindSpeed>18</WindSpeed>
|
||||
<Velocity>19</Velocity>
|
||||
<Reflectivity>20</Reflectivity>
|
||||
<LayerMaxRefl>21</LayerMaxRefl>
|
||||
<VisDefault>25</VisDefault>
|
||||
<GriddedData>29</GriddedData>
|
||||
<LowrangeEnhanced>30</LowrangeEnhanced>
|
||||
<MidrangeEnhanced>31</MidrangeEnhanced>
|
||||
<HirangeEnhanced>32</HirangeEnhanced>
|
||||
<WarmToCold>33</WarmToCold>
|
||||
<CWBZReflectivity>34</CWBZReflectivity>
|
||||
<StormClearReflectivity>35</StormClearReflectivity>
|
||||
<IRWV>36</IRWV>
|
||||
<IRFog>37</IRFog>
|
||||
<SLCWV>38</SLCWV>
|
||||
<Lvl8Vel>39</Lvl8Vel>
|
||||
<Bit8Refl>40</Bit8Refl>
|
||||
<VADWindProfile>41</VADWindProfile>
|
||||
<VelocityAzimuthDisplay>42</VelocityAzimuthDisplay>
|
||||
<Level16Reflectivity>43</Level16Reflectivity>
|
||||
<Level8Reflectivity>44</Level8Reflectivity>
|
||||
<Level256Reflectivity>72</Level256Reflectivity>
|
||||
<Level16Velocity>45</Level16Velocity>
|
||||
<Level8Velocity>46</Level8Velocity>
|
||||
<Level256Velocity>73</Level256Velocity>
|
||||
<Hr1_3PrecipAccumulation>47</Hr1_3PrecipAccumulation>
|
||||
<SpectrumWidth>48</SpectrumWidth>
|
||||
<Level16CompositeReflectivity>49</Level16CompositeReflectivity>
|
||||
<Shear>50</Shear>
|
||||
<StormClearRefl>74</StormClearRefl>
|
||||
<SevereWxProb>51</SevereWxProb>
|
||||
<EchoTops>52</EchoTops>
|
||||
<CombinedShear>53</CombinedShear>
|
||||
<VerticallyIntegratedLiquid>54</VerticallyIntegratedLiquid>
|
||||
<SRMRadialVelocity>55</SRMRadialVelocity>
|
||||
<ClutterFilterControl>56</ClutterFilterControl>
|
||||
<GrayScaleWaterVapor>11</GrayScaleWaterVapor>
|
||||
<CWAThreatIndex>58</CWAThreatIndex>
|
||||
<LiftedIndex>60</LiftedIndex>
|
||||
<PrecipWater>61</PrecipWater>
|
||||
<SkinTemp>62</SkinTemp>
|
||||
<CloudTopHeight>63</CloudTopHeight>
|
||||
<QPFBestCategory>68</QPFBestCategory>
|
||||
<LAMPGriddedData>69</LAMPGriddedData>
|
||||
<Bit8Vel>70</Bit8Vel>
|
||||
<km10RadarCodedMessage>71</km10RadarCodedMessage>
|
||||
<Hr0_3RadarBasedProbabilities>75</Hr0_3RadarBasedProbabilities>
|
||||
<Hr0_3RadarBasedCategorical>76</Hr0_3RadarBasedCategorical>
|
||||
<DigitalVIL>77</DigitalVIL>
|
||||
<OSFDigitalVIL>78</OSFDigitalVIL>
|
||||
<EnhancedEchoTops>79</EnhancedEchoTops>
|
||||
<StormTotalPrecip>80</StormTotalPrecip>
|
||||
<OSFStormTotalPrecip>81</OSFStormTotalPrecip>
|
||||
<CUSTOM_LIB>customLib</CUSTOM_LIB>
|
||||
<DATAURI>dataURI</DATAURI>
|
||||
|
||||
<OBJECT>OBJECT</OBJECT>
|
||||
<METADATA>METADATA</METADATA>
|
||||
<SEPARATOR>SEPARATOR</SEPARATOR>
|
||||
<RECORD>Record</RECORD>
|
||||
|
||||
<ADAPTERSRVQUE>adapterServiceQueue</ADAPTERSRVQUE>
|
||||
<RESFOLDER>resFolder</RESFOLDER>
|
||||
<HDF5DIR>hdf5Dir</HDF5DIR>
|
||||
<SHAREDIR>shareDir</SHAREDIR>
|
||||
<SCRIPTFOLDER>pluginScriptFolder</SCRIPTFOLDER>
|
||||
|
||||
<BINDADDR>bindAddr</BINDADDR>
|
||||
<UTILITYDIR>utilityDir</UTILITYDIR>
|
||||
<STATICDIR>staticDir</STATICDIR>
|
||||
<SITENAME>sitename</SITENAME>
|
||||
<GFESMARTINIT>gfeSmartInitEnable</GFESMARTINIT>
|
||||
<LOGDIR>logDir</LOGDIR>
|
||||
<FXADEBUGSAVEBADTEXTFILES>fxaDebugSaveBadTextFiles</FXADEBUGSAVEBADTEXTFILES>
|
||||
<ARCHIVEDIR>archiveDir</ARCHIVEDIR>
|
||||
<SVCBACKUP>svcBackupDir</SVCBACKUP>
|
||||
<MHS_DATA>mhsData</MHS_DATA>
|
||||
</properties>
|
||||
|
57
tests/conf/res/base/environment.xml
Normal file
57
tests/conf/res/base/environment.xml
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
||||
<properties>
|
||||
<Name>ENVIRONMENT</Name>
|
||||
<logDir>${env:edex.home}/logs</logDir>
|
||||
<pluginDirectory>${env:edex.home}/lib/plugins/</pluginDirectory>
|
||||
<servicesDirectory>${env:edex.home}/lib/services/</servicesDirectory>
|
||||
<pluginResDirectory>res/</pluginResDirectory>
|
||||
<httpProxySet>true</httpProxySet>
|
||||
<httpProxyHost>proxy.ext.ray.com</httpProxyHost>
|
||||
<httpProxyPort>80</httpProxyPort>
|
||||
<gribJars>${env:edex.home}/lib</gribJars>
|
||||
<uengineOutDir>${env:edex.home}/data/uEngine</uengineOutDir>
|
||||
<defaultDataDir>${env:edex.home}/data/</defaultDataDir>
|
||||
<archiveDir>${env:data.archive.root}</archiveDir>
|
||||
<jsLibraryDir>${env:edex.home}/esb/js/</jsLibraryDir>
|
||||
<customLib>${env:edex.home}/lib/</customLib>
|
||||
<bindAddr>bindaddr</bindAddr>
|
||||
<adapterServiceQueue>edex.AdapterSrv</adapterServiceQueue>
|
||||
<resFolder>../conf/res</resFolder>
|
||||
<pluginScriptFolder>${env:edex.home}/conf/db/commonScripts/</pluginScriptFolder>
|
||||
<!--
|
||||
hdf5Dir now refers only to the local hdf5 directory; pypies keeps track
|
||||
of its own hdf5 directory. The local hdf5 directory will only be used
|
||||
by plugins that do not store / retrieve their data through pypies
|
||||
(ex: QC).
|
||||
-->
|
||||
<hdf5Dir>${env:edex.home}/data/hdf5</hdf5Dir>
|
||||
<shareDir>${env:edex.home}/data/share</shareDir>
|
||||
<utilityDir>${env:edex.home}/data/utility</utilityDir>
|
||||
<staticDir>${env:edex.home}/data/static</staticDir>
|
||||
<gfeSmartInitEnable>true</gfeSmartInitEnable>
|
||||
<fxaDebugSaveBadTextFiles>false</fxaDebugSaveBadTextFiles>
|
||||
<svcBackupDir>${env:edex.home}/../GFESuite/</svcBackupDir>
|
||||
<mhsData>/data/fxa/mhs</mhsData>
|
||||
</properties>
|
||||
|
||||
|
43
tests/conf/res/config.xml
Normal file
43
tests/conf/res/config.xml
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
<header>
|
||||
<result>
|
||||
<nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
|
||||
</result>
|
||||
</header>
|
||||
|
||||
<!-- Localized Environmental Properties -->
|
||||
<override>
|
||||
<xml fileName="site/environment.xml" encoding="UTF-8" validating="false" />
|
||||
<xml fileName="base/environment.xml" encoding="UTF-8" validating="false" />
|
||||
</override>
|
||||
|
||||
<!-- Localized Attribute Names -->
|
||||
<override>
|
||||
<xml fileName="site/attributeNames.xml" encoding="UTF-8" validating="false" />
|
||||
<xml fileName="base/attributeNames.xml" encoding="UTF-8" validating="false" />
|
||||
</override>
|
||||
|
||||
</configuration>
|
||||
|
||||
|
25
tests/conf/res/site/attributeNames.xml
Normal file
25
tests/conf/res/site/attributeNames.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
||||
<properties>
|
||||
<Name>ATTRIBUTE_NAMES</Name>
|
||||
</properties>
|
||||
|
29
tests/conf/res/site/environment.xml
Normal file
29
tests/conf/res/site/environment.xml
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
||||
<properties>
|
||||
<Name>ENVIRONMENT</Name>
|
||||
<clustered>false</clustered>
|
||||
<sitename>${env:aw.site.identifier}</sitename>
|
||||
<!-- httpServer and jmsServer moved to setup.env -->
|
||||
</properties>
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ package com.raytheon.uf.common.localization;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -32,6 +33,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.TestPathManager.TestLocalizationAdapter;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.common.util.TestUtil;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +49,7 @@ import com.raytheon.uf.common.util.TestUtil;
|
|||
* Jul 18, 2012 740 djohnson Initial creation
|
||||
* Oct 23, 2012 1286 djohnson Handle executing tests in Eclipse/command-line transparently.
|
||||
* Apr 18, 2013 1914 djohnson Allow initializing test localization support from Spring.
|
||||
* Jan 08, 2014 2615 bgonzale Fixes for PropertiesFactory configuration loading in test.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,7 +77,8 @@ public class PathManagerFactoryTest implements BeanFactoryPostProcessor {
|
|||
// Clear known file cache and the directory each time
|
||||
PathManager.fileCache.clear();
|
||||
File file = TestUtil.setupTestClassDir(PathManagerFactoryTest.class);
|
||||
savedLocalizationFileDir = new File(file, "utility");
|
||||
savedLocalizationFileDir = new File(file, "data");
|
||||
savedLocalizationFileDir = new File(savedLocalizationFileDir, "utility");
|
||||
savedLocalizationFileDir.mkdirs();
|
||||
|
||||
// But only install the path manager if the test version is not already
|
||||
|
@ -85,6 +89,20 @@ public class PathManagerFactoryTest implements BeanFactoryPostProcessor {
|
|||
: new CommandLineTestLocalizationAdapter(site,
|
||||
savedLocalizationFileDir);
|
||||
PathManagerFactory.pathManager = new TestPathManager(adapter);
|
||||
|
||||
System.setProperty("edex.home", file.getAbsolutePath());
|
||||
File confResDataDir = new File(file, "conf/res");
|
||||
confResDataDir.mkdirs();
|
||||
File confResTestDataDir = new File("conf/res/");
|
||||
|
||||
try {
|
||||
FileUtil.copyDirectory(confResTestDataDir, confResDataDir);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(
|
||||
"Failed to setup test configuration directory conf/res",
|
||||
e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ import com.raytheon.uf.common.util.TestUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 04, 2012 1241 djohnson Initial creation
|
||||
* Jul 10, 2013 2106 djohnson Spring file path moved to SpringFiles for reuse.
|
||||
* Jul 10, 2013 2106 djohnson Spring file path moved to SpringFiles for reuse.
|
||||
* Jan 09, 2014 2615 bgonzale Added spring files to initialize beans missing in tests.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,7 +79,9 @@ public class RegistryObjectHandlersUtil {
|
|||
RegistryObjectHandlers.clear();
|
||||
new ClassPathXmlApplicationContext(
|
||||
new String[] {
|
||||
TestUtil.getResResourcePath(SpringFiles.DATADELIVERY_HANDLERS_IMPL_XML),
|
||||
TestUtil.getResResourcePath(SpringFiles.DATADELIVERY_HANDLERS_XML),
|
||||
TestUtil.getResResourcePath(SpringFiles.DATADELIVERY_STANDALONE_XML),
|
||||
TestUtil.getResResourcePath(resResource) },
|
||||
RegistryObjectHandlersUtil.class);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.junit.Ignore;
|
|||
* May 28, 2013 1650 djohnson Add event bus spring files.
|
||||
* Jun 24, 2013 2106 djohnson Remove spring file.
|
||||
* Jul 10, 2013 2106 djohnson Add MEMORY_DATADELIVERY_HANDLERS_XML.
|
||||
* Jan 09, 2014 2615 bgonzale Add DATADELIVERY_STANDALONE_XML.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -73,6 +74,8 @@ public class SpringFiles {
|
|||
|
||||
public static final String DATADELIVERY_HANDLERS_IMPL_XML = "/spring/datadelivery-handlers-impl.xml";
|
||||
|
||||
public static final String DATADELIVERY_STANDALONE_XML = "/spring/datadelivery-standalone.xml";
|
||||
|
||||
public static final String EBXML_XML = "/spring/ebxml.xml";
|
||||
|
||||
public static final String EBXML_IMPL_XML = "/spring/ebxml-impl.xml";
|
||||
|
|
|
@ -33,6 +33,7 @@ import static org.mockito.Mockito.when;
|
|||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -56,6 +57,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
|||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactoryTest;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlersUtil;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.time.util.TimeUtilTest;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.InMemoryBandwidthBucketDao;
|
||||
|
@ -81,8 +83,9 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus;
|
|||
* Feb 14, 2013 1595 djohnson Fix retrieval plan/subscription time intersections.
|
||||
* Jun 05, 2013 2038 djohnson Use public API for getting retrieval times.
|
||||
* Jun 25, 2013 2106 djohnson RetrievalPlan uses setters instead of constructor injection now.
|
||||
* Sept 25, 2013 1797 dhladky separated time and gridded time
|
||||
* Sep 25, 2013 1797 dhladky separated time and gridded time
|
||||
* Jan 07, 2014 2636 mpduff Removed dataset availability offset calculator (not used).
|
||||
* Jan 08, 2014 2615 bgonzale Updated test.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -107,6 +110,7 @@ public class BandwidthDaoUtilTest {
|
|||
public void setUp() {
|
||||
TimeUtilTest.freezeTime(TimeUtil.MILLIS_PER_DAY * 2);
|
||||
|
||||
RegistryObjectHandlersUtil.init();
|
||||
PathManagerFactoryTest.initLocalization();
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
|
@ -183,7 +187,7 @@ public class BandwidthDaoUtilTest {
|
|||
SortedSet<Calendar> subscriptionTimes = bandwidthDaoUtil
|
||||
.getRetrievalTimes(subscription, cycles);
|
||||
|
||||
final List<Integer> daysOfTheYear = Arrays.asList(4);
|
||||
final List<Integer> daysOfTheYear = Collections.EMPTY_LIST;
|
||||
verifySubscriptionTimesContainsCyclesForSpecifiedDays(daysOfTheYear,
|
||||
cycles, subscriptionTimes);
|
||||
final List<Integer> notScheduledDays = Arrays.asList(3);
|
||||
|
|
Loading…
Add table
Reference in a new issue