Merge "Issue #2473 Clean up grib plugin." into development

Former-commit-id: 7e7d375cea [formerly 7e7d375cea [formerly 4d0cc0385afc3a0e4f1789d6f6d88c26fcbdf386]]
Former-commit-id: 1f44eb5e8d
Former-commit-id: 475d94751a
This commit is contained in:
Nate Jensen 2013-10-16 15:26:20 -05:00 committed by Gerrit Code Review
commit 119124b766
36 changed files with 341 additions and 379 deletions

View file

@ -18,7 +18,6 @@ Require-Bundle: com.raytheon.edex.common,
com.raytheon.uf.edex.plugin.grid,
com.raytheon.uf.edex.python.decoder,
org.apache.camel,
org.apache.commons.configuration,
org.apache.commons.lang,
org.apache.commons.logging,
javax.measure,

View file

@ -1,11 +0,0 @@
com.raytheon.edex.plugin.grib.util.GenProcess
com.raytheon.edex.plugin.grib.util.GribLevel
com.raytheon.edex.plugin.grib.util.GribParameter
com.raytheon.edex.plugin.grib.util.Grib1Parameter
com.raytheon.edex.plugin.grib.util.Grib1ParameterSet
com.raytheon.edex.util.grib.Grib1TableMap
com.raytheon.edex.util.grib.CompositeModel
com.raytheon.edex.plugin.grib.spatial.FileData
com.raytheon.edex.plugin.grib.spatial.FileDataList
com.raytheon.edex.plugin.grib.decoderpostprocessors.PostProcessedModelSet
com.raytheon.edex.plugin.grib.decoderpostprocessors.PostProcessedModel

View file

