diff --git a/cave/com.raytheon.uf.viz.archive.feature/feature.xml b/cave/com.raytheon.uf.viz.archive.feature/feature.xml index 6b25bdef69..69a8103635 100644 --- a/cave/com.raytheon.uf.viz.archive.feature/feature.xml +++ b/cave/com.raytheon.uf.viz.archive.feature/feature.xml @@ -40,7 +40,6 @@ id="org.apache.commons.compress" download-size="0" install-size="0" - version="0.0.0" - unpack="false"/> + version="0.0.0"/> diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java index fb0b40c538..8b88ba67e1 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/editor/CollaborationPaneManager.java @@ -53,6 +53,7 @@ import com.raytheon.viz.ui.panes.VizDisplayPane; * ------------ ---------- ----------- -------------------------- * Jun 07, 2012 mschenke Initial creation * Apr 23, 2014 3060 njensen Safety checks for SWT widgets disposed + * May 01, 2014 2956 njensen More safety checks for SWT widgets disposed * * * @@ -242,7 +243,9 @@ public class CollaborationPaneManager extends PaneManager { public void setCanvasSize(IRenderableDisplay display, Rectangle bounds) { DisplayData data = displayMap.get(display); - if (data == null) { + if (data == null || data.canvasComp.isDisposed() + || data.scrollable.isDisposed() + || data.wrapperComp.isDisposed()) { return; } data.canvasBounds = bounds; @@ -273,9 +276,11 @@ public class CollaborationPaneManager extends PaneManager { } private void setExclude(DisplayData data, boolean exclude) { - GridData gd = (GridData) data.scrollable.getLayoutData(); - data.scrollable.setVisible(!exclude); - gd.exclude = exclude; + if (!data.scrollable.isDisposed()) { + GridData gd = (GridData) data.scrollable.getLayoutData(); + data.scrollable.setVisible(!exclude); + gd.exclude = exclude; + } } } diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/TableDataManager.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/TableDataManager.java index 0bc6aad030..6a91ac4f00 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/TableDataManager.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/TableDataManager.java @@ -31,6 +31,7 @@ package com.raytheon.uf.viz.datadelivery.common.ui; * Jun 06, 2012 lvenable Initial creation * Apr 10, 2013 1891 djohnson Declare variable as List. * Feb 07, 2014 2453 mpduff Added getSize(). + * Apr 18, 2014 3012 dhladky Null check. * * * @@ -134,7 +135,11 @@ public class TableDataManager> implements ISortTable { if (index >= 0 && index < tableData.size()) { return tableData.get(index); } else { - return tableData.get(0); + if (!tableData.isEmpty()) { + return tableData.get(0); + } else { + return null; + } } } diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java index bf7f980632..ddead4d62a 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java @@ -85,6 +85,7 @@ import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler; * Oct 15, 2013 2451 skorolev Get highlighted rows after message update. * Nov 01, 2013 2431 skorolev Changed labels on the table. * Feb 07, 2014 2453 mpduff Refactored. + * Apr 18, 2014 3012 dhladky Null check. * * * @author lvenable @@ -941,6 +942,9 @@ public class NotificationTableComp extends TableComp implements ITableFind { for (int index : indices) { NotificationRowData rowData = filteredTableList .getDataRow(index); + if (rowData == null) { + continue; + } selectedRowIds.add(rowData.getId()); } } diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java index 0dd10104bf..7657c805db 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java @@ -159,6 +159,7 @@ import com.raytheon.viz.ui.presenter.IDisplay; * Mar 24, 2014 #2951 lvenable Added dispose checks for SWT widgets. * Mar 31, 2014 2889 dhladky Added username for notification center tracking. * Apr 2, 2014 2974 dhladky DD ID added to list for dropdowns in DD. + * Apr 18, 2014 3012 dhladky Null check. * * * @@ -1001,18 +1002,20 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements SubscriptionManagerRowData removedItem = tableComp .getSubscriptionData().getDataRow(idx); Subscription sub = removedItem.getSubscription(); - if (sub instanceof SharedSubscription) { - sub.getOfficeIDs().remove(CURRENT_SITE); - if (sub.getOfficeIDs().size() > 0) { - subsToUpdate.add(sub); + if (sub != null) { + if (sub instanceof SharedSubscription) { + sub.getOfficeIDs().remove(CURRENT_SITE); + if (sub.getOfficeIDs().size() > 0) { + subsToUpdate.add(sub); + } else { + subsToDelete.add(sub); + } } else { - subsToDelete.add(sub); + subsToDelete.add(removedItem.getSubscription()); } - } else { - subsToDelete.add(removedItem.getSubscription()); - } - deleteList.add(removedItem); + deleteList.add(removedItem); + } } String message = getMessage(subsToDelete, subsToUpdate); @@ -1189,7 +1192,9 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements int idx = selectionIndices[i]; SubscriptionManagerRowData rowData = tableComp .getSubscriptionData().getDataRow(idx); - + if (rowData == null) { + continue; + } Subscription sub = rowData.getSubscription(); if (activate) { sub.activate(); diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java index d91bd91f6c..89927b45d9 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java @@ -113,7 +113,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE; * Feb 04, 2014 2722 mpduff Add last update time. * Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site. * Mar 24, 2014 #2951 lvenable Added dispose checks for SWT widgets. - * + * Apr 18, 2014 3012 dhladky Null check. * @version 1.0 */ @@ -325,6 +325,9 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction { SubscriptionManagerRowData rowData = subManagerData .getDataRow(selectionIndices[i]); + if (rowData == null) { + continue; + } // get the subscription details to be displayed to the user printDetails.append(DataDeliveryUtils.formatDetails(rowData .getSubscription())); @@ -911,4 +914,4 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction { public long getLastUpdateTime() { return lastUpdateTime; } -} \ No newline at end of file +} diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java index 6d5520aae1..e464776963 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java @@ -74,6 +74,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE; * denied pending messages. * Apr 05, 2013 1841 djohnson Refresh entire table on receiving a notification of the correct type. * Apr 10, 2013 1891 djohnson Move logic to get column display text to the column definition, fix sorting. + * Apr 18, 2014 3012 dhladky Null check. * * * @author lvenable @@ -270,6 +271,9 @@ public class SubApprovalTableComp extends TableComp { SubscriptionApprovalRowData rowData = pendingSubData.getDataRow(table .getSelectionIndex()); + if (rowData == null) { + return; + } // Get the subscription object InitialPendingSubscription pendingSub = rowData.getSubscription(); diffDetails.append("Subscription Name: ") diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java index 46e9cb0fff..c115f24bc5 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java @@ -96,6 +96,7 @@ import com.raytheon.viz.ui.presenter.IDisplay; * Sep 03, 2013 2315 mpduff Add subscription name to denied approval message. * Oct 23, 2013 2292 mpduff Move subscription overlap checks to edex. * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Apr 18, 2014 3012 dhladky Null check. * * * @@ -368,13 +369,15 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements for (int idx : tableComp.getTable().getSelectionIndices()) { SubscriptionApprovalRowData approvedItem = pendingSubData .getDataRow(idx); - if (site) { - approveList.add(approvedItem); - } else { - if (approvedItem.isOwner(user)) { + if (approvedItem != null) { + if (site) { approveList.add(approvedItem); } else { - notApprovedSubList.add(approvedItem.getSubName()); + if (approvedItem.isOwner(user)) { + approveList.add(approvedItem); + } else { + notApprovedSubList.add(approvedItem.getSubName()); + } } } } @@ -461,12 +464,13 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements for (int idx : tableComp.getTable().getSelectionIndices()) { SubscriptionApprovalRowData removedItem = pendingSubData .getDataRow(idx); - - if (site) { - deleteList.add(removedItem); - } else { - if (removedItem.isOwner(user)) { + if (removedItem != null) { + if (site) { deleteList.add(removedItem); + } else { + if (removedItem.isOwner(user)) { + deleteList.add(removedItem); + } } } } 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/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java index 61f3df4581..71d694bf21 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java @@ -59,7 +59,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 11, 2013 2085 njensen Initial creation - * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL + * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL + * Apr 30, 2014 2060 njensen Safety checks for null guidance * * * @@ -200,7 +201,7 @@ public class FFMPRowGenerator implements Runnable { mouseOverText = metabasin.getBasinId() + "\n" + lid + "-" + fvgmbd.getName(); - + if (!huc.equals(FFMPRecord.ALL)) { sb.append("-").append(fvgmbd.getName()); } @@ -905,26 +906,25 @@ public class FFMPRowGenerator implements Runnable { forced = forceResult.isForced(); } - if (!forcedPfafs.isEmpty() || forced || !pfafList.isEmpty()) { - // Recalculate guidance using the forced value(s) - guidance = guidRecords - .get(guidType) - .getBasinData() - .getAverageGuidanceValue(pfafList, - resource.getGuidanceInterpolators().get(guidType), - guidance, forcedPfafs, - resource.getGuidSourceExpiration(guidType)); - } else { + FFMPRecord grec = guidRecords.get(guidType); + if (grec != null) { + if (!forcedPfafs.isEmpty() || forced || !pfafList.isEmpty()) { + // Recalculate guidance using the forced value(s) + guidance = grec.getBasinData().getAverageGuidanceValue( + pfafList, + resource.getGuidanceInterpolators().get(guidType), + guidance, forcedPfafs, + resource.getGuidSourceExpiration(guidType)); + } else { + FFMPGuidanceBasin ffmpGuidBasin = (FFMPGuidanceBasin) grec + .getBasinData().get(cBasinPfaf); + guidance = resource.getGuidanceValue(ffmpGuidBasin, + paintRefTime, guidType); - FFMPGuidanceBasin ffmpGuidBasin = (FFMPGuidanceBasin) guidRecords - .get(guidType).getBasinData().get(cBasinPfaf); - guidance = resource.getGuidanceValue(ffmpGuidBasin, paintRefTime, - guidType); - - if (guidance < 0.0f) { - guidance = Float.NaN; + if (guidance < 0.0f) { + guidance = Float.NaN; + } } - } return new FFMPTableCellData(FIELDS.GUIDANCE, guidance, forced); diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java index 185de0e49b..713a6a4694 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/DerivedSatelliteRecord.java @@ -73,13 +73,9 @@ public class DerivedSatelliteRecord extends SatelliteRecord { Set base = findBaseRecords(requestableData); Set creatingEntities = new HashSet(); - int interpolationLevels = 1; for (SatelliteRecord record : base) { creatingEntities.add(record.getCreatingEntity()); - interpolationLevels = Math.max(interpolationLevels, - record.getInterpolationLevels()); } - setInterpolationLevels(interpolationLevels); if (creatingEntities.size() == 1) { setCreatingEntity(creatingEntities.iterator().next()); } else { @@ -92,6 +88,10 @@ public class DerivedSatelliteRecord extends SatelliteRecord { setCoverage(((ComparableSatMapCoverage) requestableData.getSpace()) .getCoverage()); } + Rectangle[] levels = GridDownscaler + .getDownscaleSizes(getGridGeometry()); + setInterpolationLevels(levels.length - 1); + } /** diff --git a/deltaScripts/14.3.1/dropGridDataURI.sh b/deltaScripts/14.3.1/DR2060/dropGridDataURI.sh similarity index 100% rename from deltaScripts/14.3.1/dropGridDataURI.sh rename to deltaScripts/14.3.1/DR2060/dropGridDataURI.sh diff --git a/deltaScripts/14.3.1/renameLightningSourceInBundles.sh b/deltaScripts/14.3.1/DR2667/renameLightningSourceInBundles.sh similarity index 100% rename from deltaScripts/14.3.1/renameLightningSourceInBundles.sh rename to deltaScripts/14.3.1/DR2667/renameLightningSourceInBundles.sh diff --git a/deltaScripts/14.3.1/renameLightningSourceInDB.sh b/deltaScripts/14.3.1/DR2667/renameLightningSourceInDB.sh similarity index 100% rename from deltaScripts/14.3.1/renameLightningSourceInDB.sh rename to deltaScripts/14.3.1/DR2667/renameLightningSourceInDB.sh diff --git a/deltaScripts/14.3.1/renameLightningSourceInProcedures.sh b/deltaScripts/14.3.1/DR2667/renameLightningSourceInProcedures.sh similarity index 100% rename from deltaScripts/14.3.1/renameLightningSourceInProcedures.sh rename to deltaScripts/14.3.1/DR2667/renameLightningSourceInProcedures.sh diff --git a/deltaScripts/14.3.1/utility/replaceAttributeInXML.py b/deltaScripts/14.3.1/DR2667/utility/replaceAttributeInXML.py similarity index 100% rename from deltaScripts/14.3.1/utility/replaceAttributeInXML.py rename to deltaScripts/14.3.1/DR2667/utility/replaceAttributeInXML.py diff --git a/deltaScripts/14.3.1/utility/updateLightningNameInXML.sh b/deltaScripts/14.3.1/DR2667/utility/updateLightningNameInXML.sh similarity index 100% rename from deltaScripts/14.3.1/utility/updateLightningNameInXML.sh rename to deltaScripts/14.3.1/DR2667/utility/updateLightningNameInXML.sh diff --git a/deltaScripts/14.3.1/removeLocalGroupsLocalization.sh b/deltaScripts/14.3.1/DR2701/removeLocalGroupsLocalization.sh similarity index 100% rename from deltaScripts/14.3.1/removeLocalGroupsLocalization.sh rename to deltaScripts/14.3.1/DR2701/removeLocalGroupsLocalization.sh diff --git a/deltaScripts/14.3.1/moveDerivedParameters.sh b/deltaScripts/14.3.1/DR2725/moveDerivedParameters.sh similarity index 100% rename from deltaScripts/14.3.1/moveDerivedParameters.sh rename to deltaScripts/14.3.1/DR2725/moveDerivedParameters.sh diff --git a/deltaScripts/14.3.1/subsetRelocator.sh b/deltaScripts/14.3.1/DR2864/subsetRelocator.sh similarity index 100% rename from deltaScripts/14.3.1/subsetRelocator.sh rename to deltaScripts/14.3.1/DR2864/subsetRelocator.sh 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.pl b/deltaScripts/14.3.1/datadelivery/updateSubscriptionOwners.pl new file mode 100644 index 0000000000..5c4ef198ae --- /dev/null +++ b/deltaScripts/14.3.1/datadelivery/updateSubscriptionOwners.pl @@ -0,0 +1,24 @@ +#!/usr/bin/perl + +open (IN, $ARGV[0]); +print $ARGV[0]; +@lines = ; +close IN; +$site = ""; +foreach $line (@lines) { + if ($line =~ /originatingSite="([\w]+)"/) { + $site = $1; + } +} + +foreach $line (@lines) { +if ($line =~ s/owner="([\w]+)"/owner="$site"/g) { +print $line; +} +} +$OUTFILE = "TEMP"; +open (OUT, ">>TEMP"); +foreach $line (@lines) { +print OUT $line; +} +rename $OUTFILE, $ARGV[0] \ No newline at end of file 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/deltaScripts/11.9.0-1/db/create_index.sh b/deltaScripts/archived/11.9.0-1/db/create_index.sh similarity index 100% rename from deltaScripts/11.9.0-1/db/create_index.sh rename to deltaScripts/archived/11.9.0-1/db/create_index.sh diff --git a/deltaScripts/11.9.0-1/db/remove_bufrua.sh b/deltaScripts/archived/11.9.0-1/db/remove_bufrua.sh similarity index 100% rename from deltaScripts/11.9.0-1/db/remove_bufrua.sh rename to deltaScripts/archived/11.9.0-1/db/remove_bufrua.sh diff --git a/deltaScripts/11.9.0-1/db/update_gfehistory.sh b/deltaScripts/archived/11.9.0-1/db/update_gfehistory.sh similarity index 100% rename from deltaScripts/11.9.0-1/db/update_gfehistory.sh rename to deltaScripts/archived/11.9.0-1/db/update_gfehistory.sh diff --git a/deltaScripts/11.9.0-1/db/update_stdtextproducts.sh b/deltaScripts/archived/11.9.0-1/db/update_stdtextproducts.sh similarity index 100% rename from deltaScripts/11.9.0-1/db/update_stdtextproducts.sh rename to deltaScripts/archived/11.9.0-1/db/update_stdtextproducts.sh diff --git a/deltaScripts/11.9.0-2/db/airmet_convsigmet_add_indices.sql b/deltaScripts/archived/11.9.0-2/db/airmet_convsigmet_add_indices.sql similarity index 100% rename from deltaScripts/11.9.0-2/db/airmet_convsigmet_add_indices.sql rename to deltaScripts/archived/11.9.0-2/db/airmet_convsigmet_add_indices.sql diff --git a/deltaScripts/11.9.0-3/db/create_sfcobs_index.sh b/deltaScripts/archived/11.9.0-3/db/create_sfcobs_index.sh similarity index 100% rename from deltaScripts/11.9.0-3/db/create_sfcobs_index.sh rename to deltaScripts/archived/11.9.0-3/db/create_sfcobs_index.sh diff --git a/deltaScripts/11.9.0-3/db/drop_warning_tables.sh b/deltaScripts/archived/11.9.0-3/db/drop_warning_tables.sh similarity index 100% rename from deltaScripts/11.9.0-3/db/drop_warning_tables.sh rename to deltaScripts/archived/11.9.0-3/db/drop_warning_tables.sh diff --git a/deltaScripts/11.9.0-3/db/fog_update.sh b/deltaScripts/archived/11.9.0-3/db/fog_update.sh similarity index 100% rename from deltaScripts/11.9.0-3/db/fog_update.sh rename to deltaScripts/archived/11.9.0-3/db/fog_update.sh diff --git a/deltaScripts/11.9.0-4/db/gfe_update.sh b/deltaScripts/archived/11.9.0-4/db/gfe_update.sh similarity index 100% rename from deltaScripts/11.9.0-4/db/gfe_update.sh rename to deltaScripts/archived/11.9.0-4/db/gfe_update.sh diff --git a/deltaScripts/11.9.0-4/edex/removeSampleId.sh b/deltaScripts/archived/11.9.0-4/edex/removeSampleId.sh similarity index 100% rename from deltaScripts/11.9.0-4/edex/removeSampleId.sh rename to deltaScripts/archived/11.9.0-4/edex/removeSampleId.sh diff --git a/deltaScripts/11.9.0-5/db/removeGridData.sh b/deltaScripts/archived/11.9.0-5/db/removeGridData.sh similarity index 100% rename from deltaScripts/11.9.0-5/db/removeGridData.sh rename to deltaScripts/archived/11.9.0-5/db/removeGridData.sh diff --git a/deltaScripts/11.9.0-6/db/removePurgeRules.sh b/deltaScripts/archived/11.9.0-6/db/removePurgeRules.sh similarity index 100% rename from deltaScripts/11.9.0-6/db/removePurgeRules.sh rename to deltaScripts/archived/11.9.0-6/db/removePurgeRules.sh diff --git a/deltaScripts/11.9.0-6/edex/gfeRemove_vcmodule.sh b/deltaScripts/archived/11.9.0-6/edex/gfeRemove_vcmodule.sh similarity index 100% rename from deltaScripts/11.9.0-6/edex/gfeRemove_vcmodule.sh rename to deltaScripts/archived/11.9.0-6/edex/gfeRemove_vcmodule.sh diff --git a/deltaScripts/11.9.0-6/edex/removePurgeConfiguration.sh b/deltaScripts/archived/11.9.0-6/edex/removePurgeConfiguration.sh similarity index 100% rename from deltaScripts/11.9.0-6/edex/removePurgeConfiguration.sh rename to deltaScripts/archived/11.9.0-6/edex/removePurgeConfiguration.sh diff --git a/deltaScripts/11.9.0-7/cleanGFESuiteLogs.sh b/deltaScripts/archived/11.9.0-7/cleanGFESuiteLogs.sh similarity index 100% rename from deltaScripts/11.9.0-7/cleanGFESuiteLogs.sh rename to deltaScripts/archived/11.9.0-7/cleanGFESuiteLogs.sh diff --git a/deltaScripts/11.9.0-7/db/updateGrib.sh b/deltaScripts/archived/11.9.0-7/db/updateGrib.sh similarity index 100% rename from deltaScripts/11.9.0-7/db/updateGrib.sh rename to deltaScripts/archived/11.9.0-7/db/updateGrib.sh diff --git a/deltaScripts/11.9.0-7/db/updateSatellite.sh b/deltaScripts/archived/11.9.0-7/db/updateSatellite.sh similarity index 100% rename from deltaScripts/11.9.0-7/db/updateSatellite.sh rename to deltaScripts/archived/11.9.0-7/db/updateSatellite.sh diff --git a/deltaScripts/11.9.0-7/db/updateSatelliteGeo.sh b/deltaScripts/archived/11.9.0-7/db/updateSatelliteGeo.sh similarity index 100% rename from deltaScripts/11.9.0-7/db/updateSatelliteGeo.sh rename to deltaScripts/archived/11.9.0-7/db/updateSatelliteGeo.sh diff --git a/deltaScripts/11.9.0-7/db/update_afos_to_awips.sh b/deltaScripts/archived/11.9.0-7/db/update_afos_to_awips.sh similarity index 100% rename from deltaScripts/11.9.0-7/db/update_afos_to_awips.sh rename to deltaScripts/archived/11.9.0-7/db/update_afos_to_awips.sh diff --git a/deltaScripts/12.10.1/edex/UpdateMakeHazardConfig.py b/deltaScripts/archived/12.10.1/edex/UpdateMakeHazardConfig.py similarity index 100% rename from deltaScripts/12.10.1/edex/UpdateMakeHazardConfig.py rename to deltaScripts/archived/12.10.1/edex/UpdateMakeHazardConfig.py diff --git a/deltaScripts/12.11.1/edex/removeObeGribParamInfoFiles.py b/deltaScripts/archived/12.11.1/edex/removeObeGribParamInfoFiles.py similarity index 100% rename from deltaScripts/12.11.1/edex/removeObeGribParamInfoFiles.py rename to deltaScripts/archived/12.11.1/edex/removeObeGribParamInfoFiles.py diff --git a/deltaScripts/12.12.1/reformatPurgeRules.sh b/deltaScripts/archived/12.12.1/reformatPurgeRules.sh similarity index 100% rename from deltaScripts/12.12.1/reformatPurgeRules.sh rename to deltaScripts/archived/12.12.1/reformatPurgeRules.sh diff --git a/deltaScripts/12.5.1/addgfelockindex.sh b/deltaScripts/archived/12.5.1/addgfelockindex.sh similarity index 100% rename from deltaScripts/12.5.1/addgfelockindex.sh rename to deltaScripts/archived/12.5.1/addgfelockindex.sh diff --git a/deltaScripts/12.5.1/drop_gfe_tables.sh b/deltaScripts/archived/12.5.1/drop_gfe_tables.sh similarity index 100% rename from deltaScripts/12.5.1/drop_gfe_tables.sh rename to deltaScripts/archived/12.5.1/drop_gfe_tables.sh diff --git a/deltaScripts/12.6.1/edex/removeMonitorAreaFiles.sh b/deltaScripts/archived/12.6.1/edex/removeMonitorAreaFiles.sh similarity index 100% rename from deltaScripts/12.6.1/edex/removeMonitorAreaFiles.sh rename to deltaScripts/archived/12.6.1/edex/removeMonitorAreaFiles.sh diff --git a/deltaScripts/13.1.2/createEventsSchema.sql b/deltaScripts/archived/13.1.2/createEventsSchema.sql similarity index 100% rename from deltaScripts/13.1.2/createEventsSchema.sql rename to deltaScripts/archived/13.1.2/createEventsSchema.sql diff --git a/deltaScripts/13.1.2/eventsSchemaDelta.sh b/deltaScripts/archived/13.1.2/eventsSchemaDelta.sh similarity index 100% rename from deltaScripts/13.1.2/eventsSchemaDelta.sh rename to deltaScripts/archived/13.1.2/eventsSchemaDelta.sh diff --git a/deltaScripts/13.2.1/aggregateRecordGroupingLength.sh b/deltaScripts/archived/13.2.1/aggregateRecordGroupingLength.sh similarity index 100% rename from deltaScripts/13.2.1/aggregateRecordGroupingLength.sh rename to deltaScripts/archived/13.2.1/aggregateRecordGroupingLength.sh diff --git a/deltaScripts/13.2.1/convertAggregateRecordGroupToXml.sh b/deltaScripts/archived/13.2.1/convertAggregateRecordGroupToXml.sh similarity index 100% rename from deltaScripts/13.2.1/convertAggregateRecordGroupToXml.sh rename to deltaScripts/archived/13.2.1/convertAggregateRecordGroupToXml.sh diff --git a/deltaScripts/13.2.1/convertAggregateRecordGroupToXml.sql b/deltaScripts/archived/13.2.1/convertAggregateRecordGroupToXml.sql similarity index 100% rename from deltaScripts/13.2.1/convertAggregateRecordGroupToXml.sql rename to deltaScripts/archived/13.2.1/convertAggregateRecordGroupToXml.sql diff --git a/deltaScripts/13.2.1/fixParameterUnits.sh b/deltaScripts/archived/13.2.1/fixParameterUnits.sh similarity index 100% rename from deltaScripts/13.2.1/fixParameterUnits.sh rename to deltaScripts/archived/13.2.1/fixParameterUnits.sh diff --git a/deltaScripts/13.2.1/fixParameterUnits.sql b/deltaScripts/archived/13.2.1/fixParameterUnits.sql similarity index 100% rename from deltaScripts/13.2.1/fixParameterUnits.sql rename to deltaScripts/archived/13.2.1/fixParameterUnits.sql diff --git a/deltaScripts/13.2.1/increaseAggregateRecordGroupingLength.sql b/deltaScripts/archived/13.2.1/increaseAggregateRecordGroupingLength.sql similarity index 100% rename from deltaScripts/13.2.1/increaseAggregateRecordGroupingLength.sql rename to deltaScripts/archived/13.2.1/increaseAggregateRecordGroupingLength.sql diff --git a/deltaScripts/13.3.1/addRouteToSubscriptionSlots.sh b/deltaScripts/archived/13.3.1/addRouteToSubscriptionSlots.sh similarity index 100% rename from deltaScripts/13.3.1/addRouteToSubscriptionSlots.sh rename to deltaScripts/archived/13.3.1/addRouteToSubscriptionSlots.sh diff --git a/deltaScripts/13.3.1/addRouteToSubscriptionSlots.sql b/deltaScripts/archived/13.3.1/addRouteToSubscriptionSlots.sql similarity index 100% rename from deltaScripts/13.3.1/addRouteToSubscriptionSlots.sql rename to deltaScripts/archived/13.3.1/addRouteToSubscriptionSlots.sql diff --git a/deltaScripts/13.3.1/convertPluginNameToDataType.sh b/deltaScripts/archived/13.3.1/convertPluginNameToDataType.sh similarity index 100% rename from deltaScripts/13.3.1/convertPluginNameToDataType.sh rename to deltaScripts/archived/13.3.1/convertPluginNameToDataType.sh diff --git a/deltaScripts/13.3.1/convertPluginNameToDataType.sql b/deltaScripts/archived/13.3.1/convertPluginNameToDataType.sql similarity index 100% rename from deltaScripts/13.3.1/convertPluginNameToDataType.sql rename to deltaScripts/archived/13.3.1/convertPluginNameToDataType.sql diff --git a/deltaScripts/13.3.1/lightsourcecolumn.sql b/deltaScripts/archived/13.3.1/lightsourcecolumn.sql similarity index 100% rename from deltaScripts/13.3.1/lightsourcecolumn.sql rename to deltaScripts/archived/13.3.1/lightsourcecolumn.sql diff --git a/deltaScripts/13.3.1/reftimeIndexUpdate.sh b/deltaScripts/archived/13.3.1/reftimeIndexUpdate.sh similarity index 100% rename from deltaScripts/13.3.1/reftimeIndexUpdate.sh rename to deltaScripts/archived/13.3.1/reftimeIndexUpdate.sh diff --git a/deltaScripts/13.3.1/removeDataURIIndex.sh b/deltaScripts/archived/13.3.1/removeDataURIIndex.sh similarity index 100% rename from deltaScripts/13.3.1/removeDataURIIndex.sh rename to deltaScripts/archived/13.3.1/removeDataURIIndex.sh diff --git a/deltaScripts/13.4.1/alterWarningTables.sql b/deltaScripts/archived/13.4.1/alterWarningTables.sql similarity index 100% rename from deltaScripts/13.4.1/alterWarningTables.sql rename to deltaScripts/archived/13.4.1/alterWarningTables.sql diff --git a/deltaScripts/13.4.1/createNewGfeTables.sql b/deltaScripts/archived/13.4.1/createNewGfeTables.sql similarity index 100% rename from deltaScripts/13.4.1/createNewGfeTables.sql rename to deltaScripts/archived/13.4.1/createNewGfeTables.sql diff --git a/deltaScripts/13.4.1/createPluginDataObjectSequences.sh b/deltaScripts/archived/13.4.1/createPluginDataObjectSequences.sh similarity index 100% rename from deltaScripts/13.4.1/createPluginDataObjectSequences.sh rename to deltaScripts/archived/13.4.1/createPluginDataObjectSequences.sh diff --git a/deltaScripts/13.4.1/createScanIndexes.sh b/deltaScripts/archived/13.4.1/createScanIndexes.sh similarity index 100% rename from deltaScripts/13.4.1/createScanIndexes.sh rename to deltaScripts/archived/13.4.1/createScanIndexes.sh diff --git a/deltaScripts/13.4.1/determineRefTimeDirectory.py b/deltaScripts/archived/13.4.1/determineRefTimeDirectory.py similarity index 100% rename from deltaScripts/13.4.1/determineRefTimeDirectory.py rename to deltaScripts/archived/13.4.1/determineRefTimeDirectory.py diff --git a/deltaScripts/13.4.1/modelsoundingFileName.py b/deltaScripts/archived/13.4.1/modelsoundingFileName.py similarity index 100% rename from deltaScripts/13.4.1/modelsoundingFileName.py rename to deltaScripts/archived/13.4.1/modelsoundingFileName.py diff --git a/deltaScripts/13.4.1/normalizeGfe.sh b/deltaScripts/archived/13.4.1/normalizeGfe.sh similarity index 100% rename from deltaScripts/13.4.1/normalizeGfe.sh rename to deltaScripts/archived/13.4.1/normalizeGfe.sh diff --git a/deltaScripts/13.4.1/parseParmIds.py b/deltaScripts/archived/13.4.1/parseParmIds.py similarity index 100% rename from deltaScripts/13.4.1/parseParmIds.py rename to deltaScripts/archived/13.4.1/parseParmIds.py diff --git a/deltaScripts/13.4.1/parseUgcZones.py b/deltaScripts/archived/13.4.1/parseUgcZones.py similarity index 100% rename from deltaScripts/13.4.1/parseUgcZones.py rename to deltaScripts/archived/13.4.1/parseUgcZones.py diff --git a/deltaScripts/13.4.1/removeHdffileidColumn.sh b/deltaScripts/archived/13.4.1/removeHdffileidColumn.sh similarity index 100% rename from deltaScripts/13.4.1/removeHdffileidColumn.sh rename to deltaScripts/archived/13.4.1/removeHdffileidColumn.sh diff --git a/deltaScripts/13.4.1/removeOldStatAggregates.sh b/deltaScripts/archived/13.4.1/removeOldStatAggregates.sh similarity index 100% rename from deltaScripts/13.4.1/removeOldStatAggregates.sh rename to deltaScripts/archived/13.4.1/removeOldStatAggregates.sh diff --git a/deltaScripts/13.4.1/resetNtransTable.sh b/deltaScripts/archived/13.4.1/resetNtransTable.sh similarity index 100% rename from deltaScripts/13.4.1/resetNtransTable.sh rename to deltaScripts/archived/13.4.1/resetNtransTable.sh diff --git a/deltaScripts/13.4.1/sequences.txt b/deltaScripts/archived/13.4.1/sequences.txt similarity index 100% rename from deltaScripts/13.4.1/sequences.txt rename to deltaScripts/archived/13.4.1/sequences.txt diff --git a/deltaScripts/13.4.1/updateGfeConstraintsAndIndexes.sql b/deltaScripts/archived/13.4.1/updateGfeConstraintsAndIndexes.sql similarity index 100% rename from deltaScripts/13.4.1/updateGfeConstraintsAndIndexes.sql rename to deltaScripts/archived/13.4.1/updateGfeConstraintsAndIndexes.sql diff --git a/deltaScripts/13.4.1/updateModelSoundingPaths.sh b/deltaScripts/archived/13.4.1/updateModelSoundingPaths.sh similarity index 100% rename from deltaScripts/13.4.1/updateModelSoundingPaths.sh rename to deltaScripts/archived/13.4.1/updateModelSoundingPaths.sh diff --git a/deltaScripts/13.4.1/updateWarningTables.sh b/deltaScripts/archived/13.4.1/updateWarningTables.sh similarity index 100% rename from deltaScripts/13.4.1/updateWarningTables.sh rename to deltaScripts/archived/13.4.1/updateWarningTables.sh diff --git a/deltaScripts/13.4.1/upgradeGribLocalization.sh b/deltaScripts/archived/13.4.1/upgradeGribLocalization.sh similarity index 100% rename from deltaScripts/13.4.1/upgradeGribLocalization.sh rename to deltaScripts/archived/13.4.1/upgradeGribLocalization.sh diff --git a/deltaScripts/13.5.1/changeDataTypeEnumToUppercase.sh b/deltaScripts/archived/13.5.1/changeDataTypeEnumToUppercase.sh similarity index 100% rename from deltaScripts/13.5.1/changeDataTypeEnumToUppercase.sh rename to deltaScripts/archived/13.5.1/changeDataTypeEnumToUppercase.sh diff --git a/deltaScripts/13.5.1/changeDataTypeEnumToUppercase.sql b/deltaScripts/archived/13.5.1/changeDataTypeEnumToUppercase.sql similarity index 100% rename from deltaScripts/13.5.1/changeDataTypeEnumToUppercase.sql rename to deltaScripts/archived/13.5.1/changeDataTypeEnumToUppercase.sql diff --git a/deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sh b/deltaScripts/archived/13.5.1/convertSubscriptionSitesToCollection.sh similarity index 100% rename from deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sh rename to deltaScripts/archived/13.5.1/convertSubscriptionSitesToCollection.sh diff --git a/deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sql b/deltaScripts/archived/13.5.1/convertSubscriptionSitesToCollection.sql similarity index 100% rename from deltaScripts/13.5.1/convertSubscriptionSitesToCollection.sql rename to deltaScripts/archived/13.5.1/convertSubscriptionSitesToCollection.sql diff --git a/deltaScripts/13.5.1/dropDataURI.sh b/deltaScripts/archived/13.5.1/dropDataURI.sh similarity index 100% rename from deltaScripts/13.5.1/dropDataURI.sh rename to deltaScripts/archived/13.5.1/dropDataURI.sh diff --git a/deltaScripts/13.5.1/ebxmlSchemaChange.sh b/deltaScripts/archived/13.5.1/ebxmlSchemaChange.sh similarity index 100% rename from deltaScripts/13.5.1/ebxmlSchemaChange.sh rename to deltaScripts/archived/13.5.1/ebxmlSchemaChange.sh diff --git a/deltaScripts/13.5.1/ebxmlSchemaDefinition.sql b/deltaScripts/archived/13.5.1/ebxmlSchemaDefinition.sql similarity index 100% rename from deltaScripts/13.5.1/ebxmlSchemaDefinition.sql rename to deltaScripts/archived/13.5.1/ebxmlSchemaDefinition.sql diff --git a/deltaScripts/13.5.1/getSubscriptionSite.sql b/deltaScripts/archived/13.5.1/getSubscriptionSite.sql similarity index 100% rename from deltaScripts/13.5.1/getSubscriptionSite.sql rename to deltaScripts/archived/13.5.1/getSubscriptionSite.sql diff --git a/deltaScripts/13.5.1/removeDeliveryOptions.sql b/deltaScripts/archived/13.5.1/removeDeliveryOptions.sql similarity index 100% rename from deltaScripts/13.5.1/removeDeliveryOptions.sql rename to deltaScripts/archived/13.5.1/removeDeliveryOptions.sql diff --git a/deltaScripts/13.5.1/removeDeliveryOptionsDb.sh b/deltaScripts/archived/13.5.1/removeDeliveryOptionsDb.sh similarity index 100% rename from deltaScripts/13.5.1/removeDeliveryOptionsDb.sh rename to deltaScripts/archived/13.5.1/removeDeliveryOptionsDb.sh diff --git a/deltaScripts/13.5.1/removeDeliveryOptionsLocalization.sh b/deltaScripts/archived/13.5.1/removeDeliveryOptionsLocalization.sh similarity index 100% rename from deltaScripts/13.5.1/removeDeliveryOptionsLocalization.sh rename to deltaScripts/archived/13.5.1/removeDeliveryOptionsLocalization.sh diff --git a/deltaScripts/13.5.1/removeRegistryBackupTags.sh b/deltaScripts/archived/13.5.1/removeRegistryBackupTags.sh similarity index 100% rename from deltaScripts/13.5.1/removeRegistryBackupTags.sh rename to deltaScripts/archived/13.5.1/removeRegistryBackupTags.sh diff --git a/deltaScripts/13.5.1/renameSubscriptionToSiteSubscription.sh b/deltaScripts/archived/13.5.1/renameSubscriptionToSiteSubscription.sh similarity index 100% rename from deltaScripts/13.5.1/renameSubscriptionToSiteSubscription.sh rename to deltaScripts/archived/13.5.1/renameSubscriptionToSiteSubscription.sh diff --git a/deltaScripts/13.5.1/renameSubscriptionToSiteSubscription.sql b/deltaScripts/archived/13.5.1/renameSubscriptionToSiteSubscription.sql similarity index 100% rename from deltaScripts/13.5.1/renameSubscriptionToSiteSubscription.sql rename to deltaScripts/archived/13.5.1/renameSubscriptionToSiteSubscription.sql diff --git a/deltaScripts/13.5.1/resetNtransTable.sh b/deltaScripts/archived/13.5.1/resetNtransTable.sh similarity index 100% rename from deltaScripts/13.5.1/resetNtransTable.sh rename to deltaScripts/archived/13.5.1/resetNtransTable.sh diff --git a/deltaScripts/13.5.1/tableNameUpdate.sql b/deltaScripts/archived/13.5.1/tableNameUpdate.sql similarity index 100% rename from deltaScripts/13.5.1/tableNameUpdate.sql rename to deltaScripts/archived/13.5.1/tableNameUpdate.sql diff --git a/deltaScripts/13.5.1/updateProviderType.xsl b/deltaScripts/archived/13.5.1/updateProviderType.xsl similarity index 100% rename from deltaScripts/13.5.1/updateProviderType.xsl rename to deltaScripts/archived/13.5.1/updateProviderType.xsl diff --git a/deltaScripts/13.5.1/updateProviderTypeDb.sh b/deltaScripts/archived/13.5.1/updateProviderTypeDb.sh similarity index 100% rename from deltaScripts/13.5.1/updateProviderTypeDb.sh rename to deltaScripts/archived/13.5.1/updateProviderTypeDb.sh diff --git a/deltaScripts/13.5.1/updateProviderTypeLocalization.sh b/deltaScripts/archived/13.5.1/updateProviderTypeLocalization.sh similarity index 100% rename from deltaScripts/13.5.1/updateProviderTypeLocalization.sh rename to deltaScripts/archived/13.5.1/updateProviderTypeLocalization.sh diff --git a/deltaScripts/13.5.1/update_svcbu_props.sh b/deltaScripts/archived/13.5.1/update_svcbu_props.sh similarity index 100% rename from deltaScripts/13.5.1/update_svcbu_props.sh rename to deltaScripts/archived/13.5.1/update_svcbu_props.sh diff --git a/deltaScripts/13.5.2/addBufrmosDataURI.sh b/deltaScripts/archived/13.5.2/addBufrmosDataURI.sh similarity index 100% rename from deltaScripts/13.5.2/addBufrmosDataURI.sh rename to deltaScripts/archived/13.5.2/addBufrmosDataURI.sh diff --git a/deltaScripts/future/alterTextProductsTables.sh b/deltaScripts/archived/future/alterTextProductsTables.sh similarity index 100% rename from deltaScripts/future/alterTextProductsTables.sh rename to deltaScripts/archived/future/alterTextProductsTables.sh diff --git a/deltaScripts/future/combineH5Files.py b/deltaScripts/archived/future/combineH5Files.py similarity index 100% rename from deltaScripts/future/combineH5Files.py rename to deltaScripts/archived/future/combineH5Files.py diff --git a/deltaScripts/future/relocateTextUtilities.py b/deltaScripts/archived/future/relocateTextUtilities.py similarity index 100% rename from deltaScripts/future/relocateTextUtilities.py rename to deltaScripts/archived/future/relocateTextUtilities.py diff --git a/deltaScripts/future/removeHdfFileId.sh b/deltaScripts/archived/future/removeHdfFileId.sh similarity index 100% rename from deltaScripts/future/removeHdfFileId.sh rename to deltaScripts/archived/future/removeHdfFileId.sh diff --git a/deltaScripts/unified_grid/README.txt b/deltaScripts/archived/unified_grid/README.txt similarity index 100% rename from deltaScripts/unified_grid/README.txt rename to deltaScripts/archived/unified_grid/README.txt diff --git a/deltaScripts/unified_grid/convert_grib_data.py b/deltaScripts/archived/unified_grid/convert_grib_data.py similarity index 100% rename from deltaScripts/unified_grid/convert_grib_data.py rename to deltaScripts/archived/unified_grid/convert_grib_data.py diff --git a/deltaScripts/unified_grid/copy_grib_purge_rules.sh b/deltaScripts/archived/unified_grid/copy_grib_purge_rules.sh similarity index 100% rename from deltaScripts/unified_grid/copy_grib_purge_rules.sh rename to deltaScripts/archived/unified_grid/copy_grib_purge_rules.sh diff --git a/deltaScripts/unified_grid/create_grid_tables.sh b/deltaScripts/archived/unified_grid/create_grid_tables.sh similarity index 100% rename from deltaScripts/unified_grid/create_grid_tables.sh rename to deltaScripts/archived/unified_grid/create_grid_tables.sh diff --git a/deltaScripts/unified_grid/register_grid_coverage.sh b/deltaScripts/archived/unified_grid/register_grid_coverage.sh similarity index 100% rename from deltaScripts/unified_grid/register_grid_coverage.sh rename to deltaScripts/archived/unified_grid/register_grid_coverage.sh diff --git a/deltaScripts/unified_grid/update_D2D_bundles.sh b/deltaScripts/archived/unified_grid/update_D2D_bundles.sh similarity index 100% rename from deltaScripts/unified_grid/update_D2D_bundles.sh rename to deltaScripts/archived/unified_grid/update_D2D_bundles.sh diff --git a/deltaScripts/unified_grid/update_D2D_procedures.sh b/deltaScripts/archived/unified_grid/update_D2D_procedures.sh similarity index 100% rename from deltaScripts/unified_grid/update_D2D_procedures.sh rename to deltaScripts/archived/unified_grid/update_D2D_procedures.sh diff --git a/deltaScripts/unified_grid/update_FFMP_Source.sh b/deltaScripts/archived/unified_grid/update_FFMP_Source.sh similarity index 100% rename from deltaScripts/unified_grid/update_FFMP_Source.sh rename to deltaScripts/archived/unified_grid/update_FFMP_Source.sh diff --git a/deltaScripts/unified_grid/update_saved_display.sh b/deltaScripts/archived/unified_grid/update_saved_display.sh similarity index 100% rename from deltaScripts/unified_grid/update_saved_display.sh rename to deltaScripts/archived/unified_grid/update_saved_display.sh diff --git a/deltaScripts/unified_grid_rollback/convert_grib_data.py b/deltaScripts/archived/unified_grid_rollback/convert_grib_data.py similarity index 100% rename from deltaScripts/unified_grid_rollback/convert_grib_data.py rename to deltaScripts/archived/unified_grid_rollback/convert_grib_data.py diff --git a/deltaScripts/unified_grid_rollback/copy_grib_purge_rules.sh b/deltaScripts/archived/unified_grid_rollback/copy_grib_purge_rules.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/copy_grib_purge_rules.sh rename to deltaScripts/archived/unified_grid_rollback/copy_grib_purge_rules.sh diff --git a/deltaScripts/unified_grid_rollback/create_grid_tables.sh b/deltaScripts/archived/unified_grid_rollback/create_grid_tables.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/create_grid_tables.sh rename to deltaScripts/archived/unified_grid_rollback/create_grid_tables.sh diff --git a/deltaScripts/unified_grid_rollback/register_grid_coverage.sh b/deltaScripts/archived/unified_grid_rollback/register_grid_coverage.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/register_grid_coverage.sh rename to deltaScripts/archived/unified_grid_rollback/register_grid_coverage.sh diff --git a/deltaScripts/unified_grid_rollback/update_D2D_bundles.sh b/deltaScripts/archived/unified_grid_rollback/update_D2D_bundles.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/update_D2D_bundles.sh rename to deltaScripts/archived/unified_grid_rollback/update_D2D_bundles.sh diff --git a/deltaScripts/unified_grid_rollback/update_D2D_procedures.sh b/deltaScripts/archived/unified_grid_rollback/update_D2D_procedures.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/update_D2D_procedures.sh rename to deltaScripts/archived/unified_grid_rollback/update_D2D_procedures.sh diff --git a/deltaScripts/unified_grid_rollback/update_FFMP_Source.sh b/deltaScripts/archived/unified_grid_rollback/update_FFMP_Source.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/update_FFMP_Source.sh rename to deltaScripts/archived/unified_grid_rollback/update_FFMP_Source.sh diff --git a/deltaScripts/unified_grid_rollback/update_saved_display.sh b/deltaScripts/archived/unified_grid_rollback/update_saved_display.sh similarity index 100% rename from deltaScripts/unified_grid_rollback/update_saved_display.sh rename to deltaScripts/archived/unified_grid_rollback/update_saved_display.sh diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/ifpAG/ASCIIGrid.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/ifpAG/ASCIIGrid.java index 04276f8595..d53bfc46c3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/ifpAG/ASCIIGrid.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/ifpAG/ASCIIGrid.java @@ -25,6 +25,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.text.DateFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -34,6 +35,7 @@ import java.util.Scanner; import com.raytheon.edex.plugin.gfe.config.IFPServerConfig; import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager; import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException; +import com.raytheon.edex.plugin.gfe.server.IFPServer; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType; import com.raytheon.uf.common.dataplugin.gfe.RemapGrid; @@ -46,6 +48,7 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo; import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.TimeConstraints; import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey; +import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte; import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat; import com.raytheon.uf.common.dataplugin.gfe.slice.DiscreteGridSlice; @@ -72,6 +75,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Apr 13, 2011 #8393 dgilling Initial creation * 02/19/13 #1637 randerso Added exception handling for Discrete and Weather * 10/31/2013 #2508 randerso Change to use DiscreteGridSlice.getKeys() + * 04/22/2014 #3050 randerso Allow exceptions to propagate to caller from readASCIIGridData * * * @@ -353,12 +357,14 @@ public class ASCIIGrid { } public String readASCIIGridData(File aGridData) - throws FileNotFoundException { + throws FileNotFoundException, GfeException, ParseException { List gridSlices = new ArrayList(); - Scanner inputStream = new Scanner(aGridData, "US-ASCII"); - while (true) { - try { + Scanner inputStream = null; + try { + inputStream = new Scanner(aGridData, "US-ASCII"); + + while (true) { // read the ASCIIGRID keyword // if we have an ASCIIGRID to read if (!inputStream.next().equals("ASCIIGRID")) { @@ -421,8 +427,12 @@ public class ASCIIGrid { float yExtent = inputStream.nextFloat(); // make the GridLocation - IFPServerConfig config = IFPServerConfigManager - .getServerConfig(dbSiteId); + IFPServer ifpServer = IFPServer.getActiveServer(dbSiteId); + if (ifpServer == null) { + throw new GfeException("No active IFPServer for site: " + + dbSiteId); + } + IFPServerConfig config = ifpServer.getConfig(); GridLocation baseGLoc = config.dbDomain(); ProjectionData projData = config.getProjectionData(projId); GridLocation gLocation = new GridLocation(dbSiteId, projData, @@ -600,14 +610,12 @@ public class ASCIIGrid { if (!inputStream.hasNext()) { break; } - - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, - "Caught exception in readASCIIGridData()", e); - break; + } + } finally { + if (inputStream != null) { + inputStream.close(); } } - inputStream.close(); this.gridSlices = gridSlices; return ""; diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/SaveASCIIGridsHandler.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/SaveASCIIGridsHandler.java index 6c1ef52bdc..02d63e30bc 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/SaveASCIIGridsHandler.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/SaveASCIIGridsHandler.java @@ -61,6 +61,9 @@ import com.raytheon.uf.common.status.UFStatus; * Apr 21, 2011 dgilling Initial creation * Apr 23, 2013 1949 rjpeter Removed extra lock table look up * Jun 13, 2013 #2044 randerso Refactored to use IFPServer + * Apr 21, 2014 #3050 randerso Get the IFPServer instance based on the + * site in the ParmID + * * * * @author dgilling @@ -83,9 +86,6 @@ public class SaveASCIIGridsHandler extends BaseGfeRequestHandler implements @Override public ServerResponse handleRequest(SaveASCIIGridsRequest request) throws Exception { - IFPServer ifpServer = getIfpServer(request); - GridParmManager gridParmMgr = ifpServer.getGridParmMgr(); - LockManager lockMgr = ifpServer.getLockMgr(); ServerResponse sr = new ServerResponse(); @@ -97,10 +97,23 @@ public class SaveASCIIGridsHandler extends BaseGfeRequestHandler implements sr.addMessage(msg); } + String prevSiteID = null; int ngrids = agrid.getGridSlices().size(); for (int i = 0; i < ngrids; i++) { ParmID pid = agrid.getGridSlices().get(i).getGridInfo().getParmID(); + // get the server for this site + String siteID = pid.getDbId().getSiteId(); + IFPServer ifpServer = IFPServer.getActiveServer(siteID); + if (ifpServer == null && !siteID.equals(prevSiteID)) { + sr.addMessage("No active IFPServer for site: " + siteID); + continue; + } + prevSiteID = siteID; + + GridParmManager gridParmMgr = ifpServer.getGridParmMgr(); + LockManager lockMgr = ifpServer.getLockMgr(); + // get a list of available databases, see if the grid is part of an // existing database. ServerResponse> srDbInv = gridParmMgr 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.datadelivery.harvester/src/com/raytheon/uf/common/datadelivery/harvester/HarvesterConfig.java b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/src/com/raytheon/uf/common/datadelivery/harvester/HarvesterConfig.java index 4765f2ff1b..e682c12869 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/src/com/raytheon/uf/common/datadelivery/harvester/HarvesterConfig.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/src/com/raytheon/uf/common/datadelivery/harvester/HarvesterConfig.java @@ -19,6 +19,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 12 Sept, 2012 1038 dhladky Initial creation * 1 May 2013 1959 dhladky remove backup registry references * 23 Oct, 2013 2361 njensen Remove ISerializableObject + * 15 Apr, 2014 3012 dhladky Added retention time for this provider in registry. * * * @@ -37,6 +38,11 @@ public class HarvesterConfig { @XmlElement(name = "agent") @DynamicSerializeElement private Agent agent; + + /** default of 7 days **/ + @XmlElement(name = "retention") + @DynamicSerializeElement + private String retention = "7"; public HarvesterConfig() { @@ -58,4 +64,12 @@ public class HarvesterConfig { this.provider = provider; } + public String getRetention() { + return retention; + } + + public void setRetention(String retention) { + this.retention = retention; + } + } diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/NOMADS-harvester.xml b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/NOMADS-harvester.xml index f6a2be6687..0c1d4fb65e 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/NOMADS-harvester.xml +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/NOMADS-harvester.xml @@ -28,6 +28,8 @@ http://nomads.ncep.noaa.gov:9090/dods/ + + 7 /awips2/crawl diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/OGC-harvester.xml.sample b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/OGC-harvester.xml.sample index 329561f2cd..969ddc31a8 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/OGC-harvester.xml.sample +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.harvester/utility/common_static/base/datadelivery/harvester/OGC-harvester.xml.sample @@ -15,6 +15,8 @@ METAR Test LatLon Coverage + + 1 HHddMMMyyyy diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/DataSetMetaData.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/DataSetMetaData.java index 2bd34d4968..c1ae950cb3 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/DataSetMetaData.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/DataSetMetaData.java @@ -43,7 +43,8 @@ import com.raytheon.uf.common.time.util.ImmutableDate; * Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects. * Sept, 30 2013 1797 dhladky Made generic based on Time * Dec 20, 2013 2636 mpduff Add a dataset availability offset - * jan 23, 2013 2584 dhladky Versions. + * jan 23, 2013 2584 dhladky Versions. + * Apr 14, 2013 3012 dhladky Removed unused methods. * * * @author dhladky @@ -229,13 +230,4 @@ public abstract class DataSetMetaData { return url; } - /** - * Accepts a {@link IDataSetMetaDataVisitor} which can perform arbitrary - * processing on this {@link DataSetMetaData} instance. Should be defined by - * each concrete class instance. - * - * @param visitor - * the visitor - */ - public abstract void accept(IDataSetMetaDataVisitor visitor); } diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/IDataSetMetaDataVisitor.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/IDataSetMetaDataVisitor.java deleted file mode 100644 index 78efaf40e5..0000000000 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/IDataSetMetaDataVisitor.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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. - **/ -package com.raytheon.uf.common.datadelivery.registry; - - -/** - * Defines a type that can visit {@link DataSetMetaData} instances and perform - * some activity. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Sep 4, 2012  1102       djohnson     Initial creation
- * 
- * 
- * - * @author djohnson - * @version 1.0 - */ - -public interface IDataSetMetaDataVisitor { - - /** - * Visits an {@link OpenDapGriddedDataSetMetaData} instance. - * - * @param metaData - * the metaData - */ - void visit(OpenDapGriddedDataSetMetaData metaData); -} diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/OpenDapGriddedDataSetMetaData.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/OpenDapGriddedDataSetMetaData.java index faa522a6f0..f680686be9 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/OpenDapGriddedDataSetMetaData.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/OpenDapGriddedDataSetMetaData.java @@ -36,7 +36,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 4, 2012 1102 djohnson Initial creation - * jan 23, 2013 2584 dhladky Versions + * jan 23, 2014 2584 dhladky Versions + * Apr 14, 2014 3012 dhladky Unneeded method removed. * * * @@ -49,12 +50,4 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @DynamicSerialize public class OpenDapGriddedDataSetMetaData extends GriddedDataSetMetaData { - /** - * {@inheritDoc} - */ - @Override - public void accept(IDataSetMetaDataVisitor visitor) { - visitor.visit(this); - } - } diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/PointDataSetMetaData.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/PointDataSetMetaData.java index 6da6f317aa..dbb53a7b53 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/PointDataSetMetaData.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/PointDataSetMetaData.java @@ -34,6 +34,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * ------------ ---------- ----------- -------------------------- * Aug 20, 2012 754 dhladky Initial creation * Sept 30, 2013 1797 dhladky Generics + * Apr 14, 2014 3012 dhladky Unneeded method removed. * * * @@ -50,10 +51,5 @@ public class PointDataSetMetaData extends DataSetMetaData { public PointDataSetMetaData() { } - - @Override - public void accept(IDataSetMetaDataVisitor visitor) { - // TODO: not sure what this does? - } - + } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.retrieval/src/com/raytheon/uf/common/datadelivery/retrieval/xml/DataSetInformation.java b/edexOsgi/com.raytheon.uf.common.datadelivery.retrieval/src/com/raytheon/uf/common/datadelivery/retrieval/xml/DataSetInformation.java index 2c64949b57..e6e0f2fd60 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.retrieval/src/com/raytheon/uf/common/datadelivery/retrieval/xml/DataSetInformation.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.retrieval/src/com/raytheon/uf/common/datadelivery/retrieval/xml/DataSetInformation.java @@ -20,7 +20,6 @@ package com.raytheon.uf.common.datadelivery.retrieval.xml; * further licensing information. **/ - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -28,6 +27,7 @@ import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Data Set Info XML Object. @@ -39,6 +39,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 14, 2014 dhladky Initial creation. + * Apr 09, 2014 #3012 dhladky Fixed incorrect default calc. * * * @@ -54,25 +55,26 @@ public class DataSetInformation { @XmlElement(name = "modelName", type = String.class) @DynamicSerializeElement protected String modelName; - + @XmlElement(name = "multiplier", type = Double.class) @DynamicSerializeElement protected Double multiplier; - + @XmlElement(name = "modelRunIncrement", type = Integer.class) @DynamicSerializeElement protected Integer modelRunIncrement; - + @XmlElement(name = "defaultOffset", type = Integer.class) @DynamicSerializeElement protected Integer defaultOffset; - + public DataSetInformation() { - + } - - public DataSetInformation(String modelName, Double multiplier, int modelRunIncrement, int defaultOffset) { - + + public DataSetInformation(String modelName, Double multiplier, + int modelRunIncrement, int defaultOffset) { + this.modelName = modelName; this.multiplier = multiplier; this.modelRunIncrement = modelRunIncrement; @@ -111,8 +113,12 @@ public class DataSetInformation { this.defaultOffset = defaultOffset; } + /** + * The range int is in minutes, so we need multiplier * model running increment * minutes per hour + * @return + */ public int getRange() { - return (int) (getMultiplier() * getModelRunIncrement()); + return (int) ((getMultiplier() * getModelRunIncrement()) * TimeUtil.MINUTES_PER_HOUR); } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java index 9618dfee52..51862f783c 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java @@ -66,6 +66,8 @@ import com.vividsolutions.jts.geom.Geometry; * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL * Aug,20, 2013 2250 mnash Change some methods that were not working in all cases * Jan,14, 2014 2667 mnash Remove getGridData method + * May 1, 2014 3099 bkowal No longer use an empty pfaf list when the + * data request locationNames list is empty. * * * @@ -219,7 +221,7 @@ public class FFMPGeometryFactory extends AbstractDataPluginFactory { String[] locationNames = request.getLocationNames(); List pfafList = null; - if (locationNames != null) { + if (locationNames != null && locationNames.length > 0) { pfafList = convertLocations(locationNames); } 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.dat.utils/src/com/raytheon/uf/edex/dat/utils/DATUtils.java b/edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DATUtils.java index 3143b8f76a..ca488bd958 100644 --- a/edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DATUtils.java +++ b/edexOsgi/com.raytheon.uf.edex.dat.utils/src/com/raytheon/uf/edex/dat/utils/DATUtils.java @@ -19,26 +19,19 @@ **/ package com.raytheon.uf.edex.dat.utils; -import java.text.SimpleDateFormat; -import java.util.ArrayList; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasin; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.persist.IPersistable; -import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants; import com.raytheon.uf.common.datastorage.IDataStore; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.monitor.processing.IMonitorProcessing; import com.raytheon.uf.common.monitor.xml.SCANModelParameterXML; import com.raytheon.uf.common.monitor.xml.SourceXML; -import com.raytheon.uf.edex.database.dao.CoreDao; -import com.raytheon.uf.edex.database.dao.DaoConfig; import com.raytheon.uf.edex.database.plugin.PluginDao; import com.raytheon.uf.edex.database.plugin.PluginFactory; @@ -97,16 +90,9 @@ public class DATUtils { * @return */ public static GridRecord getGridRecord(String uri) throws PluginException { - GridRecord gr = new GridRecord(uri); - PluginDao gd = PluginFactory.getInstance().getPluginDao( - gr.getPluginName()); - gr = (GridRecord) gd.getMetadata(uri); - if (gr != null) { populateGridRecord(gr); - } else { - logger.error("URI: " + uri + " Not in Database..."); } return gr; @@ -136,104 +122,6 @@ public class DATUtils { } } - /** - * Gets the value for an accumulating Virtual Gage Basin - * - * @param lid - * @param startTime - * @param endTime - * @return - * @deprecated Nothing seems to be calling this.... - */ - @Deprecated - public static FFMPVirtualGageBasin getVirtualBasinData(String lid, - FFMPVirtualGageBasin vgb, String endTime, String startTime) { - - // According to the AWIPS I code - - SimpleDateFormat dateFmt = new SimpleDateFormat("MMM dd yy HH:mm:ss"); - CoreDao dao = new CoreDao(DaoConfig.forDatabase(ShefConstants.IHFS)); - - String sql1 = "SELECT dur, value, ts FROM curpc WHERE lid = '" + lid - + "' AND obstime >= '" + startTime + "' AND obstime < '" - + endTime + "' AND pe = 'PC' ORDER BY obstime DESC, ts ASC"; - String sql2 = "SELECT dur, value, ts FROM curpp WHERE lid = '" - + lid - + "' AND obstime >= '" - + startTime - + "' AND obstime < '" - + endTime - + "' AND pe = 'PP' AND dur <= 1001 AND value >=0 ORDER BY dur ASC, obstime DESC, ts ASC"; - - dao = new CoreDao(DaoConfig.forDatabase(ShefConstants.IHFS)); - - try { - // 15 min accumulation - Object[] results = dao.executeSQLQuery(sql1.toString()); - Object[] tsresults = null; - String ts = null; - - if (results.length > 0) { - if (results.length > 1) { - // Gets the highest ranked - String sql3 = "SELECT ts, ts_rank FROM ingestfilter WHERE lid = '" - + lid - + "' AND pe = 'PC' ORDER BY ts_rank ASC limit 1"; - tsresults = dao.executeSQLQuery(sql3.toString()); - } - } else { - results = dao.executeSQLQuery(sql2.toString()); - - if (results.length > 0) { - if (results.length > 1) { - String sql3 = "SELECT ts, ts_rank FROM ingestfilter WHERE lid = '" - + lid - + "' AND pe = 'PP' ORDER BY ts_rank ASC limit 1"; - tsresults = dao.executeSQLQuery(sql3.toString()); - } - } - } - - // parse through getting rid of undesireable types - if (tsresults != null && tsresults.length > 0) { - ArrayList durations = new ArrayList(); - ArrayList values = new ArrayList(); - - for (int i = 0; i < results.length; i++) { - Object[] obs = (Object[]) tsresults[i]; - - if (obs[2] != null) { - if (((String) obs[2]).equals(ts)) { - - if (obs[0] != null) { - durations.add((Integer) obs[0]); - } - if (obs[1] != null) { - values.add(((Number) obs[1]).floatValue()); - } - } - } - } - - float totalVals = 0.0f; - for (float val : values) { - totalVals += val; - } - - float avVal = totalVals / values.size(); - - vgb.setValue(dateFmt.parse(endTime), avVal); - } else { - vgb.setValue(dateFmt.parse(endTime), 0.0f); - } - } catch (Exception e) { - logger.error("No Virual Gage Basin found....."); - } - - return vgb; - - } - /** * Check status of cached model data * diff --git a/edexOsgi/com.raytheon.uf.edex.dataaccess/utility/common_static/base/python/dataaccess/JGridData.py b/edexOsgi/com.raytheon.uf.edex.dataaccess/utility/common_static/base/python/dataaccess/JGridData.py index c8ee7ff32b..1901b10349 100644 --- a/edexOsgi/com.raytheon.uf.edex.dataaccess/utility/common_static/base/python/dataaccess/JGridData.py +++ b/edexOsgi/com.raytheon.uf.edex.dataaccess/utility/common_static/base/python/dataaccess/JGridData.py @@ -28,14 +28,19 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 12/10/12 njensen Initial Creation. +# 05/01/14 3095 bsteffen Move numeric data access to new plugin. + # # # from ufpy.dataaccess import IGridData import JData +from jep import jarray -from com.raytheon.uf.common.geospatial.interpolation.data import FloatArrayWrapper, UnitConvertingDataDestination +from com.raytheon.uf.common.numeric.buffer import FloatBufferWrapper +from com.raytheon.uf.common.geospatial.data import UnitConvertingDataFilter +from com.raytheon.uf.common.numeric.dest import FilteredDataDestination from com.raytheon.uf.common.python import PythonNumpyFloatArray from com.raytheon.uf.common.geospatial import LatLonReprojection from javax.measure.unit import UnitFormat @@ -64,21 +69,22 @@ class JGridData(IGridData, JData.JData): return str(self.jobj.getUnit()) def getRawData(self, unit=None): - dest = FloatArrayWrapper(self.jobj.getGridGeometry()) + nx = self.jobj.getGridGeometry().getGridRange().getSpan(0) + ny = self.jobj.getGridGeometry().getGridRange().getSpan(1) + dest = FloatBufferWrapper(nx, ny) pnfa = None if unit: unitObj = UnitFormat.getUCUMInstance().parseObject(unit) converter = self.jobj.getUnit().getConverterTo(unitObj) - unitDest = UnitConvertingDataDestination(converter, dest) - filledDest = self.jobj.populateData(unitDest) - nx = self.jobj.getGridGeometry().getGridRange().getSpan(0) - ny = self.jobj.getGridGeometry().getGridRange().getSpan(1) - pnfa = PythonNumpyFloatArray(filledDest.getWrappedDestination().getArray(), nx, ny) + filter = UnitConvertingDataFilter(converter) + filter = UnitConvertingDataFilter(converter) + filters = jarray(1, UnitConvertingDataFilter) + filters[0] = filter + unitDest = FilteredDataDestination.addFilters(dest, filters) + self.jobj.populateData(unitDest) else: - filledDest = self.jobj.populateData(dest) - nx = self.jobj.getGridGeometry().getGridRange().getSpan(0); - ny = self.jobj.getGridGeometry().getGridRange().getSpan(1); - pnfa = PythonNumpyFloatArray(dest.getArray(), nx, ny) + self.jobj.populateData(dest) + pnfa = PythonNumpyFloatArray(dest.getBuffer().array(), nx, ny) return pnfa.__numpy__[0] def getLatLonCoords(self): 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..b413491955 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 @@ -34,7 +34,8 @@ Require-Bundle: com.raytheon.uf.common.status;bundle-version="1.12.1174", com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0", org.eclipse.jetty;bundle-version="7.6.14", com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174", - org.quartz;bundle-version="1.8.6" + org.quartz;bundle-version="1.8.6", + com.raytheon.uf.edex.datadelivery.registry;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.hibernate, @@ -45,5 +46,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..4a2f79b269 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,8 @@ 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 09, 2014 3012 dhladky Range the querries for metadata checks to subscriptions. + * Apr 22, 2014 2992 dhladky Ability to get list of all registry nodes containing data. * * * @@ -155,13 +157,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 +178,14 @@ public abstract class BandwidthManager protected final BandwidthDaoUtil bandwidthDaoUtil; private final IBandwidthDbInit dbInit; + + /** used for min time range **/ + public static final String MIN_RANGE_TIME = "min"; + private final RegistryIdUtil idUtil; + + + /** used for max time range **/ + public static final String MAX_RANGE_TIME = "max"; // Instance variable and not static, because there are multiple child // implementation classes which should each have a unique prefix @@ -185,11 +198,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; } /** @@ -371,7 +386,9 @@ public abstract class BandwidthManager .getBaseReferenceTime(); Calendar startTime = TimeUtil.newGmtCalendar(retrievalTime .getTime()); - + + startTime.add(Calendar.MINUTE, + retrieval.getDataSetAvailablityDelay()); int maxLatency = retrieval.getSubscriptionLatency(); retrieval.setStartTime(startTime); @@ -450,8 +467,14 @@ public abstract class BandwidthManager @Override public List schedule(Subscription subscription) { - List unscheduled = null; + List unscheduled = Collections.emptyList(); + if (subscription instanceof RecurringSubscription) { + if (!((RecurringSubscription) subscription).shouldSchedule()) { + return unscheduled; + } + } + final DataType dataSetType = subscription.getDataSetType(); switch (dataSetType) { case GRID: @@ -470,7 +493,7 @@ public abstract class BandwidthManager return unscheduled; } - + /** * Update the retrieval plan for this subscription. * @@ -728,7 +751,10 @@ public abstract class BandwidthManager Subscription subscription) { List unscheduled = schedule(subscription, ((PointTime) subscription.getTime()).getInterval()); - unscheduled.addAll(getMostRecent(subscription, false)); + // add an adhoc if one exists and isn't in startup mode + if (EDEXUtil.isRunning()) { + unscheduled.addAll(getMostRecent(subscription, false)); + } return unscheduled; } @@ -752,10 +778,20 @@ public abstract class BandwidthManager if (subscribedToCycles) { unscheduled = schedule(subscription, Sets.newTreeSet(cycles)); } + // add an adhoc if one exists and isn't in startup mode + if (EDEXUtil.isRunning()) { + unscheduled.addAll(getMostRecent(subscription, true)); + } return unscheduled; } + /** + * Schedule the most recent dataset update if one exists. + * @param subscription + * @param useMostRecentDataSetUpdate + * @return + */ private List getMostRecent( Subscription subscription, boolean useMostRecentDataSetUpdate) { List unscheduled = Collections.emptyList(); @@ -878,7 +914,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 +1018,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 +1479,7 @@ public abstract class BandwidthManager */ @Override public AuthorizationResponse authorized(IUser user, - IBandwidthRequest request) throws AuthorizationException { + BandwidthRequest request) throws AuthorizationException { return new AuthorizationResponse(true); } @@ -1706,4 +1745,27 @@ public abstract class BandwidthManager return dataSetMetaDataTime; } + + /** + * Sets a range based on the baseReferenceTime hour. + * @param baseReferenceTime + * @return + */ + public static Map getBaseReferenceTimeDateRange(Calendar baseReferenceTime) { + + Map dates = new HashMap(2); + // Set min range to baseReferenceTime hour "00" minutes, "00" seconds + // Set max range to baseReferenceTime hour "59" minutes, "59" seconds + Calendar min = TimeUtil.newGmtCalendar(baseReferenceTime.getTime()); + min.set(Calendar.MINUTE, 0); + min.set(Calendar.SECOND, 0); + Calendar max = TimeUtil.newGmtCalendar(baseReferenceTime.getTime()); + max.set(Calendar.MINUTE, 59); + max.set(Calendar.SECOND, 59); + + dates.put(MIN_RANGE_TIME, min.getTime()); + dates.put(MAX_RANGE_TIME, max.getTime()); + + return dates; + } } 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..b213f1deff 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,8 @@ 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 09, 2014 3012 dhladky Range the queries for metadata checks, adhoc firing prevention. + * Apr 22, 2014 2992 dhladky Added IdUtil for siteList * * * @author djohnson @@ -177,12 +179,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; @@ -293,7 +296,6 @@ public abstract class EdexBandwidthManager * @param subscription * The completed subscription. */ - @SuppressWarnings("unchecked") @Subscribe public void subscriptionFulfilled( SubscriptionRetrievalFulfilled subscriptionRetrievalFulfilled) { @@ -383,6 +385,7 @@ public abstract class EdexBandwidthManager Subscription sub = getRegistryObjectById(subscriptionHandler, re.getId()); sendSubscriptionNotificationEvent(re, sub); + } } @@ -401,7 +404,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: @@ -448,9 +451,9 @@ public abstract class EdexBandwidthManager + dsmd.getDataSetName() + "] to [rap_f]"); dsmd.setDataSetName("rap_f"); } - // TODO: End of hack.. BandwidthEventBus.publish(dsmd); + } else { statusHandler.error("No DataSetMetaData found for id [" + id + "]"); } @@ -490,6 +493,7 @@ public abstract class EdexBandwidthManager @Subscribe public void updateGriddedDataSetMetaData( GriddedDataSetMetaData dataSetMetaData) throws ParseException { + // Daily/Hourly/Monthly datasets if (dataSetMetaData.getCycle() == GriddedDataSetMetaData.NO_CYCLE) { updateDataSetMetaDataWithoutCycle((DataSetMetaData) dataSetMetaData); @@ -498,6 +502,7 @@ public abstract class EdexBandwidthManager else { updateDataSetMetaDataWithCycle((DataSetMetaData) dataSetMetaData); } + } /** @@ -665,19 +670,20 @@ public abstract class EdexBandwidthManager DataSetMetaData dataSetMetaData) throws ParseException { BandwidthDataSetUpdate dataset = bandwidthDao .newBandwidthDataSetUpdate(dataSetMetaData); - - // Looking for active subscriptions to the dataset. - List subscriptions = bandwidthDao - .getSubscriptionRetrievals(dataset.getProviderName(), - dataset.getDataSetName(), dataset.getDataSetBaseTime()); + + // Range the query for subscriptions within the baseReferenceTime hour. + // SOME models, RAP and RTMA, come not exactly on the hour. This causes these + // subscriptions to be missed because baseReferenceTimes are on the hour. + Map timeRange = getBaseReferenceTimeDateRange(dataset.getDataSetBaseTime()); + + final SortedSet subscriptions = bandwidthDao + .getSubscriptionRetrievals(dataset.getProviderName(), dataset.getDataSetName(), + RetrievalStatus.SCHEDULED, timeRange.get(MIN_RANGE_TIME), timeRange.get(MAX_RANGE_TIME)); if (!subscriptions.isEmpty()) { // Loop through the scheduled SubscriptionRetrievals and mark // the scheduled retrievals as ready for retrieval for (SubscriptionRetrieval retrieval : subscriptions) { - // TODO: Evaluate the state changes for receiving multiple - // dataset update messages. This seems to be happening - // quite a bit. if (RetrievalStatus.SCHEDULED.equals(retrieval.getStatus())) { // Need to update the Subscription Object in the @@ -721,14 +727,12 @@ public abstract class EdexBandwidthManager } } else { - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler - .debug("No Subscriptions scheduled for BandwidthDataSetUpdate [" - + dataset.getIdentifier() - + "] base time [" - + BandwidthUtil.format(dataset - .getDataSetBaseTime()) + "]"); - } + statusHandler + .debug("No Subscriptions scheduled for BandwidthDataSetUpdate [" + + dataset.getIdentifier() + + "] base time [" + + BandwidthUtil.format(dataset.getDataSetBaseTime()) + + "]"); } } @@ -798,7 +802,7 @@ public abstract class EdexBandwidthManager * reinitialize operation. */ private void bandwidthMapConfigurationUpdated() { - IBandwidthRequest request = new IBandwidthRequest(); + BandwidthRequest request = new BandwidthRequest(); request.setRequestType(RequestType.REINITIALIZE); try { @@ -865,7 +869,8 @@ public abstract class EdexBandwidthManager + plan.getPlanEnd().getTime()); statusHandler.info("MaintenanceTask: Update schedule"); } - // Find DEFERRED Allocations and load them into the plan... + // Find DEFERRED Allocations and load them into the + // plan... List deferred = bandwidthDao .getDeferred(plan.getNetwork(), plan.getPlanEnd()); if (!deferred.isEmpty()) { @@ -884,8 +889,11 @@ public abstract class EdexBandwidthManager + " Subscriptions processed."); } catch (Throwable t) { - statusHandler.error("MaintenanceTask: Subscription update scheduling has failed", t); + statusHandler + .error("MaintenanceTask: Subscription update scheduling has failed", + t); } } + } } 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..2e0917f7fa 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; /** * @@ -39,6 +39,7 @@ import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; * Feb 06, 2014 2636 bgonzale Use scheduling initialization method after registry init. * Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site. * Feb 14, 2014 2636 mpduff Clean up logging + * Apr 09, 2014 3012 dhladky Adhoc firing prevention. * * * @author djohnson @@ -60,7 +61,7 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer { */ public HibernateBandwidthInitializer( IFindSubscriptionsForScheduling findSubscriptionsStrategy) { - this(findSubscriptionsStrategy, DataDeliveryIdUtil.getId()); + this(findSubscriptionsStrategy, RegistryIdUtil.getId()); } /** @@ -102,19 +103,22 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer { @Override public void executeAfterRegistryInit() { try { + Map> subMap = findSubscriptionsStrategy .findSubscriptionsToSchedule(); List unscheduled = instance.initializeScheduling(subMap); if (!unscheduled.isEmpty()) { - StringBuilder sb = new StringBuilder("The following subscriptions could not be scheduled at startup: "); + StringBuilder sb = new StringBuilder( + "The following subscriptions could not be scheduled at startup: "); sb.append(StringUtil.NEWLINE); for (String subscription : unscheduled) { sb.append(subscription).append(" "); } statusHandler.handle(Priority.INFO, sb.toString()); } + } catch (Exception e) { statusHandler.error( "Failed to query for subscriptions to schedule", e); diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/processing/SimpleSubscriptionAggregator.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/processing/SimpleSubscriptionAggregator.java index 5d711b090f..6b63175e5f 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/processing/SimpleSubscriptionAggregator.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/processing/SimpleSubscriptionAggregator.java @@ -33,7 +33,6 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.SubscriptionRetrieval; import com.raytheon.uf.edex.datadelivery.bandwidth.interfaces.ISubscriptionAggregator; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalAgent; import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus; -import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalAgent; import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil; /** @@ -55,6 +54,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil; * Jul 11, 2013 2106 djohnson aggregate() signature changed. * Jan 06, 2014 2636 mpduff Changed how data set offset is set. * Jan 30, 2014 2686 dhladky refactor of retrieval. + * Apr 15, 2014 3012 dhladky help with confusing nomenclature. * * * @author jspinks @@ -87,6 +87,8 @@ public class SimpleSubscriptionAggregator implements ISubscriptionAggregator { // (i.e. has SubscriptionRetrievals associated with it) if // not, create a SubscriptionRetrieval for the subscription + // Do NOT confuse this with an actual SubscriptionRetrieval. + // This SubscriptionRetrieval object is a BandwidthAllocation object SubscriptionRetrieval subscriptionRetrieval = new SubscriptionRetrieval(); // Link this SubscriptionRetrieval with the subscription. subscriptionRetrieval.setBandwidthSubscription(subDao); diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java index dbaf01baeb..9f59583046 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthDaoUtil.java @@ -84,6 +84,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus; * active period. * Jan 29, 2014 2636 mpduff Scheduling refactor. * Feb 11, 2014 2636 mpduff Change how retrieval times are calculated. + * Apr 15, 2014 3012 dhladky Fixed improper offsets. * Apr 21, 2014 2887 dhladky Missed start/end in previous call, needs shouldScheduleForTime(); * * @@ -180,6 +181,7 @@ public class BandwidthDaoUtil { // based on plan start and subscription start. Calendar subscriptionCalculatedStart = subscription .calculateStart(planStart); + // end time when when subscription is last valid for scheduling based on // plan end and subscription end. Calendar subscriptionCalculatedEnd = subscription.calculateEnd(planEnd); @@ -201,55 +203,54 @@ public class BandwidthDaoUtil { Calendar start = TimeUtil.newGmtCalendar(subscriptionCalculatedStart .getTime()); - int availabilityOffset = 0; - try { - availabilityOffset = BandwidthUtil.getDataSetAvailablityOffset( - subscription, start); - } catch (RegistryHandlerException e) { - // Error occurred querying the registry. Log and continue on - statusHandler - .handle(Priority.PROBLEM, - "Unable to retrieve data availability offset, using 0 for the offset.", - e); - } - while (!start.after(subscriptionCalculatedEnd)) { - if (!hours.isEmpty()) { - for (Integer cycle : hours) { - start.set(Calendar.HOUR_OF_DAY, cycle); - for (Integer minute : minutes) { - start.set(Calendar.MINUTE, minute); - Calendar retrievalTime = TimeUtil.newGmtCalendar(); - retrievalTime.setTimeInMillis(start.getTimeInMillis()); - retrievalTime.add(Calendar.MINUTE, availabilityOffset); + for (Integer cycle : hours) { + start.set(Calendar.HOUR_OF_DAY, cycle); - if (retrievalTime.after(planStart) - && retrievalTime.before(planEnd)) { - // Check for nonsense - /* - * Fine grain check by hour and minute, for - * subscription(start/end), activePeriod(start/end) - */ - - // TODO: IMPORTANT NOTE: WHEN 14.2.1 MERGES IN. THIS NEEDS - // TO CHECK AGAINST THE OFFSET BASE REFTIME, THE BASE REFTIME - // WILL BE WHAT IS ADDED IF THE CHECK IS TRUE. DO NOT BLINDLY - // MERGE 14.2.1's CODE OVER THIS. - if (!subscription - .shouldScheduleForTime(retrievalTime)) { - // don't schedule this retrieval time, - // outside subscription window - continue; - } - subscriptionTimes.add(retrievalTime); - } - } + // calculate the offset, every hour + int availabilityOffset = 0; + try { + availabilityOffset = BandwidthUtil + .getDataSetAvailablityOffset(subscription, start); + } catch (RegistryHandlerException e) { + // Error occurred querying the registry. Log and continue on + statusHandler + .handle(Priority.PROBLEM, + "Unable to retrieve data availability offset, using 0 for the offset.", + e); } - // Start the next day.. - start.add(Calendar.DAY_OF_YEAR, 1); - start.set(Calendar.HOUR_OF_DAY, hours.first()); + for (Integer minute : minutes) { + + start.set(Calendar.MINUTE, minute); + Calendar baseRefTime = TimeUtil.newGmtCalendar(); + baseRefTime.setTimeInMillis(start.getTimeInMillis()); + + // add the offset and check if it falls within window + Calendar offsetBaseRefTime = TimeUtil + .newGmtCalendar(baseRefTime.getTime()); + offsetBaseRefTime.add(Calendar.MINUTE, availabilityOffset); + + if (offsetBaseRefTime.after(planStart) + && offsetBaseRefTime.before(planEnd)) { + /* + * Fine grain check by hour and minute, for + * subscription(start/end), activePeriod(start/end) + */ + + if (!subscription.shouldScheduleForTime(baseRefTime)) { + // don't schedule this retrieval time, + // outside subscription window + continue; + } + subscriptionTimes.add(baseRefTime); + } + } } + + // Start the next day.. + start.add(Calendar.DAY_OF_YEAR, 1); + start.set(Calendar.HOUR_OF_DAY, hours.first()); } return subscriptionTimes; diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthUtil.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthUtil.java index 236a5d438d..c7d40a7e8f 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.bandwidth/src/com/raytheon/uf/edex/datadelivery/bandwidth/util/BandwidthUtil.java @@ -33,6 +33,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.BandwidthSubscription; * 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. + * Apr 09, 2014 3012 dhladky GMT Calendar use. * * * @@ -191,7 +192,7 @@ public class BandwidthUtil { dao.setDataSetName(dataSetMetaData.getDataSetName()); dao.setProviderName(dataSetMetaData.getProviderName()); dao.setUpdateTime(BandwidthUtil.now()); - dao.setDataSetBaseTime(TimeUtil.newCalendar(dataSetMetaData.getDate())); + dao.setDataSetBaseTime(TimeUtil.newGmtCalendar(dataSetMetaData.getDate())); dao.setUrl(dataSetMetaData.getUrl()); return dao; 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"/> - - - + + + - + - - - + + - - - - - - - - - - - - - java.lang.Throwable - - - - - - - + + - - + + @@ -59,4 +41,31 @@ + + + + + + + + + + + + + + + + + + + java.lang.Throwable + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/resources/com.raytheon.uf.edex.datadelivery.harvester.properties b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/resources/com.raytheon.uf.edex.datadelivery.harvester.properties index c736f3e0a7..5baece9e42 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/resources/com.raytheon.uf.edex.datadelivery.harvester.properties +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/resources/com.raytheon.uf.edex.datadelivery.harvester.properties @@ -2,6 +2,6 @@ metadata-process.cron=0+*+*+*+*+? # The cron pattern for how often the DataSetMetaDataPurgeLauncher will run, e.g. # how often to check for purgeable dataset metadata instances -metadata-purge.cron=0+0+3+*+*+? +metadata-purge.cron=0+0+8+*+*+? # how many meta data process threads to use to process metadata metadata-process.threads=2 diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeLauncher.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeLauncher.java index 4033797805..4aeb30ada9 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeLauncher.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeLauncher.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; /** * Container class to hold the {@link IDataSetMetaDataPurgeTask} instance. It @@ -36,28 +37,32 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 4, 2012 1102 djohnson Initial creation + * Apr 12,2014 3012 dhladky Purge never worked, fixed to make work. * * * * @author djohnson * @version 1.0 */ -public final class DataSetMetaDataPurgeLauncher { +public class DataSetMetaDataPurgeLauncher { + private static final IUFStatusHandler statusHandler = UFStatus .getHandler(DataSetMetaDataPurgeLauncher.class); - private static final DataSetMetaDataPurgeLauncher INSTANCE = new DataSetMetaDataPurgeLauncher(); - - private static final IDataSetMetaDataPurgeTask PURGE_TASK = new DataSetMetaDataPurgeTaskImpl(); + private IDataSetMetaDataPurgeTask PURGE_TASK = null; private static final AtomicBoolean running = new AtomicBoolean(); /** - * Disabled constructor. + * Public constructor. */ - private DataSetMetaDataPurgeLauncher() { + public DataSetMetaDataPurgeLauncher(RegistryObjectDao rdo) { + PURGE_TASK = new DataSetMetaDataPurgeTaskImpl(rdo); } + /** + * Try purging datasets. + */ public void runPurge() { try { if (running.compareAndSet(false, true)) { @@ -70,11 +75,4 @@ public final class DataSetMetaDataPurgeLauncher { running.set(false); } } - - /** - * @return the instance - */ - public static DataSetMetaDataPurgeLauncher getInstance() { - return INSTANCE; - } } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeTaskImpl.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeTaskImpl.java index 0631652ebf..4cdfdca25a 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeTaskImpl.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/DataSetMetaDataPurgeTaskImpl.java @@ -22,33 +22,29 @@ package com.raytheon.uf.edex.datadelivery.harvester.purge; import static com.google.common.base.Preconditions.checkNotNull; import java.util.ArrayList; -import java.util.Collection; +import java.util.Calendar; import java.util.Collections; -import java.util.Iterator; +import java.util.HashMap; import java.util.List; -import java.util.SortedSet; +import java.util.Map; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.Multimap; -import com.google.common.collect.Ordering; -import com.google.common.collect.TreeMultimap; import com.raytheon.uf.common.datadelivery.harvester.Agent; import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent; import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig; +import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfigurationManager; +import com.raytheon.uf.common.datadelivery.registry.DataDeliveryRegistryObjectTypes; import com.raytheon.uf.common.datadelivery.registry.DataSetMetaData; -import com.raytheon.uf.common.datadelivery.registry.IDataSetMetaDataVisitor; -import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSetMetaData; import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers; import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.registry.ebxml.RegistryUtil; import com.raytheon.uf.common.registry.handler.RegistryHandlerException; -import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.edex.datadelivery.harvester.crawler.CrawlLauncher; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; /** * Purges {@link DataSetMetaData} instances that are no longer accessible on @@ -66,50 +62,22 @@ import com.raytheon.uf.edex.datadelivery.harvester.crawler.CrawlLauncher; * Oct 05, 2012 1241 djohnson Replace RegistryManager calls with registry handler calls. * Dec 12, 2012 1410 dhladky multi provider configurations. * Sept 30, 2013 1797 dhladky Generics + * Apr 12,2014 3012 dhladky Purge never worked, fixed to make work. * * * * @author djohnson * @version 1.0 */ -class DataSetMetaDataPurgeTaskImpl implements IDataSetMetaDataPurgeTask, - IDataSetMetaDataVisitor { - - /** - * Maintains state for an instance of the purge task. - */ - private static class State { - /** - * This boolean flag is used to mark whether or not the DataSetMetaData - * group should be continued, it will be set to false when the purge has - * found a DataSetMetaData instance that should NOT be purged - */ - private boolean continueWithDataSet = true; - - /** - * The harvester configurations instance at the time the purge started. - */ - private List harvesterConfigs; - } +public class DataSetMetaDataPurgeTaskImpl implements IDataSetMetaDataPurgeTask { private static final IUFStatusHandler statusHandler = UFStatus .getHandler(DataSetMetaDataPurgeTaskImpl.class); - private static final IOpenDapGriddedPurge GRIDDED_OPENDAP = new OpenDapGriddedPurgeImpl(); - - /** - * This is the unique identifying key for this metadata's dataset in the - * map. - * - * @param metaData - * the metaDat - * @return the key - */ - @VisibleForTesting - static String getDatasetMetaDataMapKey(DataSetMetaData metaData) { - return metaData.getDataSetName() + metaData.getProviderName(); - } + /** Data access object for registry objects */ + private RegistryObjectDao rdo; + /** * Purges a {@link DataSetMetaData} instance. * @@ -133,83 +101,40 @@ class DataSetMetaDataPurgeTaskImpl implements IDataSetMetaDataPurgeTask, } } - private final IOpenDapGriddedPurge openDapGriddedPurge; - - // Used to maintain state on a per-thread basis, in case two purges somehow - // overrun each other - private final ThreadLocal threadState = new ThreadLocal(); - /** * Default Constructor. */ - DataSetMetaDataPurgeTaskImpl() { - this(GRIDDED_OPENDAP); + public DataSetMetaDataPurgeTaskImpl(RegistryObjectDao rdo) { + this.rdo = rdo; } - + /** - * Constructor accepting specific purge strategies. - * - * @param openDapGriddedPurge - * openDapGriddedPurge - * - */ - @VisibleForTesting - DataSetMetaDataPurgeTaskImpl(IOpenDapGriddedPurge openDapGriddedPurge) { - this.openDapGriddedPurge = openDapGriddedPurge; - } - - /** - * Clears the state for a running instance. - */ - private void clearState() { - threadState.set(null); - } - - /** - * Returns all {@link DataSetMetaData} instances that are to be checked for - * validity. - * - * @return the {@link DataSetMetaData} instances - */ - @SuppressWarnings("rawtypes") - @VisibleForTesting - List getDataSetMetaDatas() { - try { - return DataDeliveryHandlers.getDataSetMetaDataHandler().getAll(); - } catch (RegistryHandlerException e) { - statusHandler.handle(Priority.PROBLEM, - "Unable to retrieve DataSetMetaData instances!", e); - return Collections.emptyList(); - } - } - - /** - * Creates a map from the DataSetMetaData key as defined by - * {@link #getDatasetMetaDataMapKey(DataSetMetaData)} to the - * {@link SortedSet} of instances. + * Gets the entire list of DSMD ids from the registry. * * @return the map */ @VisibleForTesting - Multimap> getDataSetNameKeyedInstanceMap() { - Multimap> map = TreeMultimap.create( - Ordering. natural(), DataSetMetaData.DATE_COMPARATOR); - - for (DataSetMetaData metaData : getDataSetMetaDatas()) { - String key = getDatasetMetaDataMapKey(metaData); - map.put(key, metaData); + List getDataSetMetaDataIds() { + ArrayList ids = null; + try { + // Gets the list of all available lids for current DataSetMetaData objects + ids = (ArrayList) rdo.getRegistryObjectIdsOfType(DataDeliveryRegistryObjectTypes.DATASETMETADATA); + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + "Unable to retrieve DataSetMetaData ids!", e); + return Collections.emptyList(); } - return map; + return ids; } /** - * Returns the HarvesterConfig Array from localization. + * Returns the Retention times by Provider name. * * @return the {@link HarvesterConfig} */ @VisibleForTesting - List getHarvesterConfigs() { + static Map getHarvesterConfigs() { // first get the Localization directory and find all harvester // configs @@ -220,8 +145,7 @@ class DataSetMetaDataPurgeTaskImpl implements IDataSetMetaDataPurgeTask, HarvesterConfig hc = null; try { - hc = SerializationUtil.jaxbUnmarshalFromXmlFile( - HarvesterConfig.class, lf.getFile()); + hc = HarvesterConfigurationManager.getHarvesterFile(lf.getFile()); } catch (Exception se) { statusHandler.handle(Priority.PROBLEM, se.getLocalizedMessage(), se); @@ -238,102 +162,78 @@ class DataSetMetaDataPurgeTaskImpl implements IDataSetMetaDataPurgeTask, } } } + + Map configMap = null; - return configs; - } - - /** - * This method consolidates the logic of applying a purge strategy for a - * specific data type and service (e.g. OpenDAP for Gridded data) on a - * specific {@link DataSetMetaData} of that type. The generics ensure strict - * adherence to the data type mappings. - * - * @param - * the type that extends DataSetMetaData - * @param metaData - * the metadata instance - * @param purge - * the purge strategy - */ - private > void handleVisit(T metaData, - IServiceDataSetMetaDataPurge purge) { - State state = threadState.get(); - List harvesterConfigs = state.harvesterConfigs; - - for (HarvesterConfig config : harvesterConfigs) { - - if (purge.isTimeToPurge(metaData, config)) { - purgeMetaData(metaData); - } else { - // Found a non-purgeable metadata instance - state.continueWithDataSet = false; - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - final String id = RegistryUtil - .getRegistryObjectKey(metaData); - statusHandler - .debug(String - .format("Provider: " - + config.getProvider().getName() - + " : DataSetMetaData with id [%s] does not require purging.", - id)); - } + if (!configs.isEmpty()) { + configMap = new HashMap( + configs.size()); + for (HarvesterConfig config : configs) { + configMap.put(config.getProvider().getName(), config.getRetention()); } + } else { + return Collections.emptyMap(); } + + return configMap; } - - /** - * Initializes the state for a running instance. - * - * @return the State instance - */ - @VisibleForTesting - State initializeState() { - State state = new State(); - state.harvesterConfigs = getHarvesterConfigs(); - threadState.set(state); - - return state; - } - + /** * {@inheritDoc} */ @Override public void run() { + ITimer timer = TimeUtil.getTimer(); timer.start(); - Multimap> dataSetKeyedMap = getDataSetNameKeyedInstanceMap(); + List idList = getDataSetMetaDataIds(); + Map configMap = getHarvesterConfigs(); + int deletes = 0; + + for (String id : idList) { - try { - State state = initializeState(); + try { - for (String key : dataSetKeyedMap.keySet()) { - Collection> metaDatas = dataSetKeyedMap - .get(key); - Iterator> iter = metaDatas.iterator(); + DataSetMetaData metaData = DataDeliveryHandlers + .getDataSetMetaDataHandler().getById(id); + Integer retention = Integer.valueOf(configMap.get(metaData.getProviderName())); - state.continueWithDataSet = true; - while (iter.hasNext() && state.continueWithDataSet) { - DataSetMetaData metaData = iter.next(); - metaData.accept(this); + if (retention != null) { + + if (retention == -1) { + // no purging for this DSMD type + continue; + } else { + // retention is in days + retention = retention * (-1); + // we are subtracting from current + Calendar thresholdTime = TimeUtil.newGmtCalendar(); + thresholdTime.add(Calendar.DAY_OF_YEAR, retention); + + if (thresholdTime.getTimeInMillis() >= metaData + .getDate().getTime()) { + purgeMetaData(metaData); + deletes++; + } + } + + } else { + statusHandler + .warn("No retention time set for this DataSetMetaData provider! " + + id + + "Provider: " + + metaData.getProviderName()); } + + } catch (Exception e) { + statusHandler.error("DataSetMetaData purge failed! " + id, e); } - } finally { - clearState(); } timer.stop(); statusHandler.info(String.format( "DataSetMetaData purge completed in %s ms.", - timer.getElapsedTime())); - } - - /** - * {@inheritDoc} - */ - @Override - public void visit(OpenDapGriddedDataSetMetaData metaData) { - handleVisit(metaData, openDapGriddedPurge); + timer.getElapsedTime()+" deleted: "+deletes)); } } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IDataSetMetaDataPurgeTask.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IDataSetMetaDataPurgeTask.java index ef2660feaa..b155dd9667 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IDataSetMetaDataPurgeTask.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IDataSetMetaDataPurgeTask.java @@ -16,7 +16,9 @@ * * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. - **/ +*/ + + package com.raytheon.uf.edex.datadelivery.harvester.purge; import com.raytheon.uf.common.datadelivery.registry.DataSetMetaData; diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IOpenDapGriddedPurge.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IOpenDapGriddedPurge.java deleted file mode 100644 index fbb45e11eb..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IOpenDapGriddedPurge.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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. - **/ -package com.raytheon.uf.edex.datadelivery.harvester.purge; - -import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSetMetaData; - -/** - * Marker interface for the gridded OpenDAP purge strategy. Intentionally - * package-level as it's an internal implementation detail that should only - * reside and be accessible within this package. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Sep 4, 2012  1102       djohnson     Initial creation
- * 
- * 
- * - * @author djohnson - * @version 1.0 - */ -interface IOpenDapGriddedPurge extends - IServiceDataSetMetaDataPurge { -} diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IServiceDataSetMetaDataPurge.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IServiceDataSetMetaDataPurge.java deleted file mode 100644 index 7e8aef5e52..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/IServiceDataSetMetaDataPurge.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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. - **/ -package com.raytheon.uf.edex.datadelivery.harvester.purge; - -import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig; -import com.raytheon.uf.common.datadelivery.registry.DataSetMetaData; - -/** - * Defines a purge for a {@link DataSetMetaData} type. Intentionally - * package-level as it's an internal implementation detail that should only - * reside and be accessible within this package. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Sep 4, 2012  1102      djohnson     Initial creation
- * 
- * 
- * - * @author djohnson - * @version 1.0 - */ - -interface IServiceDataSetMetaDataPurge { - - /** - * Perform the purge of a {@link DataSetMetaData} instance if required. - * - * @param metaData - * the metaData - * @param harvesterConfig TODO - * @return - */ - boolean isTimeToPurge(T metaData, HarvesterConfig harvesterConfig); -} diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/OpenDapGriddedPurgeImpl.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/OpenDapGriddedPurgeImpl.java deleted file mode 100644 index ac5f9cd53a..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/purge/OpenDapGriddedPurgeImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/** - * 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. - **/ -package com.raytheon.uf.edex.datadelivery.harvester.purge; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.http.HttpHost; -import org.apache.http.HttpResponse; -import org.apache.http.HttpStatus; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.conn.params.ConnRoutePNames; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; - -import com.google.common.annotations.VisibleForTesting; -import com.raytheon.uf.common.comm.ProxyConfiguration; -import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig; -import com.raytheon.uf.common.datadelivery.registry.DataSetMetaData; -import com.raytheon.uf.common.datadelivery.registry.OpenDapGriddedDataSetMetaData; -import com.raytheon.uf.common.datadelivery.registry.Provider; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.edex.datadelivery.retrieval.util.ConnectionUtil; - -/** - * Purges {@link OpenDapGriddedDataSetMetaData} instances that are no longer - * retrievable. Intentionally package-private as it should not be part of the - * public API. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Sep 4, 2012  1102      djohnson     Initial creation
- * 
- * 
- * - * @author djohnson - * @version 1.0 - */ -class OpenDapGriddedPurgeImpl implements IOpenDapGriddedPurge { - - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(OpenDapGriddedPurgeImpl.class); - - /** - * Retrieves the error response pattern from the provider for the specified - * metadata instance. - * - * @param metaData - * the metadata - * @param harvesterConfig - * the harvester configuration - * @return the pattern or null if the applicable provider cannot be found - */ - private static Pattern getProviderErrorResponsePattern( - DataSetMetaData metaData, HarvesterConfig harvesterConfig) { - - Provider provider = harvesterConfig.getProvider(); - final String providerName = provider.getName(); - final String metadataProviderName = metaData.getProviderName(); - - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler.debug("Checking provider [" + providerName - + "] to match metadata provider name [" - + metadataProviderName + "]."); - } - - if (metadataProviderName.equals(providerName)) { - return Pattern.compile(provider.getErrorResponsePattern()); - } - - return null; - } - - /** - * Retrieves the HttpClient implementation to use. - * - * @return the {@link HttpClient} implementation - */ - @VisibleForTesting - HttpClient getHttpClient() { - HttpClient httpClient = new DefaultHttpClient(); - ProxyConfiguration proxyParameters = ConnectionUtil - .getProxyParameters(); - if (proxyParameters != null) { - HttpHost proxy = new HttpHost(proxyParameters.getHost(), - proxyParameters.getPort()); - httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, - proxy); - } - return httpClient; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isTimeToPurge(OpenDapGriddedDataSetMetaData metaData, - HarvesterConfig harvesterConfig) { - HttpGet request = new HttpGet(); - HttpResponse response = null; - try { - final String url = metaData.getUrl(); - request.setURI(new URI(url)); - - HttpClient httpClient = getHttpClient(); - - response = httpClient.execute(request); - int code = response.getStatusLine().getStatusCode(); - - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler.debug(String.format( - "Received status code [%s] from url [%s]", code, url)); - } - - if (code == HttpStatus.SC_OK) { - String entityContent = EntityUtils.toString(response - .getEntity()); - Pattern providerErrorResponsePattern = getProviderErrorResponsePattern( - metaData, harvesterConfig); - if (providerErrorResponsePattern != null) { - Matcher matcher = providerErrorResponsePattern - .matcher(entityContent); - if (matcher.find()) { - return true; - } - } else { - statusHandler - .warn(String - .format("Unable to find a configured provider by name [%s], removing obsolete DataSetMetaData.", - metaData.getProviderName())); - } - } - return false; - } catch (URISyntaxException e) { - statusHandler - .handle(Priority.PROBLEM, - "Unable to parse URL into a URI, purging metadata since it would otherwise remain unusable!", - e); - return true; - } catch (IOException e) { - statusHandler - .handle(Priority.PROBLEM, - "Unable to contact the host, not purging metadata since it may still be valid!", - e); - request.abort(); - return false; - } finally { - if (response != null) { - try { - EntityUtils.consume(response.getEntity()); - } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - } - } - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/META-INF/MANIFEST.MF index 402df74a9a..67f14aed98 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/META-INF/MANIFEST.MF @@ -27,4 +27,3 @@ Export-Package: com.raytheon.uf.edex.datadelivery.registry.availability, com.raytheon.uf.edex.datadelivery.registry.federation, com.raytheon.uf.edex.datadelivery.registry.replication, com.raytheon.uf.edex.datadelivery.registry.web -Import-Package: com.raytheon.uf.edex.datadelivery.util diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/FederationProperties.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/FederationProperties.java index c5ddfc87ba..3c802281f2 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/FederationProperties.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/FederationProperties.java @@ -38,7 +38,7 @@ import com.raytheon.uf.common.registry.constants.AssociationTypes; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.constants.StatusTypes; import com.raytheon.uf.common.registry.ebxml.RegistryUtil; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * @@ -187,14 +187,14 @@ public class FederationProperties { */ public RegistryType createRegistryObject() { RegistryType registryObj = new RegistryType(); - registryObj.setId(DataDeliveryIdUtil.getId() + REGISTRY_SUFFIX); + registryObj.setId(RegistryIdUtil.getId() + REGISTRY_SUFFIX); registryObj.setLid(registryObj.getId()); registryObj.setName(RegistryUtil - .getInternationalString(DataDeliveryIdUtil.getId() + .getInternationalString(RegistryIdUtil.getId() + " Registry Specification")); registryObj.setObjectType(RegistryObjectTypes.REGISTRY); registryObj.setDescription(registryObj.getName()); - registryObj.setOwner(DataDeliveryIdUtil.getId()); + registryObj.setOwner(RegistryIdUtil.getId()); registryObj.setStatus(StatusTypes.APPROVED); registryObj.setCatalogingLatency(catalogingLatency); registryObj.setConformanceProfile(conformanceProfile); @@ -218,13 +218,13 @@ public class FederationProperties { phone.setNumber(sitePrimaryContactPhoneNumber); PersonType person = new PersonType(); - person.setId(DataDeliveryIdUtil.getId() + " Primary Contact"); + person.setId(RegistryIdUtil.getId() + " Primary Contact"); person.setLid(person.getId()); person.setName(RegistryUtil.getInternationalString(person.getId())); person.setDescription(person.getName()); person.setStatus(StatusTypes.APPROVED); person.setObjectType(RegistryObjectTypes.PERSON); - person.setOwner(DataDeliveryIdUtil.getId()); + person.setOwner(RegistryIdUtil.getId()); PersonNameType personName = new PersonNameType(); personName.setFirstName(sitePrimaryContactFirstName); personName.setMiddleName(sitePrimaryContactMiddleName); @@ -243,16 +243,16 @@ public class FederationProperties { */ public OrganizationType createOrganization() { OrganizationType org = new OrganizationType(); - org.setPrimaryContact(DataDeliveryIdUtil.getId() + " Primary Contact"); - org.setId(DataDeliveryIdUtil.getId()); + org.setPrimaryContact(RegistryIdUtil.getId() + " Primary Contact"); + org.setId(RegistryIdUtil.getId()); org.setLid(org.getId()); org.setName(RegistryUtil .getInternationalString("National Weather Service Office: " - + DataDeliveryIdUtil.getId())); + + RegistryIdUtil.getId())); org.setDescription(org.getName()); org.setStatus(StatusTypes.APPROVED); org.setObjectType(RegistryObjectTypes.ORGANIZATION); - org.setOwner(DataDeliveryIdUtil.getId()); + org.setOwner(RegistryIdUtil.getId()); TelephoneNumberType phone = new TelephoneNumberType(); phone.setAreaCode(sitePhoneAreaCode); phone.setNumber(sitePhoneNumber); @@ -285,7 +285,7 @@ public class FederationProperties { + " Federation Membership Association"); association.setLid(association.getId()); association.setObjectType(RegistryObjectTypes.ASSOCIATION); - association.setOwner(DataDeliveryIdUtil.getId()); + association.setOwner(RegistryIdUtil.getId()); association.setType(AssociationTypes.HAS_FEDERATION_MEMBER); association.setStatus(StatusTypes.APPROVED); association.setName(RegistryUtil.getInternationalString(registry diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java index 668d2f01b7..7a4021af70 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java @@ -95,18 +95,20 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.CollectionUtil; import com.raytheon.uf.common.util.StringUtil; +import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.datadelivery.registry.availability.FederatedRegistryMonitor; import com.raytheon.uf.edex.datadelivery.registry.dao.ReplicationEventDao; import com.raytheon.uf.edex.datadelivery.registry.replication.NotificationServers; import com.raytheon.uf.edex.datadelivery.registry.web.DataDeliveryRESTServices; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; import com.raytheon.uf.edex.registry.ebxml.dao.DbInit; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryDao; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.exception.NoReplicationServersAvailableException; import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener; import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; import com.raytheon.uf.edex.registry.events.CreateAuditTrailEvent; @@ -154,6 +156,7 @@ import com.raytheon.uf.edex.registry.events.CreateAuditTrailEvent; * 2/13/2014 2769 bphillip Refactored registry sync. Created quartz tasks to monitor registry uptime as well as subscription integrity * Mar 31, 2014 2889 dhladky Added username for notification center tracking. * 4/11/2014 3011 bphillip Removed automatic registry sync check on startup + * 4/15/2014 3012 dhladky Merge fixes. * * * @author bphillip @@ -173,7 +176,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, /** Query used for synchronizing registries */ private static final String SYNC_QUERY = "FROM RegistryObjectType obj where obj.id in (%s) order by obj.id asc"; - + /** Batch size for registry synchronization queries */ private static final int SYNC_BATCH_SIZE = Integer.parseInt(System .getProperty("ebxml-notification-batch-size")); @@ -202,14 +205,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, */ private static final long MAX_DOWN_TIME_DURATION = TimeUtil.MILLIS_PER_HOUR * 48; - private static final String SYNC_WARNING_MSG = "Registry is out of sync with federation. Registry Synchronization required. Go to: [" - + RegistryUtil.LOCAL_REGISTRY_ADDRESS - + "/registry/federation/status.html] to synchronize."; - - private static volatile boolean SYNC_NECESSARY = false; - - public static AtomicBoolean SYNC_IN_PROGRESS = new AtomicBoolean( - false); + public static AtomicBoolean SYNC_IN_PROGRESS = new AtomicBoolean(false); /** Cutoff parameter for the query to get the expired events */ private static final String GET_EXPIRED_EVENTS_QUERY_CUTOFF_PARAMETER = "cutoff"; @@ -327,9 +323,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, throw new EbxmlRegistryException( "Error joining federation!!"); } - if (!centralRegistry) { - checkDownTime(); - } + } catch (Exception e1) { throw new EbxmlRegistryException( "Error initializing RegistryReplicationManager", e1); @@ -351,29 +345,6 @@ public class RegistryFederationManager implements IRegistryFederationManager, initialized.set(true); } - /** - * Checks how long a registry has been down. If the registry has been down - * longer than the MAX_DOWN_TIME_DURATION, then a sync is necessary - * - * @see RegistryFederationManager.MAX_DOWN_TIME_DURATION - * @throws Exception - */ - private void checkDownTime() throws Exception { - long currentTime = TimeUtil.currentTimeMillis(); - long lastKnownUp = federatedRegistryMonitor.getLastKnownUptime(); - long downTime = currentTime - lastKnownUp; - statusHandler.info("Registry has been down since: " - + new Date(currentTime - downTime)); - /* - * The registry has been down for ~2 days, this requires a - * synchronization of the data from the federation - */ - if (currentTime - lastKnownUp > MAX_DOWN_TIME_DURATION) { - SYNC_NECESSARY = true; - sendSyncMessage(); - } - } - public boolean joinFederation() { try { final List objects = new ArrayList( @@ -411,7 +382,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, submitObjectsRequest .getSlot() .add(new SlotType(EbxmlObjectUtil.EVENT_SOURCE_SLOT, - new StringValueType(DataDeliveryIdUtil.getId()))); + new StringValueType(RegistryIdUtil.getId()))); try { statusHandler .info("Submitting federation registration objects to local registry..."); @@ -510,6 +481,62 @@ public class RegistryFederationManager implements IRegistryFederationManager, return true; } + /** + * Checks how long a registry has been down. If the registry has been down + * for over 2 days, the registry is synchronized with one of the federation + * members + * + * @throws Exception + */ + private void synchronize() throws EbxmlRegistryException { + + monitorHandler.warn("Synchronizing registry with federation..."); + RegistryType registryToSyncFrom = null; + for (String remoteRegistryId : servers.getRegistryReplicationServers()) { + statusHandler.info("Checking availability of [" + remoteRegistryId + + "]..."); + RegistryType remoteRegistry = null; + try { + remoteRegistry = dataDeliveryRestClient.getRegistryObject( + ncfAddress, remoteRegistryId + + FederationProperties.REGISTRY_SUFFIX); + } catch (Exception e) { + throw new EbxmlRegistryException( + "Error getting remote registry object!", e); + } + if (remoteRegistry == null) { + statusHandler + .warn("Registry at [" + + remoteRegistryId + + "] not found in federation. Unable to use as synchronization source."); + } else if (dataDeliveryRestClient + .isRegistryAvailable(remoteRegistry.getBaseURL())) { + registryToSyncFrom = remoteRegistry; + break; + } else { + statusHandler + .info("Registry at [" + + remoteRegistryId + + "] is not available. Unable to use as synchronization source."); + } + } + + // No available registry was found! + if (registryToSyncFrom == null) { + throw new NoReplicationServersAvailableException( + "No available registries found! Registry data will not be synchronized with the federation!"); + } else { + try { + synchronizeWithRegistry(registryToSyncFrom.getId()); + } catch (Exception e) { + throw new EbxmlRegistryException( + "Error synchronizing with registry [" + + registryToSyncFrom.getId() + "]", e); + } + } + + } + /** * Synchronizes this registry's data with the registry at the specified URL * @@ -524,6 +551,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, @Path("synchronizeWithRegistry/{registryId}") public void synchronizeWithRegistry(@PathParam("registryId") String registryId) throws Exception { + if (SYNC_IN_PROGRESS.compareAndSet(false, true)) { try { monitorHandler.handle(Priority.WARN, @@ -552,7 +580,6 @@ public class RegistryFederationManager implements IRegistryFederationManager, for (final String objectType : replicatedObjectTypes) { syncObjectType(objectType, remoteRegistryUrl); } - SYNC_NECESSARY = false; federatedRegistryMonitor.updateTime(); StringBuilder syncMsg = new StringBuilder(); @@ -566,6 +593,10 @@ public class RegistryFederationManager implements IRegistryFederationManager, } finally { SYNC_IN_PROGRESS.set(false); } + + } else { + statusHandler.info("Registry sync already in progress."); + } } @@ -612,8 +643,9 @@ public class RegistryFederationManager implements IRegistryFederationManager, int remainder = remoteIds.size() % SYNC_BATCH_SIZE; for (int currentBatch = 0; currentBatch < batches; currentBatch++) { - statusHandler.info("Processing batch " + (currentBatch + 1) - + "/" + batches); + + statusHandler.info("Processing batch "+(currentBatch+1)+"/"+batches); + persistBatch(objectType, remoteRegistryUrl, remoteIds.subList( currentBatch * SYNC_BATCH_SIZE, (currentBatch + 1) * SYNC_BATCH_SIZE)); @@ -670,12 +702,6 @@ public class RegistryFederationManager implements IRegistryFederationManager, } } - private void sendSyncMessage() { - if (!SYNC_IN_PROGRESS.get()) { - statusHandler.warn(SYNC_WARNING_MSG); - monitorHandler.handle(Priority.WARN, SYNC_WARNING_MSG); - } - } @GET @Path("isFederated") @@ -687,7 +713,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, @GET @Path("dataDeliveryId") public String dataDeliveryId() { - return DataDeliveryIdUtil.getId(); + return RegistryIdUtil.getId(); } @GET @@ -747,7 +773,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, + registry.getId() + "]", e); continue; } - if (remoteReplicatingTo.contains(DataDeliveryIdUtil.getId())) { + if (remoteReplicatingTo.contains(RegistryIdUtil.getId())) { registrySet.add(registry.getId().replace( FederationProperties.REGISTRY_SUFFIX, "")); } @@ -765,7 +791,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, RegistryType remoteRegistry = getRegistry(registryId); dataDeliveryRestClient.getRegistryFederationManager( remoteRegistry.getBaseURL()).addReplicationServer( - DataDeliveryIdUtil.getId()); + RegistryIdUtil.getId()); statusHandler.info("Established replication with [" + registryId + "]"); } @@ -779,7 +805,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, RegistryType remoteRegistry = getRegistry(registryId); dataDeliveryRestClient.getRegistryFederationManager( remoteRegistry.getBaseURL()).removeReplicationServer( - DataDeliveryIdUtil.getId()); + RegistryIdUtil.getId()); statusHandler .info("Disconnected replication with [" + registryId + "]"); } @@ -1044,7 +1070,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, request.setUsername(RegistryUtil.registryUser); request.getSlot().add( new SlotType(EbxmlObjectUtil.EVENT_SOURCE_SLOT, - new StringValueType(DataDeliveryIdUtil + new StringValueType(RegistryIdUtil .getId()))); try { if (!request.getRegistryObjects().isEmpty()) { @@ -1068,7 +1094,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, refList, false, true, DeletionScope.DELETE_ALL); request.getSlot().add( new SlotType(EbxmlObjectUtil.EVENT_SOURCE_SLOT, - new StringValueType(DataDeliveryIdUtil + new StringValueType(RegistryIdUtil .getId()))); try { if (!refList.getObjectRef().isEmpty()) { @@ -1096,15 +1122,35 @@ public class RegistryFederationManager implements IRegistryFederationManager, * Updates the record in the registry that keeps track of if this registry * has been up. This method is called every minute via a quartz cron * configured in Camel + * + * @throws EbxmlRegistryException */ @Transactional - public void updateUpTime() { - if (initialized.get()) { - if (SYNC_NECESSARY) { - if (!SYNC_IN_PROGRESS.get() - && TimeUtil.newGmtCalendar().get(Calendar.MINUTE) % 15 == 0) { - sendSyncMessage(); + public void updateUpTime() throws EbxmlRegistryException { + if (initialized.get() && EDEXUtil.isRunning()) { + long currentTime = TimeUtil.currentTimeMillis(); + long lastKnownUp = federatedRegistryMonitor.getLastKnownUptime(); + long downTime = currentTime - lastKnownUp; + if (currentTime - lastKnownUp > MAX_DOWN_TIME_DURATION + && !centralRegistry) { + if (!SYNC_IN_PROGRESS.get()) { + statusHandler.info("Registry has been down since: " + + new Date(currentTime - downTime)); + statusHandler + .warn("Registry is out of sync with federation. Attempting to automatically synchronize"); + try { + synchronize(); + monitorHandler + .info("Registry successfully synchronized!"); + } catch (EbxmlRegistryException e) { + monitorHandler + .error("Error synchronizing registry!", e); + throw e; + } + } + + } else { federatedRegistryMonitor.updateTime(); } @@ -1145,7 +1191,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, String replicatingTo = dataDeliveryRestClient .getRegistryFederationManager(remoteRegistry.getBaseURL()) .getReplicatingTo(); - if (replicatingTo.contains(DataDeliveryIdUtil.getId())) { + if (replicatingTo.contains(RegistryIdUtil.getId())) { statusHandler.info("Successfully verified replication with [" + registryId + "]"); } else { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryDataAccessService.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryDataAccessService.java index 5b0af16e0d..398caabab1 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryDataAccessService.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryDataAccessService.java @@ -80,6 +80,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; * 10/8/2013 1682 bphillip Added query queries * 11/7/2013 1678 bphillip Added getCustomQueries method * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Apr 12,2014 3012 dhladky Purge never worked, fixed to make work. * * * @author bphillip @@ -343,9 +344,9 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { try { Object subObj = subscriptionJaxbManager .unmarshalFromXml(subscriptionXML); - EDEXUtil.getMessageProducer().sendSync("scheduleSubscription", - subObj); lcm.submitObjects(submitRequest); + EDEXUtil.getMessageProducer().sendSync("scheduleSubscription", + new Object[] {subObj, false}); subscriptionFile.delete(); response.append( "Subscription successfully restored from file [") diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java index cac0b9dc73..1ec242036b 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java @@ -53,6 +53,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.handlers.SubscriptionRetrieva * Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes. * Dec 11, 2013 2625 mpduff Remove creation of DataURI. * Jan 30, 2014 2686 dhladky refactor of retrieval. + * Apr 09, 2014 3012 dhladky Added error message. * Apr 21, 2014 2060 njensen Remove dependency on grid dataURI column * * @@ -102,7 +103,7 @@ public class RetrievalGeneratorUtilities { } } catch (Exception e) { statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + "Can't determine if URI is a duplicate", e); } } } diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.service/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/META-INF/MANIFEST.MF index d4f19d4155..e1e4fe8d2c 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.service/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/META-INF/MANIFEST.MF @@ -34,4 +34,3 @@ Require-Bundle: com.raytheon.uf.common.auth;bundle-version="1.12.1174", org.geotools;bundle-version="2.6.4", com.raytheon.uf.common.geospatial;bundle-version="1.12.1174", com.raytheon.edex.common;bundle-version="1.12.1174" -Import-Package: com.raytheon.uf.edex.datadelivery.util diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/overlap/SubscriptionOverlapHandler.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/overlap/SubscriptionOverlapHandler.java index d433df3f7b..f4d004a034 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/overlap/SubscriptionOverlapHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/overlap/SubscriptionOverlapHandler.java @@ -34,7 +34,7 @@ import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandle import com.raytheon.uf.common.datadelivery.service.subscription.SubscriptionOverlapRequest; import com.raytheon.uf.common.datadelivery.service.subscription.SubscriptionOverlapResponse; import com.raytheon.uf.common.serialization.comm.IRequestHandler; -import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil; +import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil; /** * Edex handler for subscription overlap requests. @@ -64,7 +64,7 @@ public class SubscriptionOverlapHandler implements @Override public Object handleRequest(SubscriptionOverlapRequest request) throws Exception { - String deliveryId = DataDeliveryIdUtil.getId(); + String deliveryId = RegistryIdUtil.getId(); List 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.ogc.registry/src/com/raytheon/uf/edex/ogc/registry/RegistryCollectorAddon.java b/edexOsgi/com.raytheon.uf.edex.ogc.registry/src/com/raytheon/uf/edex/ogc/registry/RegistryCollectorAddon.java index d441a5a077..841283d8e3 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.registry/src/com/raytheon/uf/edex/ogc/registry/RegistryCollectorAddon.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.registry/src/com/raytheon/uf/edex/ogc/registry/RegistryCollectorAddon.java @@ -63,6 +63,7 @@ import com.raytheon.uf.edex.ogc.common.db.SimpleLayer; * Aug 08, 2013 dhladky Made operational * Jan 13, 2014 #2679 dhladky multiple layers * Mar 31, 2014 2889 dhladky Added username for notification center tracking. + * Apr 14, 2014 3012 dhladky Cleaned up. * * * @@ -120,7 +121,7 @@ public abstract class RegistryCollectorAddon * @@ -454,13 +455,15 @@ public abstract class WfsRegistryCollectorAddon * * @author dhladky @@ -697,10 +698,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements FFMPProcessor ffmp = new FFMPProcessor(config, generator, ffmpRec, template); ffmpRec = ffmp.processFFMP(ffmpProduct); - ffmpRec.constructDataURI(); - + if (ffmpRec != null) { + ffmpRec.constructDataURI(); persistRecord(ffmpRec); processDataContainer(ffmpRec, siteKey); // Now that we have the data container, diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java index 44031e4278..f26c2ffae9 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java @@ -428,9 +428,10 @@ public class FFMPConfig { } } catch (Exception e) { sources = null; - statusHandler.handle(Priority.PROBLEM, - "Couldn't create FFMP Config... Improper source configuration detected." - + e); + statusHandler + .handle(Priority.PROBLEM, + "Couldn't create FFMP Config... Improper source configuration detected.", + e); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPProcessor.java b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPProcessor.java index c996d429b3..be1166159b 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPProcessor.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPProcessor.java @@ -37,6 +37,7 @@ import org.opengis.referencing.crs.ProjectedCRS; import org.opengis.referencing.datum.PixelInCell; import org.opengis.referencing.operation.TransformException; +import com.raytheon.uf.common.dataplugin.exception.MalformedDataException; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData; import com.raytheon.uf.common.dataplugin.ffmp.FFMPDataContainer; @@ -260,9 +261,7 @@ public class FFMPProcessor { try { xmrg = (XmrgFile) config.getSourceData( source.getSourceName()).get(dataKey); - this.extent = getExtents(source.getHrapGridFactor()); - setHRAPSubGrid(extent, source.getHrapGridFactor()); - xmrgData = xmrg.getData(extent); + xmrgData = getXMRGData(); } catch (Exception e) { fireBadConfigMessage(type, e); return; @@ -610,6 +609,7 @@ public class FFMPProcessor { } catch (Exception e) { + ffmpRec = null; throw new Exception( "FFMPProcessor: Failed to process source domain: " + source.getSourceName() + ": " @@ -704,6 +704,7 @@ public class FFMPProcessor { } } catch (Exception e) { + ffmpRec = null; throw new Exception("FFMPProcessor: Failed to process source: " + source.getSourceName()); } @@ -735,9 +736,7 @@ public class FFMPProcessor { try { xmrg = (XmrgFile) config.getSourceData(source.getSourceName()).get( dataKey); - this.extent = getExtents(source.getHrapGridFactor()); - setHRAPSubGrid(extent, source.getHrapGridFactor()); - xmrgData = xmrg.getData(extent); + xmrgData = getXMRGData(); recdate = xmrg.getHeader().getValidDate(); } catch (Exception e) { fireBadConfigMessage(type, e); @@ -804,6 +803,7 @@ public class FFMPProcessor { } } catch (Exception e) { + ffmpRec = null; statusHandler.error("Unable to process VGB: "+type, e); } } @@ -1820,8 +1820,26 @@ public class FFMPProcessor { sb.append("Record: " + gribRec.getDataURI() + " \n"); } } - + // null out the record it is garbage. + ffmpRec = null; statusHandler.handle(Priority.ERROR, sb.toString(), e); } + /** + * Gets the XMRG data array + * + * @return + */ + private short[][] getXMRGData() throws Exception { + + this.extent = getExtents(source.getHrapGridFactor()); + setHRAPSubGrid(extent, source.getHrapGridFactor()); + if (xmrg.getHrapExtent() != null) { + xmrgData = xmrg.getData(extent); + } else { + throw new MalformedDataException("The XMRG data is malformed or the file is non-readable."); + } + + return xmrgData; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.madis.registry/utility/common_static/base/datadelivery/harvester/MADIS-harvester.xml b/edexOsgi/com.raytheon.uf.edex.plugin.madis.registry/utility/common_static/base/datadelivery/harvester/MADIS-harvester.xml index cc0c4cf5af..fd24cc4deb 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.madis.registry/utility/common_static/base/datadelivery/harvester/MADIS-harvester.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.madis.registry/utility/common_static/base/datadelivery/harvester/MADIS-harvester.xml @@ -19,6 +19,8 @@ MADIS Test LatLon Coverage + + -1 HHddMMMyyyy diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.redbook/src/com/raytheon/uf/edex/plugin/redbook/menu/RedbookMenuUtil.java b/edexOsgi/com.raytheon.uf.edex.plugin.redbook/src/com/raytheon/uf/edex/plugin/redbook/menu/RedbookMenuUtil.java index d70eb3da38..79512a1008 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.redbook/src/com/raytheon/uf/edex/plugin/redbook/menu/RedbookMenuUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.redbook/src/com/raytheon/uf/edex/plugin/redbook/menu/RedbookMenuUtil.java @@ -54,6 +54,7 @@ import com.raytheon.uf.edex.plugin.redbook.ingest.xml.RedbookMenusXML; * Mar 07, 2014 2858 mpduff Initial creation * Mar 14, 2014 2855 mpduff Refactored common code. * Mar 19, 2014 2860 mpduff Implemented Redbook UpperAir. + * Apr 30, 2014 2860 mpduff Fixed instances of empty substitution tags. * * * @@ -168,15 +169,8 @@ public abstract class RedbookMenuUtil extends AbstractMenuUtil { commonBundleMenuContribution.id = menuEntry.getId(); commonBundleMenuContribution.text = menuEntry.getText(); - if (menuEntry.getMenuEntryList().size() > 0) { + if (!menuEntry.getMenuEntryList().isEmpty()) { List subList = new ArrayList(); - for (MenuEntry substitute : menuEntry.getMenuEntryList()) { - VariableSubstitution var = new VariableSubstitution(); - var.key = substitute.getKey(); - var.value = substitute.getValue(); - subList.add(var); - } - List dataUriList = new ArrayList(); for (MenuEntry me : menuEntry.getMenuEntryList()) { @@ -190,7 +184,6 @@ public abstract class RedbookMenuUtil extends AbstractMenuUtil { } else if (MenuEntryType.DataUri == me.getType()) { dataUriList.add(me.getDataUri()); } - } commonBundleMenuContribution.substitutions = subList diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/ScanProduct.java b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/ScanProduct.java index 10e5aeea04..9a2fde5bb6 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/ScanProduct.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/process/ScanProduct.java @@ -27,10 +27,8 @@ import java.util.List; import org.geotools.referencing.GeodeticCalculator; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord; import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType; -import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject; import com.raytheon.uf.common.dataplugin.radar.RadarRecord; @@ -38,9 +36,6 @@ import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants; import com.raytheon.uf.common.dataplugin.scan.data.CellTableDataRow; import com.raytheon.uf.common.dataplugin.scan.data.ScanTableData; import com.raytheon.uf.common.dataplugin.scan.data.ScanTableDataRow; -import com.raytheon.uf.common.datastorage.IDataStore; -import com.raytheon.uf.common.datastorage.records.FloatDataRecord; -import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.geospatial.ISpatialQuery; import com.raytheon.uf.common.geospatial.SpatialException; import com.raytheon.uf.common.geospatial.SpatialQueryFactory; @@ -49,8 +44,6 @@ import com.raytheon.uf.common.monitor.scan.ScanUtils; import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.database.plugin.PluginDao; -import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.plugin.scan.ScanURIFilter; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.GeometryFactory; @@ -63,7 +56,8 @@ import com.vividsolutions.jts.geom.GeometryFactory; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 05/07/2009 2037 dhladky Initial Creation. + * 05/07/2009 2037 dhladky Initial Creation. + * Apr 30, 2014 2060 njensen Updates for removal of grid dataURI column * * * @@ -72,9 +66,6 @@ import com.vividsolutions.jts.geom.GeometryFactory; */ public abstract class ScanProduct implements Serializable { - /** - * - */ private static final long serialVersionUID = 1L; public String dataType = null; @@ -244,34 +235,6 @@ public abstract class ScanProduct implements Serializable { return cwa; } - /** - * get Populated grib record - * - * @param uri - * @return - */ - public static GridRecord getGridRecord(String uri) throws PluginException { - - GridRecord gr = new GridRecord(uri); - PluginDao gd = PluginFactory.getInstance().getPluginDao( - gr.getPluginName()); - gr = (GridRecord) gd.getMetadata(uri); - IDataStore dataStore = gd.getDataStore(gr); - - try { - IDataRecord[] dataRec = dataStore.retrieve(uri); - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i] instanceof FloatDataRecord) { - gr.setMessageData(dataRec[i]); - } - } - } catch (Exception se) { - se.printStackTrace(); - } - - return gr; - } - /** * process lightning * 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.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/SlotTypeDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/SlotTypeDao.java index 6995bd5db0..ebe6ba4096 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/SlotTypeDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/SlotTypeDao.java @@ -19,13 +19,16 @@ **/ package com.raytheon.uf.edex.registry.ebxml.dao; +import java.util.Collection; import java.util.List; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import org.hibernate.SQLQuery; +import org.hibernate.criterion.Property; import com.raytheon.uf.edex.database.dao.SessionManagedDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; /** * @@ -84,4 +87,10 @@ public class SlotTypeDao extends SessionManagedDao { this.template.delete(slot); } } + + public void deleteBySlotId(Collection ids){ + template.deleteAll(createCriteria().add( + Property.forName(QueryConstants.ID).in(ids)) + .list()); + } } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/RegistryGarbageCollector.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/RegistryGarbageCollector.java index 17cd6c76ab..39fe07f2f0 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/RegistryGarbageCollector.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/RegistryGarbageCollector.java @@ -55,6 +55,7 @@ import com.raytheon.uf.edex.registry.events.DeleteSlotEvent; * 2/4/2014 2769 bphillip Removed flush and clear call * 2/13/2014 2769 bphillip Refactored to no longer use executor threads * 4/11/2014 3011 bphillip Added slot purging via event bus notifications + * 4/17/2014 3011 bphillip Delete slot events now contain strings * * * @author bphillip @@ -139,15 +140,17 @@ public class RegistryGarbageCollector { @Subscribe public void deleteOrphanedSlot(DeleteSlotEvent slotEvent) { + if (!CollectionUtil.isNullOrEmpty(slotEvent.getSlotsToDelete())) { long start = TimeUtil.currentTimeMillis(); statusHandler.info("Deleting " + slotEvent.getSlotsToDelete().size() + " slots..."); - slotDao.deleteAll(slotEvent.getSlotsToDelete()); + slotDao.deleteBySlotId(slotEvent.getSlotsToDelete()); statusHandler.info("Deleted " + slotEvent.getSlotsToDelete().size() + " slots in " + (TimeUtil.currentTimeMillis() - start) + " ms"); } + } } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImpl.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImpl.java index 73002427f1..aec58708a4 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImpl.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImpl.java @@ -112,6 +112,7 @@ import com.raytheon.uf.edex.registry.events.DeleteSlotEvent; * 2/19/2014 2769 bphillip Added current time to audit trail events * Mar 31, 2014 2889 dhladky Added username for notification center tracking. * 4/11/2014 3011 bphillip Modified merge behavior + * 4/17/2014 3011 bphillip Delete slot events now contain strings * * * @@ -301,6 +302,8 @@ public class LifecycleManagerImpl implements LifecycleManager { event.setObjectType(objectType); EventBus.publish(event); } + DeleteSlotEvent deleteEvent = new DeleteSlotEvent(obj.getSlot()); + EventBus.publish(deleteEvent); EventBus.publish(new RegistryStatisticsEvent(obj.getObjectType(), obj.getStatus(), obj.getOwner(), avTimePerRecord)); } @@ -757,9 +760,8 @@ public class LifecycleManagerImpl implements LifecycleManager { private void mergeObjects(RegistryObjectType newObject, RegistryObjectType existingObject) { + DeleteSlotEvent deleteSlotEvent = new DeleteSlotEvent(existingObject.getSlot()); registryObjectDao.merge(newObject, existingObject); - DeleteSlotEvent deleteSlotEvent = new DeleteSlotEvent( - existingObject.getSlot()); EventBus.publish(deleteSlotEvent); } 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/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/events/DeleteSlotEvent.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/events/DeleteSlotEvent.java index 11868fc1fa..fa9e94a9ff 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/events/DeleteSlotEvent.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/events/DeleteSlotEvent.java @@ -19,11 +19,13 @@ **/ package com.raytheon.uf.edex.registry.events; +import java.util.ArrayList; import java.util.List; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import com.raytheon.uf.common.event.Event; +import com.raytheon.uf.common.util.CollectionUtil; /** * Event containing slots to be deleted by the registry garbage collector @@ -35,6 +37,7 @@ import com.raytheon.uf.common.event.Event; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 4/11/2014 3011 bphillip Initial Coding + * 4/17/2014 3011 bphillip Delete slot events now contain strings * * * @author bphillip @@ -42,26 +45,31 @@ import com.raytheon.uf.common.event.Event; */ public class DeleteSlotEvent extends Event { - private static final long serialVersionUID = -2818002679753482984L; - - private List slotsToDelete; - - public DeleteSlotEvent(){ - super(); - } - - public DeleteSlotEvent(List slotsToDelete){ - this.slotsToDelete = slotsToDelete; - } + private static final long serialVersionUID = -2818002679753482984L; - public List getSlotsToDelete() { - return slotsToDelete; - } + private List slotsToDelete;; - public void setSlotsToDelete(List slotsToDelete) { - this.slotsToDelete = slotsToDelete; - } - - + public DeleteSlotEvent() { + super(); + } + + public DeleteSlotEvent(List slotsToDelete) { + if (CollectionUtil.isNullOrEmpty(slotsToDelete)) { + slotsToDelete = new ArrayList(); + } else { + this.slotsToDelete = new ArrayList(slotsToDelete.size()); + for (SlotType slot : slotsToDelete) { + this.slotsToDelete.add(slot.getId()); + } + } + } + + public List getSlotsToDelete() { + return slotsToDelete; + } + + public void setSlotsToDelete(List slotsToDelete) { + this.slotsToDelete = slotsToDelete; + } } diff --git a/rpms/awips2.core/Installer.collab-dataserver/component.spec b/rpms/awips2.core/Installer.collab-dataserver/component.spec index 145527b4fe..4c86e31dde 100644 --- a/rpms/awips2.core/Installer.collab-dataserver/component.spec +++ b/rpms/awips2.core/Installer.collab-dataserver/component.spec @@ -45,6 +45,8 @@ if [ $? -ne 0 ]; then fi %install +dataserver_project="%{_baseline_workspace}/rpms/awips2.core/Installer.collab-dataserver" +config_directory="${dataserver_project}/configuration" cd %{_baseline_workspace}/collaboration.dataserver export ANT_OPTS="%{_ant_opts}" /awips2/ant/bin/ant -f build.xml deploy @@ -52,9 +54,23 @@ if [ $? -ne 0 ]; then exit 1 fi +cp -r ${config_directory}/etc ${RPM_BUILD_ROOT} + %pre %post +chmod ug+x /awips2/collab-dataserver/bin/*.sh +chmod 755 /etc/init.d/collab-dataserver +/sbin/chkconfig --add collab-dataserver + %preun +# Remove and unregister the collab-dataserver service. +if [ -f /etc/init.d/collab-dataserver ]; then + /sbin/chkconfig collab-dataserver off + /sbin/chkconfig --del collab-dataserver + + rm -f /etc/init.d/collab-dataserver +fi + %postun %clean @@ -82,3 +98,6 @@ rm -rf ${RPM_BUILD_ROOT} /awips2/collab-dataserver/lib/foss/* %dir /awips2/collab-dataserver/config /awips2/collab-dataserver/config/* + +%defattr(755,root,root,755) +/etc/init.d/collab-dataserver diff --git a/rpms/awips2.core/Installer.collab-dataserver/configuration/etc/init.d/collab-dataserver b/rpms/awips2.core/Installer.collab-dataserver/configuration/etc/init.d/collab-dataserver index 5f701adc5f..b28547c85d 100644 --- a/rpms/awips2.core/Installer.collab-dataserver/configuration/etc/init.d/collab-dataserver +++ b/rpms/awips2.core/Installer.collab-dataserver/configuration/etc/init.d/collab-dataserver @@ -14,7 +14,7 @@ COLLAB_BIN=/awips2/collab-dataserver/bin PROG=`basename $0` start() { - echo -n $"Starting HTTP Collaboration Dataserver" + echo $"Starting HTTP Collaboration Dataserver" # start.sh script starts the service using nohup. ${COLLAB_BIN}/start.sh return $? @@ -26,7 +26,7 @@ status() { } stop() { - echo -n $"Stopping HTTP Collaboration Dataserver" + echo $"Stopping HTTP Collaboration Dataserver" ${COLLAB_BIN}/stop.sh return } @@ -50,8 +50,10 @@ case "$1" in start RETVAL=$? ;; + *) echo $"Usage: $PROG {start|stop|restart|status}" exit 1 + ;; esac exit $RETVAL diff --git a/rpms/common/static.versions/LATEST.maps b/rpms/common/static.versions/LATEST.maps index e2e574437b..5907e7a315 100644 --- a/rpms/common/static.versions/LATEST.maps +++ b/rpms/common/static.versions/LATEST.maps @@ -1 +1 @@ -20130305 \ No newline at end of file +20140430 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(); }