diff --git a/cave/build/cave/customTargets.xml b/cave/build/cave/customTargets.xml index 58aec6418e..a26c95ee68 100644 --- a/cave/build/cave/customTargets.xml +++ b/cave/build/cave/customTargets.xml @@ -268,7 +268,7 @@ + value="4.0"/> + + + + + + + + + + + + + + + + + diff --git a/cave/build/cave/memorySettings.xml b/cave/build/cave/memorySettings.xml index 65a6c0c1e1..7f82b6136d 100644 --- a/cave/build/cave/memorySettings.xml +++ b/cave/build/cave/memorySettings.xml @@ -2,7 +2,7 @@ - 3.0 + 4.0 + + + wfo + + + 3072M + + + + DEFAULT + + + + + + rfc + + + 2048M + + + + DEFAULT + + + + + + ncep + + + 2048M + + + + DEFAULT + + + + + + cwsu + + + 3072M + + + + DEFAULT + + + + diff --git a/cave/build/static/common/cave/etc/aviation/thresholds/KUES.hdf5 b/cave/build/static/common/cave/etc/aviation/thresholds/KUES.hdf5 new file mode 100644 index 0000000000..b15ccbef01 Binary files /dev/null and b/cave/build/static/common/cave/etc/aviation/thresholds/KUES.hdf5 differ diff --git a/cave/build/static/linux/cave/caveUtil.sh b/cave/build/static/linux/cave/caveUtil.sh index 0930433efe..df1dcb049f 100644 --- a/cave/build/static/linux/cave/caveUtil.sh +++ b/cave/build/static/linux/cave/caveUtil.sh @@ -29,6 +29,7 @@ # Jan 30, 2014 #2593 bclement extracted generic part of getPidsOfMyRunningCaves into forEachRunningCave # added methods for reading max memory from .ini files # fixes for INI files with spaces +# Feb 20, 2014 #2780 bclement added site type ini file check # # @@ -68,7 +69,13 @@ function lookupINI() if [ ${RC} -eq 0 ]; then export CAVE_INI_ARG="--launcher.ini /awips2/cave/${ASSOCIATED_INI}" else - export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini" + siteTypeIni="/awips2/cave/${SITE_TYPE}.ini" + if [[ -e ${siteTypeIni} ]] + then + export CAVE_INI_ARG="--launcher.ini ${siteTypeIni}" + else + export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini" + fi fi return 0 fi @@ -294,7 +301,7 @@ function logExitStatus() hostPath="$basePath/$hostName/" mkdir -p $hostPath if [ -d "$hostPath" ]; then - cp $coreFile $hostPath + mv $coreFile $hostPath fi fi } diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.thinclient.cave/META-INF/MANIFEST.MF index be854e77a5..7510bc3505 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.thinclient.cave/META-INF/MANIFEST.MF @@ -13,7 +13,8 @@ Require-Bundle: com.raytheon.uf.viz.core, com.raytheon.viz.core;bundle-version="1.12.1174", com.raytheon.viz.ui;bundle-version="1.12.1174", com.raytheon.viz.alerts;bundle-version="1.12.1174", - com.raytheon.uf.viz.thinclient;bundle-version="1.0.0" + com.raytheon.uf.viz.thinclient;bundle-version="1.0.0", + com.raytheon.viz.grid;bundle-version="1.12.1174" Import-Package: com.raytheon.uf.common.comm, com.raytheon.uf.common.datastorage, com.raytheon.uf.viz.core.maps.rsc, diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java index a07089df10..ebffd8b5f0 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/DataRefreshTask.java @@ -19,12 +19,17 @@ **/ package com.raytheon.uf.viz.thinclient.cave.refresh; +import java.util.ArrayList; +import java.util.Collection; + import org.eclipse.jface.preference.IPreferenceStore; +import com.raytheon.uf.viz.core.alerts.AlertMessage; import com.raytheon.uf.viz.thinclient.Activator; import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants; import com.raytheon.uf.viz.thinclient.refresh.TimedRefresher.RefreshTimerTask; import com.raytheon.viz.alerts.jobs.AutoUpdater; +import com.raytheon.viz.alerts.observers.ProductAlertObserver; /** * Timer task responsible for refreshing IEditorParts that implement @@ -38,6 +43,7 @@ import com.raytheon.viz.alerts.jobs.AutoUpdater; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 10, 2011 mschenke Initial creation + * Feb 21, 2014 DR 16744 D. Friedman Update all alert observers * * * @@ -56,8 +62,17 @@ public class DataRefreshTask implements RefreshTimerTask { public void run() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); if (store.getBoolean(ThinClientPreferenceConstants.P_DISABLE_JMS)) { - new AutoUpdater().alertArrived(ThinClientDataUpdateTree - .getInstance().updateAllData()); + Collection alerts = ThinClientDataUpdateTree + .getInstance().updateAllData(); + + // Make sure it gets to GridUpdater + ArrayList s = new ArrayList(alerts.size()); + for (AlertMessage am : alerts) { + s.add(am.dataURI); + } + ProductAlertObserver.processDataURIAlerts(s); + + new AutoUpdater().alertArrived(alerts); } } diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java index 3d3dded27d..6a0ad5bd3d 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java @@ -29,8 +29,10 @@ import java.util.Set; import java.util.TimeZone; import com.raytheon.uf.common.dataplugin.PluginDataObject; +import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; +import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -44,6 +46,8 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.AbstractResourceData; import com.raytheon.uf.viz.core.rsc.updater.DataUpdateTree; +import com.raytheon.viz.grid.inv.RadarUpdater; +import com.raytheon.viz.grid.util.RadarAdapter; /** * TODO Add Description @@ -55,6 +59,7 @@ import com.raytheon.uf.viz.core.rsc.updater.DataUpdateTree; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Dec 13, 2011 bsteffen Initial creation + * Feb 21, 2014 DR 16744 D. Friedman Add radar/grid updates * * * @@ -63,7 +68,7 @@ import com.raytheon.uf.viz.core.rsc.updater.DataUpdateTree; */ public class ThinClientDataUpdateTree extends DataUpdateTree { - private IUFStatusHandler statusHandler = UFStatus + private final IUFStatusHandler statusHandler = UFStatus .getHandler(ThinClientDataUpdateTree.class); private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( @@ -95,8 +100,9 @@ public class ThinClientDataUpdateTree extends DataUpdateTree { for (DataPair pair : getDataPairs()) { AbstractResourceData resourceData = pair.data.getResourceData(); if (!(resourceData instanceof AbstractRequestableResourceData) - || resourceData.isFrozen()) + || resourceData.isFrozen()) { continue; + } Map metadata = pair.metadata; metadata = new HashMap(metadata); metadata.put("insertTime", new RequestConstraint(time, @@ -115,9 +121,70 @@ public class ThinClientDataUpdateTree extends DataUpdateTree { e); } } + getRadarUpdates(time, messages); + getGridUpdates(time, messages); return messages; } + /** + * Get radar update messages. This is needed to update the + * radar-as-gridded-data inventory. + */ + private void getRadarUpdates(String time, Set messages) { + Set radarMessages = new HashSet(); + Map metadata = RadarAdapter.getInstance() + .getUpdateConstraints(); + metadata = new HashMap(metadata); + metadata.put("insertTime", new RequestConstraint(time, + ConstraintType.GREATER_THAN)); + try { + PluginDataObject[] pdos = DataCubeContainer.getData(metadata); + for (PluginDataObject pdo : pdos) { + AlertMessage am = new AlertMessage(); + am.dataURI = pdo.getDataURI(); + am.decodedAlert = RecordFactory.getInstance().loadMapFromUri( + am.dataURI); + radarMessages.add(am); + } + messages.addAll(radarMessages); + for (String dataURI : RadarUpdater.getInstance() + .convertRadarAlertsToGridDatauris(radarMessages)) { + AlertMessage am = new AlertMessage(); + am.dataURI = dataURI; + am.decodedAlert = RecordFactory.getInstance().loadMapFromUri( + am.dataURI); + messages.add(am); + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + } + } + + /** Get gridded data update messages. */ + private void getGridUpdates(String time, Set messages) { + Map newQuery = new HashMap(); + DbQueryRequest dbRequest = new DbQueryRequest(); + newQuery.put("pluginName", new RequestConstraint("grid")); + newQuery.put("insertTime", new RequestConstraint(time, + ConstraintType.GREATER_THAN)); + dbRequest.setConstraints(newQuery); + dbRequest.addRequestField("dataURI"); + DbQueryResponse response = null; + try { + response = (DbQueryResponse) ThriftClient.sendRequest(dbRequest); + for (String dataURI : response.getFieldObjects("dataURI", + String.class)) { + AlertMessage am = new AlertMessage(); + am.dataURI = dataURI; + am.decodedAlert = RecordFactory.getInstance().loadMapFromUri( + am.dataURI); + messages.add(am); + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + } + } + /** * Get the estimated difference between the clock on the server and the * local clock. The offset returned from this method will always be slightly diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java old mode 100755 new mode 100644 index b33b68b36d..7382bed6d4 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java @@ -73,7 +73,8 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag; * text height and width. * 12/9/2010 7380 rferrel Adjust text size to be more like AWIPS I. * 1/17/2011 7782 rferrel Added qcSkipCheck to mimic A1. - * 3/18/2011 7888 rferrel Added getLargeTF method. + * 3/18/2011 7888 rferrel Added getLargeTF method. + * 02/19/2014 16980 zhao added getter and setter for the Alt flag * * * @@ -1368,4 +1369,12 @@ public class EditorTafTabComp extends Composite { rtdRdo.setEnabled(editable); corRdo.setEnabled(editable); } + + public boolean getAlt() { + return alt; + } + + public void setAlt(boolean b) { + alt = b; + } } diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java index 94e1d8fc2e..1ee4722f49 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java @@ -80,8 +80,10 @@ import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.MessageBox; @@ -227,6 +229,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 08/09/2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR * 09/04/2013 2322 lvenable Added CAVE style so this dialog is perspective independent * 10/24/2013 16478 zhao add syntax check for extra '=' sign + * 02/12/2014 17076 lvenable Mark guidance tabs as not current so they get refreshed + * 02/19/2014 16980 zhao add code to ensure the Alt flag is false after the Alt kay is released * * * @@ -674,6 +678,10 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, populateTafViewer(); // Update the metar and mos guidance in the viewer tab. updateViewerTab(stationName); + + // Mark the tabs as not current so they get updated. + markTabsAsNotCurrent(); + break; case OPEN_RTN: @@ -769,7 +777,19 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, } } - @Override + + /** + * Mark the tabs as not current so they get refreshed. + */ + private void markTabsAsNotCurrent() { + for (TabItem tbi : guidanceViewerFolder.getItems()) { + if (tbi.getControl() instanceof ViewerTab) { + ((ViewerTab) tbi.getControl()).setDisplayCurrent(false); + } + } + } + + @Override public void clearAll() { if (shell == null) { return; @@ -1073,6 +1093,11 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, // Create the File menu item with a File "dropdown" menu Menu fileMenu = new Menu(menuBar); fileMenuItem.setMenu(fileMenu); + fileMenu.addListener(SWT.Show, new Listener() { + public void handleEvent(Event event) { + setAltFlagForEditorTafTabComp(); + } + }); // ------------------------------------------------- // Create all the items in the File dropdown menu @@ -1179,6 +1204,11 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, // Create the Options menu item with a Options "dropdown" menu Menu optionsMenu = new Menu(menuBar); optionsMenuItem.setMenu(optionsMenu); + optionsMenu.addListener(SWT.Show, new Listener() { + public void handleEvent(Event event) { + setAltFlagForEditorTafTabComp(); + } + }); // ---------------------------------------------------- // Create all the items in the Options dropdown menu @@ -1253,7 +1283,12 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, // Create the File menu item with a File "dropdown" menu Menu editMenu = new Menu(menuBar); editMenuItem.setMenu(editMenu); - + editMenu.addListener(SWT.Show, new Listener() { + public void handleEvent(Event event) { + setAltFlagForEditorTafTabComp(); + } + }); + // ------------------------------------------------- // Create all the items in the Edit dropdown menu // ------------------------------------------------- @@ -1327,6 +1362,19 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, } }); } + + /** + * When respectively using alt+'f', alt+'e', alt+'o' and alt+'h' + * to open/display menus 'File', 'Edit', 'Options' and 'Help', + * the alt flag of the editorTafTabComp object is set to true; + * it needs to be re-set to false + * (DR16980) + */ + private void setAltFlagForEditorTafTabComp() { + if ( editorTafTabComp.getAlt() ) { + editorTafTabComp.setAlt(false); + } + } /** * Create the Help menu. @@ -1344,6 +1392,11 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, // Create the File menu item with a File "dropdown" menu Menu helpMenu = new Menu(menuBar); helpMenuItem.setMenu(helpMenu); + helpMenu.addListener(SWT.Show, new Listener() { + public void handleEvent(Event event) { + setAltFlagForEditorTafTabComp(); + } + }); // ------------------------------------------------- // Create all the items in the Help dropdown menu diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MakeHazard.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MakeHazard.py index 9b41e7087d..33e8e1eb08 100644 --- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MakeHazard.py +++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MakeHazard.py @@ -11,6 +11,7 @@ # Apr 03,2012 436 randerso Converted to Python procedure to allow some # level of site customization # Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure +# Feb 12,2014 17058 ryu Extend converter for Collections$EmptyList objects. # # Author: randerso # ---------------------------------------------------------------------------- @@ -307,6 +308,8 @@ def converter(obj): objtype = obj.jclassname if objtype == "java.util.Date": retVal = AbsTime.AbsTime(obj) + elif objtype == "java.util.Collections$EmptyList": + retVal = [] elif objtype == "com.raytheon.uf.common.time.TimeRange": retVal = TimeRange.TimeRange(obj) return retVal diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MergeHazards.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MergeHazards.py index 7fd0d9131c..4f705d5a67 100644 --- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MergeHazards.py +++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/procedures/MergeHazards.py @@ -1,61 +1,70 @@ ## # 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 +# 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 -# +# 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. ## -# ---------------------------------------------------------------------------- -# This software is in the public domain, furnished "as is", without technical -# support, and with no warranty, express or implied, as to its usefulness for -# any purpose. -# -# MergeHazards -# -# Author: lefebvre -# -# This procedure reads all of the temporary hazard grids and selectively -# loads them in the the "Hazards" grid. -# ---------------------------------------------------------------------------- - -# The MenuItems list defines the GFE menu item(s) under which the -# Procedure is to appear. -# Possible items are: Populate, Edit, Consistency, Verify, Hazards -MenuItems = ["Hazards"] - -#import Tkinter -import SmartScript -import string -import HazardUtils -import VTECTable -import LogStream -import numpy - - -from HazardUtils import MODEL -from HazardUtils import ELEMENT -from HazardUtils import LEVEL - -######################### CONFIGURATION SECTION ###################### -# -# This dictionary defines which hazards cannot be combined with other -# Hazards. The structure lists each hazard in the VTECTable followed -# by a list of VTEC codes that may not be combined with it at the same -# grid point. For example "DS.W" : ["DU.Y"] means that DS.W may not -# be combined with a DU.Y hazard at the same grid point. - +# ---------------------------------------------------------------------------- +# This software is in the public domain, furnished "as is", without technical +# support, and with no warranty, express or implied, as to its usefulness for +# any purpose. +# +# MergeHazards +# +# Author: lefebvre +# +# This procedure reads all of the temporary hazard grids and selectively +# loads them in the the "Hazards" grid. +# ---------------------------------------------------------------------------- +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Dec 23, 2013 16893 ryu Check in njensen's change to removeTempHazards() +# to call SmartScript.unloadWEs(). +# +######################################################################## + +# The MenuItems list defines the GFE menu item(s) under which the +# Procedure is to appear. +# Possible items are: Populate, Edit, Consistency, Verify, Hazards +MenuItems = ["Hazards"] + +#import Tkinter +import SmartScript +import string +import HazardUtils +import VTECTable +import LogStream +import numpy + + +from HazardUtils import MODEL +from HazardUtils import ELEMENT +from HazardUtils import LEVEL + +######################### CONFIGURATION SECTION ###################### +# +# This dictionary defines which hazards cannot be combined with other +# Hazards. The structure lists each hazard in the VTECTable followed +# by a list of VTEC codes that may not be combined with it at the same +# grid point. For example "DS.W" : ["DU.Y"] means that DS.W may not +# be combined with a DU.Y hazard at the same grid point. + HazardsConflictDict = { "AF.W" : ["AF.Y"], "AF.Y" : ["AF.W"], @@ -187,302 +196,304 @@ HazardsConflictDict = { "ZR.Y" : ["BZ.A", "LE.A", "WS.A", "BZ.W", "IS.W", "WS.W", "LE.W", "WW.Y", "LE.Y"], } - -########################## END OF CONFIGURATION SECTION ######################## - -class Procedure(SmartScript.SmartScript): - def __init__(self, dbss): - SmartScript.SmartScript.__init__(self, dbss) - self._dbss = dbss - - ## - # Get the list of loaded temporary hazard parms - # @return: Temporary hazard parm names, i.e., ["hazAFY"] - # @rtype: List of Strings - def getHazardParmNames(self): - parms = self.loadedParms() - hazParms = [] - for weName, level, dbID in parms: - if string.find(weName, "haz") == 0: - # TODO: Why is this back/forth xform needed? - key = self._hazUtils._tempWENameToKey(weName) - index = string.find(key, ":") - if index != -1: - mkey = key[0:index] - segNum = key[index+1:] - else: - mkey = key - segNum = "" - - # append the hazard and a description - parmName = "haz" + key - parmName = string.replace(parmName, ".", "") - parmName = string.replace(parmName, ":", "") - hazParms.append(parmName) - - return hazParms - - ## - # Unload (delete) all the temporary hazards - def removeTempHazards(self): - parms = self.loadedParms() - - for weName, level, dbID in parms: - if string.find(weName, "haz") == 0: - self.unloadWE(MODEL, weName, level) - - return - - ## - # The action performed when the user opts to cancel a merge. - # This was a callback under Tcl/tk; now displayDialog invokes - # it directly. - def cancelCommand(self): - LogStream.logEvent("MergeHazards: cancel") - return - - ## - # The action performed when the user opts to continue a merge. - # This was a callback under Tcl/tk; now displayDialog invokes - # it directly. - def continueCommand(self): - LogStream.logEvent("MergeHazards: continue") - parm = self.getParm(MODEL, ELEMENT, LEVEL) - parm.setMutable(True) - self.mergeHazardGrids() - return - - ## - # Displays a dialog box and queries the user to continue to merge or - # abort the merge + +########################## END OF CONFIGURATION SECTION ######################## + +class Procedure(SmartScript.SmartScript): + def __init__(self, dbss): + SmartScript.SmartScript.__init__(self, dbss) + self._dbss = dbss + + ## + # Get the list of loaded temporary hazard parms + # @return: Temporary hazard parm names, i.e., ["hazAFY"] + # @rtype: List of Strings + def getHazardParmNames(self): + parms = self.loadedParms() + hazParms = [] + for weName, level, dbID in parms: + if string.find(weName, "haz") == 0: + # TODO: Why is this back/forth xform needed? + key = self._hazUtils._tempWENameToKey(weName) + index = string.find(key, ":") + if index != -1: + mkey = key[0:index] + segNum = key[index+1:] + else: + mkey = key + segNum = "" + + # append the hazard and a description + parmName = "haz" + key + parmName = string.replace(parmName, ".", "") + parmName = string.replace(parmName, ":", "") + hazParms.append(parmName) + + return hazParms + + ## + # Unload (delete) all the temporary hazards + def removeTempHazards(self): + parms = self.loadedParms() + + toRemovePairs = [] + for weName, level, dbID in parms: + if string.find(weName, "haz") == 0: + toRemovePairs.append((weName, level)) + self.unloadWEs(MODEL, toRemovePairs) + + return + + ## + # The action performed when the user opts to cancel a merge. + # This was a callback under Tcl/tk; now displayDialog invokes + # it directly. + def cancelCommand(self): + LogStream.logEvent("MergeHazards: cancel") + return + + ## + # The action performed when the user opts to continue a merge. + # This was a callback under Tcl/tk; now displayDialog invokes + # it directly. + def continueCommand(self): + LogStream.logEvent("MergeHazards: continue") + parm = self.getParm(MODEL, ELEMENT, LEVEL) + parm.setMutable(True) + self.mergeHazardGrids() + return + + ## + # Displays a dialog box and queries the user to continue to merge or + # abort the merge def displayDialog(self, message): - from MessageBox import MessageBox - messageBox = MessageBox(style=MessageBox.ICON_WARNING) - messageBox.setText("MakeHazard") - messageBox.setMessage(message) - messageBox.setButtonLabels(["Continue Merge", "Cancel Merge"]) - messageBox.setDefaultIndex(1) - if (messageBox.open() == 0): - self.continueCommand() - else: - self.cancelCommand() - - return - - ## - # Returns the set of hazParms grids that overlap with the specified - # timeRange. - # @param hazParms: Hazard parm names to check - # @type hazParms: Sequence of string - # @param timeRange: The time range to check for overlap with - # @type timeRange: Python TimeRange - # @return: Byte grids and keys of the overlapping parms - # @rtype: 2-tuple: list of byte arrays, list of list of strings - def getOverlappingHazGrids(self, hazParms, timeRange): - byteGridList = [] - keyList = [] - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - for tr in trList: - if tr.overlaps(timeRange): - byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, - tr, mode="First") - if isinstance(hazKey, str): - hazKey = eval(hazKey) - byteGridList.append(byteGrid) - keyList.append(hazKey) - - return byteGridList, keyList - - ## - # Returns the first non-None key it finds in the keyList - # @param keyList: Keys to search - # @type keyList: Sequence of string - # @return: First key that is not "" - # @rtype: string - def getHazardKey(self, keyList): - for k in keyList: - if k != "": - return k - - ## - # Checks the specified hazard grids to see if they are conflicting - # Each grid is a tuple (byteGrid, key). Uses the configurable - # HazardConflictDict to determine whether two hazards can be combined - # at the same grid point. Returns an empty list if no conflict or - # the list of hazards if they do. - # - # This method should really only be used internally; it assumes that - # there is at most one key other than "", and that it contains - # a single subkey. - # - # @param hazGrid1: The first hazard grid - # @type hazGrid1: 2-tuple: numpy array of int8, list of String - # @param hazGrid2: The second hazard grid - # @type hazGrid2: 2-tuple: numpy array of int8, list of String - # @return: conflicting hazard names or empty list - # @rtype: list - def conflictingHazards(self, hazGrid1, hazGrid2): - byteGrid1, hazKey1 = hazGrid1 - byteGrid2, hazKey2 = hazGrid2 - - key1 = self.getHazardKey(hazKey1) - key2 = self.getHazardKey(hazKey2) - phenSig1 = key1[0:4] # remove the etn - phenSig2 = key2[0:4] - - keyConflict = False - if phenSig1 == phenSig2 and key1 != key2: - keyConflict = True - elif HazardsConflictDict.has_key(phenSig1): - if phenSig2 in HazardsConflictDict[phenSig1]: - keyConflict = True - - if keyConflict: - # calculate the overlap, adding the grids together will tell us if - # there is any overlap. Any grid points > 1 are overlapped - totalGrid = byteGrid1 + byteGrid2 - overlapMask = numpy.greater(totalGrid, 1) - if numpy.any(overlapMask): - return [key1, key2] - - return [] - - ## - # See if there are any temporary hazards for the same position and time - # that conflict with one another. - # - # @param hazParms: Temporary hazard parm names to check. - # @type hazParms: sequence of string - # @return: The first conflict, or None if there are no conflicts - # @rtype: 2-tuple(TimeRange, list of string) or NoneType - def checkForHazardConflicts(self, hazParms): - timeList = [] - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - for tr in trList: - if tr.startTime().unixTime() not in timeList: - timeList.append(tr.startTime().unixTime()) - if tr.endTime().unixTime() not in timeList: - timeList.append(tr.endTime().unixTime()) - - timeList.sort() # sort the list - - for t in xrange(len(timeList) - 1): - start = timeList[t] - end = timeList[t+1] - timeRange = self._hazUtils._makeTimeRange(start, end) - byteGridList = [] - keyList = [] - byteGridList, keyList = self.getOverlappingHazGrids(hazParms, timeRange) - # compare each grid to all other grids at this timeRange - for firstIndex in xrange(len(byteGridList) - 1): - for secondIndex in xrange(firstIndex + 1, len(byteGridList)): - grid1 = (byteGridList[firstIndex], keyList[firstIndex]) - grid2 = (byteGridList[secondIndex], keyList[secondIndex]) - conflictList = self.conflictingHazards(grid1, grid2) - if conflictList != []: - return (timeRange, conflictList) - - # if we made it to here, all is well - return None - - ## - # Perform checks to see if it's OK to merge hazards. If there are no conflicting - # locks or incompatible hazards, do the merge. If there are conflicting locks, - # generate a status bar message and quit. If there incompatible - # hazards, show a warning and let the user decide whether to continue. - def checkForMerge(self): - # get the hazards selected by the forecaster - hazParms = self.getHazardParmNames() - - # check for empty list of hazards - if hazParms == []: - self.statusBarMsg("No temporary grids to merge.", "S") - return - - # FIXME: Lock race condition - # check for conflicting locks - if self._hazUtils._conflictingLocks(hazParms): - self.statusBarMsg("There are conflicting locks. " + - "Please resolve these before merging any hazards", "S") - return - - conflicts = self.checkForHazardConflicts(hazParms) - if conflicts is None: - # if no conflicts, merge the grids - # We made the hazards parm immutable when we separated hazard grids. - # It has to be made mutable to do the merge. - parm = self.getParm(MODEL, ELEMENT, LEVEL) - parm.setMutable(True) - self.mergeHazardGrids() - else: - haz1 = string.replace(conflicts[1][0], ".", "") - haz2 = string.replace(conflicts[1][1], ".", "") - timeRange = str(conflicts[0]) - msg = "Hazard conflict detected!\n\n" - msg += "Time: " + timeRange + " \n\n" - msg += "with Hazard grids haz" + haz1 + " and haz" + haz2 + ".\n" - - LogStream.logEvent("Merge conflict: "+ msg) - self.displayDialog(msg) - - return - - ## - # Performs the actual merge of the temp hazards grids into the "Hazards" grid. - def mergeHazardGrids(self): - # get the hazards selected by the forecaster - hazParms = self.getHazardParmNames() - - self._hazUtils._removeAllHazardsGrids() - - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - - for tr in trList: - byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, tr, - mode="First") - if isinstance(hazKey, str): - hazKey = eval(hazKey) - - uniqueKeys = self._hazUtils._getUniqueKeys(byteGrid, hazKey) - for uKey in uniqueKeys: - if uKey == "": - continue - subKeys = self._hazUtils._getSubKeys(uKey) - for subKey in subKeys: - # make the mask - find all areas that contain the subKey - mask = numpy.zeros(byteGrid.shape) - for haz in hazKey: - if string.find(haz, subKey) >= 0: - hazIndex = self.getIndex(haz, hazKey) - mask = numpy.logical_or(numpy.equal(byteGrid, hazIndex), mask) - - # make the grid - self._hazUtils._addHazard(ELEMENT, tr, subKey, mask) - LogStream.logEvent("merge: " + \ - str(self._hazUtils._printTime(tr.startTime().unixTime())) + " " + \ - str(self._hazUtils._printTime(tr.endTime().unixTime())) + " " + \ - subKey + "\n") - - self.removeTempHazards() - - return - - ## - # The main entry point of the procedure. - def execute(self): - self.setToolType("numeric") - - self._hazUtils = HazardUtils.HazardUtils(self._dbss, None) - - # see if the Hazards WE is loaded in the GFE, if not abort the tool - if not self._hazUtils._hazardsLoaded(): - self.statusBarMsg("Hazards Weather Element must be loaded in " +\ - "the GFE before running MergeHazards", "S") - self.cancel() - - self.checkForMerge() - return - + from MessageBox import MessageBox + messageBox = MessageBox(style=MessageBox.ICON_WARNING) + messageBox.setText("MakeHazard") + messageBox.setMessage(message) + messageBox.setButtonLabels(["Continue Merge", "Cancel Merge"]) + messageBox.setDefaultIndex(1) + if (messageBox.open() == 0): + self.continueCommand() + else: + self.cancelCommand() + + return + + ## + # Returns the set of hazParms grids that overlap with the specified + # timeRange. + # @param hazParms: Hazard parm names to check + # @type hazParms: Sequence of string + # @param timeRange: The time range to check for overlap with + # @type timeRange: Python TimeRange + # @return: Byte grids and keys of the overlapping parms + # @rtype: 2-tuple: list of byte arrays, list of list of strings + def getOverlappingHazGrids(self, hazParms, timeRange): + byteGridList = [] + keyList = [] + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + for tr in trList: + if tr.overlaps(timeRange): + byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, + tr, mode="First") + if isinstance(hazKey, str): + hazKey = eval(hazKey) + byteGridList.append(byteGrid) + keyList.append(hazKey) + + return byteGridList, keyList + + ## + # Returns the first non-None key it finds in the keyList + # @param keyList: Keys to search + # @type keyList: Sequence of string + # @return: First key that is not "" + # @rtype: string + def getHazardKey(self, keyList): + for k in keyList: + if k != "": + return k + + ## + # Checks the specified hazard grids to see if they are conflicting + # Each grid is a tuple (byteGrid, key). Uses the configurable + # HazardConflictDict to determine whether two hazards can be combined + # at the same grid point. Returns an empty list if no conflict or + # the list of hazards if they do. + # + # This method should really only be used internally; it assumes that + # there is at most one key other than "", and that it contains + # a single subkey. + # + # @param hazGrid1: The first hazard grid + # @type hazGrid1: 2-tuple: numpy array of int8, list of String + # @param hazGrid2: The second hazard grid + # @type hazGrid2: 2-tuple: numpy array of int8, list of String + # @return: conflicting hazard names or empty list + # @rtype: list + def conflictingHazards(self, hazGrid1, hazGrid2): + byteGrid1, hazKey1 = hazGrid1 + byteGrid2, hazKey2 = hazGrid2 + + key1 = self.getHazardKey(hazKey1) + key2 = self.getHazardKey(hazKey2) + phenSig1 = key1[0:4] # remove the etn + phenSig2 = key2[0:4] + + keyConflict = False + if phenSig1 == phenSig2 and key1 != key2: + keyConflict = True + elif HazardsConflictDict.has_key(phenSig1): + if phenSig2 in HazardsConflictDict[phenSig1]: + keyConflict = True + + if keyConflict: + # calculate the overlap, adding the grids together will tell us if + # there is any overlap. Any grid points > 1 are overlapped + totalGrid = byteGrid1 + byteGrid2 + overlapMask = numpy.greater(totalGrid, 1) + if numpy.any(overlapMask): + return [key1, key2] + + return [] + + ## + # See if there are any temporary hazards for the same position and time + # that conflict with one another. + # + # @param hazParms: Temporary hazard parm names to check. + # @type hazParms: sequence of string + # @return: The first conflict, or None if there are no conflicts + # @rtype: 2-tuple(TimeRange, list of string) or NoneType + def checkForHazardConflicts(self, hazParms): + timeList = [] + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + for tr in trList: + if tr.startTime().unixTime() not in timeList: + timeList.append(tr.startTime().unixTime()) + if tr.endTime().unixTime() not in timeList: + timeList.append(tr.endTime().unixTime()) + + timeList.sort() # sort the list + + for t in xrange(len(timeList) - 1): + start = timeList[t] + end = timeList[t+1] + timeRange = self._hazUtils._makeTimeRange(start, end) + byteGridList = [] + keyList = [] + byteGridList, keyList = self.getOverlappingHazGrids(hazParms, timeRange) + # compare each grid to all other grids at this timeRange + for firstIndex in xrange(len(byteGridList) - 1): + for secondIndex in xrange(firstIndex + 1, len(byteGridList)): + grid1 = (byteGridList[firstIndex], keyList[firstIndex]) + grid2 = (byteGridList[secondIndex], keyList[secondIndex]) + conflictList = self.conflictingHazards(grid1, grid2) + if conflictList != []: + return (timeRange, conflictList) + + # if we made it to here, all is well + return None + + ## + # Perform checks to see if it's OK to merge hazards. If there are no conflicting + # locks or incompatible hazards, do the merge. If there are conflicting locks, + # generate a status bar message and quit. If there incompatible + # hazards, show a warning and let the user decide whether to continue. + def checkForMerge(self): + # get the hazards selected by the forecaster + hazParms = self.getHazardParmNames() + + # check for empty list of hazards + if hazParms == []: + self.statusBarMsg("No temporary grids to merge.", "S") + return + + # FIXME: Lock race condition + # check for conflicting locks + if self._hazUtils._conflictingLocks(hazParms): + self.statusBarMsg("There are conflicting locks. " + + "Please resolve these before merging any hazards", "S") + return + + conflicts = self.checkForHazardConflicts(hazParms) + if conflicts is None: + # if no conflicts, merge the grids + # We made the hazards parm immutable when we separated hazard grids. + # It has to be made mutable to do the merge. + parm = self.getParm(MODEL, ELEMENT, LEVEL) + parm.setMutable(True) + self.mergeHazardGrids() + else: + haz1 = string.replace(conflicts[1][0], ".", "") + haz2 = string.replace(conflicts[1][1], ".", "") + timeRange = str(conflicts[0]) + msg = "Hazard conflict detected!\n\n" + msg += "Time: " + timeRange + " \n\n" + msg += "with Hazard grids haz" + haz1 + " and haz" + haz2 + ".\n" + + LogStream.logEvent("Merge conflict: "+ msg) + self.displayDialog(msg) + + return + + ## + # Performs the actual merge of the temp hazards grids into the "Hazards" grid. + def mergeHazardGrids(self): + # get the hazards selected by the forecaster + hazParms = self.getHazardParmNames() + + self._hazUtils._removeAllHazardsGrids() + + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + + for tr in trList: + byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, tr, + mode="First") + if isinstance(hazKey, str): + hazKey = eval(hazKey) + + uniqueKeys = self._hazUtils._getUniqueKeys(byteGrid, hazKey) + for uKey in uniqueKeys: + if uKey == "": + continue + subKeys = self._hazUtils._getSubKeys(uKey) + for subKey in subKeys: + # make the mask - find all areas that contain the subKey + mask = numpy.zeros(byteGrid.shape) + for haz in hazKey: + if string.find(haz, subKey) >= 0: + hazIndex = self.getIndex(haz, hazKey) + mask = numpy.logical_or(numpy.equal(byteGrid, hazIndex), mask) + + # make the grid + self._hazUtils._addHazard(ELEMENT, tr, subKey, mask) + LogStream.logEvent("merge: " + \ + str(self._hazUtils._printTime(tr.startTime().unixTime())) + " " + \ + str(self._hazUtils._printTime(tr.endTime().unixTime())) + " " + \ + subKey + "\n") + + self.removeTempHazards() + + return + + ## + # The main entry point of the procedure. + def execute(self): + self.setToolType("numeric") + + self._hazUtils = HazardUtils.HazardUtils(self._dbss, None) + + # see if the Hazards WE is loaded in the GFE, if not abort the tool + if not self._hazUtils._hazardsLoaded(): + self.statusBarMsg("Hazards Weather Element must be loaded in " +\ + "the GFE before running MergeHazards", "S") + self.cancel() + + self.checkForMerge() + return + diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/textUtilities/headline/TextFormatter.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/textUtilities/headline/TextFormatter.py index 80ed152ac4..d79a243c9a 100644 --- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/textUtilities/headline/TextFormatter.py +++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/textUtilities/headline/TextFormatter.py @@ -1,19 +1,19 @@ ## # 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 +# 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 -# +# +# 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. ## @@ -27,16 +27,25 @@ # # Author: hansen # ---------------------------------------------------------------------------- +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 02/12/2014 #2591 randerso Added retry when loading combinations fails import string, getopt, sys, time, os, types, math import ModuleAccessor import Utility, logging, traceback +import AbsTime from java.lang import ThreadDeath from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID, ReferenceData GridLoc = None LatLonIds = [] +MAX_TRIES = 2 + # If someone imports TextFormatter and needs this instance # they should either be fixed to use the IFPImporter module # or turn this line on (which is a kludge but should make @@ -44,19 +53,19 @@ LatLonIds = [] #IFPImporter = IFPImporter.IFPImporter class TextFormatter: - def __init__(self, dataManager): + def __init__(self, dataManager): # Variable for unique combinations self.__comboNumber = -1 self.dataMgr = dataManager self.log = logging.getLogger("FormatterRunner.TextFormatter.TextFormatter") pass - + # def __del__(self): # for i in LatLonIds: # self.dataMgr.getRefManager().deleteRefSet(i, False) def getForecast(self, fcstName, argDict): - " Create the forecast " + " Create the forecast " ForecastNarrative = argDict["ForecastNarrative"] ForecastTable = argDict["ForecastTable"] @@ -71,7 +80,7 @@ class TextFormatter: argDict["getForecast"] = self.getForecast argDict["getFcstDef"] = self.getFcstDef argDict["dataMgr"] = self.dataMgr - self.__ut = argDict["utility"] + self.__ut = argDict["utility"] # Get the Forecast Definition and type from the server #print "finding", fcstName @@ -79,11 +88,11 @@ class TextFormatter: #print "found ", found if found == 0: text = "Text Product Definition Not Found: " + fcstName + " " + \ - traceback.format_exc() + traceback.format_exc() self.log.error("Text Product Definition Not Found: Caught Exception: " + fcstName, exc_info=True) raise Exception, text forecastDef = argDict["forecastDef"] - fcstType = self.__ut.set(forecastDef,"type",None) + fcstType = self.__ut.set(forecastDef, "type", None) argDict["fcstType"] = fcstType if fcstType is None: text = "Text Product Type Not Found: " + fcstName + " " + \ @@ -101,16 +110,16 @@ class TextFormatter: # Must have at least one edit area and time range specified if fcstType != "smart" and fcstType != "component": if argDict["editAreas"] == []: - text= "No Edit Areas Specified over which to generate product." - text=text+'\nTry setting "defaultEditAreas" in the product Definition' - text=text+'\nOr, if running from the command line, add a -r flag.' + text = "No Edit Areas Specified over which to generate product." + text = text + '\nTry setting "defaultEditAreas" in the product Definition' + text = text + '\nOr, if running from the command line, add a -r flag.' text = text + '\n' + string.join(traceback.format_exc()) self.log.error("Caught Exception: " + text) raise Exception, text if argDict["rawRanges"] == []: - text= "No Time Ranges Specified over which to generate product." - text=text+'\nTry setting "defaultRanges" in the product Definition' - text=text+'\nOr, if running from the command line, add a -w flag.' + text = "No Time Ranges Specified over which to generate product." + text = text + '\nTry setting "defaultRanges" in the product Definition' + text = text + '\nOr, if running from the command line, add a -w flag.' text = text + '\n' + string.join(traceback.format_exc()) self.log.error("Caught Exception: " + text) raise Exception, text @@ -153,7 +162,7 @@ class TextFormatter: argDict["module"] = module product.setUp("T", argDict) product._argDict = argDict - + try: text = product.generateForecast(argDict) except RuntimeError, e: @@ -166,11 +175,11 @@ class TextFormatter: # requirement for TEST phrasing for TEST products if argDict.get('testMode', 0): - testMsg = "\nTHIS IS A TEST MESSAGE. DO NOT TAKE ACTION" +\ + testMsg = "\nTHIS IS A TEST MESSAGE. DO NOT TAKE ACTION" + \ " BASED ON THIS TEST\nMESSAGE.\n" #split by "$$" segs = text.split('\n$$') - for i in xrange(len(segs)-1): #never the last one + for i in xrange(len(segs) - 1): #never the last one if text.find(testMsg) == -1: #not found, add it in segs[i] = segs[i] + testMsg text = '\n$$'.join(segs) #put text back together again @@ -185,7 +194,7 @@ class TextFormatter: if not forecastDef.get('lowerCase', 0): text = text.upper() else: - text="Text Product Type Invalid "+\ + text = "Text Product Type Invalid " + \ "(must be 'table', 'component' or 'narrative'): ", fcstName, type text = text + '\n' + string.join(traceback.format_exc()) self.log.error("Caught Exception: " + text) @@ -196,18 +205,18 @@ class TextFormatter: def __createNarrativeDef(self, fcstName, timeRange): return { "methodList": [self.assembleChildWords], - "narrativeDef": [(fcstName, timeRange.duration()/3600)], + "narrativeDef": [(fcstName, timeRange.duration() / 3600)], } def __loop(self, argDict, forecast, forecastDef): # Loop through product by edit areas and time ranges - begText = self.__ut.set(forecastDef,"beginningText","") - endText = self.__ut.set(forecastDef,"endingText","") - editAreaLoopBegText = self.__ut.set(forecastDef,"editAreaLoopBegText","") - timeRangeLoopBegText = self.__ut.set(forecastDef,"timeRangeLoopBegText","") - editAreaLoopEndText = self.__ut.set(forecastDef,"editAreaLoopEndText","") - timeRangeLoopEndText = self.__ut.set(forecastDef,"timeRangeLoopEndText","") + begText = self.__ut.set(forecastDef, "beginningText", "") + endText = self.__ut.set(forecastDef, "endingText", "") + editAreaLoopBegText = self.__ut.set(forecastDef, "editAreaLoopBegText", "") + timeRangeLoopBegText = self.__ut.set(forecastDef, "timeRangeLoopBegText", "") + editAreaLoopEndText = self.__ut.set(forecastDef, "editAreaLoopEndText", "") + timeRangeLoopEndText = self.__ut.set(forecastDef, "timeRangeLoopEndText", "") outerLoop = self.__ut.set(forecastDef, "outerLoop", "EditArea") editAreas = argDict["editAreas"] @@ -274,10 +283,10 @@ class TextFormatter: #print "varDict", varDict for item, default in [ - ("language","english"), - ("appendFile",None), - ("lineLength",69), # no command line option - ("timePeriod",3), + ("language", "english"), + ("appendFile", None), + ("lineLength", 69), # no command line option + ("timePeriod", 3), ]: try: # Try the varDict #print "trying varDict", item @@ -362,19 +371,28 @@ class TextFormatter: # (["Zones37","Zones38"], "/37/38"),"/37/38"), # (["Zones57","Zones58","Zones59"],"57/58/59") # ] - - # RWA-05/19/11: added this check here to force Combinations files - # to be reloaded since we removed a similar check from ModuleAccessor - # to preserve the magicCodeChanges. Perhaps we should be doing something - # similar to magicCodeChanges for Combinations files as well. - if sys.modules.has_key(dfEditAreas): - del sys.modules[dfEditAreas] - - accessor = ModuleAccessor.ModuleAccessor() - dfEditAreas = accessor.variable(dfEditAreas, "Combinations") - if dfEditAreas is None: - return "COMBINATION FILE NOT FOUND: " + \ - self.__ut.set(forecastDef, "defaultEditAreas", []) + + comboName = dfEditAreas + for retryCount in xrange(MAX_TRIES): + accessor = ModuleAccessor.ModuleAccessor() + dfEditAreas = accessor.variable(comboName, "Combinations") + if dfEditAreas is None: + if sys.modules.has_key(comboName): + comboMod = sys.modules[comboName] + if comboMod.__file__.endswith(".pyo"): + os.remove(comboMod.__file__) + comboMod = None + del sys.modules[comboName] + + # if not last try, log and try again + if retryCount < MAX_TRIES - 1: + # log but don't pop up + self.log.error("Error loading combinations file: %s, retrying", comboName) + else: + return "COMBINATION FILE NOT FOUND: " + \ + self.__ut.set(forecastDef, "defaultEditAreas", []) + else: + break elif len(dfEditAreas) > 0: refDataList = [] @@ -411,7 +429,7 @@ class TextFormatter: filterMethod = product.filterMethod except: allowedHazards = None - + if allowedHazards is not None and allowedHazards != []: # Set up editAreas as a list of combinations # Cases: @@ -440,7 +458,7 @@ class TextFormatter: "AreaDictionary") editAreas = self._separateByTimeZone(editAreas, areaDictName, argDict['creationTime'], - effectiveTZ = separateByTZ) + effectiveTZ=separateByTZ) accurateCities = product.Definition.get('accurateCities', 0) cityRefData = [] @@ -464,7 +482,7 @@ class TextFormatter: "contain entry for edit area: " self.log.error(msg + `ean`) continue - + for city, llrec in citydict[ean].iteritems(): # Create a referenceData given lat, lon, dim area = (llrec[0], llrec[1], 0) @@ -490,8 +508,8 @@ class TextFormatter: filterMethod, argDict["databaseID"], stationID4, argDict["vtecActiveTable"], argDict["vtecMode"], sampleThreshold, creationTime=argDict["creationTime"], dataMgr=self.dataMgr, - accurateCities=accurateCities, - cityEditAreas=cityRefData) + accurateCities=accurateCities, + cityEditAreas=cityRefData) # Store hazards object for later use argDict["hazards"] = hazards @@ -540,7 +558,7 @@ class TextFormatter: except: trName = "" if tr is not None: - rawRanges.append((tr,trName)) + rawRanges.append((tr, trName)) elif len(dfRanges) == 0: pass else: @@ -548,13 +566,13 @@ class TextFormatter: forecast = TimeRangeUtils.TimeRangeUtils() for rangeName in dfRanges: rawRange = forecast.getTimeRange(rangeName, argDict) - rawRanges.append((rawRange,rangeName)) + rawRanges.append((rawRange, rangeName)) argDict["rawRanges"] = rawRanges #print "rawRanges", rawRanges # Row Label - areaType = self.__ut.set(forecastDef,"areaType","") - rowVariable = self.__ut.set(forecastDef,"rowVariable","EditArea") + areaType = self.__ut.set(forecastDef, "areaType", "") + rowVariable = self.__ut.set(forecastDef, "rowVariable", "EditArea") if rowVariable == "EditArea": rowLabel = areaType elif rowVariable == "WeatherElement": @@ -566,7 +584,7 @@ class TextFormatter: def __pairAreaWithLabel(self, chosenAreas, defaultEditAreas): # Pair the chosen edit areas with associated labels from # default list and return new list - dfEditAreas= [] + dfEditAreas = [] for area in chosenAreas: for name, label in defaultEditAreas: if area == name: @@ -620,8 +638,8 @@ class TextFormatter: def __getLatLonAreaName(self, latLonTuple): lat, lon, dim = latLonTuple name = "Ref" + '%s%s%s' % (lat, lon, dim) - name = name.replace(".","") - name = name.replace("-","") + name = name.replace(".", "") + name = name.replace("-", "") return name def getCombinations(self, combinations, argDict): @@ -635,7 +653,7 @@ class TextFormatter: newArea = self.getEditArea(editArea, argDict) if comboList.index(editArea) == 0: comboNumber = self.getComboNumber() - label = "Combo"+`comboNumber` + label = "Combo" + `comboNumber` refId = ReferenceID(label) #global GridLoc #GridLoc = newArea.getGloc() @@ -680,7 +698,7 @@ class TextFormatter: try: product = argDict["self"] - exec "fcstDef = product."+fcstName+"()" + exec "fcstDef = product." + fcstName + "()" module = argDict["module"] except: # See if fcstName is variable in imported modules e.g. MyTable = {} @@ -699,7 +717,7 @@ class TextFormatter: try: # Look for fcstName = {} # This can be removed eventually - exec "fcstDef = module."+fcstName + exec "fcstDef = module." + fcstName except: try: # Try to instantiate smart text product class @@ -750,7 +768,7 @@ class TextFormatter: def getEditArea(self, editAreaName, argDict): # Returns an AFPS.ReferenceData object given an edit area name - # as defined in the GFE + # as defined in the GFE # Apply suffix if appropriate refID = ReferenceID(editAreaName) #print "Getting edit area" @@ -779,7 +797,7 @@ class TextFormatter: return tmp def _separateByTimeZone(self, editAreaGroups, areaDictName, creationTime, - effectiveTZ = "effectiveTZ"): + effectiveTZ="effectiveTZ"): #takes the list of areas, and based on the time zones breaks #them up to ensure that each grouping using the same time zone. #areaDictName is name of the area dictionary. creationTime is the @@ -817,7 +835,7 @@ class TextFormatter: zoneTZ = localTZ tzid = localTZid #print "falling back to WFOtz: ", zoneTZ - self.log.warning("WARNING: Entry " + area + + self.log.warning("WARNING: Entry " + area + " missing from AreaDictionary. Using default time zone.") zones = tzDir.get(zoneTZ, []) @@ -835,7 +853,7 @@ class TextFormatter: elif effectiveTZ == "actualTZ": dict = tzDir else: - self.log.error("Invalid effectiveTZ for separateByTZ() " + + self.log.error("Invalid effectiveTZ for separateByTZ() " + effectiveTZ) return editAreaGroups keys = dict.keys() @@ -850,39 +868,39 @@ class TextFormatter: ################################################################# def makeSquare(lat, lon, km): " Make a list of square of given km around lat,lon" - latinc = km/222.0 - loninc = math.cos(lat/57.17) * km / 222.0 + latinc = km / 222.0 + loninc = math.cos(lat / 57.17) * km / 222.0 latTop = lat + latinc - latBottom =lat - latinc + latBottom = lat - latinc lonLeft = lon - loninc lonRight = lon + loninc points = [] - points.append(`latTop`+","+ `lonRight`) - points.append(`latTop`+","+ `lonLeft`) - points.append(`latBottom`+","+ `lonLeft`) - points.append(`latBottom`+","+`lonRight`) + points.append(`latTop` + "," + `lonRight`) + points.append(`latTop` + "," + `lonLeft`) + points.append(`latBottom` + "," + `lonLeft`) + points.append(`latBottom` + "," + `lonRight`) return points def makePoint(point): " Make a CartCoord2D from the point in format: x,y" from com.vividsolutions.jts.geom import Coordinate - ind = string.find(point,",") - latStr = point[0:ind-1] - lonStr = point[ind+1:len(point)] + ind = string.find(point, ",") + latStr = point[0:ind - 1] + lonStr = point[ind + 1:len(point)] lat = float(latStr) - lon = float(lonStr) - return Coordinate(lon,lat) + lon = float(lonStr) + return Coordinate(lon, lat) def makeArea(gridLoc, pointList, refname=None): " Make a Reference Area with a unique ReferenceID" from com.vividsolutions.jts.geom import GeometryFactory, LinearRing, Coordinate, Polygon - from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType + from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType geomFactory = GeometryFactory() import jep size = len(pointList) - if pointList[0] != pointList[size-1]: # closing the loop + if pointList[0] != pointList[size - 1]: # closing the loop pointList.append(pointList[0]) pointArray = jep.jarray(len(pointList), Coordinate) for i in range(len(pointList)): @@ -893,7 +911,7 @@ def makeArea(gridLoc, pointList, refname=None): polyArray[0] = poly region = geomFactory.createMultiPolygon(polyArray) if refname is None: - refname = "Ref" + getTime() + refname = "Ref" + getTime() refId = ReferenceID(refname) refData = ReferenceData(gridLoc, refId, region, CoordinateType.LATLON) # randerso: I don't think this is necessary @@ -913,8 +931,8 @@ def storeReferenceData(refSetMgr, refData, temp=True): def getTime(): "Return an ascii string for the current time without spaces or :'s" - timeStr = `time.time()` - timeStr = string.replace(timeStr,".","_") + timeStr = `time.time()` + timeStr = string.replace(timeStr, ".", "_") return timeStr def getAbsTime(timeStr): @@ -926,7 +944,7 @@ def getAbsTime(timeStr): hour = string.atoi(timeStr[9:11]) minute = string.atoi(timeStr[11:13]) - return AFPSSup.AbsTimeYMD(year,month,day,hour,minute) + return AbsTime.absTimeYMD(year, month, day, hour, minute) def usage(): print """ diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/utilities/SmartScript.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/utilities/SmartScript.py index 4d24e6f8d7..4f641b8131 100644 --- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/utilities/SmartScript.py +++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/utilities/SmartScript.py @@ -54,6 +54,7 @@ # Oct 31, 2013 2508 randerso Change to use DiscreteGridSlice.getKeys() # Nov 07, 2013 2476 dgilling Fix _getGridsResult() for retrieving # Wx/Discrete in First mode. +# Dec 23, 2013 16893 ryu Added unloadWEs() method (created by njensen) # ######################################################################## import types, string, time, sys @@ -1500,7 +1501,6 @@ class SmartScript(BaseTool.BaseTool): tzname = self.__dataMgr.getClient().getSiteTimeZone() tz = dateutil.tz.gettz(tzname) - utczone = dateutil.tz.gettz('UTC') gmdt = self._gmtime(date).replace(tzinfo=utczone) tzdt = gmdt.astimezone(tz) @@ -1803,6 +1803,19 @@ class SmartScript(BaseTool.BaseTool): parmJA[0] = parm self.__parmMgr.deleteParm(parmJA) + def unloadWEs(self, model, elementLevelPairs, mostRecent=0): + jparms = [] + for element, level in elementLevelPairs: + exprName = self.getExprName(model, element, level, mostRecent) + parm = self.__parmMgr.getParmInExpr(exprName, 1) + if parm: + jparms.append(parm) + if jparms: + parmJA = jep.jarray(len(jparms), jparms[0]) + for i in xrange(len(jparms)): + parmJA[i] = jparms[i] + self.__parmMgr.deleteParm(parmJA) + def saveElements(self, elementList): # Save the given Fcst elements to the server # Example: diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java index 3b008d4387..81761361f2 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/FormatterLauncherDialog.java @@ -28,6 +28,7 @@ import java.util.Set; import java.util.TimeZone; import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MenuAdapter; @@ -97,6 +98,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * up warnings. * May 15, 2013 1842 dgilling Pass DataManager instance down to sub- * components. + * Feb 12, 2014 2801 randerso Added prompting if formatter is run against non-normal database * * * @@ -106,6 +108,12 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; public class FormatterLauncherDialog extends CaveJFACEDialog implements IProductTab { + + // formatter data sources. Fcst must be first + private static enum FormatterDataSource { + Fcst, ISC, Official, Default, + } + private final transient IUFStatusHandler statusHandler = UFStatus .getHandler(FormatterLauncherDialog.class); @@ -161,24 +169,9 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements private Image failedImg; /** - * Fcst data source menu item. + * data source menu items */ - private MenuItem fcstMI = null; - - /** - * Official data source menu item. - */ - private MenuItem officialMI = null; - - /** - * ISC data source menu item. - */ - private MenuItem iscMI = null; - - /** - * Default data source menu item. - */ - private MenuItem defaultMI = null; + private java.util.List dataSourceMI; /** * Products menu. @@ -212,8 +205,6 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements private DataManager dataMgr; - private String selectedDataSource = null; - private boolean doClose = false; /** @@ -338,59 +329,47 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements // Get the CAVE operating mode CAVEMode mode = dataMgr.getOpMode(); - // Forecast menu item, set text based on operating mode - fcstMI = new MenuItem(dataSourceMenu, SWT.RADIO); - if (mode.equals(CAVEMode.OPERATIONAL)) { - fcstMI.setText("Fcst"); - } else if (mode.equals(CAVEMode.PRACTICE)) { - fcstMI.setText("Fcst_Prac"); - fcstMI.setSelection(true); - } else { - fcstMI.setText("Fcst_Test"); - fcstMI.setSelection(true); - } - fcstMI.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - selectedDataSource = dataMgr.getParmManager() - .getMutableDatabase().toString(); + this.dataSourceMI = new ArrayList(); + // create menu items + for (FormatterDataSource source : FormatterDataSource.values()) { + MenuItem item = new MenuItem(dataSourceMenu, SWT.RADIO); + item.setData(source); + this.dataSourceMI.add(item); + String text = source.toString(); + if (source.equals(FormatterDataSource.Fcst)) { + if (mode.equals(CAVEMode.PRACTICE)) { + text += "_Prac"; + } else if (mode.equals(CAVEMode.TEST)) { + text += "_Test"; + } } - }); + item.setText(text); + item.addSelectionListener(new SelectionAdapter() { - // Only show these menu items when in operational mode - if (mode.equals(CAVEMode.OPERATIONAL)) { - // ISC menu item - iscMI = new MenuItem(dataSourceMenu, SWT.RADIO); - iscMI.setText("ISC"); - iscMI.addSelectionListener(new SelectionAdapter() { @Override - public void widgetSelected(SelectionEvent event) { - getIscDataSource(); + public void widgetSelected(SelectionEvent e) { + MenuItem item = (MenuItem) e.getSource(); + if (item.getSelection()) { + statusHandler.handle( + Priority.EVENTB, + "User selected formatter data source: " + + item.getText()); + } } }); - // Official menu item - officialMI = new MenuItem(dataSourceMenu, SWT.RADIO); - officialMI.setText("Official"); - officialMI.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - selectedDataSource = getOfficialDataSource(); - } - }); + if (!mode.equals(CAVEMode.OPERATIONAL)) { + item.setSelection(true); + statusHandler.handle(Priority.EVENTB, + "Formatter default data source: " + item.getText()); + break; + } - // Default menu item - defaultMI = new MenuItem(dataSourceMenu, SWT.RADIO); - defaultMI.setText("Default"); - defaultMI.setSelection(true); - defaultMI.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent event) { - } - }); - } else { - selectedDataSource = dataMgr.getParmManager().getMutableDatabase() - .toString(); + if (source.equals(FormatterDataSource.Default)) { + item.setSelection(true); + statusHandler.handle(Priority.EVENTB, + "Formatter default data source: " + item.getText()); + } } } @@ -731,32 +710,108 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * The name of the product * @return The data source */ - public String getSelectedDataSource(String productName) { - if (fcstMI.getSelection()) { - selectedDataSource = getFcstDataSource(); - } else if (iscMI.getSelection()) { - selectedDataSource = getIscDataSource(); - } else if (officialMI.getSelection()) { - selectedDataSource = getOfficialDataSource(); - } else { - // Default value - ProductDefinition prodDef = textProductMgr - .getProductDefinition(productName); - String dataSource = (String) prodDef.get("database"); - if (dataSource == null) { - dataSource = "Official"; - } - - if (dataSource.equals("ISC")) { - selectedDataSource = getIscDataSource(); - } else if (dataSource.equals("Official")) { - selectedDataSource = getOfficialDataSource(); - } else { - selectedDataSource = getFcstDataSource(); + public DatabaseID getSelectedDataSource(String productName) { + FormatterDataSource menuDataSource = FormatterDataSource.Default; + for (MenuItem item : dataSourceMI) { + if (item.getSelection()) { + menuDataSource = (FormatterDataSource) item.getData(); + break; } } - return selectedDataSource; + // Default value + ProductDefinition prodDef = textProductMgr + .getProductDefinition(productName); + String dbString = (String) prodDef.get("database"); + FormatterDataSource productDataSource; + if (dbString == null) { + productDataSource = FormatterDataSource.Default; + } else { + try { + productDataSource = FormatterDataSource.valueOf(dbString); + } catch (IllegalArgumentException e) { + StringBuilder msg = new StringBuilder(); + msg.append("The "); + msg.append(productName); + msg.append(" product definition contains an invalid database selection: \""); + msg.append(dbString); + msg.append("\". Valid values are: ["); + for (FormatterDataSource src : FormatterDataSource.values()) { + if (!src.equals(FormatterDataSource.Default)) { + msg.append(src).append(", "); + } + } + msg.delete(msg.length() - 2, msg.length()); + msg.append("]"); + statusHandler.error(msg.toString()); + return null; + } + } + + FormatterDataSource dataSource; + if (menuDataSource.equals(FormatterDataSource.Default)) { + if (productDataSource.equals(FormatterDataSource.Default)) { + dataSource = FormatterDataSource.Official; + } else { + dataSource = productDataSource; + } + } else { + dataSource = menuDataSource; + } + + if (!productDataSource.equals(FormatterDataSource.Default)) { + if (!dataSource.equals(productDataSource)) { + // A check should be made that a hazard formatter is actually + // being run on the database specified in the Local or + // Definition file (Definition["database"] entry). If the + // database being run is different, provide a warning to the + // forecaster that requires acknowledgment before running. + MessageDialog dlg = new MessageDialog(getShell(), + "Confirm Data Source", null, + "The product definition indicates the " + productName + + " formatter should be run against the " + + productDataSource + + " database, but you have selected the " + + dataSource + + " database.\n\nDo you wish to continue?", + MessageDialog.WARNING, new String[] { "Yes", "No" }, 1); + int retVal = dlg.open(); + if (retVal != 0) { + dataSource = null; + } + } + } else { + if (dataSource.equals(FormatterDataSource.ISC)) { + // If the database is not explicitly defined (default), provide + // a a warning to the forecaster that requires acknowledgment + // before running if the database being used is ISC + MessageDialog dlg = new MessageDialog( + getShell(), + "Confirm Data Source", + null, + "You are about to run the " + + productName + + " formatter against the ISC database.\n\nDo you wish to continue?", + MessageDialog.WARNING, new String[] { "Yes", "No" }, 1); + int retVal = dlg.open(); + if (retVal != 0) { + dataSource = null; + } + } + } + + DatabaseID selectedDbId; + if (dataSource == null) { + selectedDbId = null; + } else if (dataSource.equals(FormatterDataSource.ISC)) { + selectedDbId = getIscDataSource(); + } else if (dataSource.equals(FormatterDataSource.Official)) { + selectedDbId = getOfficialDataSource(); + } else { + selectedDbId = getFcstDataSource(); + } + + return selectedDbId; } /** @@ -1009,8 +1064,8 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * * @return The FcstDataSource */ - private String getFcstDataSource() { - return dataMgr.getParmManager().getMutableDatabase().toString(); + private DatabaseID getFcstDataSource() { + return dataMgr.getParmManager().getMutableDatabase(); } /** @@ -1021,13 +1076,13 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * * @return The ISC Data Source */ - private String getIscDataSource() { + private DatabaseID getIscDataSource() { java.util.List dbs = dataMgr.getParmManager() .getIscDatabases(); if (dbs.size() > 0) { // Always return the last one in the list - return dbs.get(dbs.size() - 1).toString(); + return dbs.get(dbs.size() - 1); } return null; @@ -1038,12 +1093,12 @@ public class FormatterLauncherDialog extends CaveJFACEDialog implements * * @return The Official Data source */ - private String getOfficialDataSource() { - String source = null; + private DatabaseID getOfficialDataSource() { + DatabaseID source = null; try { ServerResponse> sr = dataMgr.getClient() .getOfficialDBName(); - source = sr.getPayload().get(0).toString(); + source = sr.getPayload().get(0); } catch (GFEServerException e) { statusHandler.handle(Priority.PROBLEM, "Unable to determine official db", e); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java index ac377cd260..2f16d0d691 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java @@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.TabFolder; +import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog; @@ -64,6 +65,8 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager; * 05 SEP 2013 2329 randerso Added call to ZoneCombinerComp.applyZoneCombo when * when run formatter button is clicked. * 05 FEB 2014 2591 randerso Added dataManager to ZoneCombinerComp constructor + * Passed dataMgr instance to FormatterUtil.runFormatterScript + * 12 FEB 2014 2801 randerso Added prompting if formatter is run against non-normal database * * * @@ -365,36 +368,37 @@ public class ProductAreaComp extends Composite implements productEditorBtnSelected(); if (okToLoseText()) { - productEditorComp.clearProductText(); - abortFormatterBtn.setEnabled(true); - // closeTabBtn.setEnabled(false); - runFormatterBtn.setEnabled(false); - String vtecMode = ""; - if (formattingCbo.isVisible()) { - vtecMode = formattingCbo.getText(); - } else { - int hazIndex = productName.indexOf("Hazard_"); - if (hazIndex > -1) { - String category = productName.substring( - hazIndex + 7, hazIndex + 10); - vtecMode = textProductMgr - .getVtecMessageType(category); - if (vtecMode == null) { - vtecMode = ""; + DatabaseID dbId = ((FormatterLauncherDialog) productTabCB) + .getSelectedDataSource(productName); + + if (dbId != null) { + productEditorComp.clearProductText(); + abortFormatterBtn.setEnabled(true); + // closeTabBtn.setEnabled(false); + runFormatterBtn.setEnabled(false); + String vtecMode = ""; + if (formattingCbo.isVisible()) { + vtecMode = formattingCbo.getText(); + } else { + int hazIndex = productName.indexOf("Hazard_"); + if (hazIndex > -1) { + String category = productName.substring( + hazIndex + 7, hazIndex + 10); + vtecMode = textProductMgr + .getVtecMessageType(category); + if (vtecMode == null) { + vtecMode = ""; + } } } - } - // Check the data source menus, if one is selected then - // use - // it, else use the default - String dbId = null; - zoneCombiner.applyZoneCombo(); - dbId = ((FormatterLauncherDialog) productTabCB) - .getSelectedDataSource(productName); - FormatterUtil.runFormatterScript(textProductMgr, - productName, dbId, vtecMode, - ProductAreaComp.this); + // Get the source database + zoneCombiner.applyZoneCombo(); + FormatterUtil.runFormatterScript(dataMgr, + textProductMgr, productName, + dbId.toString(), vtecMode, + ProductAreaComp.this); + } } } }); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java index bb281db254..ca3a85a581 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java @@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.textformatter; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -223,12 +224,18 @@ public class CombinationsFileUtil { // retrieve combinations file if it's changed LocalizationFile lf = pm.getStaticLocalizationFile(FileUtil.join( COMBO_DIR_PATH, comboName + ".py")); - File pyFile; - try { - pyFile = lf.getFile(true); - } catch (LocalizationException e) { - throw new GfeException("Error retrieving combinations file: " - + comboName, e); + File pyFile = null; + if (lf != null) { + try { + pyFile = lf.getFile(true); + } catch (LocalizationException e) { + throw new GfeException("Error retrieving combinations file: " + + comboName, e); + } + } + + if (pyFile == null || !pyFile.exists()) { + return Collections.emptyList(); } LocalizationContext baseContext = pm.getContext( diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java index 1d0915d84f..9cb65090f9 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java @@ -24,7 +24,6 @@ import java.util.TimeZone; 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.SimulatedTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.viz.core.mode.CAVEMode; @@ -42,6 +41,8 @@ import com.raytheon.viz.gfe.tasks.TaskManager; * Sep 8, 2008 njensen Initial creation * Jan 15, 2010 3395 ryu Fix "issued by" functionality * Sep 05, 2013 2329 randerso Removed save of combinations file + * Feb 12, 2014 2591 randerso Passed dataMgr instance to FormatterUtil.runFormatterScript + * Removed call to TextProductManager.reloadModule * * * @@ -59,6 +60,9 @@ public class FormatterUtil { /** * Runs a text formatter script for a given product * + * @param dataMgr + * the DataManager instance to use + * * @param productMgr * the formatter instance to use * @param productName @@ -70,22 +74,12 @@ public class FormatterUtil { * @param finish * listener to fire when formatter finishes generating product */ - public static void runFormatterScript(TextProductManager productMgr, - String productName, String dbId, String vtecMode, - TextProductFinishListener finish) { - try { - String filename = productMgr.getCombinationsFileName(productName); - boolean mapRequired = productMgr.mapRequired(productName); - if (filename != null && mapRequired) { - productMgr.reloadModule(filename); - } - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, - "Cannot generate combinations file", e); - } + public static void runFormatterScript(DataManager dataMgr, + TextProductManager productMgr, String productName, String dbId, + String vtecMode, TextProductFinishListener finish) { int testMode = 0; - if (DataManager.getCurrentInstance().getOpMode().equals(CAVEMode.TEST)) { + if (dataMgr.getOpMode().equals(CAVEMode.TEST)) { testMode = 1; } @@ -106,8 +100,7 @@ public class FormatterUtil { } String name = productMgr.getModuleName(productName); - String varDict = productMgr.getVarDict(productName, - DataManager.getCurrentInstance(), dbId); + String varDict = productMgr.getVarDict(productName, dataMgr, dbId); if (varDict != null) { // run the formatter with the normal active table diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java index 339d416024..b18878c0a6 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/TextProductManager.java @@ -55,9 +55,10 @@ import com.raytheon.viz.gfe.core.DataManager; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * May 1, 2009 njensen Initial creation - * Jan 15, 2010 3395 ryu Fix "issued by" functionality - * Apr 24, 2013 1936 dgilling Remove unused imports. + * May 1, 2009 njensen Initial creation + * Jan 15, 2010 3395 ryu Fix "issued by" functionality + * Apr 24, 2013 1936 dgilling Remove unused imports. + * Feb 12, 2014 2591 randerso Removed reloadModule method * * * @@ -269,17 +270,6 @@ public class TextProductManager { return mapName; } - protected void reloadModule(String moduleName) { - Map args = new HashMap(1); - args.put("moduleName", moduleName); - try { - script.execute("reloadModule", args); - } catch (JepException e) { - statusHandler.handle(Priority.PROBLEM, - "Exception reloading module " + moduleName, e); - } - } - public void setIssuedBy(String issuedBy) { if (LocalizationManager.getInstance().getCurrentSite().equals(issuedBy)) { this.issuedBy = ""; diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java index f74e5ce966..90e9186064 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java @@ -40,6 +40,7 @@ import com.raytheon.viz.grid.util.RadarProductCodeMapping; * ------------ ---------- ----------- -------------------------- * Sep 20, 2012 bsteffen Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 21, 2014 DR 16744 D. Friedman Support thin client updates * * * @@ -150,10 +151,14 @@ public class RadarUpdater implements IAlertObserver { @Override public void alertArrived(Collection alertMessages) { + ProductAlertObserver.processDataURIAlerts(convertRadarAlertsToGridDatauris(alertMessages)); + } + + public Set convertRadarAlertsToGridDatauris(Collection alertMessages) { RadarStation configuredRadar = RadarAdapter.getInstance() .getConfiguredRadar(); if (configuredRadar == null) { - return; + return new HashSet(); } Set datauris = new HashSet(); for (AlertMessage alertMessage : alertMessages) { @@ -209,7 +214,7 @@ public class RadarUpdater implements IAlertObserver { "Unable to generate updates for derived product", e); } } - ProductAlertObserver.processDataURIAlerts(datauris); + return datauris; } private CacheKey getCacheKey(RadarRequestableLevelNode rNode) { diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java index 305d0e6963..c655aa0e63 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java @@ -20,6 +20,7 @@ package com.raytheon.viz.grid.util; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -81,6 +82,7 @@ import com.raytheon.viz.radar.util.StationUtils; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 23, 2010 #4473 rjpeter Initial creation + * Feb 21, 2014 DR 16744 D. Friedman Add getUpdateConstraints * * * @@ -400,4 +402,23 @@ public class RadarAdapter { return rval; } + + public Map getUpdateConstraints() { + RadarProductCodeMapping rpcMap = RadarProductCodeMapping.getInstance(); + HashSet productCodes = new HashSet(); + for (String abbrev : rpcMap.getParameterAbbrevs()) { + productCodes.addAll(rpcMap.getProductCodesForAbbrev(abbrev)); + } + Map rcMap = new HashMap(); + rcMap.put(RadarAdapter.PLUGIN_NAME_QUERY, new RequestConstraint( + RADAR_SOURCE)); + rcMap.put(ICAO_QUERY, new RequestConstraint(getConfiguredRadar() + .getRdaId().toLowerCase())); + rcMap.put( + PRODUCT_CODE_QUERY, + new RequestConstraint(Arrays.toString(new ArrayList( + productCodes).toArray()), + RequestConstraint.ConstraintType.IN)); + return rcMap; + } } diff --git a/edexOsgi/build.edex/esb/conf/logback-ingest.xml b/edexOsgi/build.edex/esb/conf/logback-ingest.xml index 69f9fb5a80..3a0f3a324a 100644 --- a/edexOsgi/build.edex/esb/conf/logback-ingest.xml +++ b/edexOsgi/build.edex/esb/conf/logback-ingest.xml @@ -178,7 +178,7 @@ - RadarLog:radarThreadPool.*;SatelliteLog:satelliteThreadPool.*;ShefLog:shefThreadPool.*;TextLog:textThreadPool.*;SmartInitLog:smartInit.*;PurgeLog:Purge.*;ArchiveLog:Archive.* + RadarLog:Ingest.Radar.*;SatelliteLog:Ingest.Satellite.*;ShefLog:Ingest.Shef.*;TextLog:Ingest.Text.*;SmartInitLog:smartInit.*;PurgeLog:Purge.*;ArchiveLog:Archive.* asyncConsole diff --git a/edexOsgi/build.edex/esb/conf/logback-registry.xml b/edexOsgi/build.edex/esb/conf/logback-registry.xml index 7aed0ec22d..e4970fb742 100644 --- a/edexOsgi/build.edex/esb/conf/logback-registry.xml +++ b/edexOsgi/build.edex/esb/conf/logback-registry.xml @@ -90,11 +90,10 @@ - HarvesterLog:harvesterThreadPool.*,crawlerThreadPool.*,Crawler.*,RetrievalLog:retrievalThreadPool.*,retrievalThreadPool.*,Retrieval.* + HarvesterLog:harvester.*,crawlerThreadPool.*,Crawler.* console - diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml index dede45534e..a8183ab588 100644 --- a/edexOsgi/build.edex/esb/conf/modes.xml +++ b/edexOsgi/build.edex/esb/conf/modes.xml @@ -87,6 +87,7 @@ .*datadelivery.* .*bandwidth.* excludeDpaAndOgc + obs-ingest-metarshef.xml aww-ingest.xml ncep-util-on-edex-ingest @@ -117,10 +118,12 @@ shef-ingest.xml persist-ingest.xml obs-common.xml - obs-ingest.xml - metartohmdb-plugin.xml - pointdata-common.xml + obs-ingest.xml + obs-ingest-metarshef.xml + metartohmdb-plugin.xml + pointdata-common.xml shef-common.xml + ohd-common-database.xml ohd-common.xml alarmWhfs-spring.xml arealffgGenerator-spring.xml @@ -145,6 +148,7 @@ fssobs-common.xml + ohd-common-database.xml ohd-common.xml database-common.xml ohd-request.xml @@ -227,6 +231,7 @@ shef-common.xml satellite-common.xml satellite-dataplugin-common.xml + ohd-common-database.xml ohd-common.xml management-common.xml auth-common.xml diff --git a/edexOsgi/build.edex/esb/conf/spring/edex.xml b/edexOsgi/build.edex/esb/conf/spring/edex.xml index 8f08ea06e1..b680aed378 100644 --- a/edexOsgi/build.edex/esb/conf/spring/edex.xml +++ b/edexOsgi/build.edex/esb/conf/spring/edex.xml @@ -27,17 +27,17 @@ - - + + - + - + @@ -63,13 +63,13 @@ - + - + - + diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/res/spring/binlightning_ep-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.binlightning/res/spring/binlightning_ep-ingest.xml index 0e28d3357b..4c60b738c3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.binlightning/res/spring/binlightning_ep-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/res/spring/binlightning_ep-ingest.xml @@ -9,7 +9,7 @@ - + - + - + - + - + diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-request.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-request.xml index 8e1e641146..87c372b700 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-request.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-request.xml @@ -346,19 +346,13 @@ - - - - - - - + + - + @@ -370,16 +364,6 @@ - - - - - - - - - @@ -455,7 +439,7 @@ - + @@ -494,8 +478,7 @@ - + @@ -503,8 +486,7 @@ java.lang.Throwable - + @@ -515,7 +497,7 @@ autoStartup="false"> - + diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml index 811ab38a54..64d9cced5c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/res/spring/gfe-spring.xml @@ -4,15 +4,9 @@ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - - - - - - + + @@ -114,7 +108,7 @@ - + @@ -126,7 +120,7 @@ - + @@ -138,7 +132,6 @@ - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/isc/IscSendQueue.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/isc/IscSendQueue.java index a28fd672d0..8930f626f1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/isc/IscSendQueue.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/isc/IscSendQueue.java @@ -59,9 +59,10 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 20, 2011 dgilling Initial creation - * May 08, 2012 #600 dgilling Re-work logic for handling PENDING - * records. + * Oct 20, 2011 dgilling Initial creation + * May 08, 2012 600 dgilling Re-work logic for handling PENDING + * records. + * Feb 07, 2014 2357 rjpeter iscSendNotification uri. * * * @@ -74,9 +75,9 @@ public class IscSendQueue { // how we'll organize the temporary queue private class JobSetQueueKey { - private ParmID pid; + private final ParmID pid; - private IscSendState state; + private final IscSendState state; public JobSetQueueKey(ParmID pid, IscSendState state) { this.pid = pid; @@ -92,8 +93,9 @@ public class IscSendQueue { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((pid == null) ? 0 : pid.hashCode()); - result = prime * result + ((state == null) ? 0 : state.hashCode()); + result = (prime * result) + ((pid == null) ? 0 : pid.hashCode()); + result = (prime * result) + + ((state == null) ? 0 : state.hashCode()); return result; } @@ -148,7 +150,7 @@ public class IscSendQueue { private int timeoutMillis = 60000; - private Map> jobSet = new HashMap>(); + private final Map> jobSet = new HashMap>(); private static final IscSendQueue instance = new IscSendQueue(); @@ -168,7 +170,7 @@ public class IscSendQueue { try { byte[] messages = SerializationUtil.transformToThrift(sendJobs); EDEXUtil.getMessageProducer().sendAsyncUri( - "jms-iscsend:queue:iscSendNotification", messages); + "jms-durable:queue:iscSendNotification", messages); } catch (SerializationException e) { handler.error("Unable to serialize IscSendRecords.", e); } catch (EdexException e) { @@ -238,7 +240,7 @@ public class IscSendQueue { // Now combine time ranges if we can int i = 0; - while (i <= pending.size() - 2) { + while (i <= (pending.size() - 2)) { TimeRange time = pending.get(i).getTimeRange(); TimeRange time1 = pending.get(i + 1).getTimeRange(); diff --git a/edexOsgi/com.raytheon.edex.plugin.goessounding/res/spring/goessounding-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.goessounding/res/spring/goessounding-ingest.xml index 25158070e6..5f7aa56c3c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.goessounding/res/spring/goessounding-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.goessounding/res/spring/goessounding-ingest.xml @@ -12,7 +12,7 @@ - + - - - - - - - - - - - - @@ -53,7 +39,7 @@ autoStartup="false"> - + @@ -66,7 +52,7 @@ - + @@ -97,6 +83,5 @@ - diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-distribution.xml b/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-distribution.xml index f5d7db6c69..cdd021b194 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-distribution.xml +++ b/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-distribution.xml @@ -4,6 +4,6 @@ - + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.ldad/res/spring/ldad-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.ldad/res/spring/ldad-ingest.xml index 6c33246a98..84ae50fe1e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldad/res/spring/ldad-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldad/res/spring/ldad-ingest.xml @@ -8,7 +8,7 @@ - + - + diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml index 08bb3d9182..7d21714988 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml @@ -12,7 +12,7 @@ - + - + + + + + + + + + + + + + obs + + + + + + + + + + + + + + + java.lang.Throwable + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml new file mode 100644 index 0000000000..3fa8f85c54 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + obs + + + + + + + + + + + + + java.lang.Throwable + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml index f797a17d03..876404ccac 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - + @@ -12,42 +12,7 @@ - + - - - - - - - - - - - obs - - - - - - - - - - - - - - - java.lang.Throwable - - - - - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.poessounding/res/spring/poessounding-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.poessounding/res/spring/poessounding-ingest.xml index b82366bf4b..a5acee9edc 100644 --- a/edexOsgi/com.raytheon.edex.plugin.poessounding/res/spring/poessounding-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.poessounding/res/spring/poessounding-ingest.xml @@ -9,7 +9,7 @@ - + - + - - - - - - - - - - + - + - + radar - + --> - + radar-sbn @@ -61,7 +50,7 @@ - + radar-local diff --git a/edexOsgi/com.raytheon.edex.plugin.recco/res/spring/recco-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.recco/res/spring/recco-ingest.xml index 2ef0c4dbe6..7ab29724e2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.recco/res/spring/recco-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.recco/res/spring/recco-ingest.xml @@ -12,7 +12,7 @@ - + - + - + satellite diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/res/spring/sfcobs-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.sfcobs/res/spring/sfcobs-ingest.xml index 303c3f7cdc..097d703b64 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/res/spring/sfcobs-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/res/spring/sfcobs-ingest.xml @@ -13,7 +13,7 @@ - + - - - - - - - - - - @@ -47,13 +35,13 @@ factory-method="register"> + value="jms-durable:queue:Ingest.Shef"/> - + + uri="jms-durable:queue:Ingest.Shef"/> shef @@ -103,7 +91,7 @@ + uri="jms-durable:queue:Ingest.ShefStaged"/> shef @@ -155,7 +143,7 @@ + uri="jms-durable:queue:Ingest.ShefManual"/> shef diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml index fcd1df9358..651083abdb 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml @@ -9,13 +9,13 @@ - + - + * @@ -102,7 +103,6 @@ public class ChangeGroup extends PersistableDataObject { @Id @GeneratedValue - @DynamicSerializeElement private int id; /** A String containing the change group */ @@ -885,6 +885,11 @@ public class ChangeGroup extends PersistableDataObject { public void setTurbulence_layers(Set turbulence_layers) { this.turbulence_layers = turbulence_layers; + if ((turbulence_layers != null) && (turbulence_layers.size() > 0)) { + for (TurbulenceLayer turbulence_layer : turbulence_layers) { + turbulence_layer.setParentID(this); + } + } } public Set getIcing_layers() { @@ -893,6 +898,11 @@ public class ChangeGroup extends PersistableDataObject { public void setIcing_layers(Set icing_layers) { this.icing_layers = icing_layers; + if ((icing_layers != null) && (icing_layers.size() > 0)) { + for (IcingLayer icing_layer : icing_layers) { + icing_layer.setParentID(this); + } + } } public Set getTemp_forecasts() { @@ -901,6 +911,11 @@ public class ChangeGroup extends PersistableDataObject { public void setTemp_forecasts(Set temp_forecasts) { this.temp_forecasts = temp_forecasts; + if ((temp_forecasts != null) && (temp_forecasts.size() > 0)) { + for (TemperatureForecast temForecast : temp_forecasts) { + temForecast.setParentID(this); + } + } } public Set getWeather() { @@ -909,6 +924,11 @@ public class ChangeGroup extends PersistableDataObject { public void setWeather(Set weather) { this.weather = weather; + if ((weather != null) && (weather.size() > 0)) { + for (TafWeatherCondition twc : weather) { + twc.setParentID(this); + } + } } public Set getSky_cover() { @@ -917,6 +937,11 @@ public class ChangeGroup extends PersistableDataObject { public void setSky_cover(Set sky_cover) { this.sky_cover = sky_cover; + if ((sky_cover != null) && (sky_cover.size() > 0)) { + for (TafSkyCover tsc : sky_cover) { + tsc.setParentID(this); + } + } } private void checkGroupDataEnd(StringBuilder group) { diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java index 3b9804ee88..abe688217b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java @@ -65,6 +65,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Nov 01, 2013 2361 njensen Remove XML annotations + * Feb 10, 2014 2777 rferrel Assign parent id when setting ChangeGroup. + * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * * * @@ -277,6 +279,11 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { */ public void setChangeGroups(Set changeGroups) { this.changeGroups = changeGroups; + if ((changeGroups != null) && (changeGroups.size() > 0)) { + for (ChangeGroup changeGroup : changeGroups) { + changeGroup.setParentID(this); + } + } } /** @@ -324,19 +331,6 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { this.remarks = remarks; } - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - if ((this.changeGroups != null) && (this.changeGroups.size() > 0)) { - for (ChangeGroup group : this.changeGroups) { - group.setParentID(this); - } - } - - } - @Override public ObStation getSpatialObject() { return location; diff --git a/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml index f2c2cdc1bc..95a4a7083a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml @@ -11,13 +11,13 @@ - + - + @@ -27,18 +27,6 @@ - - - - - - - - - - @@ -118,7 +106,7 @@ - + text @@ -145,7 +133,7 @@ - + diff --git a/edexOsgi/com.raytheon.edex.plugin.textlightning/res/spring/textlightning_ep-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.textlightning/res/spring/textlightning_ep-ingest.xml index feb8c3a7a6..5f5ada5907 100644 --- a/edexOsgi/com.raytheon.edex.plugin.textlightning/res/spring/textlightning_ep-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.textlightning/res/spring/textlightning_ep-ingest.xml @@ -9,7 +9,7 @@ - + - + - + - - - - - - - - - - - + warning @@ -67,10 +55,10 @@ - + - + @@ -80,10 +68,5 @@ - - - - - - \ No newline at end of file + diff --git a/edexOsgi/com.raytheon.edex.textdb/res/spring/textdb-request.xml b/edexOsgi/com.raytheon.edex.textdb/res/spring/textdb-request.xml index 5ebc2d0a0f..12bb2fc4aa 100644 --- a/edexOsgi/com.raytheon.edex.textdb/res/spring/textdb-request.xml +++ b/edexOsgi/com.raytheon.edex.textdb/res/spring/textdb-request.xml @@ -41,12 +41,18 @@ - - - + + + - + + + + + + @@ -64,7 +70,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java index 173fad6ece..15caba37ac 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java @@ -97,6 +97,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * * * @author bphillip @@ -984,6 +985,11 @@ public class MetarRecord extends PersistablePluginDataObject implements */ public void setSkyCoverage(Set skyCoverage) { this.skyCoverage = skyCoverage; + if ((skyCoverage != null) && (skyCoverage.size() > 0)) { + for (SkyCover cover : skyCoverage) { + cover.setParentMetar(this); + } + } } public void addSkyCoverage(SkyCover cover) { @@ -1019,6 +1025,11 @@ public class MetarRecord extends PersistablePluginDataObject implements */ public void setWeatherCondition(List weatherCondition) { this.weatherCondition = weatherCondition; + if ((weatherCondition != null) && (weatherCondition.size() > 0)) { + for (WeatherCondition cond : weatherCondition) { + cond.setParentMetar(this); + } + } } public void addWeatherCondition(WeatherCondition condition) { @@ -1116,30 +1127,6 @@ public class MetarRecord extends PersistablePluginDataObject implements this.snowWater = snowWater; } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - // set the parentID to the dataURI for all values - if ((this.getWeatherCondition() != null) - && (this.getWeatherCondition().size() > 0)) { - for (WeatherCondition cond : this.getWeatherCondition()) { - cond.setParentMetar(this); - } - } - - // set the parentID to the dataURI for all values - if ((this.getSkyCoverage() != null) - && (this.getSkyCoverage().size() > 0)) { - for (SkyCover cover : this.getSkyCoverage()) { - cover.setParentMetar(this); - } - } - } - public String getReportType() { return reportType; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.java b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.java index eb55100ec0..eb5657f98e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.java @@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** * This is the root class for any object being persisted in the database using @@ -50,6 +49,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 7/24/07 353 bphillip Initial Check in * 20080408 1039 jkorman Added traceId for tracing data. * Oct 10, 2012 1261 djohnson Add generic for identifier. + * Feb 11, 2014 2784 rferrel Identifier no longer a DynamicSerializeElement. * * * @@ -59,8 +59,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public abstract class PersistableDataObject implements - IPersistableDataObject, - Serializable, ISerializableObject { + IPersistableDataObject, Serializable, + ISerializableObject { private static final long serialVersionUID = -6747395152869923909L; @@ -69,7 +69,6 @@ public abstract class PersistableDataObject implements * key for the associated database table. */ @XmlElement - @DynamicSerializeElement protected IDENTIFIER_TYPE identifier; private String traceId = ""; diff --git a/edexOsgi/com.raytheon.uf.common.jms/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.jms/META-INF/MANIFEST.MF index b55485d361..5677c0d2f5 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.common.jms/META-INF/MANIFEST.MF @@ -5,6 +5,7 @@ Bundle-SymbolicName: com.raytheon.uf.common.jms Bundle-Version: 1.12.1174.qualifier Bundle-Vendor: Raytheon Require-Bundle: javax.jms, - com.raytheon.uf.common.status + com.raytheon.uf.common.status, + org.apache.qpid Export-Package: com.raytheon.uf.common.jms Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnection.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnection.java index 27076515d6..4a806981a7 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnection.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnection.java @@ -39,7 +39,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * connection can be released to the pool. Any exception will close pooled * session instead of returning to the pool. The sessions are tracked in both * active and available states. An available session can be reused by the next - * client. + * client. The connection is pinned to Thread that creates the connection and + * cannot be used/reused by any other thread. * * Synchronization Principle To prevent deadlocks: Chained sync blocks can only * happen in a downward direction. A manager has a synchronized lock can make a @@ -52,9 +53,11 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 15, 2011 rjpeter Initial creation - * Mar 08, 2012 194 njensen Improved safety of close() - * Feb 21, 2013 1642 rjpeter Fix deadlock scenario + * Apr 15, 2011 rjpeter Initial creation. + * Mar 08, 2012 194 njensen Improved safety of close(). + * Feb 21, 2013 1642 rjpeter Fix deadlock scenario. + * Feb 07, 2014 2357 rjpeter Track by Thread, close session is it has no + * producers/consumers. * * * @author rjpeter @@ -86,7 +89,7 @@ public class JmsPooledConnection implements ExceptionListener { private volatile AvailableJmsPooledObject availableSession = null; - private volatile String key = null; + private final Thread thread; private final String clientId; @@ -94,8 +97,10 @@ public class JmsPooledConnection implements ExceptionListener { private volatile boolean exceptionOccurred = false; - public JmsPooledConnection(JmsPooledConnectionFactory connFactory) { + public JmsPooledConnection(JmsPooledConnectionFactory connFactory, + Thread thread) { this.connFactory = connFactory; + this.thread = thread; this.clientId = null; getConnection(); } @@ -123,7 +128,8 @@ public class JmsPooledConnection implements ExceptionListener { if (availableSession != null) { JmsPooledSession availSess = availableSession.getPooledObject(); synchronized (availSess.getStateLock()) { - if (availSess.isValid()) { + if (availSess.isValid() + && availSess.hasProducersOrConsumers()) { availSess.setState(State.InUse); session = availSess; } else { @@ -185,6 +191,7 @@ public class JmsPooledConnection implements ExceptionListener { } if (canClose) { + statusHandler.info("Closing connection: " + this.toString()); // njensen: I moved removing the connection from the pool to be // the first thing in this block instead of last thing so // there's no chance it could be closed and then retrieved from @@ -283,6 +290,8 @@ public class JmsPooledConnection implements ExceptionListener { // safe since conn is volatile synchronized (stateLock) { if (conn == null) { + statusHandler.info("Creating connection: " + + this.toString()); long exceptionLastHandled = 0; boolean connected = false; while (!connected) { @@ -298,7 +307,7 @@ public class JmsPooledConnection implements ExceptionListener { connectionStartTime = System.currentTimeMillis(); connected = true; } catch (Exception e) { - if (exceptionLastHandled + ERROR_BROADCAST_INTERVAL < System + if ((exceptionLastHandled + ERROR_BROADCAST_INTERVAL) < System .currentTimeMillis()) { exceptionLastHandled = System .currentTimeMillis(); @@ -502,12 +511,8 @@ public class JmsPooledConnection implements ExceptionListener { } } - public void setKey(String key) { - this.key = key; - } - - public String getKey() { - return key; + public Thread getThread() { + return thread; } /** diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnectionFactory.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnectionFactory.java index 8d9bc5d682..85023845a7 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnectionFactory.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConnectionFactory.java @@ -57,7 +57,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * ------------ ---------- ----------- -------------------------- * Apr 15, 2011 rjpeter Initial creation * Oct 04, 2013 2357 rjpeter Removed pooling, keeps resources open for the - * thread that created them for a configured amount of time + * thread that created them for a configured amount of time. + * Feb 07, 2014 2357 rjpeter Track by Thread object, periodly check that tracked Threads are still alive. * * * @author rjpeter @@ -72,11 +73,11 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { private String provider = "QPID"; - // connections in use, key is "threadId-threadName" - private final Map inUseConnections = new HashMap(); + // connections in use + private final Map inUseConnections = new HashMap(); - // connections that were recently returned, key is "threadId-threadName" - private final Map> pendingConnections = new HashMap>(); + // connections that were recently returned + private final Map> pendingConnections = new HashMap>(); private final ConcurrentLinkedQueue deadConnections = new ConcurrentLinkedQueue(); @@ -95,24 +96,23 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { */ @Override public Connection createConnection() throws JMSException { - String threadKey = "" + Thread.currentThread().getId() + "-" - + Thread.currentThread().getName(); + Thread thread = Thread.currentThread(); JmsPooledConnection conn = null; synchronized (inUseConnections) { - conn = inUseConnections.get(threadKey); + conn = inUseConnections.get(thread); if (conn != null) { JmsConnectionWrapper ref = conn.createReference(); if (ref != null) { statusHandler - .info(threadKey + .info(thread.getName() + " already has a connection in use, returning previous connection thread, references=" + conn.getReferenceCount()); return ref; } else { deadConnections.add(conn); - inUseConnections.remove(threadKey); + inUseConnections.remove(thread); conn = null; } } @@ -122,13 +122,13 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { // check connections by Thread synchronized (pendingConnections) { - wrapper = pendingConnections.remove(threadKey); + wrapper = pendingConnections.remove(thread); } // was retrieved connection valid if (wrapper != null) { conn = wrapper.getPooledObject(); - JmsConnectionWrapper ref = getConnectionWrapper(threadKey, conn); + JmsConnectionWrapper ref = getConnectionWrapper(conn); if (ref != null) { return ref; @@ -140,22 +140,20 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { // create new connection? if (conn == null) { - conn = new JmsPooledConnection(this); + conn = new JmsPooledConnection(this, thread); } - return getConnectionWrapper(threadKey, conn); + return getConnectionWrapper(conn); } - private JmsConnectionWrapper getConnectionWrapper(String threadKey, - JmsPooledConnection conn) { + private JmsConnectionWrapper getConnectionWrapper(JmsPooledConnection conn) { synchronized (conn.getStateLock()) { if (conn.isValid()) { conn.setState(State.InUse); JmsConnectionWrapper ref = conn.createReference(); if (ref != null) { - conn.setKey(threadKey); synchronized (inUseConnections) { - inUseConnections.put(threadKey, conn); + inUseConnections.put(conn.getThread(), conn); } return ref; } @@ -207,13 +205,13 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { } public void removeConnectionFromPool(JmsPooledConnection conn) { - String threadKey = conn.getKey(); + Thread thread = conn.getThread(); boolean success = false; // remove it from inUseConnections if it was in use, theoretically could // go by connection state, but may miss something due to threading synchronized (inUseConnections) { - JmsPooledConnection inUse = inUseConnections.remove(threadKey); + JmsPooledConnection inUse = inUseConnections.remove(thread); // make sure the one we removed is indeed this connection, 99% // of time this is correct @@ -228,7 +226,7 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { // really only here for bullet proofing code against bad // use of pool if (inUse != null) { - inUseConnections.put(threadKey, inUse); + inUseConnections.put(thread, inUse); } } } @@ -236,13 +234,13 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { // remove it from pendingConnections AvailableJmsPooledObject pooledObj = null; synchronized (pendingConnections) { - pooledObj = pendingConnections.remove(threadKey); + pooledObj = pendingConnections.remove(thread); if (pooledObj != null) { if (pooledObj.getPooledObject() == conn) { // found conn, done return; } else { - pendingConnections.put(threadKey, pooledObj); + pendingConnections.put(thread, pooledObj); } } } @@ -250,10 +248,10 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { public boolean returnConnectionToPool(JmsPooledConnection conn) { boolean success = false; - String threadKey = conn.getKey(); + Thread thread = conn.getThread(); synchronized (inUseConnections) { - JmsPooledConnection inUse = inUseConnections.remove(threadKey); + JmsPooledConnection inUse = inUseConnections.remove(thread); // make sure the one we removed is indeed this connection, 99% // of time this is correct @@ -265,7 +263,7 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { // really only here for bullet proofing code against bad // use of pool if (inUse != null) { - inUseConnections.put(threadKey, inUse); + inUseConnections.put(thread, inUse); statusHandler .handle(Priority.INFO, "Another connection already in use for this thread, not returning this connection to pool"); @@ -279,7 +277,7 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { AvailableJmsPooledObject prev = null; synchronized (pendingConnections) { prev = pendingConnections - .put(threadKey, + .put(thread, new AvailableJmsPooledObject( conn)); } @@ -317,6 +315,19 @@ public class JmsPooledConnectionFactory implements ConnectionFactory { } } + // check for dead threads + synchronized (inUseConnections) { + Iterator> iter = inUseConnections + .entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry entry = iter.next(); + if (!entry.getKey().isAlive()) { + iter.remove(); + deadConnections.add(entry.getValue()); + } + } + } + while (!deadConnections.isEmpty()) { JmsPooledConnection conn = deadConnections.poll(); if (conn != null) { diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConsumer.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConsumer.java index f8e3e053fa..0a671ffbd9 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConsumer.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledConsumer.java @@ -26,6 +26,8 @@ import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.MessageConsumer; +import org.apache.qpid.client.BasicMessageConsumer; + import com.raytheon.uf.common.jms.wrapper.JmsConsumerWrapper; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -47,9 +49,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 18, 2011 rjpeter Initial creation - * Mar 08, 2012 194 njensen Improved logging - * Feb 26, 2013 1642 rjpeter Removed lazy initialization + * Apr 18, 2011 rjpeter Initial creation. + * Mar 08, 2012 194 njensen Improved logging. + * Feb 26, 2013 1642 rjpeter Removed lazy initialization. + * Feb 07, 2014 2357 rjpeter Updated logging. * * * @author rjpeter @@ -87,6 +90,14 @@ public class JmsPooledConsumer { this.destKey = destKey; consumer = sess.getSession().createConsumer(destination, messageSelector); + + if (consumer instanceof BasicMessageConsumer) { + statusHandler.info("Creating AMQ consumer " + + ((BasicMessageConsumer) consumer).getDestination() + .getQueueName()); // njensen + } else { + statusHandler.info("Creating consumer " + destKey); // njensen + } } public String getDestKey() { @@ -164,7 +175,13 @@ public class JmsPooledConsumer { if (close) { try { - statusHandler.info("Closing consumer " + destKey); // njensen + if (consumer instanceof BasicMessageConsumer) { + statusHandler.info("Closing AMQ consumer " + + ((BasicMessageConsumer) consumer) + .getDestination().getQueueName()); // njensen + } else { + statusHandler.info("Closing consumer " + destKey); // njensen + } consumer.close(); } catch (Throwable e) { statusHandler.handle(Priority.WARN, "Failed to close consumer " diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledProducer.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledProducer.java index e693b74750..445e7fff4a 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledProducer.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledProducer.java @@ -25,6 +25,9 @@ import java.util.List; import javax.jms.JMSException; import javax.jms.MessageProducer; +import org.apache.qpid.client.AMQDestination; +import org.apache.qpid.client.BasicMessageProducer; + import com.raytheon.uf.common.jms.wrapper.JmsProducerWrapper; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -46,9 +49,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 18, 2011 rjpeter Initial creation - * Mar 08, 2012 194 njensen Improved logging - * Feb 26, 2013 1642 rjpeter Removed lazy initialization + * Apr 18, 2011 rjpeter Initial creation. + * Mar 08, 2012 194 njensen Improved logging. + * Feb 26, 2013 1642 rjpeter Removed lazy initialization. + * Feb 07, 2014 2357 rjpeter Updated logging. * * * @author rjpeter @@ -84,6 +88,19 @@ public class JmsPooledProducer { this.sess = sess; this.destKey = destKey; this.producer = producer; + if (producer instanceof BasicMessageProducer) { + try { + statusHandler.info("Creating AMQ producer " + + ((AMQDestination) ((BasicMessageProducer) producer) + .getDestination()).getQueueName()); + } catch (Exception e) { + statusHandler + .error("Could not get producer destination for key " + + destKey, e); + } + } else { + statusHandler.info("Creating producer " + destKey); // njensen + } } public String getDestKey() { @@ -161,7 +178,14 @@ public class JmsPooledProducer { if (close) { try { - statusHandler.info("Closing producer " + destKey); // njensen + if (producer instanceof BasicMessageProducer) { + statusHandler + .info("Closing AMQ producer " + + ((AMQDestination) ((BasicMessageProducer) producer) + .getDestination()).getQueueName()); // njensen + } else { + statusHandler.info("Closing producer " + destKey); // njensen + } producer.close(); } catch (Throwable e) { statusHandler.handle(Priority.WARN, "Failed to close producer", diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledSession.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledSession.java index 241b6c73e3..9c1ce83c72 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledSession.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/JmsPooledSession.java @@ -44,7 +44,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * can be released to the pool. Any exception will close pooled session instead * of returning to the pool. The consumers/producers are tracked in both active * and available states. An available consumer/producer can be reused by the - * next client. + * next client. Once a consumer has been closed the entire session is closed at + * next opportunity since QPID tracks consumers at the session level. Not doing + * this can leave a topic with no consumers on the qpid broker. * * Synchronization Principle To prevent deadlocks: Chained sync blocks can only * happen in a downward direction. A manager has a synchronized lock can make a @@ -61,6 +63,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Mar 08, 2012 194 njensen Improved logging * Feb 21, 2013 1642 rjpeter Fix deadlock scenario * Jan 26, 2014 2357 rjpeter Close a session when it has no producers or consumers. + * Feb 07, 2014 2357 rjpeter Close session at next return to pool after a + * consumer has closed. * * * @author rjpeter @@ -78,7 +82,7 @@ public class JmsPooledSession { // The thread this session was most recently used by for tracking a pending // session that is being reserved for a given thread. - private String threadKey; + private final Thread thread; private volatile boolean exceptionOccurred = false; @@ -86,6 +90,10 @@ public class JmsPooledSession { private volatile State state = State.InUse; + // flag to stat that session should be closed instead of returned to pool on + // next iteration + private volatile boolean shouldClose = false; + // keeps track of number of creates vs. closes to know when it can be // returned to the pool private final List references = new ArrayList( @@ -102,6 +110,8 @@ public class JmsPooledSession { public JmsPooledSession(JmsPooledConnection conn, Session sess) { this.conn = conn; this.sess = sess; + this.thread = conn.getThread(); + statusHandler.info("Opening session: " + this.toString()); } public long getCreateTime() { @@ -121,12 +131,8 @@ public class JmsPooledSession { return conn; } - public String getThreadKey() { - return threadKey; - } - - public void setThreadKey(String threadKey) { - this.threadKey = threadKey; + public Thread getThread() { + return thread; } public boolean isValid() { @@ -437,6 +443,9 @@ public class JmsPooledSession { String destKey = consumer.getDestKey(); boolean removed = false; + // a consumer was closed, close the session at next opportunity + shouldClose = true; + synchronized (inUseConsumers) { JmsPooledConsumer inUse = inUseConsumers.remove(destKey); removed = inUse == consumer; @@ -463,6 +472,7 @@ public class JmsPooledSession { } if (canClose) { + statusHandler.info("Closing session: " + this.toString()); closePooledConsumersProducers(); // need to close down all wrappers @@ -628,7 +638,7 @@ public class JmsPooledSession { } } - boolean valid = isValid() && hasProducersOrConsumers(); + boolean valid = isValid() && !shouldClose && hasProducersOrConsumers(); if (valid && returnToPool) { valid = conn.returnSessionToPool(this); } diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsConsumerWrapper.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsConsumerWrapper.java index ec978fe7b8..4dd79cc2fa 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsConsumerWrapper.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsConsumerWrapper.java @@ -37,8 +37,9 @@ import com.raytheon.uf.common.jms.JmsPooledConsumer; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 18, 2011 rjpeter Initial creation + * Apr 18, 2011 rjpeter Initial creation. * Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling. + * Feb 07, 2014 2357 rjpeter Set linked exception in exception handling. * * * @author rjpeter @@ -124,8 +125,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in getMessageListener"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -144,8 +148,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in getMessageSelector"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -164,8 +171,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in receive"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -184,8 +194,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in receive(timeout)"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -204,8 +217,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in receiveNoWait"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -226,8 +242,11 @@ public class JmsConsumerWrapper implements MessageConsumer { } catch (Throwable e) { exceptionOccurred = true; JMSException exc = new JMSException( - "Exception occurred on pooled consumer"); + "Exception occurred on pooled consumer in setMessageLister"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } diff --git a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsProducerWrapper.java b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsProducerWrapper.java index 5ab53cb6a8..581dd63898 100644 --- a/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsProducerWrapper.java +++ b/edexOsgi/com.raytheon.uf.common.jms/src/com/raytheon/uf/common/jms/wrapper/JmsProducerWrapper.java @@ -37,9 +37,10 @@ import com.raytheon.uf.common.jms.JmsPooledProducer; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Dec fi8, 2011 rjpeter Initial creation + * Dec 08, 2011 rjpeter Initial creation. * Feb 26, 2013 1642 rjpeter Added volatile references for better concurrency handling. - * Jun 07, 2013 DR 16316 rjpeter Fix memory leak + * Jun 07, 2013 DR 16316 rjpeter Fix memory leak. + * Feb 07, 2014 2357 rjpeter Set linked exception in exception handling. * * * @author rjpeter @@ -122,6 +123,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -142,6 +146,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -162,6 +169,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -182,6 +192,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -202,6 +215,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -222,6 +238,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -242,6 +261,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -264,6 +286,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -285,6 +310,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -309,6 +337,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -329,6 +360,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -349,6 +383,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -369,6 +406,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -389,6 +429,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } @@ -409,6 +452,9 @@ public class JmsProducerWrapper implements MessageProducer { JMSException exc = new JMSException( "Exception occurred on pooled producer"); exc.initCause(e); + if (e instanceof Exception) { + exc.setLinkedException((Exception) e); + } throw exc; } } diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-common.xml b/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-common.xml index 5e968850e9..ef83b1b3dc 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-common.xml +++ b/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-common.xml @@ -15,17 +15,6 @@ - - - - - - - - - @@ -45,7 +34,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-ingest.xml b/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-ingest.xml index 0d6e84d11e..434c097ac8 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.activetable/res/spring/activetable-ingest.xml @@ -25,8 +25,8 @@ - - + + java.lang.Throwable diff --git a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiveProcessor.java b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiveProcessor.java index 8c81d43e9c..646061083c 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiveProcessor.java +++ b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiveProcessor.java @@ -77,6 +77,7 @@ import com.raytheon.uf.edex.database.processor.IDatabaseProcessor; * Dec 10, 2013 2555 rjpeter Initial creation. * Jan 23, 2014 2555 rjpeter Updated to be a row at a time using ScrollableResults. * Feb 04, 2014 2770 rferrel The dumpPdos now dumps all PluginDataObjects. + * Feb 12, 2014 2784 rjpeter Update logging for dup elim scenarios. * * * @author rjpeter @@ -194,6 +195,7 @@ public class DatabaseArchiveProcessor> if (entriesInMemory > 0) { try { savePdoMap(pdosByFile); + pdosByFile.clear(); int prev = recordsSaved; recordsSaved += entriesInMemory; statusHandler.info(pluginName + ": Processed rows " + prev @@ -436,74 +438,93 @@ public class DatabaseArchiveProcessor> } List> pdosFromDisk = readDataFromDisk(dataFile); - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler.debug(pluginName + ": Checking " - + pdosFromDisk.size() + " old records from file: " - + dataFile.getAbsolutePath()); - } - Iterator> pdoIter = pdosFromDisk - .iterator(); - boolean needsUpdate = false; - int dupsRemoved = 0; - int index = 0; - while (pdoIter.hasNext() && (index < dupElimUntil)) { - PersistableDataObject pdo = pdoIter.next(); - - if (identifierSet.contains(pdo.getIdentifier())) { - pdoIter.remove(); - needsUpdate = true; - dupsRemoved++; - } - - index++; - } - - if (statusHandler.isPriorityEnabled(Priority.DEBUG) - && (dupsRemoved > 0)) { - statusHandler.debug(pluginName + ": Removed " + dupsRemoved - + " old records from file: " - + dataFile.getAbsolutePath()); - } - - if (!fileIter.hasNext() && (pdosFromDisk.size() < fetchSize)) { - // last file, add more data to it - needsUpdate = true; - - if (prevFileStatus == null) { - prevFileStatus = new FileStatus(); - prevFileStatus.dupElimUntilIndex = pdosFromDisk.size(); - prevFileStatus.fileFull = pdos.size() >= fetchSize; - filesCreatedThisSession.put(dataFile.getAbsolutePath(), - prevFileStatus); - } - - int numToAdd = fetchSize - pdosFromDisk.size(); - numToAdd = Math.min(numToAdd, pdos.size()); - + if (pdosFromDisk.size() > 0) { if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler.debug(pluginName + ": Adding " + numToAdd - + " records to file: " + statusHandler.debug(pluginName + ": Checking " + + pdosFromDisk.size() + + " old records from file: " + dataFile.getAbsolutePath()); } - pdosFromDisk.addAll(pdos.subList(0, numToAdd)); - if (numToAdd < pdos.size()) { - pdos = pdos.subList(numToAdd, pdos.size()); - } else { - pdos = Collections.emptyList(); - } - } + Iterator> pdoIter = pdosFromDisk + .iterator(); + int dupsRemoved = 0; + int index = 0; + boolean needsUpdate = false; - if (needsUpdate) { - if (!pdosFromDisk.isEmpty()) { - writeDataToDisk(dataFile, pdosFromDisk); - if (prevFileStatus != null) { - prevFileStatus.fileFull = pdosFromDisk.size() >= fetchSize; + while (pdoIter.hasNext() && (index < dupElimUntil)) { + PersistableDataObject pdo = pdoIter.next(); + + if (identifierSet.contains(pdo.getIdentifier())) { + pdoIter.remove(); + needsUpdate = true; + dupsRemoved++; + } + + index++; + } + + if (dupsRemoved > 0) { + statusHandler.info(pluginName + ": Removed " + + dupsRemoved + " old records from file: " + + dataFile.getAbsolutePath()); + } + + if (!fileIter.hasNext() + && (pdosFromDisk.size() < fetchSize)) { + // last file, add more data to it + needsUpdate = true; + + if (prevFileStatus == null) { + prevFileStatus = new FileStatus(); + prevFileStatus.dupElimUntilIndex = pdosFromDisk + .size(); + prevFileStatus.fileFull = pdos.size() >= fetchSize; + filesCreatedThisSession.put( + dataFile.getAbsolutePath(), prevFileStatus); + } + + int numToAdd = fetchSize - pdosFromDisk.size(); + numToAdd = Math.min(numToAdd, pdos.size()); + + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + statusHandler.debug(pluginName + ": Adding " + + numToAdd + " records to file: " + + dataFile.getAbsolutePath()); + } + + pdosFromDisk.addAll(pdos.subList(0, numToAdd)); + if (numToAdd < pdos.size()) { + pdos = pdos.subList(numToAdd, pdos.size()); + } else { + pdos = Collections.emptyList(); + } + } + + if (needsUpdate) { + if (!pdosFromDisk.isEmpty()) { + writeDataToDisk(dataFile, pdosFromDisk); + if (prevFileStatus != null) { + prevFileStatus.fileFull = pdosFromDisk.size() >= fetchSize; + } + } else { + + dirsToCheckNumbering.add(dataFile.getParentFile()); + if (dataFile.exists() && !dataFile.delete()) { + statusHandler + .error(pluginName + + ": Failed to delete file [" + + dataFile.getAbsolutePath() + + "], all entries have been updated in later files."); + if (!dataFile.renameTo(new File(dataFile + .getAbsoluteFile() + ".bad"))) { + statusHandler.error(pluginName + ": file [" + + dataFile.getAbsoluteFile() + + "] cannot be renamed to .bad"); + } + } + fileIter.remove(); } - } else { - dirsToCheckNumbering.add(dataFile.getParentFile()); - dataFile.delete(); - fileIter.remove(); } } } @@ -543,7 +564,13 @@ public class DatabaseArchiveProcessor> } finally { if (!successful) { // couldn't read in file, move it to bad - file.renameTo(new File(file.getAbsoluteFile() + ".bad")); + if (file.exists() + && !file.renameTo(new File(file.getAbsoluteFile() + + ".bad"))) { + statusHandler.error(pluginName + ": file [" + + file.getAbsoluteFile() + + "] cannot be renamed to .bad"); + } } if (is != null) { try { @@ -668,8 +695,9 @@ public class DatabaseArchiveProcessor> writer = new BufferedWriter(new FileWriter(dumpFile)); if (statusHandler.isPriorityEnabled(Priority.INFO)) { - statusHandler.info(String.format("%s: Dumping records to: %s", - pluginName, dumpFile.getAbsolutePath())); + statusHandler.info(String.format("%s: Dumping " + pdos.size() + + " records to: %s", pluginName, + dumpFile.getAbsolutePath())); } while (pdoIter.hasNext()) { @@ -753,6 +781,8 @@ public class DatabaseArchiveProcessor> } while (size > 0); DecimalFormat format = new DecimalFormat(formatString.toString()); + statusHandler.info("Checking file numbering consistency for " + + dir.getAbsolutePath()); for (Map.Entry entry : fileMap.entrySet()) { int fileNum = entry.getKey(); @@ -771,7 +801,15 @@ public class DatabaseArchiveProcessor> } File newFile = new File(oldFile.getParent(), newFileName); - oldFile.renameTo(newFile); + if (!oldFile.renameTo(newFile)) { + statusHandler + .error("Failed rename file " + + oldFile.getAbsolutePath() + + " to " + + newFile.getAbsolutePath() + + ". Stopping file number consistency checking."); + return; + } } nextFileCount++; diff --git a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiver.java b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiver.java index f9a4e8af2c..70cae04fdf 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiver.java +++ b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/DatabaseArchiver.java @@ -58,6 +58,7 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory; * Nov 05, 2013 2499 rjpeter Repackaged, removed config files, always compresses hdf5. * Nov 11, 2013 2478 rjpeter Updated data store copy to always copy hdf5. * Dec 13, 2013 2555 rjpeter Refactored logic into DatabaseArchiveProcessor. + * Feb 12, 2014 2784 rjpeter Fixed clusterLock to not update the time by default. * * * @author rjpeter @@ -145,14 +146,16 @@ public class DatabaseArchiver implements IPluginArchiver { // cluster lock, grabbing time of last successful archive CurrentTimeClusterLockHandler lockHandler = new CurrentTimeClusterLockHandler( - CLUSTER_LOCK_TIMEOUT, dateFormat.format(runTime.getTime()), - false); + CLUSTER_LOCK_TIMEOUT, false); ClusterTask ct = ClusterLockUtils.lock(TASK_NAME, pluginName, lockHandler, false); if (!LockState.SUCCESSFUL.equals(ct.getLockState())) { return true; } + // keep extra info the same until processing updates the time. + lockHandler.setExtraInfo(ct.getExtraInfo()); + Calendar startTime = null; long timimgStartMillis = System.currentTimeMillis(); int recordCount = 0; @@ -226,12 +229,6 @@ public class DatabaseArchiver implements IPluginArchiver { .info(pluginName + ": Found no records to archive"); } } catch (Throwable e) { - // previous run time needs to be reset - if (startTime != null) { - lockHandler - .setExtraInfo(dateFormat.format(startTime.getTime())); - } - statusHandler.error(pluginName + ": Error occurred archiving data", e); } finally { diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/DatabaseSessionFactoryBean.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/DatabaseSessionFactoryBean.java index 2f627f6ffc..084f2261e0 100644 --- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/DatabaseSessionFactoryBean.java +++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/DatabaseSessionFactoryBean.java @@ -20,9 +20,9 @@ package com.raytheon.uf.edex.database; -import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -120,7 +120,7 @@ public class DatabaseSessionFactoryBean extends AnnotationSessionFactoryBean { public void setDatabaseSessionConfiguration( DatabaseSessionConfiguration databaseSessionConfiguration) { // make own copy so can modify it - List> annotatedClasses = new ArrayList>( + List> annotatedClasses = new LinkedList>( databaseSessionConfiguration.getAnnotatedClasses()); if (databaseSessionConfiguration != null) { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml index 0daba48b69..bfe8a42ca9 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml @@ -3,21 +3,6 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - - - - - - - - - - - - @@ -30,11 +15,11 @@ errorHandlerRef="errorHandler"> - + - + diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml b/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml index 018a905229..38cd142db1 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml @@ -8,19 +8,6 @@ - - - - - - - - - - - - + @@ -40,7 +27,7 @@ - + @@ -51,7 +38,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/DedicatedThreadJmsComponent.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/DedicatedThreadJmsComponent.java new file mode 100644 index 0000000000..978efdac8f --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/DedicatedThreadJmsComponent.java @@ -0,0 +1,101 @@ +/** + * 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.esb.camel.jms; + +import java.util.Map; + +import org.apache.camel.Endpoint; +import org.apache.camel.component.jms.JmsComponent; +import org.apache.camel.component.jms.JmsEndpoint; + +import com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor; + +/** + * Custom JMS component that makes dedicated thread pools for each JmsEndpoint + * based on the concurrent consumers needed. Each pool is named based on the JMS + * endpoint. Each endpoint also overrides the message listener container factory + * to monitor the created containers to see if they need to be restarted in a + * disconnect scenario. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 07, 2014 2357       rjpeter     Initial creation.
+ * 
+ * + * @author rjpeter + * @version 1.0 + */ +public class DedicatedThreadJmsComponent extends JmsComponent { + + public DedicatedThreadJmsComponent( + org.apache.camel.component.jms.JmsConfiguration jmsconfig) { + super(jmsconfig); + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.camel.component.jms.JmsComponent#createEndpoint(java.lang. + * String, java.lang.String, java.util.Map) + */ + @Override + protected Endpoint createEndpoint(String uri, String remaining, + Map parameters) throws Exception { + String threadName = (String) parameters.remove("threadName"); + Endpoint e = super.createEndpoint(uri, remaining, parameters); + if (e instanceof JmsEndpoint) { + JmsEndpoint jmsE = (JmsEndpoint) e; + if ((threadName != null) && (threadName.length() > 0) + && !threadName.endsWith("-")) { + threadName += "-"; + } else { + threadName = jmsE.getDestinationName() + "-"; + } + /* + * This is used for a SimpleMessageListenerContainer use case. + * + * JmsSimpleMessageListenerTaskExecutor executor = new + * JmsSimpleMessageListenerTaskExecutor( + * jmsE.getConcurrentConsumers(), threadName); + */ + // DefaultMessageListenerContainer use case + JmsThreadPoolTaskExecutor executor = new JmsThreadPoolTaskExecutor(); + executor.setThreadNamePrefix(threadName); + executor.setCorePoolSize(jmsE.getConcurrentConsumers()); + executor.setMaxPoolSize(Math.max(jmsE.getConcurrentConsumers(), + jmsE.getMaxConcurrentConsumers())); + executor.setQueueCapacity(0); + executor.afterPropertiesSet(); + + jmsE.setTaskExecutor(executor); + jmsE.setMessageListenerContainerFactory(MonitoredDefaultMessageListenerContainerFactory + .getInstance()); + + return jmsE; + } + throw new Exception( + "JmsComponent did not create a JmsEnpoint. Check Camel Jms Override"); + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/MonitoredDefaultMessageListenerContainerFactory.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/MonitoredDefaultMessageListenerContainerFactory.java new file mode 100644 index 0000000000..074c2a0377 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/jms/MonitoredDefaultMessageListenerContainerFactory.java @@ -0,0 +1,142 @@ +/** + * 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.esb.camel.jms; + +import java.util.Collection; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.camel.component.jms.DefaultJmsMessageListenerContainer; +import org.apache.camel.component.jms.JmsEndpoint; +import org.apache.camel.component.jms.MessageListenerContainerFactory; +import org.springframework.jms.listener.AbstractMessageListenerContainer; +import org.springframework.jms.listener.DefaultMessageListenerContainer; + +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.edex.core.EDEXUtil; + +/** + * Creates DefaultMessageListenerContainer instances that are then monitored + * once a minute for paused tasks. If a paused task is found the container is + * restarted. This is necessary in broker restart scenarios. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 8, 2014  2357      rjpeter     Initial creation.
+ * 
+ * + * @author rjpeter + * @version 1.0 + */ +public class MonitoredDefaultMessageListenerContainerFactory implements + MessageListenerContainerFactory { + private static final AtomicInteger threadCount = new AtomicInteger(1); + + private final Collection containers = new ConcurrentLinkedQueue(); + + private final IUFStatusHandler statusHandler = UFStatus + .getHandler(MonitoredDefaultMessageListenerContainerFactory.class); + + private static final MonitoredDefaultMessageListenerContainerFactory instance = new MonitoredDefaultMessageListenerContainerFactory(); + + public static MonitoredDefaultMessageListenerContainerFactory getInstance() { + return instance; + } + + private MonitoredDefaultMessageListenerContainerFactory() { + Thread containerChecker = new Thread("MessageListenerContainerMonitor-" + + threadCount.getAndIncrement()) { + /* + * (non-Javadoc) + * + * @see java.lang.Thread#run() + */ + @Override + public void run() { + while (!EDEXUtil.isRunning()) { + try { + Thread.sleep(TimeUtil.MILLIS_PER_MINUTE); + } catch (InterruptedException e) { + // ignore + } + } + + while (true) { + try { + for (DefaultMessageListenerContainer container : containers) { + if (container.getPausedTaskCount() > 0) { + StringBuilder msg = new StringBuilder(160); + msg.append("Container[") + .append(container.getDestinationName()) + .append("] has paused tasks. Container is "); + if (!container.isRunning()) { + msg.append("not "); + } + msg.append("running. Container is "); + if (container.isActive()) { + msg.append("not "); + } + msg.append("active. Restarting container."); + statusHandler.warn(msg.toString()); + container.start(); + } + } + + try { + Thread.sleep(TimeUtil.MILLIS_PER_MINUTE); + } catch (InterruptedException e) { + // ignore + } + } catch (Throwable e) { + statusHandler + .error("Error occurred in checking message listener containers", + e); + } + } + } + }; + containerChecker.start(); + } + + /* + * (non-Javadoc) + * + * @see org.apache.camel.component.jms.MessageListenerContainerFactory# + * createMessageListenerContainer + * (org.apache.camel.component.jms.JmsEndpoint) + */ + @Override + public AbstractMessageListenerContainer createMessageListenerContainer( + JmsEndpoint endpoint) { + // track the container for monitoring in the case of a provider + // reconnect + DefaultJmsMessageListenerContainer container = new DefaultJmsMessageListenerContainer( + endpoint); + containers.add(container); + return container; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.event/res/spring/event-ingest.xml b/edexOsgi/com.raytheon.uf.edex.event/res/spring/event-ingest.xml deleted file mode 100644 index 9a2ecd4632..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.event/res/spring/event-ingest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.grid.staticdata/res/spring/grid-staticdata-process.xml b/edexOsgi/com.raytheon.uf.edex.grid.staticdata/res/spring/grid-staticdata-process.xml index 1f72790c2b..5b57dd63f5 100644 --- a/edexOsgi/com.raytheon.uf.edex.grid.staticdata/res/spring/grid-staticdata-process.xml +++ b/edexOsgi/com.raytheon.uf.edex.grid.staticdata/res/spring/grid-staticdata-process.xml @@ -13,7 +13,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.edex.grid.staticdata/utility/common_static/base/notification/grid-staticdata.xml b/edexOsgi/com.raytheon.uf.edex.grid.staticdata/utility/common_static/base/notification/grid-staticdata.xml index 854d43b8e0..659d1dc2ac 100644 --- a/edexOsgi/com.raytheon.uf.edex.grid.staticdata/utility/common_static/base/notification/grid-staticdata.xml +++ b/edexOsgi/com.raytheon.uf.edex.grid.staticdata/utility/common_static/base/notification/grid-staticdata.xml @@ -1,8 +1,10 @@ grid-staticdata-generate - VM + QUEUE DATAURI + true + 600000 diff --git a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml index e5e7eff311..e926100e28 100644 --- a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml @@ -9,13 +9,13 @@ - + - + - + - +
- + + + + + + + + com.raytheon.uf.common.dataplugin.shef + com.raytheon.edex.plugin.shef + + + + + + + file:///${edex.home}/conf/db/hibernateConfig/ihfs/hibernate.cfg.xml + + + + + + + + + + + + + file:///${edex.home}/conf/db/hibernateConfig/damCatalog/hibernate.cfg.xml + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/ohd-common.xml b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/ohd-common.xml index d6c96319a9..d9a1488be0 100644 --- a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/ohd-common.xml +++ b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/ohd-common.xml @@ -1,45 +1,6 @@ - - - - - - - com.raytheon.uf.common.dataplugin.shef - com.raytheon.edex.plugin.shef - - - - - - - file:///${edex.home}/conf/db/hibernateConfig/ihfs/hibernate.cfg.xml - - - - - - - - - - - - - file:///${edex.home}/conf/db/hibernateConfig/damCatalog/hibernate.cfg.xml - - - - - - - - + - + - + - + - + - + - + - + - + - + + value="jms-durable:queue:dataDeliveryRetrievalProcess"/> \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/res/spring/ldadmesonet-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/res/spring/ldadmesonet-ingest.xml index 156bced102..88966f5486 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/res/spring/ldadmesonet-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/res/spring/ldadmesonet-ingest.xml @@ -15,7 +15,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.loctables/res/spring/loctables-spring.xml b/edexOsgi/com.raytheon.uf.edex.plugin.loctables/res/spring/loctables-spring.xml index 761d2fdf82..18bd451570 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.loctables/res/spring/loctables-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.loctables/res/spring/loctables-spring.xml @@ -24,7 +24,7 @@ - + - + - - - - - - - - - - - - - @@ -29,8 +14,7 @@ - + + value="jms-durable:queue:Ingest.madisSeparator" /> @@ -95,13 +79,12 @@ madis - +
- + madis @@ -122,7 +105,7 @@ + uri="jms-durable:queue:Ingest.madisSeparator" /> madis diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/res/spring/modelsounding-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/res/spring/modelsounding-ingest.xml index 0230b80501..ef92b8e42d 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/res/spring/modelsounding-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/res/spring/modelsounding-ingest.xml @@ -22,7 +22,7 @@ - + - + - + - - - - - - - - - - + - + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.obs.ogc/res/spring/obs-dpa-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.obs.ogc/res/spring/obs-dpa-ingest.xml index de1595fb80..d1d3ef8623 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.obs.ogc/res/spring/obs-dpa-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.obs.ogc/res/spring/obs-dpa-ingest.xml @@ -14,7 +14,7 @@ - + - + obs diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java index 5c77463dda..f84d8bd4e9 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java @@ -59,6 +59,7 @@ import com.raytheon.uf.edex.plugin.qc.dao.QCDao; * pupynere * May 16, 2013 1869 bsteffen Remove DataURI column from qc. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 20, 2014 DR 17098 D. Friedman Filter out invalid lat/lon values. * * * @@ -207,13 +208,15 @@ public class QCScanner { while (ri < records.length) { QCRecord r = new QCRecord(); double obsTime = dObsTime.getDouble(ri); + double lat = dLat.getDouble(ri); + double lon = dLon.getDouble(ri); if ((obsTime != vObsTimeFillValue) - && ((vObsTimeMissingValue == null) || (vObsTimeMissingValue != obsTime))) { + && ((vObsTimeMissingValue == null) || (vObsTimeMissingValue != obsTime)) + && Math.abs(lon) <= 180 && Math.abs(lat) <= 90) { r.setDataTime(new DataTime(new Date( (long) (obsTime * 1000)))); SurfaceObsLocation loc = new SurfaceObsLocation(); - loc.assignLocation(dLat.getDouble(ri), - dLon.getDouble(ri)); + loc.assignLocation(lat, lon); loc.setElevation(dElev.getInt(ri)); StringBuilder stationId = new StringBuilder( ID_LENGTH); @@ -230,10 +233,12 @@ public class QCScanner { ++index; ++ri; } - if (oi < records.length) { - records = Arrays.copyOf(records, oi); + if (oi > 0) { + if (oi < records.length) { + records = Arrays.copyOf(records, oi); + } + target.acceptRecords(records); } - target.acceptRecords(records); } } finally { nc.close(); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/res/spring/satellite-mcidas-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/res/spring/satellite-mcidas-ingest.xml index 43c3f88bdf..988a5a7b45 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/res/spring/satellite-mcidas-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/res/spring/satellite-mcidas-ingest.xml @@ -3,26 +3,14 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - - - - - - - - - - - - + + + @@ -35,7 +23,7 @@ - + satellite-mcidas diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/res/spring/svrwx-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/res/spring/svrwx-ingest.xml index 09021bf61e..58689cd836 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/res/spring/svrwx-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/res/spring/svrwx-ingest.xml @@ -10,7 +10,7 @@ - + - + - + - + - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ - package gov.noaa.nws.ncep.common.dataplugin.airmet; import java.util.Calendar; @@ -53,6 +24,37 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * AirmetRecord + * + * This java class performs the mapping to the database table for AIRMET + * + *
+ * HISTORY
+ * 
+ * Date         Author      Description
+ * ------------ ----------  ----------- --------------------------
+ * 05/2009      L. Lin      Initial creation    
+ * 
+ * This code has been developed by the SIB for use in the AWIPS2 system.
+ * 
+ * Date         Ticket#         Engineer    Description
+ * ------------ ----------      ----------- --------------------------
+ * 05/2009      39              L. Lin      Initial coding
+ * 07/2009      39              L. Lin      Migration to TO11
+ * 09/2011                      Chin Chen   changed to improve purge performance and
+ *                                          removed xml serialization as well
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013       1857 bgonzale         Added SequenceGenerator annotation.
+ * May 07, 2013 1869            bsteffen    Remove dataURI column from
+ *                                          PluginDataObject.
+ * Feb 11, 2014 2784            rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "airmetseq") @Table(name = "airmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -319,24 +321,6 @@ public class AirmetRecord extends PluginDataObject { */ public void addAirmetReport(AirmetReport curReport) { airmetReport.add(curReport); - // curReport.setParentID(this); - } - - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - /* - * if(this.getAirmetReport() != null && this.getAirmetReport().size() > - * 0) { for (Iterator iter = - * this.getAirmetReport().iterator(); iter.hasNext();) { AirmetReport cs - * = iter.next(); cs.setParentID(this); } } - */ - } @Override diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java index 61e7aecdb9..9c14f7cdbb 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java @@ -1,38 +1,3 @@ -/** - * AwwRecord - * - * This java class performs the mapping to the database tables for AWW. - * - * HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 12/2008 38 L. Lin Initial coding - * 04/2009 38 L. Lin Convert to TO10. - * 07/2009 38 L. Lin Migration to TO11 - * 05/2010 38 L. Lin Migration to TO11DR11 - * 01/11/2011 N/A M. Gao Add mndTime as the 5th element to construct - * dataUri value that is used as a unique constraint - * when the aww record is inserted into relational DB - * The reason mndTime is used is because the combination - * of original 4 elements is not unique in some scenarios. - * 01/26/2011 N/A M. Gao Add designatorBBB as the 6th (No.4) element to construct - * dataUri value that is used as a unique constraint - * when the aww record is inserted into relational DB - * The reason mndTime is used is because the combination - * of original 5 elements is not unique in some scenarios. - * 09/2011 Chin Chen changed to improve purge performance and - * removed xml serialization as well - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from - * PluginDataObject. - * July 29, 2013 1028 ghull add AwwReportType enum - * - * - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ package gov.noaa.nws.ncep.common.dataplugin.aww; import java.util.Calendar; @@ -59,6 +24,43 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * AwwRecord + * + * This java class performs the mapping to the database tables for AWW. + * + * SOFTWARE HISTORY + * + *
+ * Date         Ticket#         Engineer    Description
+ * ------------ ----------      ----------- --------------------------
+ * 12/2008      38              L. Lin      Initial coding
+ * 04/2009      38              L. Lin      Convert to TO10.
+ * 07/2009      38              L. Lin      Migration to TO11
+ * 05/2010      38              L. Lin      Migration to TO11DR11
+ * 01/11/2011   N/A             M. Gao      Add mndTime as the 5th element to construct 
+ *                                          dataUri value that is used as a unique constraint 
+ *                                          when the aww record is inserted into relational DB
+ *                                          The reason mndTime is used is because the combination 
+ *                                          of original 4 elements is not unique in some scenarios.                                       
+ * 01/26/2011   N/A             M. Gao      Add designatorBBB as the 6th (No.4) element to construct 
+ *                                          dataUri value that is used as a unique constraint 
+ *                                          when the aww record is inserted into relational DB
+ *                                          The reason mndTime is used is because the combination 
+ *                                          of original 5 elements is not unique in some scenarios.                                       
+ * 09/2011                      Chin Chen   changed to improve purge performance and
+ *                                          removed xml serialization as well
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869            bsteffen    Remove dataURI column from
+ *                                          PluginDataObject.
+ * July 29, 2013 1028           ghull       add AwwReportType enum
+ * Feb 11, 2014 2784            rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "awwseq") @Table(name = "aww", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -86,68 +88,42 @@ public class AwwRecord extends PluginDataObject { * REPORT 27. HIGH WIND WARNING 28. FREEZE WARNING 29. ADVERTENCIA DE * INUNDACIONES 30. HYDROLOGIC STATEMENT 31. URGENT WEATHER MESSAGE */ - public static enum AwwReportType { - SEVERE_THUNDERSTORM_WARNING, - SEVERE_THUNDERSTORM_WATCH, - TORNADO_WARNING, - TORNADO_WATCH, - SEVERE_THUNDERSTORM_OUTLINE_UPDATE, - TORNADO_WATCH_OUTLINE_UPDATE, - FLASH_FLOOD_WARNING, - FLASH_FLOOD_WATCH, - FLOOD_WARNING, - FLOOD_WATCH, - FLOOD_STATEMENT, - // WINTER STORM. something is getting decoded as WINTER STORM - WINTER_STORM_WARNING, - WINTER_STORM_WATCH, - WATCH_COUNTY_NOTIFICATION, - SEVERE_WEATHER_STATEMENT, - WIND_ADVISORY, // ?WIND CHILL ADVISORY? - // WIND CHILL ADVISORYs getting decoded as "ADVISORY" - FOG_ADVISORY, - HEAT_ADVISORY, - FROST_ADVISORY, - SMOKE_ADVISORY, - WEATHER_ADVISORY, - WINTER_WEATHER_ADVISORY, - SIGNIGICANT_WEATHER_ADVISORY, - SPECIAL_WEATHER_STATEMENT, - RED_FLAG_WARNING, - TORNADO_REPORT, - HIGH_WIND_WARNING, - FREEZE_WARNING, - ADVERTENCIA_DE_INUNDACIONES, - HYDROLOGIC_STATEMENT, - URGENT_WEATHER_MESSAGE, - UNKNOWN_AWW_REPORT_TYPE, - // DON"T know what this is but WTCH is looking for it (isSevereWeatherStatusNotification)? - STATUS_REPORT; + public static enum AwwReportType { + SEVERE_THUNDERSTORM_WARNING, SEVERE_THUNDERSTORM_WATCH, TORNADO_WARNING, TORNADO_WATCH, SEVERE_THUNDERSTORM_OUTLINE_UPDATE, TORNADO_WATCH_OUTLINE_UPDATE, FLASH_FLOOD_WARNING, FLASH_FLOOD_WATCH, FLOOD_WARNING, FLOOD_WATCH, FLOOD_STATEMENT, + // WINTER STORM. something is getting decoded as WINTER STORM + WINTER_STORM_WARNING, WINTER_STORM_WATCH, WATCH_COUNTY_NOTIFICATION, SEVERE_WEATHER_STATEMENT, WIND_ADVISORY, // ?WIND + // CHILL + // ADVISORY? + // WIND CHILL ADVISORYs getting decoded as "ADVISORY" + FOG_ADVISORY, HEAT_ADVISORY, FROST_ADVISORY, SMOKE_ADVISORY, WEATHER_ADVISORY, WINTER_WEATHER_ADVISORY, SIGNIGICANT_WEATHER_ADVISORY, SPECIAL_WEATHER_STATEMENT, RED_FLAG_WARNING, TORNADO_REPORT, HIGH_WIND_WARNING, FREEZE_WARNING, ADVERTENCIA_DE_INUNDACIONES, HYDROLOGIC_STATEMENT, URGENT_WEATHER_MESSAGE, UNKNOWN_AWW_REPORT_TYPE, + // DON"T know what this is but WTCH is looking for it + // (isSevereWeatherStatusNotification)? + STATUS_REPORT; - public static AwwReportType getReportType( String rtStr ) { - rtStr = rtStr.trim().replace(" ", "_" ); - for( AwwReportType rt : values() ) { - if( rt.toString().equals( rtStr ) ) { - return rt; - } - } - // WTCH is looking for - if( rtStr.equals("THUNDERSTORM_REPORT" ) ) { - return SEVERE_THUNDERSTORM_WATCH; - } - if( rtStr.endsWith( "STATUS REPORT" ) ) { -// ??? return AwwReportType.SEVERE_WEATHER_STATUS_NOTIFICATION - } - // WSTM is looking for - if( rtStr.equals( "WINTER_STORM" ) ) { - // ??? - } - if( rtStr.equals( "ADVISORY" ) ) { - // ???? WIND CHILL ADVISORY is getting decoded as "ADVISORY"??? - } - return UNKNOWN_AWW_REPORT_TYPE; - } - } + public static AwwReportType getReportType(String rtStr) { + rtStr = rtStr.trim().replace(" ", "_"); + for (AwwReportType rt : values()) { + if (rt.toString().equals(rtStr)) { + return rt; + } + } + // WTCH is looking for + if (rtStr.equals("THUNDERSTORM_REPORT")) { + return SEVERE_THUNDERSTORM_WATCH; + } + if (rtStr.endsWith("STATUS REPORT")) { + // ??? return AwwReportType.SEVERE_WEATHER_STATUS_NOTIFICATION + } + // WSTM is looking for + if (rtStr.equals("WINTER_STORM")) { + // ??? + } + if (rtStr.equals("ADVISORY")) { + // ???? WIND CHILL ADVISORY is getting decoded as "ADVISORY"??? + } + return UNKNOWN_AWW_REPORT_TYPE; + } + } @Column(length = 40) @DataURI(position = 1) @@ -304,17 +280,6 @@ public class AwwRecord extends PluginDataObject { // pugc.setParentID(this); } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - /** * @return the designator */ diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java index 6799bf4f97..40d4dc9eb0 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java @@ -1,26 +1,3 @@ -/** - * ConvsigmetRecord - * - * This java class performs the mapping to the database table for CONVSIGMET - * - * HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 03/2009 87/114 L. Lin Initial coding - * 07/2009 87/114 L. Lin Migration to TO11 - * 09/2011 Chin Chen changed to improve purge performance and - * removed xml serialization as well - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from - * PluginDataObject. - * - * - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ - package gov.noaa.nws.ncep.common.dataplugin.convsigmet; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -49,6 +26,31 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * ConvsigmetRecord + * + * This java class performs the mapping to the database table for CONVSIGMET + * + * SOFTWARE HISTORY + * + *
+ * Date         Ticket#         Engineer    Description
+ * ------------ ----------      ----------- --------------------------
+ * 03/2009      87/114          L. Lin      Initial coding
+ * 07/2009      87/114          L. Lin      Migration to TO11
+ * 09/2011                      Chin Chen   changed to improve purge performance and
+ *                                          removed xml serialization as well
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869            bsteffen    Remove dataURI column from
+ *                                          PluginDataObject.
+ * Feb 11, 2014 2784            rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "convsigmetseq") @Table(name = "convsigmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -291,17 +293,6 @@ public class ConvSigmetRecord extends PluginDataObject { } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java index bf9c24bf61..6975cd6147 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java @@ -1,34 +1,3 @@ -/** - * - * FfgRecord - * - * This java class performs the mapping to the database tables for FFG. - * - *
- * SOFTWARE HISTORY
- *
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 08/2008      14         T. Lee      Initial coding
- * 12/2008      14         T. Lee      Initialized variable
- * 03/2009      14         T. Lee      Migration to TO10
- * 07/2009      14         T. Lee      Migration to TO11
- * 09/2011                 Chin Chen   changed to improve purge performance
- *                                     and  removed xml serialization as
- *                                     well
- * Apr 04, 2013 1846       bkowal      Added an index on refTime and
- *                                     forecastTime
- * Apr 12, 2013 1857       bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869       bsteffen    Remove dataURI column from
- *                                     PluginDataObject.
- * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
- *
- * 
- * - * @author T.Lee - * @version 1.0 - */ - package gov.noaa.nws.ncep.common.dataplugin.ffg; import java.util.Calendar; @@ -55,6 +24,38 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * + * FfgRecord + * + * This java class performs the mapping to the database tables for FFG. + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 08/2008      14         T. Lee      Initial coding
+ * 12/2008      14         T. Lee      Initialized variable
+ * 03/2009      14         T. Lee      Migration to TO10
+ * 07/2009      14         T. Lee      Migration to TO11
+ * 09/2011                 Chin Chen   changed to improve purge performance
+ *                                     and  removed xml serialization as
+ *                                     well
+ * Apr 04, 2013 1846       bkowal      Added an index on refTime and
+ *                                     forecastTime
+ * Apr 12, 2013 1857       bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869       bsteffen    Remove dataURI column from
+ *                                     PluginDataObject.
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * Feb 11, 2014 2784       rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * @author T.Lee + * @version 1.0 + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ffgseq") @Table(name = "ffg", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -288,22 +289,6 @@ public class FfgRecord extends PluginDataObject { // precip.setParentID (this); } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - /* - * if (this.getFfgP() != null && this.getFfgP().size() > 0) { for - * (Iterator iter = this.getFfgP().iterator(); - * iter.hasNext();) { FfgPrecip fp = iter.next(); - * //fp.setParentID(this); } } - */ - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java index 60b09f4e49..e2fe0b3494 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java @@ -1,28 +1,3 @@ -/** - * IntlsigmetRecord - * - * This java class performs the mapping to the database table for ITNLSIGMET - * - * HISTORY - * - * This code has been developed by the SIB for use in the AWIPS2 system. - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 06/2009 113 L. Lin Initial coding - * 07/2009 113 L. Lin Migration to TO11 - * 05/2010 113 L. Lin Migration to TO11DR11 - * 09/2011 Chin Chen changed to improve purge performance and - * removed xml serialization as well - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from - * PluginDataObject. - * - * - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ - package gov.noaa.nws.ncep.common.dataplugin.intlsigmet; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -51,6 +26,32 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * IntlsigmetRecord + * + * This java class performs the mapping to the database table for ITNLSIGMET + * + * SOFTWARE HISTORY + * + *
+ * This code has been developed by the SIB for use in the AWIPS2 system.
+ * Date         Ticket#         Engineer    Description
+ * ------------ ----------      ----------- --------------------------
+ * 06/2009      113             L. Lin      Initial coding
+ * 07/2009      113             L. Lin      Migration to TO11
+ * 05/2010      113             L. Lin      Migration to TO11DR11
+ * 09/2011                      Chin Chen   changed to improve purge performance and
+ *                                          removed xml serialization as well
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869            bsteffen    Remove dataURI column from         
+ *                                          PluginDataObject.
+ * Feb 11, 2014 2784            rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "intlsigmetseq") @Table(name = "intlsigmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -575,15 +576,6 @@ public class IntlSigmetRecord extends PluginDataObject { } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java index 1063ca2c1b..b97b222e99 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java @@ -64,6 +64,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * * * @author F. J. Yen, SIB @@ -385,15 +386,6 @@ public class NcPafmRecord extends PersistablePluginDataObject implements return null; } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java index 348cb46bdb..855844269e 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java @@ -1,20 +1,3 @@ -/** - * NcscatRecord - * - * This java class performs the mapping to the database table for ASCAT,Quikscat - * - * HISTORY - * - * Date Author Description - * ------------ ---------- ----------- -------------------------- - * 11/2009 Uma Josyula Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 bsteffen Remove dataURI column from PluginDataObject. - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ - package gov.noaa.nws.ncep.common.dataplugin.ncscat; import java.util.Calendar; @@ -43,6 +26,26 @@ import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * NcscatRecord + * + * This java class performs the mapping to the database table for ASCAT,Quikscat + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket Author      Description
+ * ------------ ------ ----------  ----------- --------------------------
+ * 11/2009      Uma Josyula Initial creation    
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013  1857       bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 bsteffen    Remove dataURI column from PluginDataObject.
+ * Feb 11, 2014 2784   rferrel     Remove override of setIdentifier.
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ncscatseq") @Table(name = "ncscat", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -145,11 +148,6 @@ public class NcscatRecord extends PersistablePluginDataObject { return serialVersionUID; } - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } - public int getRecordLength() { return recordLength; } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java index eba70056ec..354ab682dc 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java @@ -77,6 +77,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract. * Dec 03, 2013 2551 rjpeter Extend PersistablePluginDataObject. + * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * * * @author sgurung @@ -612,13 +613,6 @@ public class NcTafRecord extends PersistablePluginDataObject implements this.issue_timeString = issue_timeString; } - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - @Override public SurfaceObsLocation getSpatialObject() { return location; diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java index 3faefa1d77..71829f735e 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java @@ -1,31 +1,3 @@ -/** - * NcUairRecord - * - *
- * The java class defines the parameters in the postgres table and
- * the for HDF5 dataset for the upper air data.
- * 
- * Date         Ticket#         Engineer    Description
- * ------------ ----------      ----------- --------------------------
- * 03/2010      210				L. Lin     	Initial creation
- * 4/2011						T. Lee		Persist to HDF5
- * 09/2011      457             S. Gurung   Renamed H5 to Nc and h5 to nc
- * 09/2011                   	Chin Chen   support batch decoding methods for better performance and
- * 											remove xml serialization as well
- * 10/2011                      S. Gurung   Replace slat/slon/selv with location of type SurfaceObsLocation
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * 04/2013      1293            bkowal      Removed references to hdffileid. 
- * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869            bsteffen    Remove dataURI column from
- *                                          PluginDataObject.
- * Dec 03, 2013 2551            rjpeter     Remove get/setPersistenceTime
- * 
- * - * This code has been developed by the SIB for use in the AWIPS2 system. - * @author L. Lin - * @version 1.0 - */ - package gov.noaa.nws.ncep.common.dataplugin.ncuair; import java.util.Calendar; @@ -59,6 +31,39 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.vividsolutions.jts.geom.Geometry; +/** + * NcUairRecord + * + *
+ * The java class defines the parameters in the postgres table and
+ * the for HDF5 dataset for the upper air data.
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#         Engineer    Description
+ * ------------ ----------      ----------- --------------------------
+ * 03/2010      210             L. Lin      Initial creation
+ * 4/2011                       T. Lee      Persist to HDF5
+ * 09/2011      457             S. Gurung   Renamed H5 to Nc and h5 to nc
+ * 09/2011                      Chin Chen   support batch decoding methods for better performance and
+ *                                          remove xml serialization as well
+ * 10/2011                      S. Gurung   Replace slat/slon/selv with location of type SurfaceObsLocation
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * 04/2013      1293            bkowal      Removed references to hdffileid. 
+ * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869            bsteffen    Remove dataURI column from
+ *                                          PluginDataObject.
+ * Dec 03, 2013 2551            rjpeter     Remove get/setPersistenceTime
+ * Feb 11, 2014 2784            rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + * + * @author L. Lin + * @version 1.0 + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ncuairseq") @Table(name = "ncuair", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -477,17 +482,6 @@ public class NcUairRecord extends PersistablePluginDataObject implements // li.setParentID(this); } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - @Override public SurfaceObsLocation getSpatialObject() { return location; diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java index ffd2bd171c..1f8d810b63 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java @@ -1,22 +1,3 @@ -/** - * NonConvsigmetRecord - * - * This java class performs the mapping to the database table for NONCONVSIGMET - * - * HISTORY - * - * Date Author Description - * ------------ ---------- ----------- -------------------------- - * 06/2009 Uma Josyula Initial creation - * 09/2011 Chin Chen changed to improve purge performance and - * removed xml serialization as well - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 bsteffen Remove dataURI column from PluginDataObject. - * - * This code has been developed by the SIB for use in the AWIPS2 system. - */ - package gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -45,6 +26,30 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * NonConvsigmetRecord + * + * This java class performs the mapping to the database table for NONCONVSIGMET + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket Author      Description
+ * ------------ ------ ------  ----------- --------------------------
+ * 06/2009      Uma Josyula Initial creation    
+ * 09/2011      Chin Chen   changed to improve purge performance and
+ *                          removed xml serialization as well
+ * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013       1857 bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 bsteffen    Remove dataURI column from PluginDataObject.
+ * Feb 11, 2014 2784   rferrel    Remove override of setIdentifier.
+ * 
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "nonconvsigmetseq") @Table(name = "nonconvsigmet", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -519,17 +524,6 @@ public class NonConvSigmetRecord extends PluginDataObject { } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java index 179a35f666..0bb0b26d44 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java @@ -1,21 +1,3 @@ -/** - * NtransRecord - * - * This java class performs the mapping to the database table for NTRANS Metafiles - * - *
- * HISTORY
- *
- * Date     	Author		Description
- * ------------	----------	-----------	--------------------------
- * 02/2013		B. Hebbard	Initial creation	
- * Apr 4, 2013  1846 bkowal Added an index on refTime and forecastTime	
- * Apr 12, 2013       1857 bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 bsteffen    Remove dataURI column from PluginDataObject.
- * 
- * This code has been developed by the SIB for use in the AWIPS2 system.
- */
-
 package gov.noaa.nws.ncep.common.dataplugin.ntrans;
 
 import javax.persistence.Access;
@@ -43,6 +25,27 @@ import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
 import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
 import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
 
+/**
+ * NtransRecord
+ * 
+ * This java class performs the mapping to the database table for NTRANS
+ * Metafiles
+ * 
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket# Author      Description
+ * ------------ ------- ----------  ----------- --------------------------
+ * 02/2013      B. Hebbard  Initial creation    
+ * Apr 4, 2013  1846 bkowal Added an index on refTime and forecastTime  
+ * Apr 12, 2013       1857 bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 bsteffen    Remove dataURI column from PluginDataObject.
+ * Feb 11, 2014 2784    rferrel     Remove override of setIdentifier.
+ * 
+ * + * This code has been developed by the SIB for use in the AWIPS2 system. + */ + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ntransseq") @Table(name = "ntrans", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -235,11 +238,6 @@ public class NtransRecord extends PersistablePluginDataObject { return serialVersionUID; } - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java index 27f67b511b..7d90969610 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java @@ -47,6 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. *
* * @author T.Lee @@ -494,16 +495,6 @@ public class TcmRecord extends PluginDataObject { } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - - } - @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java index a04b47479f..3a1fa1b52f 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java @@ -1,34 +1,3 @@ -/** - * WcpRecord is the Data Access component for WCP Watch Corner Point data. - * This contains getters and setters for the main parent table wcp. - * This code has been developed by the SIB for use in the AWIPS2 system. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 12Dec2008    37         F. J. Yen   Initial Coding.
- * 17Apr2009    37         F. J. Yen   Refactored for TO10
- * 24Aug2009    37         F. J. Yen   Refactored for TO11
- * 17May2010    37         F. J. Yen   Refactored to dataplugin for migration to
- *                                     to11dr11
- * 09/2011                 Chin Chen   changed to improve purge performance and
- *                                     removed xml serialization as well
- * Apr 04, 2013 1846       bkowal      Added an index on refTime and
- *                                     forecastTime
- * Apr 12, 2013 1857       bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869       bsteffen    Remove dataURI column from
- *                                     PluginDataObject.
- * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
- * 
- * 
- * - * @author F. J. Yen, SIB - * @version 1.0 - */ - package gov.noaa.nws.ncep.common.dataplugin.wcp; import java.util.Calendar; @@ -55,6 +24,37 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * WcpRecord is the Data Access component for WCP Watch Corner Point data. This + * contains getters and setters for the main parent table wcp. This code has + * been developed by the SIB for use in the AWIPS2 system. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 12Dec2008    37         F. J. Yen   Initial Coding.
+ * 17Apr2009    37         F. J. Yen   Refactored for TO10
+ * 24Aug2009    37         F. J. Yen   Refactored for TO11
+ * 17May2010    37         F. J. Yen   Refactored to dataplugin for migration to
+ *                                     to11dr11
+ * 09/2011                 Chin Chen   changed to improve purge performance and
+ *                                     removed xml serialization as well
+ * Apr 04, 2013 1846       bkowal      Added an index on refTime and
+ *                                     forecastTime
+ * Apr 12, 2013 1857       bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869       bsteffen    Remove dataURI column from
+ *                                     PluginDataObject.
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * Feb 11, 2014 2784       rferrel     Remove override of setIdentifier.
+ * 
+ * 
+ * + * @author F. J. Yen, SIB + * @version 1.0 + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "wcpseq") @Table(name = "wcp", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -172,12 +172,6 @@ public class WcpRecord extends PluginDataObject { } - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/ncep/gov.noaa.nws.ncep.edex.common/res/spring/ncinventory-request.xml b/ncep/gov.noaa.nws.ncep.edex.common/res/spring/ncinventory-request.xml index 2fe290a42b..5ed9a3a3d2 100644 --- a/ncep/gov.noaa.nws.ncep.edex.common/res/spring/ncinventory-request.xml +++ b/ncep/gov.noaa.nws.ncep.edex.common/res/spring/ncinventory-request.xml @@ -36,7 +36,7 @@ autoStartup="false"> - + diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/spring/airep-ingest.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/spring/airep-ingest.xml index 5750f10c25..b627390977 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/spring/airep-ingest.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/spring/airep-ingest.xml @@ -14,7 +14,7 @@ - + - + - + - + - - @@ -20,7 +15,7 @@ - + - + - + - - @@ -27,7 +15,7 @@ - + - + - + - + - + - - - - - - - - - - - - @@ -25,10 +11,10 @@ - + - + diff --git a/rpms/awips2.core/Installer.ant/scripts/profile.d/awips2Ant.csh b/rpms/awips2.core/Installer.ant/scripts/profile.d/awips2Ant.csh index 77fded2b94..3ee35cb6ae 100644 --- a/rpms/awips2.core/Installer.ant/scripts/profile.d/awips2Ant.csh +++ b/rpms/awips2.core/Installer.ant/scripts/profile.d/awips2Ant.csh @@ -1,8 +1,7 @@ #!/bin/csh # Determine where ant has been installed. -set ANT_INSTALL=`rpm -q --queryformat '%{INSTPREFIXES}' awips2-ant` -setenv ANT_HOME "${ANT_INSTALL}" +setenv ANT_INSTALL "/awips2/ant" if $?PATH then setenv PATH ${ANT_INSTALL}/bin:$PATH diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index e15fbc57ca..e3043a6207 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -411,7 +411,7 @@ if [ "${1}" = "-viz" ]; then buildRPM "awips2" buildRPM "awips2-common-base" #buildRPM "awips2-python-numpy" - buildRPM "awips2-ant" + #buildRPM "awips2-ant" #buildRPM "awips2-python-dynamicserialize" #buildRPM "awips2-python" #buildRPM "awips2-adapt-native" @@ -456,8 +456,9 @@ if [ "${1}" = "-custom" ]; then #buildRPM "awips2-alertviz" #buildRPM "awips2-python" #buildRPM "awips2-alertviz" + buildRPM "awips2-ant" #buildRPM "awips2-eclipse" - buildRPM "awips2-python" + #buildRPM "awips2-python" exit 0 fi