From 1e06c862bf8a3dfe28d64c14dfbce72656e67bfd Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Tue, 9 Sep 2014 14:00:17 -0500 Subject: [PATCH] Omaha #3356 updates for improved level lookup Change-Id: I32ca44114fb18770bff22c6d0c9173e8fa49a362 Former-commit-id: 62b84b2fb3c42eef2c67664856cfe5941ef8975c [formerly ae9cffaaea4a4c4bd3c67ece3278000607d650ec [formerly 0ca90b58d7ca85d5bfc8fc525415115ac8451c5b]] Former-commit-id: ae9cffaaea4a4c4bd3c67ece3278000607d650ec Former-commit-id: 1c77f666082b3b8cd4272dfe9de8e5eeb7ae37b9 --- .../META-INF/MANIFEST.MF | 1 - .../npp/viirs/data/VIIRSDataInventory.java | 21 +- .../objectiveanalysis/rsc/OAResourceData.java | 46 ++-- .../META-INF/MANIFEST.MF | 1 - .../GridProductBrowserDataDefinition.java | 249 ++++++++---------- .../grid/GridProductBrowserDataFormatter.java | 5 +- .../viz/grid/data/RadarRequestableData.java | 20 +- .../grid/data/StaticGridRequestableData.java | 19 +- .../viz/grid/data/TopoRequestableData.java | 15 +- .../raytheon/viz/grid/inv/GridInventory.java | 53 ++-- .../raytheon/viz/grid/inv/GridUpdater.java | 43 +-- .../raytheon/viz/grid/inv/RadarUpdater.java | 35 +-- .../viz/grid/rsc/GridNameGenerator.java | 19 +- .../raytheon/viz/grid/util/RadarAdapter.java | 19 +- .../raytheon/viz/pointdata/PlotModels.java | 29 +- .../util/AbstractPointDataInventory.java | 31 +-- .../pointdata/util/PointDataCubeAdapter.java | 23 +- .../inventory/SatelliteInventory.java | 11 +- .../datacatalog/AbstractDataCatalog.java | 26 +- .../AbstractInventoryDataCatalog.java | 60 ++--- .../datacatalog/GridDataCatalog.java | 59 ++--- .../datacatalog/PointDataCatalog.java | 23 +- .../gfe/server/database/D2DGridDatabase.java | 23 +- .../res/spring/grib-decode.xml | 2 +- .../edex/plugin/grib/Grib1Decoder.java | 4 +- .../LapsPostProcessor.java | 12 +- .../dataaccess/GridDataAccessFactory.java | 27 +- .../.settings/org.eclipse.jdt.core.prefs | 8 - .../edex/plugin/grid/dao/GridInfoCache.java | 12 +- 29 files changed, 341 insertions(+), 555 deletions(-) delete mode 100644 edexOsgi/com.raytheon.uf.edex.plugin.grid/.settings/org.eclipse.jdt.core.prefs diff --git a/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF index fc3b9b55f4..17d7eb1311 100644 --- a/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.npp.viirs/META-INF/MANIFEST.MF @@ -20,7 +20,6 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.common.pointdata;bundle-version="1.12.1174", com.raytheon.viz.core;bundle-version="1.12.1174", com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174", - com.raytheon.uf.common.comm;bundle-version="1.12.1174", com.raytheon.viz.alerts;bundle-version="1.12.1174", com.raytheon.uf.viz.npp;bundle-version="1.0.0", com.raytheon.uf.common.style;bundle-version="1.0.0", diff --git a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/data/VIIRSDataInventory.java b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/data/VIIRSDataInventory.java index 445102994b..1d8e9b1165 100644 --- a/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/data/VIIRSDataInventory.java +++ b/cave/com.raytheon.uf.viz.npp.viirs/src/com/raytheon/uf/viz/npp/viirs/data/VIIRSDataInventory.java @@ -28,14 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.data.AbstractRequestableData; -import com.raytheon.uf.common.inventory.exception.DataCubeException; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; -import com.raytheon.uf.common.inventory.tree.DataTree; -import com.raytheon.uf.common.inventory.tree.LevelNode; -import com.raytheon.uf.common.inventory.tree.ParameterNode; -import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; @@ -47,6 +39,13 @@ import com.raytheon.uf.common.derivparam.library.DerivParamDesc; import com.raytheon.uf.common.derivparam.library.DerivParamField; import com.raytheon.uf.common.derivparam.library.DerivParamMethod; import com.raytheon.uf.common.derivparam.tree.AbstractDerivedDataNode; +import com.raytheon.uf.common.inventory.data.AbstractRequestableData; +import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; +import com.raytheon.uf.common.inventory.tree.DataTree; +import com.raytheon.uf.common.inventory.tree.LevelNode; +import com.raytheon.uf.common.inventory.tree.ParameterNode; +import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -66,7 +65,8 @@ import com.raytheon.viz.alerts.observers.ProductAlertObserver; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 18, 2012 mschenke Initial creation + * Jan 18, 2012 mschenke Initial creation + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -104,7 +104,7 @@ public class VIIRSDataInventory extends AbstractInventory implements private List viirsLevels = new ArrayList(); - public VIIRSDataInventory() throws CommunicationException { + public VIIRSDataInventory() { entireAtmosphere = LevelFactory.getInstance().getLevel( VIIRS_LEVEL_NAME, 0.0); ProductAlertObserver.addObserver(PLUGIN_NAME, this); @@ -274,6 +274,7 @@ public class VIIRSDataInventory extends AbstractInventory implements try { return walkTree(null, sources, parameters, levels, true, true, null); } catch (InterruptedException e) { + // no-op } return new ArrayList(0); } diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java index 5a6fe4ba0a..d430c99bf1 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java @@ -27,16 +27,14 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.MasterLevel; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; -import com.raytheon.uf.common.style.level.SingleLevel; import com.raytheon.uf.common.style.level.Level.LevelType; +import com.raytheon.uf.common.style.level.SingleLevel; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; @@ -52,6 +50,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties; * ------------ ---------- ----------- -------------------------- * Nov 5, 2009 randerso Initial creation * Jan 8, 2010 4205 jelkins add equals checking for OA resources + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -197,30 +196,27 @@ public class OAResourceData extends AbstractRequestableResourceData { if (this.levelKey.equals(ALL_TILTS)) { LevelFactory factory = LevelFactory.getInstance(); List timesWithLevels = new ArrayList(); - try { - MasterLevel ml = factory.getMasterLevel("TILT"); - Set allLevels = LevelMappingFactory.getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getAllLevels(); - List levels = new ArrayList(); - for (Level l : allLevels) { - if (l.getMasterLevel().equals(ml)) { - levels.add(l); - } + MasterLevel ml = factory.getMasterLevel("TILT"); + Set allLevels = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels(); + List levels = new ArrayList(); + for (Level l : allLevels) { + if (l.getMasterLevel().equals(ml)) { + levels.add(l); } - - for (int i = 0; i < times.length; ++i) { - for (int j = 0; j < levels.size(); ++j) { - DataTime time = times[i].clone(); - time.setLevelValue(levels.get(j).getLevelonevalue()); - if (time.isSpatial()) { - timesWithLevels.add(time); - } - } - } - } catch (CommunicationException e) { - throw new VizCommunicationException(e); } + + for (int i = 0; i < times.length; ++i) { + for (int j = 0; j < levels.size(); ++j) { + DataTime time = times[i].clone(); + time.setLevelValue(levels.get(j).getLevelonevalue()); + if (time.isSpatial()) { + timesWithLevels.add(time); + } + } + } + return timesWithLevels .toArray(new DataTime[timesWithLevels.size()]); } else { diff --git a/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF index acc8bd05c0..b3e0c183fa 100644 --- a/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF @@ -26,7 +26,6 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.8.0", com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.dataquery, - com.raytheon.uf.common.comm, com.raytheon.uf.common.derivparam;bundle-version="1.14.0", com.raytheon.uf.common.pointdata;bundle-version="1.13.0", com.raytheon.uf.viz.d2d.core, diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java index c3e03d6180..83606f94f5 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java @@ -34,7 +34,6 @@ import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; @@ -72,6 +71,7 @@ import com.raytheon.viz.grid.rsc.GridResourceData; * DbQueryRequest. * Sep 19, 2013 2391 mpduff refactored some methods to common class. * Jan 23, 2014 2711 bsteffen Get all levels from LevelFactory. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -156,119 +156,115 @@ public class GridProductBrowserDataDefinition extends @Override protected String[] queryData(String param, Map queryList) { - try { - if (getInventory() == null) { - return super.queryData(param, queryList); - } else { - Collection sources = null; - Collection params = null; - Collection levels = null; - BlockingQueue returnQueue = new LinkedBlockingQueue(); - for (Entry queryParam : queryList - .entrySet()) { - String key = queryParam.getKey(); - String value = queryParam.getValue().getConstraintValue(); - if (key.equals(GridInventory.MODEL_NAME_QUERY)) { - sources = Arrays.asList(value); - } else if (key.equals(GridInventory.PARAMETER_QUERY)) { - params = Arrays.asList(value); - } else if (key.equals(GridInventory.MASTER_LEVEL_QUERY)) { - if (levels == null) { - levels = new ArrayList(LevelFactory - .getInstance().getAllLevels()); - } - Iterator iter = levels.iterator(); - while (iter.hasNext()) { - if (!iter.next().getMasterLevel().getName() - .equals(value)) { - iter.remove(); - } + if (getInventory() == null) { + return super.queryData(param, queryList); + } else { + Collection sources = null; + Collection params = null; + Collection levels = null; + BlockingQueue returnQueue = new LinkedBlockingQueue(); + for (Entry queryParam : queryList + .entrySet()) { + String key = queryParam.getKey(); + String value = queryParam.getValue().getConstraintValue(); + if (key.equals(GridInventory.MODEL_NAME_QUERY)) { + sources = Arrays.asList(value); + } else if (key.equals(GridInventory.PARAMETER_QUERY)) { + params = Arrays.asList(value); + } else if (key.equals(GridInventory.MASTER_LEVEL_QUERY)) { + if (levels == null) { + levels = new ArrayList(LevelFactory + .getInstance().getAllLevels()); + } + Iterator iter = levels.iterator(); + while (iter.hasNext()) { + if (!iter.next().getMasterLevel().getName() + .equals(value)) { + iter.remove(); } + } - } else if (key.equals(GridInventory.LEVEL_ONE_QUERY)) { - double doubleValue = Double.parseDouble(value); - if (levels == null) { - levels = new ArrayList( - LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getAllLevels()); + } else if (key.equals(GridInventory.LEVEL_ONE_QUERY)) { + double doubleValue = Double.parseDouble(value); + if (levels == null) { + levels = new ArrayList( + LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels()); + } + Iterator iter = levels.iterator(); + while (iter.hasNext()) { + if (iter.next().getLevelonevalue() != doubleValue) { + iter.remove(); } - Iterator iter = levels.iterator(); - while (iter.hasNext()) { - if (iter.next().getLevelonevalue() != doubleValue) { - iter.remove(); - } + } + } else if (key.equals(GridInventory.LEVEL_TWO_QUERY)) { + double doubleValue = Double.parseDouble(value); + if (levels == null) { + levels = new ArrayList( + LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels()); + } + Iterator iter = levels.iterator(); + while (iter.hasNext()) { + if (iter.next().getLeveltwovalue() != doubleValue) { + iter.remove(); } - } else if (key.equals(GridInventory.LEVEL_TWO_QUERY)) { - double doubleValue = Double.parseDouble(value); - if (levels == null) { - levels = new ArrayList( - LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getAllLevels()); - } - Iterator iter = levels.iterator(); - while (iter.hasNext()) { - if (iter.next().getLeveltwovalue() != doubleValue) { - iter.remove(); - } - } - } else if (key.equals(GridInventory.LEVEL_ID_QUERY)) { - levels = Arrays.asList(LevelFactory.getInstance() - .getLevel(value)); } - } - - if (param.equals(GridInventory.MODEL_NAME_QUERY)) { - try { - getInventory().checkSources(sources, params, levels, - returnQueue); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - return returnQueue.toArray(new String[0]); - } else if (param.equals(GridInventory.PARAMETER_QUERY)) { - try { - getInventory().checkParameters(sources, params, levels, - false, returnQueue); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - return returnQueue.toArray(new String[0]); - } else if (param.equals(GridInventory.MASTER_LEVEL_QUERY)) { - try { - getInventory().checkLevels(sources, params, levels, - returnQueue); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - Set masterlevels = new HashSet(); - LevelFactory lf = LevelFactory.getInstance(); - for (String levelid : returnQueue) { - Level level = lf.getLevel(levelid); - masterlevels.add(level.getMasterLevel().getName()); - } - return masterlevels.toArray(new String[0]); - } else if (param.equals(GridInventory.LEVEL_ID_QUERY)) { - try { - getInventory().checkLevels(sources, params, levels, - returnQueue); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - return returnQueue.toArray(new String[0]); + } else if (key.equals(GridInventory.LEVEL_ID_QUERY)) { + levels = Arrays.asList(LevelFactory.getInstance().getLevel( + value)); } } - } catch (CommunicationException e) { - statusHandler.handle(Priority.ERROR, "Unable to query data for " - + productName, e); + + if (param.equals(GridInventory.MODEL_NAME_QUERY)) { + try { + getInventory().checkSources(sources, params, levels, + returnQueue); + } catch (InterruptedException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + return returnQueue.toArray(new String[0]); + } else if (param.equals(GridInventory.PARAMETER_QUERY)) { + try { + getInventory().checkParameters(sources, params, levels, + false, returnQueue); + } catch (InterruptedException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + return returnQueue.toArray(new String[0]); + } else if (param.equals(GridInventory.MASTER_LEVEL_QUERY)) { + try { + getInventory().checkLevels(sources, params, levels, + returnQueue); + } catch (InterruptedException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + Set masterlevels = new HashSet(); + LevelFactory lf = LevelFactory.getInstance(); + for (String levelid : returnQueue) { + Level level = lf.getLevel(levelid); + masterlevels.add(level.getMasterLevel().getName()); + } + return masterlevels.toArray(new String[0]); + } else if (param.equals(GridInventory.LEVEL_ID_QUERY)) { + try { + getInventory().checkLevels(sources, params, levels, + returnQueue); + } catch (InterruptedException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } + return returnQueue.toArray(new String[0]); + } } + return new String[0]; } @@ -282,15 +278,10 @@ public class GridProductBrowserDataDefinition extends @Override public List formatData(String param, String[] parameters) { - try { - List labels = GridProductBrowserDataFormatter - .formatGridData(param, parameters); - if (labels != null && !labels.isEmpty()) { - return labels; - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.ERROR, "Unable to format data for " - + productName, e); + List labels = GridProductBrowserDataFormatter + .formatGridData(param, parameters); + if (labels != null && !labels.isEmpty()) { + return labels; } return super.formatData(param, parameters); @@ -308,26 +299,14 @@ public class GridProductBrowserDataDefinition extends RequestConstraint levelRC = queryList .remove(GridInventory.LEVEL_ID_QUERY); // Convert Level id to level one and level two values. - try { - Level level = LevelFactory.getInstance().getLevel( - levelRC.getConstraintValue()); - queryList - .put(GridInventory.LEVEL_ONE_QUERY, - new RequestConstraint(level - .getLevelOneValueAsString())); - queryList - .put(GridInventory.LEVEL_TWO_QUERY, - new RequestConstraint(level - .getLevelTwoValueAsString())); - queryList - .put(GridInventory.MASTER_LEVEL_QUERY, - new RequestConstraint(level.getMasterLevel() - .getName())); - } catch (CommunicationException e) { - statusHandler.handle(Priority.ERROR, - "Unable to get product parameters for " + productName, - e); - } + Level level = LevelFactory.getInstance().getLevel( + levelRC.getConstraintValue()); + queryList.put(GridInventory.LEVEL_ONE_QUERY, new RequestConstraint( + level.getLevelOneValueAsString())); + queryList.put(GridInventory.LEVEL_TWO_QUERY, new RequestConstraint( + level.getLevelTwoValueAsString())); + queryList.put(GridInventory.MASTER_LEVEL_QUERY, + new RequestConstraint(level.getMasterLevel().getName())); } return queryList; } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataFormatter.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataFormatter.java index 5aa1e52a81..eb1424e172 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataFormatter.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataFormatter.java @@ -26,7 +26,6 @@ import java.util.Comparator; import java.util.List; import java.util.Map; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo; import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup; import com.raytheon.uf.common.dataplugin.level.Level; @@ -47,6 +46,7 @@ import com.raytheon.viz.grid.inv.GridInventory; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 19, 2013 2391 mpduff Initial creation + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -64,10 +64,9 @@ public class GridProductBrowserDataFormatter { * @param parameters * List of parameters * @return List of ProductBrowserLabel objects - * @throws CommunicationException */ public static List formatGridData(String param, - String[] parameters) throws CommunicationException { + String[] parameters) { List labels = new ArrayList(); if (GridInventory.MODEL_NAME_QUERY.equals(param)) { DatasetInfoLookup lookup = DatasetInfoLookup.getInstance(); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java index 95d64bd5ad..7ef0ad4ec3 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java @@ -26,8 +26,6 @@ import javax.measure.converter.UnitConverter; import javax.measure.unit.Unit; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.uf.common.dataplugin.HDF5Util; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.LevelFactory; @@ -40,10 +38,8 @@ import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.gridcoverage.GridCoverage; +import com.raytheon.uf.common.inventory.exception.DataCubeException; 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.viz.core.exception.VizException; import com.raytheon.viz.grid.util.RadarAdapter; import com.raytheon.viz.grid.util.SliceUtil; @@ -59,6 +55,7 @@ import com.raytheon.viz.grid.util.SliceUtil; * ------------ ---------- ----------- -------------------------- * Mar 18, 2010 4473 rjpeter Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -67,8 +64,6 @@ import com.raytheon.viz.grid.util.SliceUtil; */ public class RadarRequestableData extends GridRequestableData { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(RadarRequestableData.class); private final RadarRecord radarSource; @@ -89,13 +84,9 @@ public class RadarRequestableData extends GridRequestableData { this.source = "radar"; this.dataTime = source.getDataTime(); this.space = RadarAdapter.getInstance().getCoverage(); - try { - this.level = LevelFactory.getInstance().getLevel("TILT", - source.getPrimaryElevationAngle()); - } catch (CommunicationException e1) { - statusHandler - .handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1); - } + this.level = LevelFactory.getInstance().getLevel("TILT", + source.getPrimaryElevationAngle()); + this.parameter = parameterAbbrev; this.parameterName = ""; this.unit = unit; @@ -109,7 +100,6 @@ public class RadarRequestableData extends GridRequestableData { this.parameterName, unit); record.setParameter(parameter); record.setDataTime(source.getDataTime()); - record.constructDataURI(); setGridSource(record); } catch (Exception e) { throw new VizException(e); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/StaticGridRequestableData.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/StaticGridRequestableData.java index d931c27cc4..9efe7c4989 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/StaticGridRequestableData.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/StaticGridRequestableData.java @@ -21,10 +21,6 @@ package com.raytheon.viz.grid.data; import javax.measure.unit.SI; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.data.AbstractRequestableData; -import com.raytheon.uf.common.inventory.exception.DataCubeException; -import com.raytheon.uf.common.inventory.TimeAndSpace; import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo; import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup; import com.raytheon.uf.common.dataplugin.grid.util.StaticGridData; @@ -33,9 +29,9 @@ import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.gridcoverage.GridCoverage; -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.inventory.TimeAndSpace; +import com.raytheon.uf.common.inventory.data.AbstractRequestableData; +import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.viz.grid.util.SliceUtil; /** @@ -48,6 +44,7 @@ import com.raytheon.viz.grid.util.SliceUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 15, 2010 rjpeter Initial creation + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -56,8 +53,6 @@ import com.raytheon.viz.grid.util.SliceUtil; */ public class StaticGridRequestableData extends AbstractRequestableData { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(StaticGridRequestableData.class); private StaticGridDataType dataType; @@ -74,11 +69,7 @@ public class StaticGridRequestableData extends AbstractRequestableData { } else { this.unit = SI.METER; } - try { - this.level = LevelFactory.getInstance().getLevel("SFC", 0.0); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } + this.level = LevelFactory.getInstance().getLevel("SFC", 0.0); } /* diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/TopoRequestableData.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/TopoRequestableData.java index f2122abad0..64a99fe84e 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/TopoRequestableData.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/TopoRequestableData.java @@ -26,22 +26,18 @@ import javax.measure.unit.SI; import org.geotools.coverage.grid.GridGeometry2D; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.gridcoverage.GridCoverage; import com.raytheon.uf.common.inventory.data.AbstractRequestableData; import com.raytheon.uf.common.inventory.exception.DataCubeException; -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.topo.TopoException; import com.raytheon.uf.common.topo.TopoQuery; import com.raytheon.viz.grid.util.SliceUtil; /** - * requestable data that queries the topo datastore and transforms the data into + * Requestable data that queries the topo datastore and transforms the data into * the correct coverage. * *
@@ -52,6 +48,7 @@ import com.raytheon.viz.grid.util.SliceUtil;
  * Jan 15, 2010            rjpeter     Initial creation
  * Feb 15, 2013 1638       mschenke    Got rid of viz/edex topo classes 
  *                                     and moved into common