@ -55,7 +55,6 @@ import com.raytheon.edex.util.grib.Grib1TableMap;
import com.raytheon.edex.util.grib.GribParamTranslator;
import com.raytheon.edex.util.grib.GribTableLookup;
import com.raytheon.uf.common.comm.CommunicationException;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
@ -92,12 +91,13 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 11, 2010 4758 bphillip Initial Creation
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util
* into ArraysUtil
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
* files.
* Mar 11, 2010 4758 bphillip Initial Creation
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util
* into ArraysUtil
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
* files.
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
*
* </pre>
*
@ -320,7 +320,7 @@ public class Grib1Decoder extends AbstractDecoder {
// Get the level information
float[] levelMetadata = this.convertGrib1LevelInfo(
pdsVars.getLevelType1(), (float) pdsVars.getLevelValue1(),
pdsVars.getLevelType2(), (float) pdsVars.getLevelValue2());
(float) pdsVars.getLevelValue2());
retVal.setLevel(getLevelInfo(centerid, subcenterid, levelMetadata[0],
levelMetadata[1], levelMetadata[2], levelMetadata[3],
levelMetadata[4], levelMetadata[5]));
@ -493,12 +493,6 @@ public class Grib1Decoder extends AbstractDecoder {
// retVal.setResCompFlags(gridCoverage.getResolution());
// }
try {
retVal.constructDataURI();
} catch (PluginException e) {
throw new GribException("Error constructing grib dataURI", e);
}
// check if FLAG.FCST_USED needs to be removed
checkForecastFlag(retVal.getDataTime(), centerid, subcenterid,
genProcess, gridCoverage);
@ -1018,7 +1012,7 @@ public class Grib1Decoder extends AbstractDecoder {
* The value of the level
* @return The converted level type information
*/
private float[] convertGrib1LevelInfo(int ltype1, float lval1, int ltype2,
private float[] convertGrib1LevelInfo(int ltype1, float lval1,
float lval2) {
float level1Type = ltype1;
float level1Scale = 0;

View file

@ -23,11 +23,7 @@ package com.raytheon.edex.plugin.grib.decoderpostprocessors;
import java.util.Calendar;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
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.DataTime;
/**
@ -48,10 +44,11 @@ import com.raytheon.uf.common.time.DataTime;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 09, 2011 4243 porricel Initial Creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 09, 2011 4243 porricel Initial Creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
*
* </pre>
*
@ -59,8 +56,6 @@ import com.raytheon.uf.common.time.DataTime;
* @version
*/
public class CPCoutlookGribPostProcessor implements IDecoderPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CPCoutlookGribPostProcessor.class);
@Override
public GridRecord[] process(GridRecord record) throws GribException {
@ -83,12 +78,6 @@ public class CPCoutlookGribPostProcessor implements IDecoderPostProcessor {
record.setDataTime(newDataTime);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (PluginException e) {
statusHandler.handle(Priority.PROBLEM,
"Error constructing dataURI!", e);
}
return new GridRecord[] { record };
}
}

View file

@ -40,9 +40,10 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 1/18/2012 porricel Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jan 18, 2012 porricel Initial Creation
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
*
* </pre>
*
@ -147,8 +148,7 @@ public class CanadianNHPostProcessor extends SixHrPrecipGridProcessor {
.getDataTime().getFcstTime())) {
// If the precipitation grid has not been produced, generate it
List<GridRecord> generated6hrPrecips = generate6hrPrecip(
precipInventory.get(i), precipInventory,
precip6hrInventory);
precipInventory.get(i), precipInventory);
for (GridRecord newRecord : generated6hrPrecips) {
// Add the generated grid to the current inventory
if (newRecord != null) {

View file

@ -40,9 +40,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 1/18/2012 porricel Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jan 18, 2012 porricel Initial Creation
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
*
*
* </pre>
*
@ -147,8 +149,7 @@ public class CanadianRegPostProcessor extends ThreeHrPrecipGridProcessor {
.getDataTime().getFcstTime())) {
// If the precipitation grid has not been produced, generate it
List<GridRecord> generated3hrPrecips = generate3hrPrecip(
precipInventory.get(i), precipInventory,
precip3hrInventory);
precipInventory.get(i), precipInventory);
for (GridRecord newRecord : generated3hrPrecips) {
// Add the generated grid to the current inventory
if (newRecord != null) {

View file

@ -40,9 +40,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/30/10 5875 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 30, 2010 5875 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
*
*
* </pre>
*
@ -150,8 +152,7 @@ public class ECMWFHiResProcessor extends SixHrPrecipGridProcessor {
.getDataTime().getFcstTime())) {
// If the precipitation grid has not been produced, generate it
List<GridRecord> generated6hrPrecips = generate6hrPrecip(
precipInventory.get(i), precipInventory,
precip6hrInventory);
precipInventory.get(i), precipInventory);
for (GridRecord newRecord : generated6hrPrecips) {
// Add the generated grid to the current inventory
if (newRecord != null) {

View file

@ -28,6 +28,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBException;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.edex.plugin.grib.spatial.GribSpatialCache;
import com.raytheon.edex.util.Util;
@ -44,7 +46,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -68,13 +70,15 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 09, 2010 4638 bphillip Initial Creation
* Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List.
* Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid
* assembler.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 09, 2010 4638 bphillip Initial Creation
* Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List.
* Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid
* assembler.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
*
* </pre>
*
@ -116,11 +120,18 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, filter,
false);
SingleTypeJAXBManager<CompositeModel> jaxbManager;
try {
jaxbManager = new SingleTypeJAXBManager<CompositeModel>(
CompositeModel.class);
} catch (JAXBException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to load thinned model files.", e);
return;
}
for (File file : thinnedModelFiles) {
try {
CompositeModel model = SerializationUtil
.jaxbUnmarshalFromXmlFile(CompositeModel.class,
file.getPath());
CompositeModel model = jaxbManager.unmarshalFromXmlFile(file);
thinnedModels.put(model.getModelName(), model);
} catch (SerializationException e) {
statusHandler.handle(Priority.PROBLEM,
@ -220,7 +231,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
}
private GridRecord createAssembledRecord(GridRecord record,
CompositeModel thinned) throws GribException {
CompositeModel thinned) {
GridRecord newRecord = new GridRecord();
GridCoverage coverage = GribSpatialCache.getInstance().getGridByName(
@ -234,12 +245,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
newRecord.setDataTime(record.getDataTime());
newRecord.setDataURI(null);
newRecord.setInsertTime(Calendar.getInstance());
try {
newRecord.constructDataURI();
} catch (PluginException e) {
throw new GribException(
"Error constructing DataURI for grib record", e);
}
return newRecord;
}

View file

@ -38,10 +38,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/31/10 5875 bphillip Initial Creation
* Mar 26, 2013 1821 bsteffen Optimize FFG version query.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 31, 2010 5875 bphillip Initial Creation
* Mar 26, 2013 1821 bsteffen Optimize FFG version query.
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* </pre>
*
@ -58,7 +59,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
.getPluginDao(GridConstants.GRID);
record.setSecondaryId("%");
record.setDataURI(null);
record.constructDataURI();
DatabaseQuery query = new DatabaseQuery(GridRecord.class);
query.addReturnedField(GridConstants.SECONDARY_ID);
@ -91,7 +91,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
record.setSecondaryId("Version" + (maxVersion + 1));
record.getInfo().setId(null);
record.setDataURI(null);
record.constructDataURI();
} catch (Exception e) {
throw new GribException("Error decoding FFG grid", e);
}

View file

@ -34,9 +34,6 @@ import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataquery.db.QueryParam.QueryOperand;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter;
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.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.database.DataAccessLayerException;
@ -50,10 +47,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* </pre>
*
@ -63,9 +61,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
public class GFSProcessor extends SixHrPrecipGridProcessor {
private static final int SECONDS_IN_12_HRS = 43200;
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFSProcessor.class);
@Override
public GridRecord[] process(GridRecord record) throws GribException {
// Post process the data if this is a Total Precipitation grid
@ -227,11 +222,5 @@ public class GFSProcessor extends SixHrPrecipGridProcessor {
// Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (PluginException e) {
statusHandler.handle(Priority.PROBLEM,
"Error constructing dataURI!", e);
}
}
}

View file

@ -26,12 +26,15 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBException;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.edex.plugin.grib.util.GribModelLookup;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -43,10 +46,13 @@ import com.raytheon.uf.common.status.UFStatus;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/30/10 5875 bphillip Initial Creation
* 9/20/2012 1206 jkorman Added logging of postProcessedModels load.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 30, 2010 5875 bphillip Initial Creation
* Sep 20, 2012 1206 jkorman Added logging of postProcessedModels
* load.
* Oct 15, 2013 2473 bsteffen Rewrite deprecated and unused code.
*
* </pre>
*
* @author bphillip
@ -56,13 +62,13 @@ public class GribPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribPostProcessor.class);
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
/** The singleton instance */
private static GribPostProcessor instance;
/** The map containing the currently registered grib post processors */
private static Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>();
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
private final Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>();
/**
* Gets the singleton instance of GribPostProcessor
@ -80,11 +86,11 @@ public class GribPostProcessor {
* Creates a new GribPostProcessor instance
*/
private GribPostProcessor() {
String processorFile = PathManagerFactory
LocalizationFile processorFile = PathManagerFactory
.getPathManager()
.getStaticFile(
.getStaticLocalizationFile(
"/grib/postProcessModels/postProcessedModels.xml")
.getPath();
;
try {
// Get the list of available model names
@ -92,8 +98,9 @@ public class GribPostProcessor {
.getModelNames();
// Unmarshal the post processed model file
PostProcessedModelSet ppModelSet = (PostProcessedModelSet) SerializationUtil
.jaxbUnmarshalFromXmlFile(processorFile);
PostProcessedModelSet ppModelSet = processorFile.jaxbUnmarshal(
PostProcessedModelSet.class, new JAXBManager(
PostProcessedModelSet.class));
statusHandler.info(String.format("Using postProcessorFile [%s]", processorFile));
@ -152,7 +159,11 @@ public class GribPostProcessor {
}
}
}
} catch (SerializationException e) {
} catch (LocalizationException e) {
statusHandler.fatal(
"Error unmarshalling post processed model list: "
+ processorFile, e);
} catch (JAXBException e) {
statusHandler.fatal(
"Error unmarshalling post processed model list: "
+ processorFile, e);
@ -212,24 +223,4 @@ public class GribPostProcessor {
}
}
private IDecoderPostProcessor getPostProcessor(String modelName,
String processorClassName) throws GribException {
for (List<IDecoderPostProcessor> processors : processorMap.values()) {
for (IDecoderPostProcessor processor : processors) {
if (processor.getClass().getCanonicalName()
.equals(processorClassName)) {
return processor;
}
}
}
try {
return (IDecoderPostProcessor) Class.forName(processorClassName)
.newInstance();
} catch (Exception e) {
throw new GribException(
"Error instantiating decoder post processor for "
+ modelName + " model.", e);
}
}
}

View file

@ -34,9 +34,10 @@ import com.raytheon.uf.common.parameter.Parameter;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/2011 #6619 bphillip Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2011 6619 bphillip Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* </pre>
*
@ -78,12 +79,6 @@ public class LapsPostProcessor implements IDecoderPostProcessor {
if (modelInfoModified) {
record.getInfo().setId(null);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (Exception e) {
throw new GribException(
"Error creating new dataURI for LAPS data!", e);
}
}
record.setOverwriteAllowed(true);

View file

@ -27,15 +27,17 @@ import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.parameter.Parameter;
/**
* TODO Add Description
* Post processor for the MSAS model.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 18, 2011 bphillip Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 18, 2011 bphillip Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
*
* </pre>
*
@ -100,12 +102,6 @@ public class MSASPostProcessor implements IDecoderPostProcessor {
if (modelInfoModified) {
record.getInfo().setId(null);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (Exception e) {
throw new GribException(
"Error creating new dataURI for MSAS data!", e);
}
}
record.setOverwriteAllowed(true);

View file

@ -45,10 +45,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 17, 2011 bphillip Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Nov 17, 2011 bphillip Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* </pre>
*
@ -208,11 +209,6 @@ public class Nam80PostProcessor implements IDecoderPostProcessor {
newRecord.setDataTime(newDataTime);
newRecord.getInfo().setId(null);
newRecord.setDataURI(null);
try {
newRecord.constructDataURI();
} catch (PluginException e) {
throw new GribException("Error constructing dataURI!", e);
}
newRecord.setOverwriteAllowed(true);
return newRecord;
}

View file

@ -27,8 +27,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* A container class to hold which post processors apply to a grib model
*
@ -36,9 +34,11 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/24/12 949 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jul 24, 2012 949 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
*
* </pre>
*
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement(name = "postProcessedModel")
@XmlAccessorType(XmlAccessType.NONE)
public class PostProcessedModel implements ISerializableObject {
public class PostProcessedModel {
/**
* The model name to which the processors apply. May be a regular expression

View file

@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* A container class to hold the list of models needing to be post processed
*
@ -37,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/24/12 949 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jul 24, 2012 949 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -48,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement(name = "postProcessedModels")
@XmlAccessorType(XmlAccessType.NONE)
public class PostProcessedModelSet implements ISerializableObject{
public class PostProcessedModelSet {
/**
* List of post processed modesl

View file

@ -35,9 +35,11 @@ import com.raytheon.uf.common.time.TimeRange;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 02/01/11 6320 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Feb 01, 2011 6320 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
*
* </pre>
*
@ -59,12 +61,6 @@ public class RTMAGribPostProcessor implements IDecoderPostProcessor {
newDataTime.setValidPeriod(new TimeRange(time, time));
record.setDataTime(newDataTime);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (Exception e) {
throw new GribException(
"Error creating new dataURI for RTMA data!", e);
}
}
return new GridRecord[] { record };
}

View file

@ -29,9 +29,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter;
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.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
*
* </pre>
*
@ -55,8 +53,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* @version 1.0
*/
public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SixHrPrecipGridProcessor.class);
/** The number of seconds in 6 hours */
protected static final int SECONDS_IN_6_HRS = 21600;
@ -87,13 +83,11 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
* grid
* @param precipInventory
* The current run accumulated grid inventory
* @param precip6hrInventory
* The current 6hr precipitation inventory
* @return The generated 6hr precipitation grid
* @throws GribException
*/
protected List<GridRecord> generate6hrPrecip(GridRecord record,
List<GridRecord> precipInventory, List<Integer> precip6hrInventory)
List<GridRecord> precipInventory)
throws GribException {
List<GridRecord> tp6hrRecords = new ArrayList<GridRecord>();
int currentFcstTime = record.getDataTime().getFcstTime();
@ -216,11 +210,5 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
// Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (PluginException e) {
statusHandler.handle(Priority.PROBLEM,
"Error constructing dataURI!", e);
}
}
}

View file

@ -29,9 +29,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter;
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.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 24, 2012 14299 M. Porricelli Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Date Ticket# Engineer Description
* ------------- -------- ------------- --------------------------
* Jan 24, 2012 14299 M. Porricelli Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
*
* </pre>
*
@ -56,8 +54,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*/
public abstract class ThreeHrPrecipGridProcessor implements
IDecoderPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ThreeHrPrecipGridProcessor.class);
/** The number of seconds in 3 hours */
protected static final int SECONDS_IN_3_HRS = 10800;
@ -88,13 +84,11 @@ public abstract class ThreeHrPrecipGridProcessor implements
* grid
* @param precipInventory
* The current run accumulated grid inventory
* @param precip3hrInventory
* The current 3hr precipitation inventory
* @return The generated 3hr precipitation grid
* @throws GribException
*/
protected List<GridRecord> generate3hrPrecip(GridRecord record,
List<GridRecord> precipInventory, List<Integer> precip3hrInventory)
List<GridRecord> precipInventory)
throws GribException {
List<GridRecord> tp3hrRecords = new ArrayList<GridRecord>();
int currentFcstTime = record.getDataTime().getFcstTime();
@ -218,11 +212,5 @@ public abstract class ThreeHrPrecipGridProcessor implements
// Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime);
record.setDataURI(null);
try {
record.constructDataURI();
} catch (PluginException e) {
statusHandler.handle(Priority.PROBLEM,
"Error constructing dataURI!", e);
}
}
}

