Issue #1869 Remove DataURI from goes/poes soundings.

Change-Id: Ib13c7537c94e15d70588d75f546586e6d1f08416

Former-commit-id: 836239896aace50e37896f6219015a75aea117b7
This commit is contained in:
Ben Steffensmeier 2013-05-15 12:35:04 -05:00
parent 82ccd32ee0
commit 1c3e60a5ff
9 changed files with 51 additions and 271 deletions

View file

@ -38,9 +38,8 @@ import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.sounding.Activator;
import com.raytheon.viz.pointdata.PointDataRequest; import com.raytheon.viz.pointdata.PointDataRequest;
/** /**
@ -51,7 +50,8 @@ import com.raytheon.viz.pointdata.PointDataRequest;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 1, 2008 1747 jkorman Initial creation * Dec 01, 2008 1747 jkorman Initial creation
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -94,8 +94,12 @@ public class GOESSoundingAdapter extends AbstractVerticalSoundingAdapter {
if (obsData != null) { if (obsData != null) {
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>(); Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put("dataURI", new RequestConstraint("" rcMap.put("location.stationId", new RequestConstraint(obsData
+ obsData.getDataURI())); .getLocation().getStationId()));
rcMap.put(
"dataTime.refTime",
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
.getDataTime().getRefTime())));
PointDataContainer container; PointDataContainer container;
try { try {
container = PointDataRequest.requestPointDataAllLevels(null, container = PointDataRequest.requestPointDataAllLevels(null,

View file

@ -39,9 +39,8 @@ import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.sounding.Activator;
import com.raytheon.viz.pointdata.PointDataRequest; import com.raytheon.viz.pointdata.PointDataRequest;
/** /**
@ -52,7 +51,8 @@ import com.raytheon.viz.pointdata.PointDataRequest;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 1, 2008 1747 jkorman Initial creation * Dec 01, 2008 1747 jkorman Initial creation
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -95,8 +95,12 @@ public class POESSoundingAdapter extends AbstractVerticalSoundingAdapter {
if (obsData != null) { if (obsData != null) {
Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>(); Map<String, RequestConstraint> rcMap = new HashMap<String, RequestConstraint>();
rcMap.put("dataURI", new RequestConstraint("" rcMap.put("location.stationId", new RequestConstraint(obsData
+ obsData.getDataURI())); .getLocation().getStationId()));
rcMap.put(
"dataTime.refTime",
new RequestConstraint(TimeUtil.formatToSqlTimestamp(obsData
.getDataTime().getRefTime())));
PointDataContainer container; PointDataContainer container;
try { try {
container = PointDataRequest.requestPointDataAllLevels(null, container = PointDataRequest.requestPointDataAllLevels(null,

View file

@ -30,14 +30,16 @@ function dropDatauriAndAddConstraint {
echo "FATAL: The update has failed." echo "FATAL: The update has failed."
exit 1 exit 1
fi fi
${PSQL} -U awips -d metadata -c "VACUUM FULL $1" ${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE $1"
} }
echo "INFO: Dropping dataURI columns." echo "INFO: Dropping dataURI columns."
dropDatauri gfe dropDatauri gfe
${PSQL} -U awips -d metadata -c "VACUUM FULL gfe" ${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE gfe"
dropDatauriAndAddConstraint bufrmosavn bufrmosavn_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" dropDatauriAndAddConstraint bufrmosavn bufrmosavn_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)"
dropDatauriAndAddConstraint bufrmoshpc bufrmoshpc_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)" dropDatauriAndAddConstraint bufrmoshpc bufrmoshpc_location_id_reftime_forecasttime_key "(location_id, reftime, forecasttime)"
dropDatauriAndAddConstraint goessounding goessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)"
dropDatauriAndAddConstraint poessounding poessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)"
echo "INFO: dataURI columns dropped successfully" echo "INFO: dataURI columns dropped successfully"

View file

@ -23,7 +23,6 @@
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" /> <parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" /> <parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" />
<parameter name="stationId" queryName="location.stationId" type="STRING" /> <parameter name="stationId" queryName="location.stationId" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="validTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms" /> <parameter name="validTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/> <parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
<parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/> <parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/>

View file

@ -35,7 +35,6 @@ import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.goessounding.dao.GOESSoundingDAO; import com.raytheon.edex.plugin.goessounding.dao.GOESSoundingDAO;
import com.raytheon.edex.plugin.goessounding.decoder.GOESSoundingDataAdapter; import com.raytheon.edex.plugin.goessounding.decoder.GOESSoundingDataAdapter;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.goessounding.GOESSounding; import com.raytheon.uf.common.dataplugin.goessounding.GOESSounding;
import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataDescription; import com.raytheon.uf.common.pointdata.PointDataDescription;
@ -59,8 +58,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080414 1077 jkorman Initial implementation. * Apr 14, 2008 1077 jkorman Initial implementation.
* 11/25/08 #1684 chammack Camel Refactor * Nov 25, 2008 1684 chammack Camel Refactor
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -154,17 +154,11 @@ public class GOESSoundingDecoder extends AbstractDecoder implements
if (soundingData != null) { if (soundingData != null) {
soundingData.setTraceId(traceId); soundingData.setTraceId(traceId);
soundingData.setPluginName(PLUGIN_NAME); soundingData.setPluginName(PLUGIN_NAME);
try { PointDataView pdv = soundingData.getPointDataView();
soundingData.constructDataURI(); pdv.setString("wmoHeader",
PointDataView pdv = soundingData soundingData.getWmoHeader());
.getPointDataView(); pdoList.add(soundingData);
pdv.setString("wmoHeader",
soundingData.getWmoHeader());
pdoList.add(soundingData);
} catch (PluginException e) {
logger.error(traceId
+ "- Unable to construct dataURI", e);
}
} }
} }

View file

@ -23,7 +23,6 @@
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" /> <parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" /> <parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" />
<parameter name="stationId" queryName="location.stationId" type="STRING" /> <parameter name="stationId" queryName="location.stationId" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
<parameter name="wmoHeader" queryName="wmoHeader" type="STRING" /> <parameter name="wmoHeader" queryName="wmoHeader" type="STRING" />
<parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/> <parameter name="refTime" queryName="dataTime.refTime" numDims="1" type="LONG" unit="ms"/>
<parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/> <parameter name="forecastHr" queryName="dataTime.fcstTime" numDims="1" type="INT" unit="h" dbunit="s"/>

View file

@ -31,7 +31,6 @@ import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder; import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.poessounding.decoder.POESSoundingDataAdapter; import com.raytheon.edex.plugin.poessounding.decoder.POESSoundingDataAdapter;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.poessounding.POESSounding; import com.raytheon.uf.common.dataplugin.poessounding.POESSounding;
import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataDescription; import com.raytheon.uf.common.pointdata.PointDataDescription;
@ -55,8 +54,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080303 1026 jkorman Initial implementation. * Mar 03, 2008 1026 jkorman Initial implementation.
* 20080408 1039 jkorman Added traceId for tracing data. * Apr 08, 2008 1039 jkorman Added traceId for tracing data.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -145,12 +145,6 @@ public class POESSoundingDecoder extends AbstractDecoder implements
if (soundingData != null) { if (soundingData != null) {
soundingData.setTraceId(traceId); soundingData.setTraceId(traceId);
soundingData.setPluginName(PLUGIN_NAME); soundingData.setPluginName(PLUGIN_NAME);
try {
soundingData.constructDataURI();
} catch (PluginException e) {
logger.error(traceId
+ "- Unable to construct dataURI", e);
}
pdoList.add(soundingData); pdoList.add(soundingData);
} }
} }

View file

@ -21,15 +21,8 @@ package com.raytheon.uf.common.dataplugin.goessounding;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import javax.measure.quantity.Angle;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Embedded; import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -37,16 +30,10 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.IPersistable; import com.raytheon.uf.common.dataplugin.persist.IPersistable;
@ -55,7 +42,6 @@ import com.raytheon.uf.common.geospatial.ISpatialEnabled;
import com.raytheon.uf.common.pointdata.IPointData; import com.raytheon.uf.common.pointdata.IPointData;
import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.common.serialization.adapters.GeometryAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
@ -69,11 +55,13 @@ import com.vividsolutions.jts.geom.Geometry;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080414 1077 jkorman Initial implementation. * Apr 14, 2008 1077 jkorman Initial implementation.
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 04, 2013 1846 bkowal Added an index on refTime and
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 07, 2013 1869 bsteffen Remove dataURI column from * May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject. * PluginDataObject.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -82,7 +70,8 @@ import com.vividsolutions.jts.geom.Geometry;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "goessoundingseq") @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "goessoundingseq")
@Table(name = "goessounding", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @Table(name = "goessounding", uniqueConstraints = { @UniqueConstraint(columnNames = {
"stationid", "reftime", "latitude", "longitude" }) })
/* /*
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
@ -94,31 +83,19 @@ import com.vividsolutions.jts.geom.Geometry;
} }
) )
@DynamicSerialize @DynamicSerialize
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class GOESSounding extends PersistablePluginDataObject implements public class GOESSounding extends PersistablePluginDataObject implements
ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { ISpatialEnabled, IPointData, IPersistable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final Unit<Angle> LOCATION_UNIT = NonSI.DEGREE_ANGLE;
private static final HashMap<String, String> PARM_MAP = new HashMap<String, String>();
static {
PARM_MAP.put("NLAT", STA_LAT);
PARM_MAP.put("NLON", STA_LON);
}
@Embedded @Embedded
@DataURI(position = 1, embedded = true) @DataURI(position = 1, embedded = true)
@XmlElement
@DynamicSerializeElement @DynamicSerializeElement
private SurfaceObsLocation location; private SurfaceObsLocation location;
// The bounding box that contains this observation. // The bounding box that contains this observation.
@Column(name = "boxGeometry", columnDefinition = "geometry") @Column(name = "boxGeometry", columnDefinition = "geometry")
@Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType") @Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement @DynamicSerializeElement
private Geometry boxGeometry; private Geometry boxGeometry;
@ -129,42 +106,34 @@ public class GOESSounding extends PersistablePluginDataObject implements
// Text of the WMO header // Text of the WMO header
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private String wmoHeader; private String wmoHeader;
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Integer satId; private Integer satId;
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Integer satInstrument; private Integer satInstrument;
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Integer qualityInfo; private Integer qualityInfo;
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Integer sounderChannels; private Integer sounderChannels;
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Double solarElevation; private Double solarElevation;
// The profiler observation time. // The profiler observation time.
@Transient @Transient
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement
private Calendar timeObs; private Calendar timeObs;
@Transient @Transient
@XmlElement
@DynamicSerializeElement @DynamicSerializeElement
private List<GOESSoundingLevel> soundingLevels; private List<GOESSoundingLevel> soundingLevels;
@ -428,83 +397,6 @@ public class GOESSounding extends PersistablePluginDataObject implements
soundingLevels.add(soundingLevel); soundingLevels.add(soundingLevel);
} }
/**
* Return this class reference as the IDecoderGettable interface
* implementation.
*
* @return Returns reference to this class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return this;
}
/**
* Get the value of a parameter that is represented as a String.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The String value of the parameter. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public String getString(String paramName) {
if ("STA".matches(paramName)) {
return this.getStationId();
}
return null;
}
/**
* Get the value and units of a named parameter within this observation.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return An Amount with value and units. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public Amount getValue(String paramName) {
Amount a = null;
String pName = PARM_MAP.get(paramName);
if (STA_LAT.equals(pName)) {
a = new Amount(this.getLatitude(), LOCATION_UNIT);
} else if (STA_LON.equals(pName)) {
a = new Amount(this.getLongitude(), LOCATION_UNIT);
}
return a;
}
/**
* Get the value of a parameter that is represented as a collection of
* values.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an Amount. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public Collection<Amount> getValues(String paramName) {
return null;
}
/**
* Get the value of a parameter that is represented as a collection of
* Strings.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an String. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public String[] getStrings(String paramName) {
return null;
}
@Override @Override
public SurfaceObsLocation getSpatialObject() { public SurfaceObsLocation getSpatialObject() {
return location; return location;
@ -527,10 +419,5 @@ public class GOESSounding extends PersistablePluginDataObject implements
public void setPointDataView(PointDataView pointDataView) { public void setPointDataView(PointDataView pointDataView) {
this.pointDataView = pointDataView; this.pointDataView = pointDataView;
} }
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
} }

View file

@ -19,16 +19,9 @@
**/ **/
package com.raytheon.uf.common.dataplugin.poessounding; package com.raytheon.uf.common.dataplugin.poessounding;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import javax.measure.quantity.Angle;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Embedded; import javax.persistence.Embedded;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -36,14 +29,9 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
@ -64,11 +52,13 @@ import com.vividsolutions.jts.geom.Geometry;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080303 1026 jkorman Initial implementation. * Mar 03, 2008 1026 jkorman Initial implementation.
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 04, 2013 1846 bkowal Added an index on refTime and
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 07, 2013 1869 bsteffen Remove dataURI column from * May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject. * PluginDataObject.
* May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings.
* *
* </pre> * </pre>
* *
@ -77,7 +67,8 @@ import com.vividsolutions.jts.geom.Geometry;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "poessoundingseq") @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "poessoundingseq")
@Table(name = "poessounding", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @Table(name = "poessounding", uniqueConstraints = { @UniqueConstraint(columnNames = {
"stationid", "reftime", "latitude", "longitude" }) })
/* /*
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
@ -89,21 +80,11 @@ import com.vividsolutions.jts.geom.Geometry;
} }
) )
@DynamicSerialize @DynamicSerialize
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class POESSounding extends PersistablePluginDataObject implements public class POESSounding extends PersistablePluginDataObject implements
ISpatialEnabled, IDecoderGettable, IPointData { ISpatialEnabled, IPointData {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final Unit<Angle> LOCATION_UNIT = NonSI.DEGREE_ANGLE;
private static final HashMap<String, String> PARM_MAP = new HashMap<String, String>();
static {
PARM_MAP.put("NLAT", STA_LAT);
PARM_MAP.put("NLON", STA_LON);
}
// The profiler observation time. // The profiler observation time.
// @Column // @Column
// @DynamicSerializeElement // @DynamicSerializeElement
@ -116,7 +97,6 @@ public class POESSounding extends PersistablePluginDataObject implements
// Text of the WMO header // Text of the WMO header
@Column(length = 32) @Column(length = 32)
@XmlElement
@DynamicSerializeElement @DynamicSerializeElement
private String wmoHeader; private String wmoHeader;
@ -125,7 +105,6 @@ public class POESSounding extends PersistablePluginDataObject implements
@Embedded @Embedded
@DataURI(position = 1, embedded = true) @DataURI(position = 1, embedded = true)
@XmlElement
@DynamicSerializeElement @DynamicSerializeElement
private SurfaceObsLocation location; private SurfaceObsLocation location;
@ -251,83 +230,6 @@ public class POESSounding extends PersistablePluginDataObject implements
soundingLevels.add(soundingLevel); soundingLevels.add(soundingLevel);
} }
/**
* Return this class reference as the IDecoderGettable interface
* implementation.
*
* @return Returns reference to this class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return this;
}
/**
* Get the value of a parameter that is represented as a String.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The String value of the parameter. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public String getString(String paramName) {
if ("STA".matches(paramName)) {
return this.getStationId();
}
return null;
}
/**
* Get the value and units of a named parameter within this observation.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return An Amount with value and units. If the parameter is unknown, a
* null reference is returned.
*/
@Override
public Amount getValue(String paramName) {
Amount a = null;
String pName = PARM_MAP.get(paramName);
if (STA_LAT.equals(pName)) {
a = new Amount(this.getLatitude(), LOCATION_UNIT);
} else if (STA_LON.equals(pName)) {
a = new Amount(this.getLongitude(), LOCATION_UNIT);
}
return a;
}
/**
* Get the value of a parameter that is represented as a collection of
* values.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an Amount. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public Collection<Amount> getValues(String paramName) {
return null;
}
/**
* Get the value of a parameter that is represented as a collection of
* Strings.
*
* @param paramName
* The name of the parameter value to retrieve.
* @return The value of the parameter as an String. If the parameter is
* unknown, a null reference is returned.
*/
@Override
public String[] getStrings(String paramName) {
return null;
}
@Override @Override
public SurfaceObsLocation getSpatialObject() { public SurfaceObsLocation getSpatialObject() {
return location; return location;
@ -350,10 +252,5 @@ public class POESSounding extends PersistablePluginDataObject implements
public void setPointDataView(PointDataView pointDataView) { public void setPointDataView(PointDataView pointDataView) {
this.pointDataView = pointDataView; this.pointDataView = pointDataView;
} }
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
} }