Omaha #3184 renamed valid identifiers to optional

Change-Id: I9653f9e00b3c693b46b516bc52ff029cd4fe1a81

Former-commit-id: 857179e08d [formerly d0e68c2fa1cc531263622410e4364b87f222139f]
Former-commit-id: 3c1ae47a76
This commit is contained in:
Nate Jensen 2014-07-31 09:45:01 -05:00
parent 5a7765628b
commit 77d0661861
17 changed files with 77 additions and 69 deletions

View file

@ -72,6 +72,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* Jan 21, 2014 2667 bclement Initial creation
* Feb 06, 2014 2672 bsteffen Add envelope support
* Jul 07, 2014 3333 bclement now uses lightning constants
* Jul 30, 2014 3184 njensen Removed getValidIdentifiers()
*
* </pre>
*
@ -79,7 +80,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* @version 1.0
*/
public class BinLightningAccessFactory extends AbstractDataPluginFactory {
private static final String sourceKey = LightningConstants.SOURCE;
private static final IUFStatusHandler log = UFStatus
@ -119,17 +120,6 @@ public class BinLightningAccessFactory extends AbstractDataPluginFactory {
return new String[] { sourceKey };
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.common.dataaccess.impl.AbstractDataFactory#
* getValidIdentifiers()
*/
@Override
public String[] getValidIdentifiers() {
return new String[] { sourceKey };
}
/*
* (non-Javadoc)
*
@ -179,7 +169,6 @@ public class BinLightningAccessFactory extends AbstractDataPluginFactory {
return rval.toArray(new IGeometryData[rval.size()]);
}
/**
* Add geometry data elements to dataList from data store
*
@ -296,7 +285,7 @@ public class BinLightningAccessFactory extends AbstractDataPluginFactory {
private Map<String, List<String>> getSourceDatasets(IDataRequest request,
List<BinLightningRecord> recList) {
List<String> includedDatasets = getIncludedDatasets(request);
Map<String, List<String>> rval = new HashMap<String, List<String>>();
for (BinLightningRecord record : recList) {
String src = record.getSource();
@ -319,7 +308,7 @@ public class BinLightningAccessFactory extends AbstractDataPluginFactory {
* @param request
* @return
*/
private List<String> getIncludedDatasets(IDataRequest request){
private List<String> getIncludedDatasets(IDataRequest request) {
String[] parameters = request.getParameters();
List<String> rval = new ArrayList<String>(parameters.length
+ requiredKeys.length);

View file

@ -73,6 +73,7 @@ import com.vividsolutions.jts.geom.Geometry;
* 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()
* Jul 30, 2014 3184 njensen Overrode required and optional identifiers
*
* </pre>
*
@ -363,4 +364,14 @@ public class FFMPGeometryFactory extends AbstractDataPluginFactory {
throw new IncompatibleRequestException(request.getDatatype()
+ " data does not support the concept of levels");
}
@Override
public String[] getRequiredIdentifiers() {
return new String[] { SITE_KEY, WFO, HUC };
}
@Override
public String[] getOptionalIdentifiers() {
return new String[] { DATA_KEY };
}
}

View file

@ -73,6 +73,7 @@ import com.raytheon.uf.common.util.StringUtil;
* Framework.
* Oct 31, 2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
* Feb 04, 2014 2672 bsteffen Enable requesting subgrids.
* Jul 30, 2014 3184 njensen Renamed valid identifiers to optional
*
* </pre>
*
@ -91,14 +92,15 @@ public class GFEGridFactory extends AbstractGridDataPluginFactory implements
private static final String KEYS = "keys";
// The more full version from GFEDataAccessUtil is prefered but the smaller
// The more full version from GFEDataAccessUtil is preferred but the smaller
// keys are needed for backwards compatibility.
private static final String[] VALID_IDENTIFIERS = { MODEL_NAME, MODEL_TIME,
SITE_ID };
private static final String[] OPTIONAL_IDENTIFIERS = {
GFEDataAccessUtil.MODEL_NAME, GFEDataAccessUtil.MODEL_TIME,
GFEDataAccessUtil.SITE_ID, MODEL_NAME, MODEL_TIME, SITE_ID };
@Override
public String[] getValidIdentifiers() {
return VALID_IDENTIFIERS;
public String[] getOptionalIdentifiers() {
return OPTIONAL_IDENTIFIERS;
}
@Override

View file

@ -64,6 +64,7 @@ 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
*
*
* </pre>
@ -82,7 +83,7 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
GridConstants.ENSEMBLE_ID, NAMESPACE };
@Override
public String[] getValidIdentifiers() {
public String[] getOptionalIdentifiers() {
return VALID_IDENTIFIERS;
}
@ -276,5 +277,4 @@ public class GridDataAccessFactory extends AbstractGridDataPluginFactory
return getAvailableLocationNames(request, GridConstants.DATASET_ID);
}
}

View file

@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.Envelope;
* Feb 14, 2013 1614 bsteffen Refactor data access framework to use
* single request.
* Feb 04, 2014 2672 bsteffen Enable requesting icaos within envelope.
* Jul 30, 2014 3184 njensen Overrode optional identifiers
*
*
* </pre>
@ -164,7 +165,7 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements
* a record.
* @return A unique location name
*/
protected String generateLocationName(RadarRecord radarRecord){
protected String generateLocationName(RadarRecord radarRecord) {
StringBuilder locationName = new StringBuilder(32);
locationName.append(radarRecord.getIcao());
locationName.append("_");
@ -416,6 +417,11 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements
return getAvailableLocationNames(request, ICAO);
}
@Override
public String[] getOptionalIdentifiers() {
return new String[] { ICAO };
}
/**
*
* This is used to convert data from bin,radial format to radial bin format.

View file

@ -56,6 +56,7 @@ import com.raytheon.uf.common.numeric.source.DataSource;
* 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 Renamed valid identifiers to optional
*
* </pre>
*
@ -69,7 +70,7 @@ public class SatelliteGridFactory extends AbstractGridDataPluginFactory
private static final String FIELD_SECTOR_ID = "sectorID";
private static final String[] VALID_IDENTIFIERS = { "source",
private static final String[] OPTIONAL_IDENTIFIERS = { "source",
"creatingEntity", FIELD_SECTOR_ID, FIELD_PYHSICAL_ELEMENT };
public SatelliteGridFactory() {
@ -77,10 +78,11 @@ public class SatelliteGridFactory extends AbstractGridDataPluginFactory
}
@Override
public String[] getValidIdentifiers() {
return VALID_IDENTIFIERS;
public String[] getOptionalIdentifiers() {
return OPTIONAL_IDENTIFIERS;
}
@Override
protected DefaultGridData constructGridDataResponse(IDataRequest request,
PluginDataObject pdo, GridGeometry2D gridGeometry,
DataSource dataSource) {
@ -125,6 +127,7 @@ public class SatelliteGridFactory extends AbstractGridDataPluginFactory
* multiple factories will be building a base constraint map using the same
* technique
*/
@Override
protected Map<String, RequestConstraint> buildConstraintsFromRequest(
IDataRequest request) {
Map<String, RequestConstraint> constraints = new HashMap<String, RequestConstraint>();

View file

@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* single request.
* Mar 03, 2014 2673 bsteffen Add ability to query only ref times.
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
* Jul 30, 2014 3184 njensen Added optional identifiers
*
* </pre>
*
@ -77,7 +78,7 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
private static final String IHFS_DATABASE = "ihfs";
public HydroGeometryFactory() {
super(IHFS_DATABASE, REQUIRED);
super(IHFS_DATABASE, REQUIRED, new String[] { COL_NAME_OPTION });
}
/*
@ -152,8 +153,7 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
* com.raytheon.uf.common.time.BinOffset)
*/
@Override
protected String assembleGetTimes(IDataRequest request,
BinOffset binOffset) {
protected String assembleGetTimes(IDataRequest request, BinOffset binOffset) {
return null;
}
@ -166,8 +166,7 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
* com.raytheon.uf.common.time.DataTime[])
*/
@Override
protected String assembleGetData(IDataRequest request,
DataTime... times) {
protected String assembleGetData(IDataRequest request, DataTime... times) {
return HydroQueryAssembler.assembleGetData(request, times);
}
@ -180,8 +179,7 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
* com.raytheon.uf.common.time.TimeRange)
*/
@Override
protected String assembleGetData(IDataRequest request,
TimeRange timeRange) {
protected String assembleGetData(IDataRequest request, TimeRange timeRange) {
return HydroQueryAssembler.assembleGetData(request, timeRange);
}
@ -203,4 +201,5 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
throw new IncompatibleRequestException(request.getDatatype()
+ " data does not support the concept of levels");
}
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>

View file

@ -1,7 +0,0 @@
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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Data Access Framework EDEX
Bundle-SymbolicName: com.raytheon.uf.edex.dataaccess
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: com.raytheon.uf.common.dataaccess,
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
com.raytheon.uf.common.serialization.comm,
com.raytheon.uf.common.util
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy

View file

@ -43,12 +43,12 @@
<constructor-arg ref="requiredIdentifiersHandler" />
</bean>
<bean id="validIdentifiersHandler"
class="com.raytheon.uf.edex.dataaccess.handler.GetValidIdentifiersHandler" />
<bean id="optionalIdentifiersHandler"
class="com.raytheon.uf.edex.dataaccess.handler.GetOptionalIdentifiersHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg
value="com.raytheon.uf.common.dataaccess.request.GetValidIdentifiersRequest" />
<constructor-arg ref="validIdentifiersHandler" />
value="com.raytheon.uf.common.dataaccess.request.GetOptionalIdentifiersRequest" />
<constructor-arg ref="optionalIdentifiersHandler" />
</bean>
<bean id="supportedDatatypesHandler"

View file

@ -20,11 +20,11 @@
package com.raytheon.uf.edex.dataaccess.handler;
import com.raytheon.uf.common.dataaccess.DataAccessLayer;
import com.raytheon.uf.common.dataaccess.request.GetValidIdentifiersRequest;
import com.raytheon.uf.common.dataaccess.request.GetOptionalIdentifiersRequest;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
/**
* Request handler for <code>GetValidIdentifiersRequest</code>.
* Request handler for <code>GetOptionalIdentifiersRequest</code>.
*
* <pre>
*
@ -33,6 +33,7 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 23, 2014 3185 njensen Initial creation
* Jul 30, 2014 3185 njensen Renamed valid to optional
*
* </pre>
*
@ -40,13 +41,13 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
* @version 1.0
*/
public class GetValidIdentifiersHandler implements
IRequestHandler<GetValidIdentifiersRequest> {
public class GetOptionalIdentifiersHandler implements
IRequestHandler<GetOptionalIdentifiersRequest> {
@Override
public String[] handleRequest(GetValidIdentifiersRequest request)
public String[] handleRequest(GetOptionalIdentifiersRequest request)
throws Exception {
return DataAccessLayer.getValidIdentifiers(request.getDatatype());
return DataAccessLayer.getOptionalIdentifiers(request.getDatatype());
}
}

View file

@ -35,6 +35,7 @@
# 03/03/14 2673 bsteffen Add ability to query only ref times.
# 07/22/14 3185 njensen Added optional/default args to newDataRequest
# and added new methods
# 07/30/14 3185 njensen Renamed valid identifiers to optional
#
#
#
@ -110,8 +111,8 @@ def getRequiredIdentifiers(datatype):
jids = JavaDataAccessLayer.getRequiredIdentifiers(datatype)
return JUtil.javaObjToPyVal(jids)
def getValidIdentifiers(datatype):
jids = JavaDataAccessLayer.getValidIdentifiers(datatype)
def getOptionalIdentifiers(datatype):
jids = JavaDataAccessLayer.getOptionalIdentifiers(datatype)
return JUtil.javaObjToPyVal(jids)
def newDataRequest(datatype, parameters=[], levels=[], locationNames = [], envelope=None, **kwargs):

View file

@ -27,13 +27,14 @@
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 07/23/14 #3185 njensen Initial Creation.
# 07/30/14 #3185 njensen Renamed valid to optional
#
#
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractIdentifierRequest
class GetValidIdentifiersRequest(AbstractIdentifierRequest):
class GetOptionalIdentifiersRequest(AbstractIdentifierRequest):
def __init__(self):
super(GetValidIdentifiersRequest, self).__init__()
super(GetOptionalIdentifiersRequest, self).__init__()

View file

@ -31,7 +31,7 @@ __all__ = [
'GetGridDataRequest',
'GetRequiredIdentifiersRequest',
'GetSupportedDatatypesRequest',
'GetValidIdentifiersRequest'
'GetOptionalIdentifiersRequest'
]
from AbstractDataAccessRequest import AbstractDataAccessRequest
@ -44,5 +44,5 @@ from GetGeometryDataRequest import GetGeometryDataRequest
from GetGridDataRequest import GetGridDataRequest
from GetRequiredIdentifiersRequest import GetRequiredIdentifiersRequest
from GetSupportedDatatypesRequest import GetSupportedDatatypesRequest
from GetValidIdentifiersRequest import GetValidIdentifiersRequest
from GetOptionalIdentifiersRequest import GetOptionalIdentifiersRequest

View file

@ -34,6 +34,7 @@
# 05/29/13 2023 dgilling Hook up ThriftClientRouter.
# 03/03/14 2673 bsteffen Add ability to query only ref times.
# 07/22/14 3185 njensen Added optional/default args to newDataRequest
# 07/30/14 3185 njensen Renamed valid identifiers to optional
#
#
#
@ -157,17 +158,17 @@ def getRequiredIdentifiers(datatype):
"""
return router.getRequiredIdentifiers(datatype)
def getValidIdentifiers(datatype):
def getOptionalIdentifiers(datatype):
"""
Gets the valid identifiers for this datatype.
Gets the optional identifiers for this datatype.
Args:
datatype: the datatype to find valid identifiers for
datatype: the datatype to find optional identifiers for
Returns:
a list of strings of valid identifiers
a list of strings of optional identifiers
"""
return router.getValidIdentifiers(datatype)
return router.getOptionalIdentifiers(datatype)
def newDataRequest(datatype=None, **kwargs):
""""

View file

@ -32,6 +32,7 @@
# 03/03/14 #2673 bsteffen Add ability to query only ref times.
# 07/22/14 #3185 njensen Added optional/default args to newDataRequest
# 07/23/14 #3185 njensen Added new methods
# 07/30/14 #3185 njensen Renamed valid identifiers to optional
#
@ -46,7 +47,7 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import G
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetAvailableParametersRequest
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetAvailableLevelsRequest
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetRequiredIdentifiersRequest
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetValidIdentifiersRequest
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetOptionalIdentifiersRequest
from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetSupportedDatatypesRequest
from ufpy import ThriftClient
@ -143,8 +144,8 @@ class ThriftClientRouter(object):
response = self._client.sendRequest(idReq)
return response
def getValidIdentifiers(self, datatype):
idReq = GetValidIdentifiersRequest()
def getOptionalIdentifiers(self, datatype):
idReq = GetOptionalIdentifiersRequest()
idReq.setDatatype(datatype)
response = self._client.sendRequest(idReq)
return response