Issue #2473 Clean up grib plugin.

Former-commit-id: 4a17225301 [formerly 6fda3bf42a0735ecb5ae9f7ef1ae0e08dac22a5b]
Former-commit-id: ae9e1160e8
This commit is contained in:
Ben Steffensmeier 2013-10-15 17:26:56 -05:00
parent b11c8e5c06
commit 297109c181
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.plugin.grid,
com.raytheon.uf.edex.python.decoder, com.raytheon.uf.edex.python.decoder,
org.apache.camel, org.apache.camel,
org.apache.commons.configuration,
org.apache.commons.lang, org.apache.commons.lang,
org.apache.commons.logging, org.apache.commons.logging,
javax.measure, 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.GribParamTranslator;
import com.raytheon.edex.util.grib.GribTableLookup; import com.raytheon.edex.util.grib.GribTableLookup;
import com.raytheon.uf.common.comm.CommunicationException; 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.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.LevelFactory;
@ -92,12 +91,13 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------- -------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Mar 11, 2010 4758 bphillip Initial Creation * Mar 11, 2010 4758 bphillip Initial Creation
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util * Feb 15, 2013 1638 mschenke Moved array based utilities from Util
* into ArraysUtil * into ArraysUtil
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of * Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
* files. * files.
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
* *
* </pre> * </pre>
* *
@ -320,7 +320,7 @@ public class Grib1Decoder extends AbstractDecoder {
// Get the level information // Get the level information
float[] levelMetadata = this.convertGrib1LevelInfo( float[] levelMetadata = this.convertGrib1LevelInfo(
pdsVars.getLevelType1(), (float) pdsVars.getLevelValue1(), pdsVars.getLevelType1(), (float) pdsVars.getLevelValue1(),
pdsVars.getLevelType2(), (float) pdsVars.getLevelValue2()); (float) pdsVars.getLevelValue2());
retVal.setLevel(getLevelInfo(centerid, subcenterid, levelMetadata[0], retVal.setLevel(getLevelInfo(centerid, subcenterid, levelMetadata[0],
levelMetadata[1], levelMetadata[2], levelMetadata[3], levelMetadata[1], levelMetadata[2], levelMetadata[3],
levelMetadata[4], levelMetadata[5])); levelMetadata[4], levelMetadata[5]));
@ -493,12 +493,6 @@ public class Grib1Decoder extends AbstractDecoder {
// retVal.setResCompFlags(gridCoverage.getResolution()); // 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 // check if FLAG.FCST_USED needs to be removed
checkForecastFlag(retVal.getDataTime(), centerid, subcenterid, checkForecastFlag(retVal.getDataTime(), centerid, subcenterid,
genProcess, gridCoverage); genProcess, gridCoverage);
@ -1018,7 +1012,7 @@ public class Grib1Decoder extends AbstractDecoder {
* The value of the level * The value of the level
* @return The converted level type information * @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 lval2) {
float level1Type = ltype1; float level1Type = ltype1;
float level1Scale = 0; float level1Scale = 0;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -38,10 +38,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 8/31/10 5875 bphillip Initial Creation * Aug 31, 2010 5875 bphillip Initial Creation
* Mar 26, 2013 1821 bsteffen Optimize FFG version query. * Mar 26, 2013 1821 bsteffen Optimize FFG version query.
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
* *
* </pre> * </pre>
* *
@ -58,7 +59,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
.getPluginDao(GridConstants.GRID); .getPluginDao(GridConstants.GRID);
record.setSecondaryId("%"); record.setSecondaryId("%");
record.setDataURI(null); record.setDataURI(null);
record.constructDataURI();
DatabaseQuery query = new DatabaseQuery(GridRecord.class); DatabaseQuery query = new DatabaseQuery(GridRecord.class);
query.addReturnedField(GridConstants.SECONDARY_ID); query.addReturnedField(GridConstants.SECONDARY_ID);
@ -91,7 +91,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
record.setSecondaryId("Version" + (maxVersion + 1)); record.setSecondaryId("Version" + (maxVersion + 1));
record.getInfo().setId(null); record.getInfo().setId(null);
record.setDataURI(null); record.setDataURI(null);
record.constructDataURI();
} catch (Exception e) { } catch (Exception e) {
throw new GribException("Error decoding FFG grid", 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.dataquery.db.QueryParam.QueryOperand;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter; 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.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.DataAccessLayerException;
@ -50,10 +47,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation * Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
* *
* </pre> * </pre>
* *
@ -63,9 +61,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
public class GFSProcessor extends SixHrPrecipGridProcessor { public class GFSProcessor extends SixHrPrecipGridProcessor {
private static final int SECONDS_IN_12_HRS = 43200; private static final int SECONDS_IN_12_HRS = 43200;
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFSProcessor.class);
@Override @Override
public GridRecord[] process(GridRecord record) throws GribException { public GridRecord[] process(GridRecord record) throws GribException {
// Post process the data if this is a Total Precipitation grid // 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 // Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime); record.setDataTime(newDataTime);
record.setDataURI(null); 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.Map;
import java.util.Set; import java.util.Set;
import javax.xml.bind.JAXBException;
import com.raytheon.edex.plugin.grib.exception.GribException; import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.edex.plugin.grib.util.GribModelLookup; import com.raytheon.edex.plugin.grib.util.GribModelLookup;
import com.raytheon.uf.common.dataplugin.grid.GridRecord; 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.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
@ -43,10 +46,13 @@ import com.raytheon.uf.common.status.UFStatus;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 8/30/10 5875 bphillip Initial Creation * Aug 30, 2010 5875 bphillip Initial Creation
* 9/20/2012 1206 jkorman Added logging of postProcessedModels load. * Sep 20, 2012 1206 jkorman Added logging of postProcessedModels
* load.
* Oct 15, 2013 2473 bsteffen Rewrite deprecated and unused code.
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -56,13 +62,13 @@ public class GribPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribPostProcessor.class); .getHandler(GribPostProcessor.class);
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
/** The singleton instance */ /** The singleton instance */
private static GribPostProcessor instance; private static GribPostProcessor instance;
/** The map containing the currently registered grib post processors */ /** The map containing the currently registered grib post processors */
private static Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>(); private final Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>();
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
/** /**
* Gets the singleton instance of GribPostProcessor * Gets the singleton instance of GribPostProcessor
@ -80,11 +86,11 @@ public class GribPostProcessor {
* Creates a new GribPostProcessor instance * Creates a new GribPostProcessor instance
*/ */
private GribPostProcessor() { private GribPostProcessor() {
String processorFile = PathManagerFactory LocalizationFile processorFile = PathManagerFactory
.getPathManager() .getPathManager()
.getStaticFile( .getStaticLocalizationFile(
"/grib/postProcessModels/postProcessedModels.xml") "/grib/postProcessModels/postProcessedModels.xml")
.getPath(); ;
try { try {
// Get the list of available model names // Get the list of available model names
@ -92,8 +98,9 @@ public class GribPostProcessor {
.getModelNames(); .getModelNames();
// Unmarshal the post processed model file // Unmarshal the post processed model file
PostProcessedModelSet ppModelSet = (PostProcessedModelSet) SerializationUtil PostProcessedModelSet ppModelSet = processorFile.jaxbUnmarshal(
.jaxbUnmarshalFromXmlFile(processorFile); PostProcessedModelSet.class, new JAXBManager(
PostProcessedModelSet.class));
statusHandler.info(String.format("Using postProcessorFile [%s]", processorFile)); 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( statusHandler.fatal(
"Error unmarshalling post processed model list: " "Error unmarshalling post processed model list: "
+ processorFile, e); + 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 * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/7/2011 #6619 bphillip Initial creation * Apr 07, 2011 6619 bphillip Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
* *
* </pre> * </pre>
* *
@ -78,12 +79,6 @@ public class LapsPostProcessor implements IDecoderPostProcessor {
if (modelInfoModified) { if (modelInfoModified) {
record.getInfo().setId(null); record.getInfo().setId(null);
record.setDataURI(null); record.setDataURI(null);
try {
record.constructDataURI();
} catch (Exception e) {
throw new GribException(
"Error creating new dataURI for LAPS data!", e);
}
} }
record.setOverwriteAllowed(true); record.setOverwriteAllowed(true);

View file

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

View file

@ -45,10 +45,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Nov 17, 2011 bphillip Initial creation * Nov 17, 2011 bphillip Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
* *
* </pre> * </pre>
* *
@ -208,11 +209,6 @@ public class Nam80PostProcessor implements IDecoderPostProcessor {
newRecord.setDataTime(newDataTime); newRecord.setDataTime(newDataTime);
newRecord.getInfo().setId(null); newRecord.getInfo().setId(null);
newRecord.setDataURI(null); newRecord.setDataURI(null);
try {
newRecord.constructDataURI();
} catch (PluginException e) {
throw new GribException("Error constructing dataURI!", e);
}
newRecord.setOverwriteAllowed(true); newRecord.setOverwriteAllowed(true);
return newRecord; 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.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; 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 * 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 * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 7/24/12 949 bphillip Initial Creation * Jul 24, 2012 949 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* *
* </pre> * </pre>
* *
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/ */
@XmlRootElement(name = "postProcessedModel") @XmlRootElement(name = "postProcessedModel")
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
public class PostProcessedModel implements ISerializableObject { public class PostProcessedModel {
/** /**
* The model name to which the processors apply. May be a regular expression * 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.XmlElements;
import javax.xml.bind.annotation.XmlRootElement; 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 * 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 * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 7/24/12 949 bphillip Initial Creation * Jul 24, 2012 949 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -48,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/ */
@XmlRootElement(name = "postProcessedModels") @XmlRootElement(name = "postProcessedModels")
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
public class PostProcessedModelSet implements ISerializableObject{ public class PostProcessedModelSet {
/** /**
* List of post processed modesl * List of post processed modesl

View file

@ -35,9 +35,11 @@ import com.raytheon.uf.common.time.TimeRange;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 02/01/11 6320 bphillip Initial Creation * Feb 01, 2011 6320 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* *
* </pre> * </pre>
* *
@ -59,12 +61,6 @@ public class RTMAGribPostProcessor implements IDecoderPostProcessor {
newDataTime.setValidPeriod(new TimeRange(time, time)); newDataTime.setValidPeriod(new TimeRange(time, time));
record.setDataTime(newDataTime); record.setDataTime(newDataTime);
record.setDataURI(null); record.setDataURI(null);
try {
record.constructDataURI();
} catch (Exception e) {
throw new GribException(
"Error creating new dataURI for RTMA data!", e);
}
} }
return new GridRecord[] { record }; 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.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter; 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.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.plugin.grid.dao.GridDao; import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Apr 25, 2011 rgeorge Initial creation * Apr 25, 2011 rgeorge Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
* *
* </pre> * </pre>
* *
@ -55,8 +53,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* @version 1.0 * @version 1.0
*/ */
public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor { public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SixHrPrecipGridProcessor.class);
/** The number of seconds in 6 hours */ /** The number of seconds in 6 hours */
protected static final int SECONDS_IN_6_HRS = 21600; protected static final int SECONDS_IN_6_HRS = 21600;
@ -87,13 +83,11 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
* grid * grid
* @param precipInventory * @param precipInventory
* The current run accumulated grid inventory * The current run accumulated grid inventory
* @param precip6hrInventory
* The current 6hr precipitation inventory
* @return The generated 6hr precipitation grid * @return The generated 6hr precipitation grid
* @throws GribException * @throws GribException
*/ */
protected List<GridRecord> generate6hrPrecip(GridRecord record, protected List<GridRecord> generate6hrPrecip(GridRecord record,
List<GridRecord> precipInventory, List<Integer> precip6hrInventory) List<GridRecord> precipInventory)
throws GribException { throws GribException {
List<GridRecord> tp6hrRecords = new ArrayList<GridRecord>(); List<GridRecord> tp6hrRecords = new ArrayList<GridRecord>();
int currentFcstTime = record.getDataTime().getFcstTime(); int currentFcstTime = record.getDataTime().getFcstTime();
@ -216,11 +210,5 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
// Reset the datauri since the datauri contains the DataTime // Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime); record.setDataTime(newDataTime);
record.setDataURI(null); 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.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.parameter.Parameter; 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.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.plugin.grid.dao.GridDao; import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ------------- --------------------------
* Jan 24, 2012 14299 M. Porricelli Initial creation * Jan 24, 2012 14299 M. Porricelli Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
* *
* </pre> * </pre>
* *
@ -56,8 +54,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
*/ */
public abstract class ThreeHrPrecipGridProcessor implements public abstract class ThreeHrPrecipGridProcessor implements
IDecoderPostProcessor { IDecoderPostProcessor {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ThreeHrPrecipGridProcessor.class);
/** The number of seconds in 3 hours */ /** The number of seconds in 3 hours */
protected static final int SECONDS_IN_3_HRS = 10800; protected static final int SECONDS_IN_3_HRS = 10800;
@ -88,13 +84,11 @@ public abstract class ThreeHrPrecipGridProcessor implements
* grid * grid
* @param precipInventory * @param precipInventory
* The current run accumulated grid inventory * The current run accumulated grid inventory
* @param precip3hrInventory
* The current 3hr precipitation inventory
* @return The generated 3hr precipitation grid * @return The generated 3hr precipitation grid
* @throws GribException * @throws GribException
*/ */
protected List<GridRecord> generate3hrPrecip(GridRecord record, protected List<GridRecord> generate3hrPrecip(GridRecord record,
List<GridRecord> precipInventory, List<Integer> precip3hrInventory) List<GridRecord> precipInventory)
throws GribException { throws GribException {
List<GridRecord> tp3hrRecords = new ArrayList<GridRecord>(); List<GridRecord> tp3hrRecords = new ArrayList<GridRecord>();
int currentFcstTime = record.getDataTime().getFcstTime(); int currentFcstTime = record.getDataTime().getFcstTime();
@ -218,11 +212,5 @@ public abstract class ThreeHrPrecipGridProcessor implements
// Reset the datauri since the datauri contains the DataTime // Reset the datauri since the datauri contains the DataTime
record.setDataTime(newDataTime); record.setDataTime(newDataTime);
record.setDataURI(null); 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 javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.geospatial.MapUtil; 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 * 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 * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Jul 25, 2012 977 rjpeter Initial creation * Jul 25, 2012 977 rjpeter Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -46,7 +46,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/ */
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
public class DefaultSubGridCenterPoint implements ISerializableObject { public class DefaultSubGridCenterPoint {
private Double centerLatitude; private Double centerLatitude;
private Double centerLongitude; private Double centerLongitude;

View file

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

View file

@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; 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.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -37,9 +36,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
*
* *
* </pre> * </pre>
* *
@ -49,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class GenProcess implements ISerializableObject { public class GenProcess {
/** /**
* A generated identification number to uniquely identify this generating * 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 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.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation * Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement @XmlRootElement
@DynamicSerialize @DynamicSerialize
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
public class Grib1Parameter implements ISerializableObject { public class Grib1Parameter {
/** The id assigned from the hashcode of this object */ /** The id assigned from the hashcode of this object */
private int id; 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.edex.plugin.grib.exception.GribException;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; 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.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 * Utility class for looking up Grib 1 Parameters
@ -40,9 +42,10 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation * Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
* *
* </pre> * </pre>
* *
@ -117,23 +120,25 @@ public class Grib1ParameterLookup {
LocalizationContext commonStaticSite = pathManager.getContext( LocalizationContext commonStaticSite = pathManager.getContext(
LocalizationContext.LocalizationType.COMMON_STATIC, LocalizationContext.LocalizationType.COMMON_STATIC,
LocalizationContext.LocalizationLevel.SITE); LocalizationContext.LocalizationLevel.SITE);
File baseParameterFile = pathManager.getFile(commonStaticBase, LocalizationFile baseParameterFile = pathManager.getLocalizationFile(
grib1ParamPath); commonStaticBase, grib1ParamPath);
File siteParameterFile = pathManager.getFile(commonStaticSite, LocalizationFile siteParameterFile = pathManager.getLocalizationFile(
grib1ParamPath); commonStaticSite, grib1ParamPath);
try { try {
JAXBManager jaxbManager = new SingleTypeJAXBManager<Grib1ParameterSet>(
Grib1ParameterSet.class);
if (baseParameterFile.exists()) { if (baseParameterFile.exists()) {
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil Grib1ParameterSet parameterSet = baseParameterFile
.jaxbUnmarshalFromXmlFile(baseParameterFile); .jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
for (Grib1Parameter param : parameterSet.getParameters()) { for (Grib1Parameter param : parameterSet.getParameters()) {
parameterMap.put(getGrib1Hash(param), param); parameterMap.put(getGrib1Hash(param), param);
param.generateId(); param.generateId();
} }
} }
if (siteParameterFile.exists()) { if (siteParameterFile.exists()) {
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil Grib1ParameterSet parameterSet = siteParameterFile
.jaxbUnmarshalFromXmlFile(siteParameterFile); .jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
for (Grib1Parameter param : parameterSet.getParameters()) { for (Grib1Parameter param : parameterSet.getParameters()) {
parameterMap.put(getGrib1Hash(param), param); parameterMap.put(getGrib1Hash(param), param);
param.generateId(); 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.XmlElements;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/** /**
* The class used for unmarshalling the grib1 parameter conversion XML file. * The class used for unmarshalling the grib1 parameter conversion XML file.
* grib1ParameterConvTable.xml * grib1ParameterConvTable.xml
@ -38,9 +36,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 3/9/10 4758 bphillip Initial Creation * Mar 09, 2010 4758 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -49,7 +48,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
*/ */
@XmlRootElement(name = "grib1ParameterSet") @XmlRootElement(name = "grib1ParameterSet")
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
public class Grib1ParameterSet implements ISerializableObject { public class Grib1ParameterSet {
/** The unmarshalled grib 1 parameters */ /** The unmarshalled grib 1 parameters */
@XmlElements( { @XmlElement(name = "grib1Parameter", type = Grib1Parameter.class) }) @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 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.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class GribLevel implements ISerializableObject { public class GribLevel {
/** The id generated from the hashcode of this object */ /** The id generated from the hashcode of this object */
private int id; 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.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; 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.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -36,9 +35,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * Apr 07, 2009 1994 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
* *
* </pre> * </pre>
* *
@ -48,7 +48,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@XmlRootElement @XmlRootElement
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class GribParameter implements ISerializableObject { public class GribParameter {
/** No subcenter id number */ /** No subcenter id number */
public static final int NO_SUBCENTER = -1; 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.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; 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) @XmlAccessorType(XmlAccessType.NONE)
public class GridModel implements ISerializableObject { public class GridModel {
/** The title of the model */ /** The title of the model */
@XmlElement @XmlElement

View file

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

View file

@ -23,24 +23,28 @@ package com.raytheon.edex.util.grib;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement; 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.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; 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.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.JAXBManager;
/** /**
* Contains a map grib 1 table aliases * Contains a map grib 1 table aliases
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 3/19/10 #4634 bphillip Initial creation * Mar 19, 2010 4634 bphillip Initial creation
* Oct 15, 2013 2473 bsteffen Remove deprecated method code.
* *
* </pre> * </pre>
* *
@ -49,12 +53,12 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "gribTableMap") @XmlRootElement(name = "gribTableMap")
public class Grib1TableMap implements ISerializableObject { public class Grib1TableMap {
private HashMap<String, String> map = new HashMap<String, String>(); private HashMap<String, String> map = new HashMap<String, String>();
private static Grib1TableMap instance; private static Grib1TableMap instance;
public static synchronized Grib1TableMap getInstance() { public static synchronized Grib1TableMap getInstance() throws GribException {
if (instance == null) { if (instance == null) {
initInstance(); initInstance();
} }
@ -64,26 +68,24 @@ public class Grib1TableMap implements ISerializableObject {
private Grib1TableMap() { private Grib1TableMap() {
} }
private static void initInstance() { private static void initInstance() throws GribException {
IPathManager pathMgr = PathManagerFactory.getPathManager(); IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext commonStaticBase = pathMgr.getContext( LocalizationContext commonStaticBase = pathMgr.getContext(
LocalizationContext.LocalizationType.COMMON_STATIC, LocalizationContext.LocalizationType.COMMON_STATIC,
LocalizationContext.LocalizationLevel.BASE); LocalizationContext.LocalizationLevel.BASE);
String path = "";
try { try {
path = pathMgr.getFile(commonStaticBase, LocalizationFile tableFile = pathMgr.getLocalizationFile(
"grid" + File.separator + "grib1ParamTableMap.xml") commonStaticBase, "grid" + File.separator
.getCanonicalPath(); + "grib1ParamTableMap.xml");
File tableFile = new File(path);
if (tableFile.exists()) { if (tableFile.exists()) {
instance = (Grib1TableMap) SerializationUtil instance = tableFile.jaxbUnmarshal(Grib1TableMap.class,
.jaxbUnmarshalFromXmlFile(tableFile.getPath()); new JAXBManager(Grib1TableMap.class));
} }
} catch (Exception e) { } catch (LocalizationException e) {
e.printStackTrace(); 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 * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/15/10 4553 bphillip Initial Creation * Apr 15, 2010 4553 bphillip Initial Creation
* Oct 15, 2013 2473 bsteffen Remove e.printStackTrace()
* *
* </pre> * </pre>
* *
@ -71,8 +72,10 @@ public class GribParamTranslator {
* Gets the singleton instance * Gets the singleton instance
* *
* @return The singleton instance * @return The singleton instance
* @throws GribException
*/ */
public static synchronized GribParamTranslator getInstance() { public static synchronized GribParamTranslator getInstance()
throws GribException {
if (instance == null) { if (instance == null) {
instance = new GribParamTranslator(); instance = new GribParamTranslator();
} }
@ -81,25 +84,13 @@ public class GribParamTranslator {
/** /**
* Creates the singleton instance * Creates the singleton instance
*
* @throws GribException
*/ */
private GribParamTranslator() { private GribParamTranslator() throws GribException {
try { initGrib1Lookup();
initGrib1Lookup(); initGrib2Lookup();
} catch (GribException e) { initParameterAliases();
e.printStackTrace();
}
try {
initGrib2Lookup();
} catch (GribException e) {
e.printStackTrace();
}
try {
initParameterAliases();
} catch (GribException e) {
e.printStackTrace();
}
} }
public void getParameterNameAlias(String modelName, Parameter parameter) { public void getParameterNameAlias(String modelName, Parameter parameter) {

View file

@ -29,9 +29,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; 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.exception.GribException;
import com.raytheon.edex.plugin.grib.util.GenProcess; import com.raytheon.edex.plugin.grib.util.GenProcess;
import com.raytheon.edex.plugin.grib.util.Grib1Parameter; 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.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory; 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.FileUtil;
import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.common.util.file.FilenameFilters;
@ -54,10 +53,11 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * Apr 07, 2009 1994 bphillip Initial Creation
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations. * Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
* Oct 15, 2013 2473 bsteffen Switch logging to use UFStatus
* *
* </pre> * </pre>
* *
@ -67,7 +67,8 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
public class GribTableLookup { public class GribTableLookup {
/** The logger */ /** The logger */
protected transient Log logger = LogFactory.getLog(getClass()); private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribTableLookup.class);
/** No center number */ /** No center number */
private static final int NO_CENTER = -1; private static final int NO_CENTER = -1;
@ -250,7 +251,7 @@ public class GribTableLookup {
try { try {
createTable(table, center, subcenter, tableName); createTable(table, center, subcenter, tableName);
} catch (GribException e) { } catch (GribException e) {
logger.error("Unable to create table: " statusHandler.error("Unable to create table: "
+ tableName + " for Center: " + center + tableName + " for Center: " + center
+ " Subcenter: " + subcenter); + " Subcenter: " + subcenter);
continue; continue;
@ -380,7 +381,7 @@ public class GribTableLookup {
try { try {
in.close(); in.close();
} catch (IOException e) { } 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.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.HashCodeBuilder;
@ -66,14 +67,16 @@ import com.vividsolutions.jts.geom.Geometry;
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Apr 07, 2009 1994 bphillip Initial Creation * Apr 07, 2009 1994 bphillip Initial Creation
* Sep 07, 2012 1102 djohnson Add missing JAXB annotations. * Sep 07, 2012 1102 djohnson Add missing JAXB annotations.
* Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling. * Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling.
* Nov 02, 2012 1302 djohnson Remove commented out code. * Nov 02, 2012 1302 djohnson Remove commented out code.
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate- * Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial * spatial
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
* context.
* *
* </pre> * </pre>
* *
@ -85,6 +88,9 @@ import com.vividsolutions.jts.geom.Geometry;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE) @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@SequenceGenerator(name = "GRIDCOVERAGE_GENERATOR", sequenceName = "gridcoverage_seq", allocationSize = 1) @SequenceGenerator(name = "GRIDCOVERAGE_GENERATOR", sequenceName = "gridcoverage_seq", allocationSize = 1)
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso({ LambertConformalGridCoverage.class, LatLonGridCoverage.class,
MercatorGridCoverage.class, PolarStereoGridCoverage.class,
StereographicGridCoverage.class })
@DynamicSerialize @DynamicSerialize
public abstract class GridCoverage extends PersistableDataObject<Integer> public abstract class GridCoverage extends PersistableDataObject<Integer>
implements ISpatialObject { implements ISpatialObject {

View file

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