+ * Sep 09, 2014 3356       njensen     Remove CommunicationException
  * 
  * 
* @@ -60,8 +57,6 @@ import com.raytheon.viz.grid.util.SliceUtil; */ public class TopoRequestableData extends AbstractRequestableData { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(TopoRequestableData.class); // need to move to a static timed cache private static Map topoCache = new HashMap(); @@ -71,11 +66,7 @@ public class TopoRequestableData extends AbstractRequestableData { this.parameter = "staticTopo"; this.parameterName = "Topography"; this.unit = SI.METER; - try { - this.level = LevelFactory.getInstance().getLevel("SFC", 0.0); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } + this.level = LevelFactory.getInstance().getLevel("SFC", 0.0); } /* diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridInventory.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridInventory.java index 66c8143ac3..20239143e3 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridInventory.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridInventory.java @@ -33,16 +33,6 @@ import java.util.Map.Entry; import java.util.NavigableSet; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.data.AbstractRequestableData; -import com.raytheon.uf.common.inventory.exception.DataCubeException; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; -import com.raytheon.uf.common.inventory.tree.CubeLevel; -import com.raytheon.uf.common.inventory.tree.DataTree; -import com.raytheon.uf.common.inventory.tree.LevelNode; -import com.raytheon.uf.common.inventory.tree.ParameterNode; -import com.raytheon.uf.common.inventory.tree.SourceNode; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode.Dependency; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridInfoConstants; import com.raytheon.uf.common.dataplugin.grid.GridInfoRecord; @@ -64,6 +54,15 @@ import com.raytheon.uf.common.derivparam.library.DerivParamMethod.MethodType; import com.raytheon.uf.common.derivparam.tree.AbstractDerivedDataNode; import com.raytheon.uf.common.derivparam.tree.StaticDataLevelNode; import com.raytheon.uf.common.gridcoverage.GridCoverage; +import com.raytheon.uf.common.inventory.data.AbstractRequestableData; +import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode.Dependency; +import com.raytheon.uf.common.inventory.tree.CubeLevel; +import com.raytheon.uf.common.inventory.tree.DataTree; +import com.raytheon.uf.common.inventory.tree.LevelNode; +import com.raytheon.uf.common.inventory.tree.ParameterNode; +import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -95,6 +94,7 @@ import com.raytheon.viz.grid.util.RadarAdapter; * parameters. * Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived * parameters to common + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -256,15 +256,7 @@ public class GridInventory extends AbstractInventory implements return null; } if (nodes.get(0) instanceof AbstractDerivedDataNode) { - try { - updater.addNode((AbstractDerivedDataNode) nodes.get(0)); - } catch (VizException e) { - statusHandler - .handle(Priority.PROBLEM, - "Error occured in Grid Inventory: Grid Update may be broken", - e); - return null; - } + updater.addNode((AbstractDerivedDataNode) nodes.get(0)); } return nodes.get(0); } catch (InterruptedException e) { @@ -275,6 +267,7 @@ public class GridInventory extends AbstractInventory implements return null; } + @Override protected DataTree createBaseTree() throws DataCubeException { DataTree newTree = getTreeFromEdex(); if (newTree == null) { @@ -349,8 +342,8 @@ public class GridInventory extends AbstractInventory implements // This should query all times for this model. DataTime[] timesArray; try { - timesArray = CatalogQuery.performTimeQuery(newQuery, - false, null); + timesArray = CatalogQuery.performTimeQuery(newQuery, false, + null); } catch (VizException e) { throw new DataCubeException(e); } @@ -476,18 +469,11 @@ public class GridInventory extends AbstractInventory implements List nodes = walkTree(null, sourcesToProcess, paramsToProcess, levelsToProcess, true, true, null); - try { - for (AbstractRequestableNode node : nodes) { - if (node instanceof AbstractDerivedDataNode) { - updater.addNode((AbstractDerivedDataNode) node); - } + for (AbstractRequestableNode node : nodes) { + if (node instanceof AbstractDerivedDataNode) { + updater.addNode((AbstractDerivedDataNode) node); } - } catch (VizException e) { - statusHandler - .handle(Priority.PROBLEM, - "Error occured in Grid Inventory: Grid Update may be broken", - e); } return nodes; } catch (InterruptedException e) { @@ -694,8 +680,7 @@ public class GridInventory extends AbstractInventory implements @Override protected LevelNode getCubeNode(SourceNode sNode, DerivParamField field, - Deque stack, Set nodata) - throws CommunicationException { + Deque stack, Set nodata) { StackEntry se = new StackEntry(sNode.getValue(), field.getParam(), Long.MIN_VALUE); if (stack.contains(se)) { @@ -748,6 +733,7 @@ public class GridInventory extends AbstractInventory implements return null; } + @Override protected Object resolvePluginStaticData(SourceNode sNode, DerivParamField field, Level level) { String fieldParamAbbrev = field.getParam(); @@ -766,6 +752,7 @@ public class GridInventory extends AbstractInventory implements return null; } + @Override protected AbstractDerivedDataNode createDerivedNode(DerivParamDesc desc, DerivParamMethod method, Level level, List fields, SourceNode source) { diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java index aecb9aeb78..fad4a7897a 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java @@ -27,10 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.tree.LevelNode; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode.Dependency; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.Level; @@ -39,13 +35,11 @@ import com.raytheon.uf.common.derivparam.library.DerivParamMethod; import com.raytheon.uf.common.derivparam.tree.AbstractDerivedDataNode; import com.raytheon.uf.common.derivparam.tree.OrLevelNode; import com.raytheon.uf.common.gridcoverage.GridCoverage; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode.Dependency; +import com.raytheon.uf.common.inventory.tree.LevelNode; 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.viz.core.alerts.AlertMessage; -import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.alerts.IAlertObserver; import com.raytheon.viz.alerts.observers.ProductAlertObserver; import com.raytheon.viz.grid.util.RadarAdapter; @@ -60,6 +54,7 @@ import com.raytheon.viz.grid.util.RadarAdapter; * ------------ ---------- ----------- -------------------------- * Mar 25, 2010 bsteffen Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -67,8 +62,6 @@ import com.raytheon.viz.grid.util.RadarAdapter; * @version 1.0 */ public class GridUpdater implements IAlertObserver { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(GridUpdater.class); private class UpdateValue { public int timeOffset; @@ -152,8 +145,7 @@ public class GridUpdater implements IAlertObserver { ProductAlertObserver.removeObserver(GridInventory.PLUGIN_NAME, this); } - public synchronized void addNode(AbstractDerivedDataNode node) - throws VizException { + public synchronized void addNode(AbstractDerivedDataNode node) { List dependencies = node.getDependencies(); if ((dependencies == null) || dependencies.isEmpty()) { return; @@ -224,17 +216,11 @@ public class GridUpdater implements IAlertObserver { } GridMapKey updateKey = new GridMapKey(alert.decodedAlert); GridTimeCache.getInstance().clearTimes(updateKey); - LevelNode lNode = null; - try { - Level level = LevelFactory.getInstance().getLevel( - updateKey.masterLevel, updateKey.levelone, - updateKey.leveltwo); - lNode = inventory.getNode(updateKey.modelName, - updateKey.parameter, level); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - e); - } + Level level = LevelFactory.getInstance().getLevel( + updateKey.masterLevel, updateKey.levelone, + updateKey.leveltwo); + LevelNode lNode = inventory.getNode(updateKey.modelName, + updateKey.parameter, level); if (lNode == null) { inventory.reinitTree(); @@ -292,16 +278,7 @@ public class GridUpdater implements IAlertObserver { .get(GridConstants.SECONDARY_ID)); fakeRec.setLocation((GridCoverage) alert.decodedAlert .get(GridConstants.LOCATION)); - try { - fakeRec.constructDataURI(); - datauris.add(fakeRec.getDataURI()); - } catch (PluginException e) { - statusHandler - .handle(Priority.PROBLEM, - "Unable to generate updates for derived product", - e); - } - + datauris.add(fakeRec.getDataURI()); } } myUpdates.addAll(datauris); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java index f80d92d1eb..7281edcd2f 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java @@ -7,19 +7,14 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.TimeAndSpace; -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; import com.raytheon.uf.common.dataplugin.radar.RadarStation; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; +import com.raytheon.uf.common.inventory.TimeAndSpace; 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.viz.core.alerts.AlertMessage; import com.raytheon.viz.alerts.IAlertObserver; @@ -41,6 +36,7 @@ import com.raytheon.viz.grid.util.RadarProductCodeMapping; * Sep 20, 2012 bsteffen Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Feb 21, 2014 DR 16744 D. Friedman Support thin client updates + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -48,8 +44,6 @@ import com.raytheon.viz.grid.util.RadarProductCodeMapping; * @version 1.0 */ public class RadarUpdater implements IAlertObserver { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(RadarUpdater.class); protected static final int CACHE_SIZE = 100; @@ -151,10 +145,12 @@ public class RadarUpdater implements IAlertObserver { @Override public void alertArrived(Collection alertMessages) { - ProductAlertObserver.processDataURIAlerts(convertRadarAlertsToGridDatauris(alertMessages)); + ProductAlertObserver + .processDataURIAlerts(convertRadarAlertsToGridDatauris(alertMessages)); } - public Set convertRadarAlertsToGridDatauris(Collection alertMessages) { + public Set convertRadarAlertsToGridDatauris( + Collection alertMessages) { RadarStation configuredRadar = RadarAdapter.getInstance() .getConfiguredRadar(); if (configuredRadar == null) { @@ -191,14 +187,8 @@ public class RadarUpdater implements IAlertObserver { } Double elevationAngle = (Double) obj; cache.remove(new CacheKey(productCode, elevationAngle)); - Level level = null; - try { - level = LevelFactory.getInstance().getLevel( - RadarAdapter.CUBE_MASTER_LEVEL_NAME, elevationAngle); - } catch (CommunicationException e1) { - statusHandler.handle(Priority.PROBLEM, - e1.getLocalizedMessage(), e1); - } + Level level = LevelFactory.getInstance().getLevel( + RadarAdapter.CUBE_MASTER_LEVEL_NAME, elevationAngle); GridRecord fakeRec = new GridRecord(); fakeRec.setDataTime(time); @@ -206,13 +196,8 @@ public class RadarUpdater implements IAlertObserver { Parameter param = new Parameter(paramAbbrev); fakeRec.setParameter(param); fakeRec.setLevel(level); - try { - fakeRec.constructDataURI(); - datauris.add(fakeRec.getDataURI()); - } catch (PluginException e) { - statusHandler.handle(Priority.PROBLEM, - "Unable to generate updates for derived product", e); - } + + datauris.add(fakeRec.getDataURI()); } return datauris; } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java index a1c7ad0321..03cb79a54b 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java @@ -19,7 +19,6 @@ **/ package com.raytheon.viz.grid.rsc; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; @@ -38,7 +37,8 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Sep 20, 2012 bsteffen Initial creation + * Sep 20, 2012 bsteffen Initial creation + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -143,18 +143,13 @@ public class GridNameGenerator extends AbstractNameGenerator { } private String lookupPlane(Level level) { - try { - LevelMapping mapping = LevelMappingFactory.getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForLevel(level); - if (mapping == null) { - return level.getMasterLevel().getName(); - } - return mapping.getDisplayName(); - } catch (CommunicationException e) { + LevelMapping mapping = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(level); + if (mapping == null) { return level.getMasterLevel().getName(); - } + return mapping.getDisplayName(); } public void setPlaneLabelString(String planeLabelString) { diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java index 7709d97ac6..39f582a04a 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java @@ -34,12 +34,6 @@ import org.opengis.referencing.crs.ProjectedCRS; import org.opengis.referencing.operation.MathTransform; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; -import com.raytheon.uf.common.inventory.tree.DataTree; -import com.raytheon.uf.common.inventory.tree.LevelNode; -import com.raytheon.uf.common.inventory.tree.ParameterNode; -import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.radar.RadarRecord; @@ -57,6 +51,11 @@ import com.raytheon.uf.common.gridcoverage.GridCoverage; import com.raytheon.uf.common.gridcoverage.StereographicGridCoverage; import com.raytheon.uf.common.gridcoverage.exception.GridCoverageException; import com.raytheon.uf.common.gridcoverage.lookup.GridCoverageLookup; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; +import com.raytheon.uf.common.inventory.tree.DataTree; +import com.raytheon.uf.common.inventory.tree.LevelNode; +import com.raytheon.uf.common.inventory.tree.ParameterNode; +import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -84,6 +83,7 @@ import com.raytheon.viz.radar.util.StationUtils; * Mar 23, 2010 #4473 rjpeter Initial creation * Feb 21, 2014 DR 16744 D. Friedman Add getUpdateConstraints * Apr 1, 2014 DR 17220 D. Friedman Handle uninitialized grid inventory + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -313,12 +313,7 @@ public class RadarAdapter { * @param level */ private void initTopoParam(SourceNode modelNameNode) { - Level sfc = null; - try { - sfc = LevelFactory.getInstance().getLevel("SFC", 0.0); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } + Level sfc = LevelFactory.getInstance().getLevel("SFC", 0.0); DerivParamDesc topo = new DerivParamDesc(); topo.setAbbreviation("Topo"); topo.setName("Topography"); diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModels.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModels.java index f87ab963c2..1636b0cd22 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModels.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModels.java @@ -30,7 +30,6 @@ import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; @@ -38,9 +37,6 @@ import com.raytheon.uf.common.localization.IPathManager; 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.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.map.MapDescriptor; import com.raytheon.uf.viz.datacube.DataCubeContainer; @@ -58,6 +54,7 @@ import com.raytheon.viz.pointdata.util.PointDataInventory; * ------------- -------- ----------- -------------------------- * Sep 18, 2013 2391 mpduff Initial creation * Jun 06, 2014 2061 bsteffen Remove old PlotResource + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -69,9 +66,6 @@ public class PlotModels { /** The only instance */ private static final PlotModels instance = new PlotModels(); - private final IUFStatusHandler statusHandler = UFStatus - .getHandler(PlotModels.class); - /** Constant */ private final String PLOTLOCATION = "plotModels"; @@ -195,19 +189,14 @@ public class PlotModels { List validLevels = new ArrayList(); if (possibleLevels != null) { for (String levelid : possibleLevels) { - try { - Level level = LevelFactory.getInstance().getLevel( - Long.parseLong(levelid)); - validLevels - .add(LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForLevel(level) - .getDisplayName()); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } + Level level = LevelFactory.getInstance().getLevel( + Long.parseLong(levelid)); + validLevels + .add(LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(level) + .getDisplayName()); } } return validLevels.toArray(new String[0]); diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java index e9ac8702c0..07e5a1592a 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java @@ -28,14 +28,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.data.AbstractRequestableData; -import com.raytheon.uf.common.inventory.exception.DataCubeException; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; -import com.raytheon.uf.common.inventory.tree.DataTree; -import com.raytheon.uf.common.inventory.tree.LevelNode; -import com.raytheon.uf.common.inventory.tree.ParameterNode; -import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; @@ -46,6 +38,13 @@ import com.raytheon.uf.common.derivparam.library.DerivParamField; import com.raytheon.uf.common.derivparam.library.DerivParamMethod; import com.raytheon.uf.common.derivparam.library.DerivParamMethod.MethodType; import com.raytheon.uf.common.derivparam.tree.AbstractDerivedDataNode; +import com.raytheon.uf.common.inventory.data.AbstractRequestableData; +import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; +import com.raytheon.uf.common.inventory.tree.DataTree; +import com.raytheon.uf.common.inventory.tree.LevelNode; +import com.raytheon.uf.common.inventory.tree.ParameterNode; +import com.raytheon.uf.common.inventory.tree.SourceNode; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -63,7 +62,8 @@ import com.raytheon.uf.viz.core.exception.VizException; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 13, 2010 bsteffen Initial creation + * Apr 13, 2010 bsteffen Initial creation + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -279,15 +279,10 @@ public abstract class AbstractPointDataInventory extends AbstractInventory { } public static Level getStationLevel() { - try { - return LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForKey("Station").getLevels().get(0); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - return null; - } + return LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForKey("Station").getLevels().get(0); } } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java index f8ca9e12fa..bb5a9d2ade 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java @@ -25,10 +25,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.inventory.data.AbstractRequestableData; -import com.raytheon.uf.common.inventory.exception.DataCubeException; -import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; @@ -36,6 +32,9 @@ import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.derivparam.inv.AvailabilityContainer; import com.raytheon.uf.common.derivparam.library.DerivedParameterGenerator; +import com.raytheon.uf.common.inventory.data.AbstractRequestableData; +import com.raytheon.uf.common.inventory.exception.DataCubeException; +import com.raytheon.uf.common.inventory.tree.AbstractRequestableNode; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -61,6 +60,7 @@ import com.raytheon.viz.pointdata.PointDataRequest; * ------------ ---------- ----------- -------------------------- * Jun 1, 2009 brockwoo Initial creation * Nov 21, 2009 #3576 rjpeter Refactored use of DerivParamDesc. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @author brockwoo @@ -78,7 +78,7 @@ public class PointDataCubeAdapter extends DefaultDataCubeAdapter { "goessounding", "bufrascat", "poessounding", "profiler", "bufrua", "ldadmesonet", "ldadhydro", "qc", "fssobs", "bufrmosAVN", "bufrmosETA", "bufrmosGFS", "bufrmosHPC", "bufrmosLAMP", - "bufrmosMRF", "bufrmosNGM", "airep", "pirep", "nctaf"}; + "bufrmosMRF", "bufrmosNGM", "airep", "pirep", "nctaf" }; protected AbstractPointDataInventory inventory; @@ -131,14 +131,11 @@ public class PointDataCubeAdapter extends DefaultDataCubeAdapter { } List levels; - try { - levels = LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForKey(levelKey).getLevels(); - } catch (CommunicationException e) { - throw new DataCubeException(e); - } + levels = LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForKey(levelKey).getLevels(); + List nodes; try { nodes = inventory.getNodes(source, Arrays.asList(parameters), diff --git a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteInventory.java b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteInventory.java index 3f94381331..849c8dad8c 100644 --- a/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteInventory.java +++ b/cave/com.raytheon.viz.satellite/src/com/raytheon/viz/satellite/inventory/SatelliteInventory.java @@ -28,7 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; @@ -69,6 +68,7 @@ import com.raytheon.viz.alerts.observers.ProductAlertObserver; * ------------- -------- ----------- -------------------------- * Apr 09, 2014 2947 bsteffen Initial creation * May 06, 2014 3117 bsteffen Update for new data. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -106,11 +106,7 @@ public class SatelliteInventory extends AbstractInventory implements @Override public synchronized void initTree(Map derParLibrary) throws DataCubeException { - try { - level = LevelFactory.getInstance().getLevel("EA", 0.0); - } catch (CommunicationException e) { - throw new DataCubeException(e); - } + level = LevelFactory.getInstance().getLevel("EA", 0.0); coverages = new SatelliteCoverageCache(); super.initTree(derParLibrary); } @@ -251,7 +247,8 @@ public class SatelliteInventory extends AbstractInventory implements try { initTree(derParLibrary); } catch (DataCubeException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); } return; } diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java index 5f398dab2a..2565e6c600 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.util.GridLevelTranslator; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; @@ -84,6 +83,7 @@ import com.vividsolutions.jts.geom.Coordinate; * graph plugin * Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived * parameters to common + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -359,24 +359,14 @@ public abstract class AbstractDataCatalog implements IDataCatalog { Collection levels = Collections.emptyList(); if (planesKey.startsWith("spatial-")) { - try { - levels = LevelUtilities.getOrderedSetOfStandardLevels(planesKey - .replace("spatial-", "")); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - e); - } + levels = LevelUtilities.getOrderedSetOfStandardLevels(planesKey + .replace("spatial-", "")); } else { - try { - LevelMappingFactory lmf = LevelMappingFactory - .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); - LevelMapping lm = lmf.getLevelMappingForKey(planesKey); - if (lm != null) { - levels = lm.getLevels(); - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - e); + LevelMappingFactory lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); + LevelMapping lm = lmf.getLevelMappingForKey(planesKey); + if (lm != null) { + levels = lm.getLevels(); } } ParamLevelMatchCriteria match = new ParamLevelMatchCriteria(); diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java index 059810e77b..a46d5c3336 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java @@ -35,7 +35,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; @@ -64,6 +63,7 @@ import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserAction; * Jul 25, 2013 2112 bsteffen Fix volume browser sounding errors. * Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived * parameters to common + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -152,7 +152,7 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { inventory.checkLevels(fSourcesToProcess, fParamsToProcess, null, levelQueue); } catch (InterruptedException e) { - ; + // no-op } return Status.OK_STATUS; } @@ -176,27 +176,21 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { String levelStr = levelQueue.poll(); while (levelStr != null) { // Convert levels into planes. - try { - Level level = LevelFactory.getInstance().getLevel(levelStr); + Level level = LevelFactory.getInstance().getLevel(levelStr); - if (levels3D.contains(level)) { - for (String plane : get3DPlanes(sourcesToProcess)) { - request.addAvailablePlane(plane); - } + if (levels3D.contains(level)) { + for (String plane : get3DPlanes(sourcesToProcess)) { + request.addAvailablePlane(plane); } - request.addAvailablePlane("spatial-" - + level.getMasterLevel().getName()); - LevelMapping lm = LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForLevel(level); + } + request.addAvailablePlane("spatial-" + + level.getMasterLevel().getName()); + LevelMapping lm = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(level); - if (lm != null) { - request.addAvailablePlane(lm.getKey()); - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + if (lm != null) { + request.addAvailablePlane(lm.getKey()); } levelStr = levelQueue.poll(); @@ -211,7 +205,7 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { try { Thread.sleep(10); } catch (InterruptedException e) { - ; + // no-op } } } @@ -247,9 +241,10 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { if (inventory != null) { try { inventory.checkSources(null, null, null, returnQueue); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } + } catch (InterruptedException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + } } List result = new ArrayList(returnQueue); result.retainAll(MenuItemManager.getInstance() @@ -288,23 +283,12 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { for (String plane : selectedPlanes) { Collection levels = Collections.emptyList(); if (plane.startsWith("spatial-")) { - try { - levels = LevelUtilities - .getOrderedSetOfStandardLevels(plane.replace( - "spatial-", "")); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } + levels = LevelUtilities.getOrderedSetOfStandardLevels(plane + .replace("spatial-", "")); } else { LevelMapping lm = lmf.getLevelMappingForKey(plane); if (lm != null) { - try { - levels = lm.getLevels(); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } + levels = lm.getLevels(); } } for (Level l : levels) { diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java index 40ec1ea7de..05cd8c32d2 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java @@ -36,7 +36,6 @@ import org.geotools.geometry.jts.ReferencedEnvelope; import org.opengis.geometry.BoundingBox; import org.opengis.referencing.operation.MathTransform; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; @@ -88,6 +87,7 @@ import com.vividsolutions.jts.geom.LineString; * Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived * parameters to common * Mar 11, 2014 #2718 randerso Changes for GeoTools 10.5 + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -188,16 +188,12 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { } else { // Get all possible levels for the selected levels List selectedLevels = Collections.emptyList(); - try { - LevelMappingFactory lmf = LevelMappingFactory - .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); - selectedLevels = new ArrayList(lmf - .getLevelMappingForKey( - catalogEntry.selectedPlanesKey).getLevels()); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } + LevelMappingFactory lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); + selectedLevels = new ArrayList(lmf + .getLevelMappingForKey(catalogEntry.selectedPlanesKey) + .getLevels()); + RequestConstraint masterRC = new RequestConstraint(null, ConstraintType.IN); RequestConstraint oneRC = new RequestConstraint(null, @@ -346,32 +342,23 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { @Override protected Collection get3DLevels() { ArrayList all = new ArrayList(); - try { - NavigableSet tilts = LevelUtilities - .getOrderedSetOfStandardLevels("TILT"); - if (tilts != null) { - all.addAll(tilts); - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + + NavigableSet tilts = LevelUtilities + .getOrderedSetOfStandardLevels("TILT"); + if (tilts != null) { + all.addAll(tilts); } - try { - NavigableSet pres = LevelUtilities - .getOrderedSetOfStandardLevels("MB"); - if (pres != null) { - all.addAll(pres); - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + + NavigableSet pres = LevelUtilities + .getOrderedSetOfStandardLevels("MB"); + if (pres != null) { + all.addAll(pres); } - try { - NavigableSet theta = LevelUtilities - .getOrderedSetOfStandardLevels("K"); - if (theta != null) { - all.addAll(theta); - } - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + + NavigableSet theta = LevelUtilities + .getOrderedSetOfStandardLevels("K"); + if (theta != null) { + all.addAll(theta); } return all; @@ -387,7 +374,7 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { ViewMenu viewSelection = VolumeBrowserAction.getVolumeBrowserDlg() .getDialogSettings().getViewSelection(); if (viewSelection == ViewMenu.PLANVIEW) { - ;// + // no-op } else if (viewSelection == ViewMenu.TIMESERIES) { pointLetters.add(VolumeBrowserAction.getVolumeBrowserDlg() .getDialogSettings().getPointsSelection().getName()); diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java index 35687e2f1b..39e0a13fd7 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java @@ -32,7 +32,6 @@ import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; @@ -80,6 +79,7 @@ import com.vividsolutions.jts.geom.LineString; * with hodo. * Aug 15, 2013 2260 bsteffen Switch poessounding to NSharp. * Jul 23, 2014 3410 bclement location changed to floats + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -400,15 +400,10 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { */ @Override protected Collection get3DLevels() { - try { - return LevelMappingFactory - .getInstance( - LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) - .getLevelMappingForKey("Station").getLevels(); - } catch (CommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - return Collections.emptyList(); - } + return LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForKey("Station").getLevels(); } @Override @@ -441,12 +436,10 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { AbstractRequestableResourceData resourceData = super .getResourceData(catalogEntry, resourceType); // TODO this should be configurable, and shared with PLAN_VIEW - if (sourceText - .equals("RaobOA")) { + if (sourceText.equals("RaobOA")) { BinOffset binOffset = new BinOffset(3600, 3600); resourceData.setBinOffset(binOffset); - } else if (sourceText - .equals("MetarOA")) { + } else if (sourceText.equals("MetarOA")) { BinOffset binOffset = new BinOffset(1800, 1800); resourceData.setBinOffset(binOffset); } @@ -559,7 +552,7 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { ViewMenu viewSelection = VolumeBrowserAction.getVolumeBrowserDlg() .getDialogSettings().getViewSelection(); if (viewSelection == ViewMenu.PLANVIEW) { - ;// + // no-op } else if (viewSelection == ViewMenu.TIMESERIES) { String name = VolumeBrowserAction.getVolumeBrowserDlg() .getDialogSettings().getPointsSelection().getName(); diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java index a0f5fbe1b6..0c66d78ad9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java @@ -45,7 +45,6 @@ import com.raytheon.edex.plugin.gfe.db.dao.GFED2DDao; import com.raytheon.edex.plugin.gfe.paraminfo.GridParamInfo; import com.raytheon.edex.plugin.gfe.paraminfo.GridParamInfoLookup; import com.raytheon.edex.plugin.gfe.paraminfo.ParameterInfo; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; import com.raytheon.uf.common.dataplugin.gfe.RemapGrid; @@ -117,6 +116,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * 05/22/2014 #3071 randerso Improved error logging * 06/24/2014 #3317 randerso Don't allow database to be created if it exceeds D2DDBVERSIONS and * should be purged. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -1237,15 +1237,10 @@ public class D2DGridDatabase extends VGridDatabase { private Level getD2DLevel(String gfeLevel) { List levels = Collections.emptyList(); - try { - LevelMapping lm = LevelMappingFactory.getInstance( - GFE_LEVEL_MAPPING_FILE).getLevelMappingForKey(gfeLevel); - - if (lm != null) { - levels = lm.getLevels(); - } - } catch (CommunicationException e) { - // do nothing + LevelMapping lm = LevelMappingFactory.getInstance( + GFE_LEVEL_MAPPING_FILE).getLevelMappingForKey(gfeLevel); + if (lm != null) { + levels = lm.getLevels(); } Level level = null; @@ -1260,12 +1255,8 @@ public class D2DGridDatabase extends VGridDatabase { private String getGFELevel(Level d2dLevel) { LevelMapping levelMapping; - try { - levelMapping = LevelMappingFactory.getInstance( - GFE_LEVEL_MAPPING_FILE).getLevelMappingForLevel(d2dLevel); - } catch (CommunicationException e) { - levelMapping = null; - } + levelMapping = LevelMappingFactory.getInstance(GFE_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(d2dLevel); String gfeLevel = null; if (levelMapping == null) { diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml b/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml index 99fad19430..0371bba778 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml +++ b/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml @@ -19,7 +19,7 @@ factory-method="getInstance" /> + factory-method="getInstance" depends-on="gridRegistered, queryDataRegistered" /> * @@ -1258,8 +1258,6 @@ public class Grib1Decoder extends AbstractDecoder { try { return LevelMapper.getInstance().lookupLevel(levelName, "grib", levelOneValue, levelTwoValue, levelUnit); - } catch (CommunicationException e) { - throw new GribException("Error requesting levels", e); } catch (MultipleLevelMappingException e) { statusHandler.handle(Priority.WARN, e.getLocalizedMessage(), e); return e.getArbitraryLevelMapping(); diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/LapsPostProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/LapsPostProcessor.java index e75f97c65d..1566aa7e66 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/LapsPostProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/LapsPostProcessor.java @@ -21,7 +21,6 @@ package com.raytheon.edex.plugin.grib.decoderpostprocessors; import com.raytheon.edex.plugin.grib.exception.GribException; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; @@ -38,6 +37,7 @@ import com.raytheon.uf.common.parameter.Parameter; * ------------- -------- ----------- -------------------------- * Apr 07, 2011 6619 bphillip Initial creation * Oct 15, 2013 2473 bsteffen Remove deprecated method calls. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -60,13 +60,9 @@ public class LapsPostProcessor implements IDecoderPostProcessor { String levelName = record.getLevel().getMasterLevel().getName(); boolean modelInfoModified = false; if (levelName.equals(FHAG)) { - try { - Level sfcLevel = LevelFactory.getInstance().getLevel(SFC, 0); - record.setLevel(sfcLevel); - modelInfoModified = true; - } catch (CommunicationException e) { - throw new GribException("Error modifying LAPS records.", e); - } + Level sfcLevel = LevelFactory.getInstance().getLevel(SFC, 0); + record.setLevel(sfcLevel); + modelInfoModified = true; } if (record.getParameter().getAbbreviation().equals(PMSL)) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/dataaccess/GridDataAccessFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/dataaccess/GridDataAccessFactory.java index 63236b8518..a600fe7414 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/dataaccess/GridDataAccessFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/dataaccess/GridDataAccessFactory.java @@ -64,7 +64,8 @@ import com.raytheon.uf.common.util.mapping.Mapper; * Feb 14, 2013 1614 bsteffen Refactor data access framework to use * single request. * Feb 04, 2014 2672 bsteffen Enable requesting subgrids. - * Jul 30, 2014 3184 njensen Ranemd valid identifiers to optional + * Jul 30, 2014 3184 njensen Renamed valid identifiers to optional + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -223,21 +224,19 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory double leveltwo = requestLevel.getLeveltwovalue(); String master = requestLevel.getMasterLevel().getName(); Unit unit = requestLevel.getMasterLevel().getUnit(); - try { - // instead of doing reverse mapping just do a forward - // mapping on everything they requested and compare to what - // they got. - Set levels = LevelMapper.getInstance().lookupLevels( - master, namespace, levelone, leveltwo, unit); - for (Level l : levels) { - if (level.equals(l)) { - level = requestLevel; - break; - } + + // instead of doing reverse mapping just do a forward + // mapping on everything they requested and compare to what + // they got. + Set levels = LevelMapper.getInstance().lookupLevels( + master, namespace, levelone, leveltwo, unit); + for (Level l : levels) { + if (level.equals(l)) { + level = requestLevel; + break; } - } catch (CommunicationException e) { - throw new DataRetrievalException(e); } + if (level == requestLevel) { // we found one. break; diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grid/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.uf.edex.plugin.grid/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5718e24147..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grid/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Fri Feb 03 13:25:55 CST 2012 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridInfoCache.java b/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridInfoCache.java index 69a53ab707..663f9d6c18 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridInfoCache.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridInfoCache.java @@ -26,7 +26,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.GridInfoConstants; import com.raytheon.uf.common.dataplugin.grid.GridInfoRecord; import com.raytheon.uf.common.dataplugin.level.LevelFactory; @@ -51,6 +50,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * ------------ ---------- ----------- -------------------------- * May 21, 2012 bsteffen Initial creation * Mar 27, 2013 1821 bsteffen Speed up GridInfoCache. + * Sep 09, 2014 3356 njensen Remove CommunicationException * * * @@ -245,14 +245,8 @@ public class GridInfoCache { record.getLocation().getId())); record.setParameter(ParameterLookup.getInstance().getParameter( record.getParameter().getAbbreviation())); - try { - record.setLevel(LevelFactory.getInstance().getLevel( - record.getLevel().getId())); - } catch (CommunicationException e) { - // This should never hit and if it does ignore it, the only side - // affect is thatthe level in the record will not be the same as - // the other records on the same level. - } + record.setLevel(LevelFactory.getInstance().getLevel( + record.getLevel().getId())); primaryCache.put(record, record); }