View file

@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* Default sub grid center point. If latitude/longitude may be null. This would
@ -35,9 +34,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 25, 2012 977 rjpeter Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jul 25, 2012 977 rjpeter Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -46,7 +46,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class DefaultSubGridCenterPoint implements ISerializableObject {
public class DefaultSubGridCenterPoint {
private Double centerLatitude;
private Double centerLongitude;

View file

@ -27,10 +27,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.opengis.metadata.spatial.PixelOrientation;
import com.raytheon.edex.plugin.grib.exception.GribException;
@ -47,10 +43,12 @@ import com.raytheon.uf.common.gridcoverage.subgrid.SubGrid;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.awipstools.GetWfoCenterHandler;
import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
@ -69,13 +67,13 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Mar 07, 2013 1771 bsteffen make subgridding deterministic.
*
* 1/4/13 DR 15653 M.Porricelli Shift subgrid domain
* westward like AWIPSI
* Date Ticket# Engineer Description
* ------------- -------- ------------ --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Mar 07, 2013 1771 bsteffen make subgridding deterministic.
* Jan 04, 2013 15653 M.Porricelli Shift subgrid domain westward like
* AWIPSI
* Oct 15, 2013 2473 bsteffen Rewrite deprecated code.
*
* </pre>
*
@ -85,7 +83,17 @@ import com.vividsolutions.jts.geom.Coordinate;
public class GribSpatialCache {
/** The logger */
protected transient Log logger = LogFactory.getLog(getClass());
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribSpatialCache.class);
private static final SingleTypeJAXBManager<GridCoverage> GRID_COVERAGE_JAXB = SingleTypeJAXBManager
.createWithoutException(GridCoverage.class);
private static final SingleTypeJAXBManager<SubGridDef> SUB_GRID_DEF_JAXB = SingleTypeJAXBManager
.createWithoutException(SubGridDef.class);
private static final SingleTypeJAXBManager<DefaultSubGridCenterPoint> SUB_GRID_CENTER_JAXB = SingleTypeJAXBManager
.createWithoutException(DefaultSubGridCenterPoint.class);
/** The singleton instance */
private static GribSpatialCache instance;
@ -285,7 +293,8 @@ public class GribSpatialCache {
.getModelByName(subGridDef.getReferenceModel())
.getGrid();
if (referenceGrid == null) {
logger.error("Failed to generate sub grid, Unable to determine coverage for referenceModel ["
statusHandler
.error("Failed to generate sub grid, Unable to determine coverage for referenceModel ["
+ subGridDef.getReferenceModel() + "]");
return false;
}
@ -294,7 +303,8 @@ public class GribSpatialCache {
GridCoverage referenceCoverage = getGridByName(referenceGrid
.toString());
if (referenceCoverage == null) {
logger.error("Failed to generate sub grid, Unable to determine coverage for referenceGrid ["
statusHandler
.error("Failed to generate sub grid, Unable to determine coverage for referenceGrid ["
+ referenceGrid + "]");
return false;
}
@ -365,7 +375,7 @@ public class GribSpatialCache {
return trim(modelName, coverage, lowerLeftPosition,
upperRightPosition);
} catch (GridCoverageException e) {
logger.error(
statusHandler.error(
"Failed to generate sub grid for world wide grid: "
+ modelName, e);
return false;
@ -405,7 +415,7 @@ public class GribSpatialCache {
try {
subGridCoverage = insert(subGridCoverage);
} catch (Exception e) {
logger.error(e.getLocalizedMessage(), e);
statusHandler.error(e.getLocalizedMessage(), e);
return false;
}
subGridCoverageMap.put(subGridKey(modelName, coverage),
@ -429,8 +439,7 @@ public class GribSpatialCache {
if (f.length() > 0) {
try {
JAXBManager manager = new JAXBManager(SubGridDef.class);
rval = (SubGridDef) manager.unmarshalFromXmlFile(f);
rval = SUB_GRID_DEF_JAXB.unmarshalFromXmlFile(f);
if ((rval.getReferenceModel() == null && rval
.getReferenceGrid() == null)
|| (rval.getModelNames() == null)
@ -449,9 +458,8 @@ public class GribSpatialCache {
}
}
} catch (SerializationException e) {
logger.error("Failed reading sub grid file: " + filePath, e);
} catch (JAXBException e) {
logger.error("Failed reading sub grid file: " + filePath, e);
statusHandler.error(
"Failed reading sub grid file: " + filePath, e);
}
}
@ -484,7 +492,7 @@ public class GribSpatialCache {
}
private void initializeGrids(FileDataList fdl) {
logger.info("Initializing grib grid coverages");
statusHandler.info("Initializing grib grid coverages");
long startTime = System.currentTimeMillis();
ClusterTask ct = null;
Map<Integer, Set<String>> gridNameMap = new HashMap<Integer, Set<String>>();
@ -497,8 +505,8 @@ public class GribSpatialCache {
try {
for (FileData fd : fdl.getCoverageFileList()) {
try {
GridCoverage grid = (GridCoverage) SerializationUtil
.jaxbUnmarshalFromXmlFile(fd.getFilePath());
GridCoverage grid = GRID_COVERAGE_JAXB
.unmarshalFromXmlFile(fd.getFilePath());
String name = grid.getName();
grid = insert(grid);
spatialNameMap.put(name, grid);
@ -510,7 +518,7 @@ public class GribSpatialCache {
names.add(name);
} catch (Exception e) {
// Log error but do not throw exception
logger.error(
statusHandler.error(
"Unable to read default grids file: "
+ fd.getFilePath(), e);
}
@ -520,7 +528,8 @@ public class GribSpatialCache {
try {
defaultCenterPoint = getDefaultSubGridCenterPoint();
} catch (Exception e) {
logger.error(
statusHandler
.error(
"Failed to generate sub grid definitions. Unable to lookup WFO Center Point",
e);
}
@ -536,7 +545,7 @@ public class GribSpatialCache {
}
} catch (Exception e) {
// Log error but do not throw exception
logger.error(
statusHandler.error(
"Unable to read default grids file: "
+ fd.getFilePath(), e);
}
@ -551,7 +560,8 @@ public class GribSpatialCache {
ClusterLockUtils.unlock(ct, false);
}
long endTime = System.currentTimeMillis();
logger.info("Grib grid coverages initialized: " + (endTime - startTime)
statusHandler.info("Grib grid coverages initialized: "
+ (endTime - startTime)
+ "ms");
}
@ -587,30 +597,30 @@ public class GribSpatialCache {
private Coordinate getDefaultSubGridCenterPoint() throws Exception {
Coordinate defaultCenterPoint = null;
IPathManager pm = PathManagerFactory.getPathManager();
File defaultSubGridLocationFile = pm
.getStaticFile("/grib/defaultSubGridCenterPoint.xml");
LocalizationFile defaultSubGridLocationFile = pm
.getStaticLocalizationFile("/grib/defaultSubGridCenterPoint.xml");
if ((defaultSubGridLocationFile != null)
&& defaultSubGridLocationFile.exists()) {
try {
// only used here, just create own manager
JAXBManager mgr = new JAXBManager(
DefaultSubGridCenterPoint.class);
DefaultSubGridCenterPoint defaultSubGridLocation = (DefaultSubGridCenterPoint) mgr
.unmarshalFromXmlFile(defaultSubGridLocationFile);
DefaultSubGridCenterPoint defaultSubGridLocation = defaultSubGridLocationFile
.jaxbUnmarshal(DefaultSubGridCenterPoint.class,
SUB_GRID_CENTER_JAXB);
if ((defaultSubGridLocation != null)
&& (defaultSubGridLocation.getCenterLatitude() != null)
&& (defaultSubGridLocation.getCenterLongitude() != null)) {
defaultCenterPoint = new Coordinate(
defaultSubGridLocation.getCenterLongitude(),
defaultSubGridLocation.getCenterLatitude());
logger.info("Default sub grid location is overriden as ["
statusHandler
.info("Default sub grid location is overriden as ["
+ defaultCenterPoint.y + "/" + defaultCenterPoint.x
+ "]");
}
} catch (Exception e) {
logger.error(
statusHandler.error(
"Unable to load default sub grid location from file: "
+ defaultSubGridLocationFile.getAbsolutePath(),
+ defaultSubGridLocationFile.getFile()
.getAbsolutePath(),
e);
}
}
@ -621,7 +631,8 @@ public class GribSpatialCache {
GetWfoCenterPoint centerPointRequest = new GetWfoCenterPoint(wfo);
defaultCenterPoint = new GetWfoCenterHandler()
.handleRequest(centerPointRequest);
logger.info("Default sub grid location is wfo center point ["
statusHandler
.info("Default sub grid location is wfo center point ["
+ defaultCenterPoint.y + "/" + defaultCenterPoint.x + "]");
/* If we are getting the WFO center as the center point, it means that
// the site has not defined its own center in the site file

View file

@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlList;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* A sub grid definition
@ -36,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2010 rjpeter Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 25, 2010 rjpeter Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class SubGridDef implements ISerializableObject {
public class SubGridDef {
/** The model names this sub grid applies to */
@XmlElement(required = true)
@XmlList

View file

@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -37,9 +36,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
*
* </pre>
*
@ -49,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class GenProcess implements ISerializableObject {
public class GenProcess {
/**
* A generated identification number to uniquely identify this generating

View file

@ -27,7 +27,6 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.apache.commons.lang.builder.HashCodeBuilder;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement
@DynamicSerialize
@XmlAccessorType(XmlAccessType.NONE)
public class Grib1Parameter implements ISerializableObject {
public class Grib1Parameter {
/** The id assigned from the hashcode of this object */
private int id;

View file

@ -30,8 +30,10 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
/**
* Utility class for looking up Grib 1 Parameters
@ -40,9 +42,10 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* </pre>
*
@ -117,23 +120,25 @@ public class Grib1ParameterLookup {
LocalizationContext commonStaticSite = pathManager.getContext(
LocalizationContext.LocalizationType.COMMON_STATIC,
LocalizationContext.LocalizationLevel.SITE);
File baseParameterFile = pathManager.getFile(commonStaticBase,
grib1ParamPath);
File siteParameterFile = pathManager.getFile(commonStaticSite,
grib1ParamPath);
LocalizationFile baseParameterFile = pathManager.getLocalizationFile(
commonStaticBase, grib1ParamPath);
LocalizationFile siteParameterFile = pathManager.getLocalizationFile(
commonStaticSite, grib1ParamPath);
try {
JAXBManager jaxbManager = new SingleTypeJAXBManager<Grib1ParameterSet>(
Grib1ParameterSet.class);
if (baseParameterFile.exists()) {
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil
.jaxbUnmarshalFromXmlFile(baseParameterFile);
Grib1ParameterSet parameterSet = baseParameterFile
.jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
for (Grib1Parameter param : parameterSet.getParameters()) {
parameterMap.put(getGrib1Hash(param), param);
param.generateId();
}
}
if (siteParameterFile.exists()) {
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil
.jaxbUnmarshalFromXmlFile(siteParameterFile);
Grib1ParameterSet parameterSet = siteParameterFile
.jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
for (Grib1Parameter param : parameterSet.getParameters()) {
parameterMap.put(getGrib1Hash(param), param);
param.generateId();

View file

@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* The class used for unmarshalling the grib1 parameter conversion XML file.
* grib1ParameterConvTable.xml
@ -38,9 +36,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -49,7 +48,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement(name = "grib1ParameterSet")
@XmlAccessorType(XmlAccessType.NONE)
public class Grib1ParameterSet implements ISerializableObject {
public class Grib1ParameterSet {
/** The unmarshalled grib 1 parameters */
@XmlElements( { @XmlElement(name = "grib1Parameter", type = Grib1Parameter.class) })

View file

@ -27,7 +27,6 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.apache.commons.lang.builder.HashCodeBuilder;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class GribLevel implements ISerializableObject {
public class GribLevel {
/** The id generated from the hashcode of this object */
private int id;

View file

@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -36,9 +35,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -48,7 +48,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class GribParameter implements ISerializableObject {
public class GribParameter {
/** No subcenter id number */
public static final int NO_SUBCENTER = -1;

View file

@ -27,10 +27,26 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
*
* Contains the grib fields that map to a specific grid dataset.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
* @author unknown
* @version 1.0
* @see GribModelLookup
*/
@XmlAccessorType(XmlAccessType.NONE)
public class GridModel implements ISerializableObject {
public class GridModel {
/** The title of the model */
@XmlElement

View file

@ -28,11 +28,26 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
*
* A JAXBable set of {@link GridModel}s.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
* @author unknown
* @version 1.0
*/
@XmlRootElement(name = "gribModelSet")
@XmlAccessorType(XmlAccessType.NONE)
public class GridModelSet implements ISerializableObject {
public class GridModelSet {
/**
* List of models for/from the XML.

View file

@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* Container class defining composite models.
*
@ -37,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/09/10 4638 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 09, 2010 4638 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* </pre>
*
@ -48,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/
@XmlRootElement(name = "compositeModel")
@XmlAccessorType(XmlAccessType.NONE)
public class CompositeModel implements ISerializableObject {
public class CompositeModel {
/** The composite model name */
@XmlElement

View file

@ -23,24 +23,28 @@ package com.raytheon.edex.util.grib;
import java.io.File;
import java.util.HashMap;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.JAXBManager;
/**
* Contains a map grib 1 table aliases
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 3/19/10 #4634 bphillip Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Mar 19, 2010 4634 bphillip Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method code.
*
* </pre>
*
@ -49,12 +53,12 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "gribTableMap")
public class Grib1TableMap implements ISerializableObject {
public class Grib1TableMap {
private HashMap<String, String> map = new HashMap<String, String>();
private static Grib1TableMap instance;
public static synchronized Grib1TableMap getInstance() {
public static synchronized Grib1TableMap getInstance() throws GribException {
if (instance == null) {
initInstance();
}
@ -64,26 +68,24 @@ public class Grib1TableMap implements ISerializableObject {
private Grib1TableMap() {
}
private static void initInstance() {
private static void initInstance() throws GribException {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext commonStaticBase = pathMgr.getContext(
LocalizationContext.LocalizationType.COMMON_STATIC,
LocalizationContext.LocalizationLevel.BASE);
String path = "";
try {
path = pathMgr.getFile(commonStaticBase,
"grid" + File.separator + "grib1ParamTableMap.xml")
.getCanonicalPath();
File tableFile = new File(path);
LocalizationFile tableFile = pathMgr.getLocalizationFile(
commonStaticBase, "grid" + File.separator
+ "grib1ParamTableMap.xml");
if (tableFile.exists()) {
instance = (Grib1TableMap) SerializationUtil
.jaxbUnmarshalFromXmlFile(tableFile.getPath());
instance = tableFile.jaxbUnmarshal(Grib1TableMap.class,
new JAXBManager(Grib1TableMap.class));
}
} catch (Exception e) {
e.printStackTrace();
} catch (LocalizationException e) {
throw new GribException("Unable to load table map from file.", e);
} catch (JAXBException e) {
throw new GribException("Unable to load table map from file.", e);
}
}

View file

@ -44,9 +44,10 @@ import com.raytheon.uf.common.time.DataTime;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/15/10 4553 bphillip Initial Creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 15, 2010 4553 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove e.printStackTrace()
*
* </pre>
*
@ -71,8 +72,10 @@ public class GribParamTranslator {
* Gets the singleton instance
*
* @return The singleton instance
* @throws GribException
*/
public static synchronized GribParamTranslator getInstance() {
public static synchronized GribParamTranslator getInstance()
throws GribException {
if (instance == null) {
instance = new GribParamTranslator();
}
@ -81,25 +84,13 @@ public class GribParamTranslator {
/**
* Creates the singleton instance
*
* @throws GribException
*/
private GribParamTranslator() {
try {
initGrib1Lookup();
} catch (GribException e) {
e.printStackTrace();
}
try {
initGrib2Lookup();
} catch (GribException e) {
e.printStackTrace();
}
try {
initParameterAliases();
} catch (GribException e) {
e.printStackTrace();
}
private GribParamTranslator() throws GribException {
initGrib1Lookup();
initGrib2Lookup();
initParameterAliases();
}
public void getParameterNameAlias(String modelName, Parameter parameter) {

View file

@ -29,9 +29,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.edex.plugin.grib.util.GenProcess;
import com.raytheon.edex.plugin.grib.util.Grib1Parameter;
@ -44,6 +41,8 @@ import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.file.FilenameFilters;
@ -54,10 +53,11 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
* Oct 15, 2013 2473 bsteffen Switch logging to use UFStatus
*
* </pre>
*
@ -67,7 +67,8 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
public class GribTableLookup {
/** The logger */
protected transient Log logger = LogFactory.getLog(getClass());
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribTableLookup.class);
/** No center number */
private static final int NO_CENTER = -1;
@ -250,7 +251,7 @@ public class GribTableLookup {
try {
createTable(table, center, subcenter, tableName);
} catch (GribException e) {
logger.error("Unable to create table: "
statusHandler.error("Unable to create table: "
+ tableName + " for Center: " + center
+ " Subcenter: " + subcenter);
continue;
@ -380,7 +381,7 @@ public class GribTableLookup {
try {
in.close();
} catch (IOException e) {
logger.error("Unable to close file: " + file, e);
statusHandler.error("Unable to close file: " + file, e);
}
}
}

View file

@ -38,6 +38,7 @@ import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.lang.builder.HashCodeBuilder;
@ -66,14 +67,16 @@ import com.vividsolutions.jts.geom.Geometry;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Sep 07, 2012 1102 djohnson Add missing JAXB annotations.
* Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling.
* Nov 02, 2012 1302 djohnson Remove commented out code.
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation
* Sep 07, 2012 1102 djohnson Add missing JAXB annotations.
* Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling.
* Nov 02, 2012 1302 djohnson Remove commented out code.
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
* context.
*
* </pre>
*
@ -85,6 +88,9 @@ import com.vividsolutions.jts.geom.Geometry;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@SequenceGenerator(name = "GRIDCOVERAGE_GENERATOR", sequenceName = "gridcoverage_seq", allocationSize = 1)
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso({ LambertConformalGridCoverage.class, LatLonGridCoverage.class,
MercatorGridCoverage.class, PolarStereoGridCoverage.class,
StereographicGridCoverage.class })
@DynamicSerialize
public abstract class GridCoverage extends PersistableDataObject<Integer>
implements ISpatialObject {

View file

@ -7,7 +7,7 @@
<camelContext id="ncgrib-file-endpoint" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup=false>
autoStartup="false">
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&amp;idempotent=false" />