From 159645b6e26d5cc01c6252a02448451fc5d3ccb5 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Fri, 26 Apr 2013 10:11:48 -0500 Subject: [PATCH] Issue #1861 - re-defined modelsounding hdf5 path Amend - forecast hours are now used in the name of the file instead of the hdf5 path. Updates to ensure that a file would be generated for every forecast hour; updates do not affect ingest time but they may have a slight affect on latency Amend - change hdf5 file naming convention Amend - create hard links to the original hdf5 files instead of duplicating them Change-Id: I364bcfaabe0a2254e558e5b66588e4a26d2a2e68 Former-commit-id: ccb1e69940376043406878b37877b50cc3dd40d9 [formerly 3bf459dc65ace7aa10f88f168278b16f3c37aa5f] Former-commit-id: a64a65e976c1ecbfe61c58ab42a8ad05e0ba2d60 --- .../13.4.1/determineRefTimeDirectory.py | 20 + deltaScripts/13.4.1/modelsoundingFileName.py | 20 + .../13.4.1/updateModelSoundingPaths.sh | 130 ++ .../META-INF/MANIFEST.MF | 3 +- .../modelsounding/ModelSoundingDecoder.java | 11 +- .../common/ModelSoundingPathProvider.java | 72 + .../modelsounding/common/SoundingSite.java | 1658 ++++++++--------- .../modelsounding/dao/ModelSoundingDAO.java | 19 +- .../base/path/modelsoundingPathKeys.xml | 11 + .../persist/DefaultPathProvider.java | 3 + .../uf/edex/pointdata/PointDataPluginDao.java | 25 +- .../accumulate/AccumDataHandler.java | 2 +- 12 files changed, 1128 insertions(+), 846 deletions(-) create mode 100644 deltaScripts/13.4.1/determineRefTimeDirectory.py create mode 100644 deltaScripts/13.4.1/modelsoundingFileName.py create mode 100644 deltaScripts/13.4.1/updateModelSoundingPaths.sh create mode 100644 edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/ModelSoundingPathProvider.java create mode 100644 edexOsgi/com.raytheon.edex.plugin.modelsounding/utility/common_static/base/path/modelsoundingPathKeys.xml diff --git a/deltaScripts/13.4.1/determineRefTimeDirectory.py b/deltaScripts/13.4.1/determineRefTimeDirectory.py new file mode 100644 index 0000000000..9280c8820d --- /dev/null +++ b/deltaScripts/13.4.1/determineRefTimeDirectory.py @@ -0,0 +1,20 @@ +#!/awips2/python/bin/python + +import re +import sys + +# we expect the filename as a command-line argument. +hdf5file = sys.argv[1] + +matches = re.search(r'modelsounding-([0-9]+-[0-9]+-[0-9]+)-([0-9]+).h5', hdf5file, re.M|re.I) +if matches: + # extract the date + # extract the hour + date = matches.group(1) + hour = matches.group(2) + + reftimeDirName = date + "_" + hour + ":00:00.0" + print reftimeDirName +else: + print "ERROR: unrecognized file - " + hdf5file + "!" + sys.exit(-1) diff --git a/deltaScripts/13.4.1/modelsoundingFileName.py b/deltaScripts/13.4.1/modelsoundingFileName.py new file mode 100644 index 0000000000..8703284fa7 --- /dev/null +++ b/deltaScripts/13.4.1/modelsoundingFileName.py @@ -0,0 +1,20 @@ +#!/awips2/python/bin/python + +import re +import sys + +# we expect the filename, model name, and forecast hour as arguments +hdf5file = sys.argv[1] +model = sys.argv[2] +forecastHour = sys.argv[3] + +matches = re.search(r'modelsounding-([0-9]+-[0-9]+-[0-9]+-[0-9]+).h5', hdf5file, re.M|re.I) +if matches: + # extract the reftime + reftime = matches.group(1) + + newFileName = "modelsounding-" + model + "-" + reftime + "-FH-" + str(forecastHour) + ".h5" + print newFileName +else: + print "ERROR: unrecognized file - " + hdf5file + "!" + sys.exit(-1) diff --git a/deltaScripts/13.4.1/updateModelSoundingPaths.sh b/deltaScripts/13.4.1/updateModelSoundingPaths.sh new file mode 100644 index 0000000000..65faedfb47 --- /dev/null +++ b/deltaScripts/13.4.1/updateModelSoundingPaths.sh @@ -0,0 +1,130 @@ +#!/bin/bash + +# DR #1846 - this update script will re-arrange the existing modelsounding hdf5 files to divide them by +# model name and site. Currently, every file will be copied to every potential path that it could be +# accessed at. But, any new files that are written after the upgrade is complete, will contain only +# the minimum amount of required data. + +# ensure that we actually have modellsounding data to re-arrange +DATA_DIRECTORY="/awips2/edex/data/hdf5/modelsounding" + +if [ ! -d ${DATA_DIRECTORY} ]; then + echo "INFO: No Model Sounding Data Was Found On The System!" + echo "INFO: Update Terminated ..." + exit 0 +fi + +# determine where we are +path_to_script=`readlink -f $0` +dir=$(dirname $path_to_script) + +# first, retrieve all possible models +PSQL="/awips2/psql/bin/psql" +SQL="SELECT DISTINCT reporttype FROM awips.modelsounding ORDER BY reporttype;" +_modelslist=modelslist.txt + +echo "INFO: update started." +pushd . > /dev/null 2>&1 +cd ${DATA_DIRECTORY} + +# retrieve the models +${PSQL} -U awips -d metadata -c "${SQL}" -t -o ${_modelslist} +if [ $? -ne 0 ]; then + echo "ERROR: Failed to retrieve the list of models." + echo "FATAL: The update has failed." + exit 1 +fi + +PYTHON="/awips2/python/bin/python" +_python_script="${dir}/determineRefTimeDirectory.py" +_python_script2="${dir}/modelsoundingFileName.py" +_fcsthourslist=fcsthourslist.txt + +# now loop through the models +for model in `cat ${_modelslist}`; do + # create a directory for the model. + mkdir -p ${DATA_DIRECTORY}/${model} + if [ $? -ne 0 ]; then + echo "ERROR: Failed to create directory - ${DATA_DIRECTORY}/${model}!" + echo "FATAL: The update has failed." + exit 1 + fi + + # retrieve the potential forecast hours for the model that we are + # currently processing. + SQL_FCST_HOUR="SELECT DISTINCT (fcstSeconds / 3600) AS forecastHour FROM modelsounding WHERE reporttype = '${model}' ORDER BY forecastHour;" + ${PSQL} -U awips -d metadata -c "${SQL_FCST_HOUR}" -t -o ${_fcsthourslist} + + # loop through the hdf5 files + for file in `ls -1 *.h5`; do + # determine which reftime directory would be associated with the file + reftimeDirectory=`${PYTHON} ${_python_script} "${file}"` + if [ $? -ne 0 ]; then + echo "FATAL: The update has failed." + exit 1 + fi + + # create the reftime directory + mkdir -p "${DATA_DIRECTORY}/${model}/${reftimeDirectory}" + if [ $? -ne 0 ]; then + echo "ERROR: Failed to create directory - ${DATA_DIRECTORY}/${model}/${reftimeDirectory}!" + echo "FATAL: The update has failed." + exit 1 + fi + + # loop through the possible forecast hours + for fcstHour in `cat ${_fcsthourslist}`; do + # determine the new name of the file + destinationFile=`${PYTHON} ${_python_script2} "${file}" "${model}" ${fcstHour}` + if [ $? -ne 0 ]; then + echo "ERROR: Failed to determine the adjusted name of file - ${file}!" + echo "FATAL: The update has failed." + exit 1 + fi + + # create a link between the files + ln ${file} ${DATA_DIRECTORY}/${model}/${reftimeDirectory}/${destinationFile} + if [ $? -ne 0 ]; then + echo "ERROR: Failed create a link for ${file} to ${DATA_DIRECTORY}/${model}/${reftimeDirectory}/${destinationFile}!" + echo "FATAL: The update has failed." + exit 1 + fi + done + done + + rm -f ${_fcsthourslist} + if [ $? -ne 0 ]; then + echo "WARNING: Failed to remove temporary file - ${_fcsthourslist}." + fi +done + +# remove the models list text file +rm -f ${_modelslist} +if [ $? -ne 0 ]; then + echo "WARNING: Failed to remove temporary file - ${_modelslist}." +fi + +# remove the hdf5 files +rm -f *.h5 +if [ $? -ne 0 ]; then + echo "ERROR: Failed to remove the obsolete hdf5 files!" + echo "WARNING: Removing the files manually is recommended." +fi + +popd > /dev/null 2>&1 + +echo "INFO: the update has completed successfully!" + +exit 0 + + + + + + + + + + + + diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.modelsounding/META-INF/MANIFEST.MF index 335175afe0..5bbd5a3cf8 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/META-INF/MANIFEST.MF @@ -12,7 +12,8 @@ Require-Bundle: com.raytheon.edex.common, org.apache.commons.logging, javax.persistence, com.raytheon.uf.common.site;bundle-version="1.12.1174", - com.raytheon.uf.common.status;bundle-version="1.12.1174" + com.raytheon.uf.common.status;bundle-version="1.12.1174", + org.apache.commons.lang;bundle-version="2.3.0" Export-Package: com.raytheon.edex.plugin.modelsounding, com.raytheon.edex.plugin.modelsounding.common, com.raytheon.edex.plugin.modelsounding.dao, diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java index 7b6e5878ab..85281093c9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java @@ -60,6 +60,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * 20080303 1026 jkorman Initial implementation. * 20080408 1039 jkorman Added traceId for tracing data. * 11/25/08 #1684 chammack Camel Refactor + * 04/29/13 #1861 bkowal Create a separate Point Data Container for + * every record so each forecast hour will + * receive a unique hdf5 file. * * * @@ -148,9 +151,13 @@ public class ModelSoundingDecoder extends AbstractDecoder implements Iterator iterator = document.iterator(); List pdoList = new ArrayList(); - PointDataContainer container = PointDataContainer - .build(pdd); while (iterator.hasNext()) { + /* + * Would it be better to cache the Point Data Container + * based on reftime and forecast hour? + */ + PointDataContainer container = PointDataContainer + .build(pdd); SoundingSite soundingData = ModelSoundingDataAdapter .createSoundingData(iterator, wmoHeader, container); diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/ModelSoundingPathProvider.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/ModelSoundingPathProvider.java new file mode 100644 index 0000000000..fb7851aa5f --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/ModelSoundingPathProvider.java @@ -0,0 +1,72 @@ +/** + * 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.edex.plugin.modelsounding.common; + +import com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider; +import com.raytheon.uf.common.dataplugin.persist.IPersistable; + +/** + * Path Provider for Model Sounding Data. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Apr 26, 2013            bkowal     Initial creation
+ * 
+ * 
+ * + * @author bkowal + * @version 1.0 + */ + +public class ModelSoundingPathProvider extends DefaultPathProvider { + private static final String FILENAME_SEPARATOR = "-"; + + private static final String FORECAST_HR_SPECIFIER = "FH"; + + /** + * + */ + public ModelSoundingPathProvider() { + } + + @Override + public String getHDFFileName(String pluginName, IPersistable persistable) { + SoundingSite soundingSite = (SoundingSite) persistable; + + long forecastHour = soundingSite.getFcstSeconds() / 3600; + + StringBuilder stringBuilder = new StringBuilder(pluginName); + stringBuilder.append(FILENAME_SEPARATOR); + stringBuilder.append(soundingSite.getReportType()); + stringBuilder.append(fileNameFormat.get().format( + soundingSite.getDataTime().getRefTime())); + stringBuilder.append(FILENAME_SEPARATOR); + stringBuilder.append(FORECAST_HR_SPECIFIER); + stringBuilder.append(FILENAME_SEPARATOR); + stringBuilder.append(Long.toString(forecastHour)); + stringBuilder.append(DefaultPathProvider.HDF5_SUFFIX); + + return stringBuilder.toString(); + } +} \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java index 48f48e1eb5..e01e087a05 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java @@ -76,839 +76,835 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "modelsounding", - indexes = { - @Index(name = "modelsounding_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "modelsounding", indexes = { @Index(name = "modelsounding_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement public class SoundingSite extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - - private static final long serialVersionUID = 1L; - - // The profiler observation time. - @Column - @DynamicSerializeElement - @XmlElement - private Calendar timeObs; - - @Column - @DynamicSerializeElement - @XmlElement - private Long fcstSeconds; - - // These site ids are not strictly ICAO ids! - @Column - @DynamicSerializeElement - @XmlElement - private String siteId; - - @DataURI(position = 1) - @Column - @DynamicSerializeElement - @XmlElement - private String reportType; - - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // Text of the WMO header - @Column - @DynamicSerializeElement - @XmlElement - private String wmoHeader; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer pressSLP; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer pressSfc; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double precipTot3Hr; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double precipConv3Hr; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer cldAmtLo; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer cldAmtMd; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer cldAmtHi; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer pressCldBase; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double uc10M; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double vc10M; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double temp2M; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double specHum2M; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer snowType; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer iceType; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer fzRainType; - - @DynamicSerializeElement - @XmlElement - @Transient - private Integer rainType; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double horzVis; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double stormUComp; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double stormVComp; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double stormRelHeli; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double totPrecip1Hr; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double precipConv1Hr; - - @DynamicSerializeElement - @XmlElement - @Transient - private Double snowWaterEquiv; - - // the level data - @Transient - private Set soundingLevels; - - // the level data - @Transient - private Set soilLevels; - - /** - * Create an empty ProfilerObs object. - */ - public SoundingSite() { - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public SoundingSite(String uri) { - super(uri); - } - - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getTimeObs() { - return timeObs; - } - - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } - - /** - * @return the fcstSeconds - */ - public Long getFcstSeconds() { - return fcstSeconds; - } - - /** - * @param fcstSeconds - * the fcstSeconds to set - */ - public void setFcstSeconds(Long fcstSeconds) { - this.fcstSeconds = fcstSeconds; - } - - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } - - /** - * Set the WMOHeader of the file that contained this data. - * - * @return The wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * Get the WMOHeader of the file that contained this data. - * - * @param wmoHeader - * The WMOHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * - * @param level - * A sounding data level to add. - */ - public void addLevel(SoundingLevel level) { - if (soundingLevels == null) { - soundingLevels = new HashSet(); - } - soundingLevels.add(level); - } - - /** - * Get all levels contained by this object. - * - * @return the levels - */ - public Set getLevels() { - return soundingLevels; - } - - /** - * Set the level data into this object. - * - * @param levels - * the levels to set - */ - public void setLevels(Set levels) { - soundingLevels = levels; - } - - /** - * - * @param level - * A soil data level to add. - */ - public void addSoilLevel(SoilLevel level) { - if (soilLevels == null) { - soilLevels = new HashSet(); - } - soilLevels.add(level); - } - - /** - * @return the soilLevels - */ - public Set getSoilLevels() { - return soilLevels; - } - - /** - * @param soilLevels - * the soilLevels to set - */ - public void setSoilLevels(Set levels) { - soilLevels = levels; - } - - /** - * @return the siteId - */ - public String getSiteId() { - return siteId; - } - - /** - * @param siteId - * the siteId to set - */ - public void setSiteId(String siteId) { - this.siteId = siteId; - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * @return the soundingLevels - */ - public Set getSoundingLevels() { - return soundingLevels; - } - - /** - * @param soundingLevels - * the soundingLevels to set - */ - public void setSoundingLevels(Set soundingLevels) { - this.soundingLevels = soundingLevels; - } - - /** - * @return the pressSLP - */ - public Integer getPressSLP() { - return pressSLP; - } - - /** - * @param pressSLP - * the pressSLP to set - */ - public void setPressSLP(Integer pressSLP) { - this.pressSLP = pressSLP; - } - - /** - * @return the pressSfc - */ - public Integer getPressSfc() { - return pressSfc; - } - - /** - * @param pressSfc - * the pressSfc to set - */ - public void setPressSfc(Integer pressSfc) { - this.pressSfc = pressSfc; - } - - /** - * @return the precipTot3Hr - */ - public Double getPrecipTot3Hr() { - return precipTot3Hr; - } - - /** - * @param precipTot3Hr - * the precipTot3Hr to set - */ - public void setPrecipTot3Hr(Double precipTot3Hr) { - this.precipTot3Hr = precipTot3Hr; - } - - /** - * @return the precipConv3Hr - */ - public Double getPrecipConv3Hr() { - return precipConv3Hr; - } - - /** - * @param precipConv3Hr - * the precipConv3Hr to set - */ - public void setPrecipConv3Hr(Double precipConv3Hr) { - this.precipConv3Hr = precipConv3Hr; - } - - /** - * @return the cldAmtLo - */ - public Integer getCldAmtLo() { - return cldAmtLo; - } - - /** - * @param cldAmtLo - * the cldAmtLo to set - */ - public void setCldAmtLo(Integer cldAmtLo) { - this.cldAmtLo = cldAmtLo; - } - - /** - * @return the cldAmtMd - */ - public Integer getCldAmtMd() { - return cldAmtMd; - } - - /** - * @param cldAmtMd - * the cldAmtMd to set - */ - public void setCldAmtMd(Integer cldAmtMd) { - this.cldAmtMd = cldAmtMd; - } - - /** - * @return the cldAmtHi - */ - public Integer getCldAmtHi() { - return cldAmtHi; - } - - /** - * @param cldAmtHi - * the cldAmtHi to set - */ - public void setCldAmtHi(Integer cldAmtHi) { - this.cldAmtHi = cldAmtHi; - } - - /** - * @return the pressCldBase - */ - public Integer getPressCldBase() { - return pressCldBase; - } - - /** - * @param pressCldBase - * the pressCldBase to set - */ - public void setPressCldBase(Integer pressCldBase) { - this.pressCldBase = pressCldBase; - } - - /** - * @return the uc10Meter - */ - public Double getUc10M() { - return uc10M; - } - - /** - * @param uc10Meter - * the uc10Meter to set - */ - public void setUc10M(Double uc10Meter) { - this.uc10M = uc10Meter; - } - - /** - * @return the vc10M - */ - public Double getVc10M() { - return vc10M; - } - - /** - * @param vc10M - * the vc10M to set - */ - public void setVc10M(Double vc10M) { - this.vc10M = vc10M; - } - - /** - * @return the temp2M - */ - public Double getTemp2M() { - return temp2M; - } - - /** - * @param temp2M - * the temp2M to set - */ - public void setTemp2M(Double temp2M) { - this.temp2M = temp2M; - } - - /** - * @return the specHum2M - */ - public Double getSpecHum2M() { - return specHum2M; - } - - /** - * @param specHum2M - * the specHum2M to set - */ - public void setSpecHum2M(Double specHum2M) { - this.specHum2M = specHum2M; - } - - /** - * @return the snowType - */ - public Integer getSnowType() { - return snowType; - } - - /** - * @param snowType - * the snowType to set - */ - public void setSnowType(Integer snowType) { - this.snowType = snowType; - } - - /** - * @return the iceType - */ - public Integer getIceType() { - return iceType; - } - - /** - * @param iceType - * the iceType to set - */ - public void setIceType(Integer iceType) { - this.iceType = iceType; - } - - /** - * @return the fzRainType - */ - public Integer getFzRainType() { - return fzRainType; - } - - /** - * @param fzRainType - * the fzRainType to set - */ - public void setFzRainType(Integer fzRainType) { - this.fzRainType = fzRainType; - } - - /** - * @return the rainType - */ - public Integer getRainType() { - return rainType; - } - - /** - * @param rainType - * the rainType to set - */ - public void setRainType(Integer rainType) { - this.rainType = rainType; - } - - /** - * @return the horzVis - */ - public Double getHorzVis() { - return horzVis; - } - - /** - * @param horzVis - * the horzVis to set - */ - public void setHorzVis(Double horzVis) { - this.horzVis = horzVis; - } - - /** - * @return the stormUComp - */ - public Double getStormUComp() { - return stormUComp; - } - - /** - * @param stormUComp - * the stormUComp to set - */ - public void setStormUComp(Double stormUComp) { - this.stormUComp = stormUComp; - } - - /** - * @return the stormVComp - */ - public Double getStormVComp() { - return stormVComp; - } - - /** - * @param stormVComp - * the stormVComp to set - */ - public void setStormVComp(Double stormVComp) { - this.stormVComp = stormVComp; - } - - /** - * @return the stormRelHeli - */ - public Double getStormRelHeli() { - return stormRelHeli; - } - - /** - * @param stormRelHeli - * the stormRelHeli to set - */ - public void setStormRelHeli(Double stormRelHeli) { - this.stormRelHeli = stormRelHeli; - } - - /** - * @return the totPrecip1Hr - */ - public Double getTotPrecip1Hr() { - return totPrecip1Hr; - } - - /** - * @param totPrecip1Hr - * the totPrecip1Hr to set - */ - public void setTotPrecip1Hr(Double totPrecip1Hr) { - this.totPrecip1Hr = totPrecip1Hr; - } - - /** - * @return the precipConv1Hr - */ - public Double getPrecipConv1Hr() { - return precipConv1Hr; - } - - /** - * @param precipConv1Hr - * the precipConv1Hr to set - */ - public void setPrecipConv1Hr(Double precipConv1Hr) { - this.precipConv1Hr = precipConv1Hr; - } - - /** - * @return the snowWaterEquiv - */ - public Double getSnowWaterEquiv() { - return snowWaterEquiv; - } - - /** - * @param snowWaterEquiv - * the snowWaterEquiv to set - */ - public void setSnowWaterEquiv(Double snowWaterEquiv) { - this.snowWaterEquiv = snowWaterEquiv; - } - - /** - * Get the IDecoderGettable interface implementation. This class does not - * currently support this interface. - * - * @return Returns null. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.dataplugin.IDecoderGettable#getString(java.lang - * .String) - */ - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.dataplugin.IDecoderGettable#getStrings(java.lang - * .String) - */ - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValue(java.lang - * .String) - */ - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValues(java.lang - * .String) - */ - @Override - public Collection getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + + private static final long serialVersionUID = 1L; + + // The profiler observation time. + @Column + @DynamicSerializeElement + @XmlElement + private Calendar timeObs; + + @Column + @DynamicSerializeElement + @XmlElement + private Long fcstSeconds; + + // These site ids are not strictly ICAO ids! + @Column + @DynamicSerializeElement + @XmlElement + private String siteId; + + @DataURI(position = 1) + @Column + @DynamicSerializeElement + @XmlElement + private String reportType; + + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // Text of the WMO header + @Column + @DynamicSerializeElement + @XmlElement + private String wmoHeader; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer pressSLP; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer pressSfc; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double precipTot3Hr; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double precipConv3Hr; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer cldAmtLo; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer cldAmtMd; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer cldAmtHi; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer pressCldBase; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double uc10M; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double vc10M; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double temp2M; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double specHum2M; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer snowType; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer iceType; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer fzRainType; + + @DynamicSerializeElement + @XmlElement + @Transient + private Integer rainType; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double horzVis; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double stormUComp; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double stormVComp; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double stormRelHeli; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double totPrecip1Hr; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double precipConv1Hr; + + @DynamicSerializeElement + @XmlElement + @Transient + private Double snowWaterEquiv; + + // the level data + @Transient + private Set soundingLevels; + + // the level data + @Transient + private Set soilLevels; + + /** + * Create an empty ProfilerObs object. + */ + public SoundingSite() { + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public SoundingSite(String uri) { + super(uri); + } + + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getTimeObs() { + return timeObs; + } + + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } + + /** + * @return the fcstSeconds + */ + public Long getFcstSeconds() { + return fcstSeconds; + } + + /** + * @param fcstSeconds + * the fcstSeconds to set + */ + public void setFcstSeconds(Long fcstSeconds) { + this.fcstSeconds = fcstSeconds; + } + + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } + + /** + * Set the WMOHeader of the file that contained this data. + * + * @return The wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * Get the WMOHeader of the file that contained this data. + * + * @param wmoHeader + * The WMOHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * + * @param level + * A sounding data level to add. + */ + public void addLevel(SoundingLevel level) { + if (soundingLevels == null) { + soundingLevels = new HashSet(); + } + soundingLevels.add(level); + } + + /** + * Get all levels contained by this object. + * + * @return the levels + */ + public Set getLevels() { + return soundingLevels; + } + + /** + * Set the level data into this object. + * + * @param levels + * the levels to set + */ + public void setLevels(Set levels) { + soundingLevels = levels; + } + + /** + * + * @param level + * A soil data level to add. + */ + public void addSoilLevel(SoilLevel level) { + if (soilLevels == null) { + soilLevels = new HashSet(); + } + soilLevels.add(level); + } + + /** + * @return the soilLevels + */ + public Set getSoilLevels() { + return soilLevels; + } + + /** + * @param soilLevels + * the soilLevels to set + */ + public void setSoilLevels(Set levels) { + soilLevels = levels; + } + + /** + * @return the siteId + */ + public String getSiteId() { + return siteId; + } + + /** + * @param siteId + * the siteId to set + */ + public void setSiteId(String siteId) { + this.siteId = siteId; + } + + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * @return the soundingLevels + */ + public Set getSoundingLevels() { + return soundingLevels; + } + + /** + * @param soundingLevels + * the soundingLevels to set + */ + public void setSoundingLevels(Set soundingLevels) { + this.soundingLevels = soundingLevels; + } + + /** + * @return the pressSLP + */ + public Integer getPressSLP() { + return pressSLP; + } + + /** + * @param pressSLP + * the pressSLP to set + */ + public void setPressSLP(Integer pressSLP) { + this.pressSLP = pressSLP; + } + + /** + * @return the pressSfc + */ + public Integer getPressSfc() { + return pressSfc; + } + + /** + * @param pressSfc + * the pressSfc to set + */ + public void setPressSfc(Integer pressSfc) { + this.pressSfc = pressSfc; + } + + /** + * @return the precipTot3Hr + */ + public Double getPrecipTot3Hr() { + return precipTot3Hr; + } + + /** + * @param precipTot3Hr + * the precipTot3Hr to set + */ + public void setPrecipTot3Hr(Double precipTot3Hr) { + this.precipTot3Hr = precipTot3Hr; + } + + /** + * @return the precipConv3Hr + */ + public Double getPrecipConv3Hr() { + return precipConv3Hr; + } + + /** + * @param precipConv3Hr + * the precipConv3Hr to set + */ + public void setPrecipConv3Hr(Double precipConv3Hr) { + this.precipConv3Hr = precipConv3Hr; + } + + /** + * @return the cldAmtLo + */ + public Integer getCldAmtLo() { + return cldAmtLo; + } + + /** + * @param cldAmtLo + * the cldAmtLo to set + */ + public void setCldAmtLo(Integer cldAmtLo) { + this.cldAmtLo = cldAmtLo; + } + + /** + * @return the cldAmtMd + */ + public Integer getCldAmtMd() { + return cldAmtMd; + } + + /** + * @param cldAmtMd + * the cldAmtMd to set + */ + public void setCldAmtMd(Integer cldAmtMd) { + this.cldAmtMd = cldAmtMd; + } + + /** + * @return the cldAmtHi + */ + public Integer getCldAmtHi() { + return cldAmtHi; + } + + /** + * @param cldAmtHi + * the cldAmtHi to set + */ + public void setCldAmtHi(Integer cldAmtHi) { + this.cldAmtHi = cldAmtHi; + } + + /** + * @return the pressCldBase + */ + public Integer getPressCldBase() { + return pressCldBase; + } + + /** + * @param pressCldBase + * the pressCldBase to set + */ + public void setPressCldBase(Integer pressCldBase) { + this.pressCldBase = pressCldBase; + } + + /** + * @return the uc10Meter + */ + public Double getUc10M() { + return uc10M; + } + + /** + * @param uc10Meter + * the uc10Meter to set + */ + public void setUc10M(Double uc10Meter) { + this.uc10M = uc10Meter; + } + + /** + * @return the vc10M + */ + public Double getVc10M() { + return vc10M; + } + + /** + * @param vc10M + * the vc10M to set + */ + public void setVc10M(Double vc10M) { + this.vc10M = vc10M; + } + + /** + * @return the temp2M + */ + public Double getTemp2M() { + return temp2M; + } + + /** + * @param temp2M + * the temp2M to set + */ + public void setTemp2M(Double temp2M) { + this.temp2M = temp2M; + } + + /** + * @return the specHum2M + */ + public Double getSpecHum2M() { + return specHum2M; + } + + /** + * @param specHum2M + * the specHum2M to set + */ + public void setSpecHum2M(Double specHum2M) { + this.specHum2M = specHum2M; + } + + /** + * @return the snowType + */ + public Integer getSnowType() { + return snowType; + } + + /** + * @param snowType + * the snowType to set + */ + public void setSnowType(Integer snowType) { + this.snowType = snowType; + } + + /** + * @return the iceType + */ + public Integer getIceType() { + return iceType; + } + + /** + * @param iceType + * the iceType to set + */ + public void setIceType(Integer iceType) { + this.iceType = iceType; + } + + /** + * @return the fzRainType + */ + public Integer getFzRainType() { + return fzRainType; + } + + /** + * @param fzRainType + * the fzRainType to set + */ + public void setFzRainType(Integer fzRainType) { + this.fzRainType = fzRainType; + } + + /** + * @return the rainType + */ + public Integer getRainType() { + return rainType; + } + + /** + * @param rainType + * the rainType to set + */ + public void setRainType(Integer rainType) { + this.rainType = rainType; + } + + /** + * @return the horzVis + */ + public Double getHorzVis() { + return horzVis; + } + + /** + * @param horzVis + * the horzVis to set + */ + public void setHorzVis(Double horzVis) { + this.horzVis = horzVis; + } + + /** + * @return the stormUComp + */ + public Double getStormUComp() { + return stormUComp; + } + + /** + * @param stormUComp + * the stormUComp to set + */ + public void setStormUComp(Double stormUComp) { + this.stormUComp = stormUComp; + } + + /** + * @return the stormVComp + */ + public Double getStormVComp() { + return stormVComp; + } + + /** + * @param stormVComp + * the stormVComp to set + */ + public void setStormVComp(Double stormVComp) { + this.stormVComp = stormVComp; + } + + /** + * @return the stormRelHeli + */ + public Double getStormRelHeli() { + return stormRelHeli; + } + + /** + * @param stormRelHeli + * the stormRelHeli to set + */ + public void setStormRelHeli(Double stormRelHeli) { + this.stormRelHeli = stormRelHeli; + } + + /** + * @return the totPrecip1Hr + */ + public Double getTotPrecip1Hr() { + return totPrecip1Hr; + } + + /** + * @param totPrecip1Hr + * the totPrecip1Hr to set + */ + public void setTotPrecip1Hr(Double totPrecip1Hr) { + this.totPrecip1Hr = totPrecip1Hr; + } + + /** + * @return the precipConv1Hr + */ + public Double getPrecipConv1Hr() { + return precipConv1Hr; + } + + /** + * @param precipConv1Hr + * the precipConv1Hr to set + */ + public void setPrecipConv1Hr(Double precipConv1Hr) { + this.precipConv1Hr = precipConv1Hr; + } + + /** + * @return the snowWaterEquiv + */ + public Double getSnowWaterEquiv() { + return snowWaterEquiv; + } + + /** + * @param snowWaterEquiv + * the snowWaterEquiv to set + */ + public void setSnowWaterEquiv(Double snowWaterEquiv) { + this.snowWaterEquiv = snowWaterEquiv; + } + + /** + * Get the IDecoderGettable interface implementation. This class does not + * currently support this interface. + * + * @return Returns null. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.IDecoderGettable#getString(java.lang + * .String) + */ + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.IDecoderGettable#getStrings(java.lang + * .String) + */ + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValue(java.lang + * .String) + */ + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValues(java.lang + * .String) + */ + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/dao/ModelSoundingDAO.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/dao/ModelSoundingDAO.java index 368ab83401..cea1445598 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/dao/ModelSoundingDAO.java +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/dao/ModelSoundingDAO.java @@ -19,8 +19,10 @@ **/ package com.raytheon.edex.plugin.modelsounding.dao; +import java.io.File; import java.util.List; +import com.raytheon.edex.plugin.modelsounding.common.ModelSoundingPathProvider; import com.raytheon.edex.plugin.modelsounding.common.SoundingSite; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.edex.database.DataAccessLayerException; @@ -35,6 +37,10 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080303 1026 jkorman Initial implementation. + * 20130426 1861 bkowal Added report type and forecast seconds as + * required keys for the hdf5 file name. Create + * a new method to generate hdf5 file names that + * will use the path provider. * * * @@ -50,6 +56,7 @@ public class ModelSoundingDAO extends PointDataPluginDao { */ public ModelSoundingDAO(String pluginName) throws PluginException { super(pluginName); + this.pathProvider = new ModelSoundingPathProvider(); } /** @@ -118,7 +125,7 @@ public class ModelSoundingDAO extends PointDataPluginDao { @Override public String[] getKeysRequiredForFileName() { - return new String[] { "dataTime.refTime" }; + return new String[] { "reportType", "dataTime.refTime", "fcstSeconds" }; } @Override @@ -130,5 +137,13 @@ public class ModelSoundingDAO extends PointDataPluginDao { public SoundingSite newObject() { return new SoundingSite(); } - + + @Override + protected String generatePointDataFileName(SoundingSite bean) { + return this.pluginName + + File.separator + + this.pathProvider.getHDFPath(this.pluginName, bean) + + File.separator + + this.pathProvider.getHDFFileName(this.pluginName, bean); + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/utility/common_static/base/path/modelsoundingPathKeys.xml b/edexOsgi/com.raytheon.edex.plugin.modelsounding/utility/common_static/base/path/modelsoundingPathKeys.xml new file mode 100644 index 0000000000..31e268c1fd --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/utility/common_static/base/path/modelsoundingPathKeys.xml @@ -0,0 +1,11 @@ + + + + reportType + 0 + + + dataTime.refTime + 1 + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/DefaultPathProvider.java b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/DefaultPathProvider.java index d79b77a372..83f9c9d47a 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/DefaultPathProvider.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/DefaultPathProvider.java @@ -56,6 +56,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * ------------ ---------- ----------- -------------------------- * 1/08/09 1674 bphillip Initial creation * 04/08/13 1293 bkowal Removed references to hdffileid. + * 04/30/13 1861 bkowal Added constant for hdf5 file suffix. * * * @author bphillip @@ -64,6 +65,8 @@ import com.raytheon.uf.common.time.util.TimeUtil; public class DefaultPathProvider implements IHDFFilePathProvider { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(DefaultPathProvider.class); + + public static final String HDF5_SUFFIX = ".h5"; public static final ThreadLocal fileNameFormat = new ThreadLocal() { @Override diff --git a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java index ed0d343773..ec0ed9d4d5 100644 --- a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java +++ b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java @@ -70,6 +70,9 @@ import com.raytheon.uf.edex.database.plugin.PluginDao; * Apr 13, 2009 chammack Initial creation * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory. * Apr 15, 2013 1868 bsteffen Rewrite mergeAll in PluginDao. + * Apr 29, 2013 1861 bkowal Refactor hdf5 filename generation during reads + * into its own method so modelsounding dao can + * override it. * * * @@ -487,19 +490,23 @@ public abstract class PointDataPluginDao extends } bm.putAll(obj); T bean = (T) bm.getBean(); - return this.pluginName - + File.separator - + this.pathProvider.getHDFPath(this.pluginName, - (IPersistable) bean) - + File.separator - + getPointDataFileName(bean).replace(".h5", "") - + DefaultPathProvider.fileNameFormat.get().format( - ((PluginDataObject) bean).getDataTime() - .getRefTime()) + ".h5"; + return this.generatePointDataFileName(bean); } finally { this.beanMapCache.offer(bm); } } + + protected String generatePointDataFileName(T bean) { + return this.pluginName + + File.separator + + this.pathProvider.getHDFPath(this.pluginName, + (IPersistable) bean) + + File.separator + + getPointDataFileName(bean).replace(".h5", "") + + DefaultPathProvider.fileNameFormat.get().format( + ((PluginDataObject) bean).getDataTime() + .getRefTime()) + ".h5"; + } public abstract T newObject(); diff --git a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/accumulate/AccumDataHandler.java b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/accumulate/AccumDataHandler.java index 36c8874832..cfcd8b8b08 100644 --- a/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/accumulate/AccumDataHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/accumulate/AccumDataHandler.java @@ -162,7 +162,7 @@ public class AccumDataHandler implements requestParams.append(request.getTimeParameter()); requestParams.append(","); requestParams.append(request.getStationParameter()); - + query.setParameters(requestParams.toString()); query.addParameter(DATATIME,