From 9c1e33521e0e6b406c1ce1afe4bc6327471e1294 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Mon, 14 Jul 2014 14:25:51 -0500 Subject: [PATCH] Omaha #3184 throw incompatible request exceptions when trying to get levels on FFMP or IHFS Change-Id: I599799cc95835708fdb48b6ce8a8e977daceff26 Former-commit-id: 2fdb210c8fe8e6763b6a6422b5710c35ee7e48a8 --- .../dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java | 9 +++++++++ .../uf/common/hydro/dataaccess/HydroGeometryFactory.java | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java index fd380ca5a9..b70ec75948 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/dataaccess/FFMPGeometryFactory.java @@ -28,6 +28,7 @@ import javax.measure.unit.Unit; import com.raytheon.uf.common.dataaccess.IDataRequest; import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException; +import com.raytheon.uf.common.dataaccess.exception.IncompatibleRequestException; import com.raytheon.uf.common.dataaccess.geom.IGeometryData; import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory; import com.raytheon.uf.common.dataaccess.impl.DefaultGeometryData; @@ -40,6 +41,7 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates; import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE; import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory; +import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; @@ -70,6 +72,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 1, 2014 3099 bkowal No longer use an empty pfaf list when the * data request locationNames list is empty. * Jun 24, 2014 3170 mnash Get the accumulated time if multiple times are requested + * Jul 14, 2014 3184 njensen Overrode getAvailableLevels() * * * @@ -354,4 +357,10 @@ public class FFMPGeometryFactory extends AbstractDataPluginFactory { return pfafList.toArray(new String[pfafList.size()]); } + + @Override + public Level[] getAvailableLevels(IDataRequest request) { + throw new IncompatibleRequestException(request.getDatatype() + + " data does not support the concept of levels"); + } } diff --git a/edexOsgi/com.raytheon.uf.common.hydro/src/com/raytheon/uf/common/hydro/dataaccess/HydroGeometryFactory.java b/edexOsgi/com.raytheon.uf.common.hydro/src/com/raytheon/uf/common/hydro/dataaccess/HydroGeometryFactory.java index a28a7551c4..b67b6a5533 100644 --- a/edexOsgi/com.raytheon.uf.common.hydro/src/com/raytheon/uf/common/hydro/dataaccess/HydroGeometryFactory.java +++ b/edexOsgi/com.raytheon.uf.common.hydro/src/com/raytheon/uf/common/hydro/dataaccess/HydroGeometryFactory.java @@ -23,10 +23,12 @@ import java.sql.Timestamp; import java.util.Map; import com.raytheon.uf.common.dataaccess.IDataRequest; +import com.raytheon.uf.common.dataaccess.exception.IncompatibleRequestException; import com.raytheon.uf.common.dataaccess.exception.TimeAgnosticDataException; import com.raytheon.uf.common.dataaccess.geom.IGeometryData; import com.raytheon.uf.common.dataaccess.impl.AbstractGeometryDatabaseFactory; import com.raytheon.uf.common.dataaccess.impl.FactoryUtil; +import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; @@ -51,6 +53,7 @@ import com.vividsolutions.jts.geom.GeometryFactory; * Feb 14, 2013 1614 bsteffen Refactor data access framework to use * single request. * Mar 03, 2014 2673 bsteffen Add ability to query only ref times. + * Jul 14, 2014 3184 njensen Overrode getAvailableLevels() * * * @@ -194,4 +197,10 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory { protected String assembleGetAvailableLocationNames(IDataRequest request) { return "select lid from location;"; } + + @Override + public Level[] getAvailableLevels(IDataRequest request) { + throw new IncompatibleRequestException(request.getDatatype() + + " data does not support the concept of levels"); + } } \ No newline at end of file