attributes, int dataIndex, Object[] data,
+ String[] paramNames) {
+ DefaultGeometryData geometryData = new DefaultGeometryData();
+ geometryData.setDataTime(time);
+ geometryData.setLevel(level);
+ geometryData.setGeometry(geometry);
+ geometryData.setLocationName(locationName);
+ geometryData.setAttributes(attributes);
+ if ((data == null) == false && data.length > dataIndex) {
+ for (int i = dataIndex; i < data.length; i++) {
+ String name = paramNames[i - dataIndex];
+ geometryData.addData(name, data[i]);
+ }
+ }
+
+ return geometryData;
+ }
+}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/AbstractGeometryTimeAgnosticDatabaseFactory.java b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/AbstractGeometryTimeAgnosticDatabaseFactory.java
new file mode 100644
index 0000000000..b584ece5c3
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/AbstractGeometryTimeAgnosticDatabaseFactory.java
@@ -0,0 +1,174 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.common.dataaccess.impl;
+
+import com.raytheon.uf.common.dataaccess.exception.TimeAgnosticDataException;
+import com.raytheon.uf.common.dataaccess.geom.IGeometryData;
+import com.raytheon.uf.common.dataaccess.geom.IGeometryRequest;
+import com.raytheon.uf.common.time.BinOffset;
+import com.raytheon.uf.common.time.DataTime;
+import com.raytheon.uf.common.time.TimeRange;
+
+/**
+ * Abstracts the retrieval of time agnostic geometry data by building on and/or
+ * extending AbstractGeometryDatabaseFactory.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 29, 2013 bkowal Initial creation
+ *
+ *
+ *
+ * @author bkowal
+ * @version 1.0
+ */
+
+public abstract class AbstractGeometryTimeAgnosticDatabaseFactory extends
+ AbstractGeometryDatabaseFactory {
+
+ /**
+ * Constructor
+ *
+ * @param databaseName
+ * the name of the database to execute queries against
+ * @param requiredIdentifiers
+ * the identifiers that need to be included in the request
+ * (ifdef)
+ */
+ public AbstractGeometryTimeAgnosticDatabaseFactory(String databaseName,
+ String[] requiredIdentifiers) {
+ super(databaseName, requiredIdentifiers);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.dataaccess.IDataFactory#getAvailableTimes(com.
+ * raytheon.uf.common.dataaccess.IDataRequest)
+ */
+ @Override
+ public DataTime[] getAvailableTimes(IGeometryRequest request)
+ throws TimeAgnosticDataException {
+ throw new TimeAgnosticDataException(this.buildExceptionMessage(request));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.dataaccess.IDataFactory#getData(com.raytheon.uf
+ * .common.dataaccess.IDataRequest, com.raytheon.uf.common.time.DataTime[])
+ */
+ @Override
+ public IGeometryData[] getData(IGeometryRequest request, DataTime... times) {
+ return this.getData(request);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.dataaccess.IDataFactory#getData(com.raytheon.uf
+ * .common.dataaccess.IDataRequest, com.raytheon.uf.common.time.TimeRange)
+ */
+ @Override
+ public IGeometryData[] getData(IGeometryRequest request, TimeRange timeRange) {
+ return this.getData(request);
+ }
+
+ /**
+ * Retrieves data in a time agnostic way.
+ *
+ * @param request the original request that we are processing
+ * @return an array of IGeometryData
+ */
+ protected IGeometryData[] getData(IGeometryRequest request) {
+ return super.executeDataQuery(this.assembleGetData(request), request);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.dataaccess.IDataFactory#getAvailableTimes(com.
+ * raytheon.uf.common.dataaccess.IDataRequest,
+ * com.raytheon.uf.common.time.BinOffset)
+ */
+ @Override
+ public DataTime[] getAvailableTimes(IGeometryRequest request,
+ BinOffset binOffset) throws TimeAgnosticDataException {
+ throw new TimeAgnosticDataException(this.buildExceptionMessage(request));
+ }
+
+ /**
+ * Constructs the message that will be included in the TimeAgnosticException
+ *
+ * @param request the original request that we are processing
+ * @return the constructed exception message
+ */
+ private String buildExceptionMessage(IGeometryRequest request) {
+ StringBuilder stringBuilder = new StringBuilder(
+ "This operation is unsupported for data type: ");
+ stringBuilder.append(request.getDatatype());
+
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Builds a time agnostic version of the query that will be used to retrieve data from the database.
+ *
+ * @param request the original request that we are processing
+ * @return the query
+ */
+ protected abstract String assembleGetData(IGeometryRequest request);
+
+ /**
+ * The following methods are no longer applicable to us.
+ *
+ * Should we be throwing an exception
+ */
+ @Override
+ protected String assembleGetTimes(IGeometryRequest request) {
+ return null;
+ }
+
+ @Override
+ protected String assembleGetTimes(IGeometryRequest request,
+ BinOffset binOffset) {
+ return null;
+ }
+
+ @Override
+ protected String assembleGetData(IGeometryRequest request,
+ DataTime... times) {
+ return null;
+ }
+
+ @Override
+ protected String assembleGetData(IGeometryRequest request,
+ TimeRange timeRange) {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/util/DatabaseQueryUtil.java b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/util/DatabaseQueryUtil.java
new file mode 100644
index 0000000000..70bb1e6065
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/util/DatabaseQueryUtil.java
@@ -0,0 +1,136 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.common.dataaccess.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException;
+import com.raytheon.uf.common.dataquery.db.QueryResult;
+import com.raytheon.uf.common.dataquery.db.QueryResultRow;
+import com.raytheon.uf.common.dataquery.requests.QlServerRequest;
+import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
+import com.raytheon.uf.common.message.response.AbstractResponseMessage;
+import com.raytheon.uf.common.message.response.ResponseMessageError;
+import com.raytheon.uf.common.message.response.ResponseMessageGeneric;
+import com.raytheon.uf.common.serialization.comm.RequestRouter;
+
+/**
+ * A utility used to run queries against a specified database.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 29, 2013 bkowal Initial creation
+ *
+ *
+ *
+ * @author bkowal
+ * @version 1.0
+ */
+
+public class DatabaseQueryUtil {
+ /*
+ * should this enum actually be provided by the QlServerRequest?
+ */
+ public static enum QUERY_MODE {
+ MODE_SQLQUERY("sqlquery"), MODE_HQLQUERY("hqlquery"), MODE_SQL_STATEMENT(
+ "sqlstatement"), MODE_HSQL_STATEMENT("hqlstatement"), MODE_SAVE_OR_UPDATE(
+ "saveOrUpdateObject");
+
+ private String modeText;
+
+ QUERY_MODE(String modeText) {
+ this.modeText = modeText;
+ }
+
+ protected String getModeText() {
+ return this.modeText;
+ }
+ }
+
+ private static final String CONSTRAINT_QUERY = "query";
+
+ private static final String CONSTRAINT_DATABASE = "database";
+
+ private static final String CONSTRAINT_MODE = "mode";
+
+ /**
+ * Constructor
+ */
+ private DatabaseQueryUtil() {
+ }
+
+ /**
+ * Executes the provided query against the specified database and returns the results of the query execution.
+ *
+ * @param mode the request mode
+ * @param query the query to execute
+ * @param database the database to execute the query against
+ * @param dataType the Data Access Framework factory data type
+ * @return the information retrieved from the database
+ */
+ public static List