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 e5e1cb5adb..975990213c 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 @@ -32,7 +32,6 @@ import javax.measure.unit.Unit; import org.geotools.coverage.grid.GridGeometry2D; import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.dataaccess.IDataFactory; import com.raytheon.uf.common.dataaccess.IDataRequest; import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException; import com.raytheon.uf.common.dataaccess.grid.IGridData; @@ -55,11 +54,11 @@ import com.raytheon.uf.common.util.mapping.Mapper; /** * Data access factory for accessing data from the Grid plugin as grid types. - * + * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------- -------- ----------- -------------------------- * Jan 17, 2013 bsteffen Initial creation @@ -70,16 +69,16 @@ import com.raytheon.uf.common.util.mapping.Mapper; * Sep 09, 2014 3356 njensen Remove CommunicationException * Oct 16, 2014 3598 nabowle Accept level identifiers. * Oct 21, 2014 3755 nabowle Add getAvailable levels and parameters. - * - * + * Feb 13, 2015 4124 mapeters Inherits IDataFactory. + * + * *- * + * * @author bsteffen * @version 1.0 */ -public class GridDataAccessFactory extends AbstractGridDataPluginFactory - implements IDataFactory { +public class GridDataAccessFactory extends AbstractGridDataPluginFactory { private static final String NAMESPACE = "namespace"; @@ -183,7 +182,7 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory /** * Check for possible level conflicts. - * + * * @param levels * The request levels. Assumed to not be null. * @param identifiers @@ -211,7 +210,7 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory /** * Copy all constraints from source to target. If target already contains a * constraint for a key then merge the values into target. - * + * * @param target * @param source */ diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/dataaccess/RadarGridFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/dataaccess/RadarGridFactory.java index bd5f0c3386..d26ce765c3 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/dataaccess/RadarGridFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/dataaccess/RadarGridFactory.java @@ -33,7 +33,6 @@ import org.geotools.coverage.grid.GridGeometry2D; import org.geotools.geometry.jts.ReferencedEnvelope; import org.opengis.referencing.FactoryException; -import com.raytheon.uf.common.dataaccess.IDataFactory; import com.raytheon.uf.common.dataaccess.IDataRequest; import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException; import com.raytheon.uf.common.dataaccess.exception.EnvelopeProjectionException; @@ -64,19 +63,19 @@ import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Envelope; /** - * + * * A data factory for getting radar data from the metadata database. There are * currently not any required identifiers. - * + * * Radar does not return subgrids for request envelopes like other gridded * types. Instead data for only icaos within the request envelope are returned * and all data for the product is used. This is done because subgridding radial * products is complex and this is not often what a caller actually wants. - * + * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------- -------- ----------- -------------------------- * Jan 23, 2013 bsteffen Initial creation @@ -91,14 +90,14 @@ import com.vividsolutions.jts.geom.Envelope; * optional identifiers to indicate what * fields are used for the level one and two * values. - * + * Feb 13, 2015 4124 mapeters Inherits IDataFactory. + * *- * + * * @author bsteffen * @version 1.0 */ -public class RadarGridFactory extends AbstractGridDataPluginFactory implements - IDataFactory { +public class RadarGridFactory extends AbstractGridDataPluginFactory { private static final String PRODUCT_CODE = "productCode"; @@ -180,7 +179,7 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements * {@value #LEVEL_ONE} or {@value #LEVEL_TWO} identifiers, those fields will * be used. If {@value #LEVEL_ONE} is not specified, {@value #PRIMARY_ANGLE} * will be used. - * + * * @param radarRecord * The radar record. * @param request @@ -227,8 +226,8 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements * Theoretically two radial geometries could have the same name but * internally different angleData but this is very unlikely and the points * would be very nearly identical. - * - * + * + * * @param radarRecord * a record. * @return A unique location name @@ -345,7 +344,7 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements /** * Populate a DataSource from the raw data(byte or short) in the provided * record. - * + * * @param radarRecord * @return a DataSource or null if the record is not populated or has no * grid data. @@ -599,7 +598,7 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements /** * Validates that, if specified, the {@value #LEVEL_ONE} and * {@value #LEVEL_TWO} identifier values are supported. - * + * * @param request */ private void validateLevelIdentifiers(IDataRequest request) { @@ -617,21 +616,21 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements } /** - * + * * This is used to convert data from bin,radial format to radial bin format. - * + * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 25, 2013 bsteffen Initial creation * Feb 14, 2013 1614 bsteffen refactor data access framework to use * single request. - * + * *- * + * * @author bsteffen * @version 1.0 */ diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/dataaccess/SatelliteGridFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/dataaccess/SatelliteGridFactory.java index 49e8ac499e..8fd22b94ac 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/dataaccess/SatelliteGridFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/dataaccess/SatelliteGridFactory.java @@ -30,7 +30,6 @@ import javax.measure.unit.UnitFormat; import org.geotools.coverage.grid.GridGeometry2D; -import com.raytheon.uf.common.dataaccess.IDataFactory; import com.raytheon.uf.common.dataaccess.IDataRequest; import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException; import com.raytheon.uf.common.dataaccess.impl.AbstractGridDataPluginFactory; @@ -38,7 +37,9 @@ import com.raytheon.uf.common.dataaccess.impl.DefaultGridData; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; import com.raytheon.uf.common.dataplugin.satellite.units.SatelliteUnits; +import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; +import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.numeric.source.DataSource; /** @@ -58,14 +59,14 @@ import com.raytheon.uf.common.numeric.source.DataSource; * Feb 04, 2014 2672 bsteffen Enable requesting subgrids. * Jul 30, 2014 3184 njensen Renamed valid identifiers to optional * Sep 29, 2014 3596 nabowle Always put creatingEntity in attributes. + * Feb 13, 2015 4124 mapeters Overrode getAvailableParameters(), inherits IDataFactory. * * * * @author bkowal * @version 1.0 */ -public class SatelliteGridFactory extends AbstractGridDataPluginFactory - implements IDataFactory { +public class SatelliteGridFactory extends AbstractGridDataPluginFactory { private static final String FIELD_CREATING_ENTITY = "creatingEntity"; @@ -127,7 +128,7 @@ public class SatelliteGridFactory extends AbstractGridDataPluginFactory /** * Builds the base constraint map based on the supplied grid request - * + * * @param request * the original grid request * @return the base constraint map @@ -172,4 +173,19 @@ public class SatelliteGridFactory extends AbstractGridDataPluginFactory return getAvailableLocationNames(request, FIELD_SECTOR_ID); } + /** + * Get the available parameters. + */ + @Override + public String[] getAvailableParameters(IDataRequest request) { + DbQueryRequest dbQueryRequest = buildDbQueryRequest(request); + dbQueryRequest.setDistinct(Boolean.TRUE); + dbQueryRequest.addRequestField(FIELD_PYHSICAL_ELEMENT); + + DbQueryResponse dbQueryResponse = this.executeDbQueryRequest( + dbQueryRequest, request.toString()); + return dbQueryResponse.getFieldObjects(FIELD_PYHSICAL_ELEMENT, + String.class); + } + } \ No newline at end of file