diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PointDataRequest.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PointDataRequest.java index 53d9e76a64..3320a1e4cf 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PointDataRequest.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PointDataRequest.java @@ -43,10 +43,11 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; *
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Apr 20, 2009 chammack Initial creation. - * 5/27/2009 1982 grichard Updated stationId key const. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Apr 20, 2009 chammack Initial creation. + * may 27, 2009 1982 grichard Updated stationId key const. + * Nov 26, 2013 2537 bsteffen Remove unused functionality. * ** @@ -56,8 +57,6 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; public class PointDataRequest { - private static final String PLUGIN = "pointdata"; - private static final String PLUGINNAME_KEY = "pluginName"; private static final String STATIONID_KEY = "location.stationId"; @@ -66,61 +65,15 @@ public class PointDataRequest { private static final String REFTIME_KEY = DATATIME_KEY + ".refTime"; - private static final String REQUESTED_PARAMETERS_KEY = "requestedParameters"; - - private static final String RESTRICT_LEVEL = "restrictLevel"; - - private static final String RESTRICT_PARAMETER = "restrictParameter"; - - private static final String ID = "id"; - private PointDataRequest() { } - /** - * Request point data for a set of stations or points, over a given set of - * parameters, at a specific point in time. - * - * - * The request can be additionally constrained by optional - * RequestConstraints. - * - * @param dt - * the datatime to request the data for (required) - * @param pluginName - * the plugin to use (required) - * @param parameters - * the parameters to request (required) - * @param stationIds - * the station IDs to constrain to (optional) - * @param constraints - * additional constraints (optional) - * @return - */ - public static PointDataContainer requestPointData(DataTime dt, - String pluginName, String[] parameters, String[] stationIds, - Map
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Feb 16, 2011 #8070 ekladstrup Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Feb 16, 2011 8070 ekladstrup Initial creation + * Nov 26, 2013 2537 bsteffen Move common constants here. + * * ** @@ -44,8 +45,15 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest; * @version 1.0 */ @DynamicSerialize -public class PointDataServerRequest implements IServerRequest, - ISerializableObject { +public class PointDataServerRequest implements IServerRequest { + + public static final String REQUEST_PARAMETERS_KEY = "requestedParameters"; + + public static final String REQUEST_MODE_KEY = "mode"; + + public static final String REQUEST_MODE_2D = "select2d"; + + public static final String REQUEST_MODE_PARAMETERS = "getParameters"; // the information needed for a PointDataQuery object @DynamicSerializeElement diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java index 932369eb2d..0c6ac93ef8 100644 --- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java +++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java @@ -60,16 +60,20 @@ import com.raytheon.uf.common.serialization.SerializationException; * *
* SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 12, 2008 #1448 chammack Initial creation - * Jun 17, 2010 #5091 njensen Optimized primitive arrays - * Mar 01, 2011 njensen Restructured deserializeArray() - * Sep 14, 2012 #1169 djohnson Add ability to write another object into the stream directly. - * Sep 28, 2012 #1195 djohnson Add ability to specify adapter at field level. - * Nov 02, 2012 1302 djohnson No more field level adapters. - * Apr 25, 2013 1954 bsteffen Size Collections better. - * Jul 23, 2013 2215 njensen Updated for thrift 0.9.0 + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Aug 12, 2008 1448 chammack Initial creation + * Jun 17, 2010 5091 njensen Optimized primitive arrays + * Mar 01, 2011 njensen Restructured deserializeArray() + * Sep 14, 2012 1169 djohnson Add ability to write another object into + * the stream directly. + * Sep 28, 2012 1195 djohnson Add ability to specify adapter at field + * level. + * Nov 02, 2012 1302 djohnson No more field level adapters. + * Apr 25, 2013 1954 bsteffen Size Collections better. + * Jul 23, 2013 2215 njensen Updated for thrift 0.9.0 + * Nov 26, 2013 2537 bsteffen Add support for void type lists which are + * sometimes created by python. * ** @@ -1183,6 +1187,29 @@ public class ThriftSerializationContext extends BaseSerializationContext { } return list; } + case TType.VOID: + if (listFieldClazz == null || listFieldClazz.isArray()) { + Object[] array = new Object[innerList.size]; + protocol.readListEnd(); + return array; + } else { + // this is a List but due to the encoded element type + // we can safely assume it's all nulls + List
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Feb 16, 2011 8070 ekladstrup Initial creation - * Aug 09, 2011 9696 gzhou add handle for request from nativeLib - * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Feb 16, 2011 8070 ekladstrup Initial creation + * Aug 09, 2011 9696 gzhou add handle for request from nativeLib + * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. + * Nov 26, 2013 2537 bsteffen Use constants in the request class. * ** @@ -78,19 +79,21 @@ public class PointDataServerRequestHandler implements // get mode String mode = ""; - constraint = map.get("mode"); + constraint = map.get(PointDataServerRequest.REQUEST_MODE_KEY); if (constraint != null) { mode = constraint.getConstraintValue(); - map.remove("mode"); + map.remove(PointDataServerRequest.REQUEST_MODE_KEY); } // create PointDataQuery PointDataQuery query = new PointDataQuery(pluginName); // find requested parameters if applicable - if (map.containsKey("requestedParameters")) { - String params = map.get("requestedParameters").getConstraintValue(); - map.remove("requestedParameters"); + if (map.containsKey(PointDataServerRequest.REQUEST_PARAMETERS_KEY)) { + String params = map.get( + PointDataServerRequest.REQUEST_PARAMETERS_KEY) + .getConstraintValue(); + map.remove(PointDataServerRequest.REQUEST_PARAMETERS_KEY); query.setParameters(params); } @@ -103,7 +106,7 @@ public class PointDataServerRequestHandler implements } // check if requestAllLevels should be called or only specific levels - if (mode.equals("select2d")) { + if (mode.equals(PointDataServerRequest.REQUEST_MODE_2D)) { query.requestAllLevels(); } else if (mode.equals("selectSpecific")) { query.requestSpecificLevel(levelParameter, levelValues); @@ -111,7 +114,7 @@ public class PointDataServerRequestHandler implements // perform action based on mode PointDataContainer container = null; - if (mode.equals("getParameters")) { + if (mode.equals(PointDataServerRequest.REQUEST_MODE_PARAMETERS)) { return query.getAvailableParameters(); } else { container = query.execute();