Omaha #3184 throw incompatible request exceptions when trying to get

levels on FFMP or IHFS

Change-Id: I599799cc95835708fdb48b6ce8a8e977daceff26

Former-commit-id: 2fdb210c8fe8e6763b6a6422b5710c35ee7e48a8
This commit is contained in:
Nate Jensen 2014-07-14 14:25:51 -05:00
parent a50f1e8e70
commit 9c1e33521e
2 changed files with 18 additions and 0 deletions

View file

@ -28,6 +28,7 @@ import javax.measure.unit.Unit;
import com.raytheon.uf.common.dataaccess.IDataRequest; import com.raytheon.uf.common.dataaccess.IDataRequest;
import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException; 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.geom.IGeometryData;
import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory; import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory;
import com.raytheon.uf.common.dataaccess.impl.DefaultGeometryData; 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;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE; import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE;
import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory; 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;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; 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 * May 1, 2014 3099 bkowal No longer use an empty pfaf list when the
* data request locationNames list is empty. * data request locationNames list is empty.
* Jun 24, 2014 3170 mnash Get the accumulated time if multiple times are requested * Jun 24, 2014 3170 mnash Get the accumulated time if multiple times are requested
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
* *
* </pre> * </pre>
* *
@ -354,4 +357,10 @@ public class FFMPGeometryFactory extends AbstractDataPluginFactory {
return pfafList.toArray(new String[pfafList.size()]); 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");
}
} }

View file

@ -23,10 +23,12 @@ import java.sql.Timestamp;
import java.util.Map; import java.util.Map;
import com.raytheon.uf.common.dataaccess.IDataRequest; 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.exception.TimeAgnosticDataException;
import com.raytheon.uf.common.dataaccess.geom.IGeometryData; import com.raytheon.uf.common.dataaccess.geom.IGeometryData;
import com.raytheon.uf.common.dataaccess.impl.AbstractGeometryDatabaseFactory; import com.raytheon.uf.common.dataaccess.impl.AbstractGeometryDatabaseFactory;
import com.raytheon.uf.common.dataaccess.impl.FactoryUtil; 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.BinOffset;
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;
@ -51,6 +53,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* Feb 14, 2013 1614 bsteffen Refactor data access framework to use * Feb 14, 2013 1614 bsteffen Refactor data access framework to use
* single request. * single request.
* Mar 03, 2014 2673 bsteffen Add ability to query only ref times. * Mar 03, 2014 2673 bsteffen Add ability to query only ref times.
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
* *
* </pre> * </pre>
* *
@ -194,4 +197,10 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
protected String assembleGetAvailableLocationNames(IDataRequest request) { protected String assembleGetAvailableLocationNames(IDataRequest request) {
return "select lid from location;"; return "select lid from location;";
} }
@Override
public Level[] getAvailableLevels(IDataRequest request) {
throw new IncompatibleRequestException(request.getDatatype()
+ " data does not support the concept of levels");
}
} }