Issue #1977: Fix NCEP Plugin issues due to merge
Former-commit-id:c311adda88
[formerly82f3d26700
[formerly 3496de5dfddf84fb7130d993a17dcf973018d2f1]] Former-commit-id:82f3d26700
Former-commit-id:61455f533b
This commit is contained in:
parent
49efaf00e0
commit
4d2b51881c
3 changed files with 181 additions and 140 deletions
|
@ -1,7 +1,7 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.geomag;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -18,14 +18,12 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.LongDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.StringDataRecord;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Record implementation for geomag plugin.
|
||||
*
|
||||
|
@ -35,6 +33,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* ------------ ---------- ---------------- --------------------------
|
||||
* 03/27/2013 975 sgurung Initial creation.
|
||||
* 05/26/2013 bhebbard Added SequenceGenerator annotation.
|
||||
* 07/22/2013 1977 rjpeter Added getDataURI and annotations.
|
||||
* </pre>
|
||||
*
|
||||
* @author sgurung
|
||||
|
@ -91,10 +90,13 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
/**
|
||||
* flag to indicate bad data point
|
||||
*/
|
||||
/*@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private String badDataPoint;*/
|
||||
/*
|
||||
* @Column
|
||||
*
|
||||
* @DynamicSerializeElement
|
||||
*
|
||||
* @XmlAttribute private String badDataPoint;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Observation Date and Time for the minute values
|
||||
|
@ -272,21 +274,21 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
|
||||
try {
|
||||
IDataRecord[] dataRec = dataStore.retrieve(getDataURI());
|
||||
for (int i = 0; i < dataRec.length; i++) {
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component1)) {
|
||||
obs_times = (((LongDataRecord) dataRec[i]).getLongData());
|
||||
for (IDataRecord element : dataRec) {
|
||||
if (element.getName().equals(GeoMagRecord.component1)) {
|
||||
obs_times = (((LongDataRecord) element).getLongData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component1)) {
|
||||
comp1_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
if (element.getName().equals(GeoMagRecord.component1)) {
|
||||
comp1_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component2)) {
|
||||
comp2_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
if (element.getName().equals(GeoMagRecord.component2)) {
|
||||
comp2_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component3)) {
|
||||
comp3_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
if (element.getName().equals(GeoMagRecord.component3)) {
|
||||
comp3_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
if (dataRec[i].getName().equals(GeoMagRecord.component4)) {
|
||||
comp4_data = (((FloatDataRecord) dataRec[i]).getFloatData());
|
||||
if (element.getName().equals(GeoMagRecord.component4)) {
|
||||
comp4_data = (((FloatDataRecord) element).getFloatData());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,4 +297,10 @@ public class GeoMagRecord extends PersistablePluginDataObject {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,12 @@
|
|||
|
||||
package gov.noaa.nws.ncep.common.dataplugin.idft;
|
||||
|
||||
|
||||
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -50,6 +51,22 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
|||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 07/22/2013 1977 rjpeter Added getDataURI and annotations.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rjpeter
|
||||
* @version 1.0
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "idftseq")
|
||||
@Table(name = "idft", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
|
@ -57,72 +74,66 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(
|
||||
appliesTo = "idft",
|
||||
indexes = {
|
||||
@Index(name = "idft_refTimeIndex", columnNames = { "refTime", "forecastTime" } )
|
||||
}
|
||||
)
|
||||
@org.hibernate.annotations.Table(appliesTo = "idft", indexes = { @Index(name = "idft_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class IdftRecord extends PluginDataObject {
|
||||
|
||||
public class IdftRecord extends PluginDataObject{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Report type */
|
||||
@Column(length=32)
|
||||
@XmlElement
|
||||
/** Report type */
|
||||
@Column(length = 32)
|
||||
@XmlElement
|
||||
@DataURI(position = 4)
|
||||
@DynamicSerializeElement
|
||||
private String reportType;
|
||||
@DynamicSerializeElement
|
||||
private String reportType;
|
||||
|
||||
@Column
|
||||
@Column
|
||||
@DataURI(position = 1)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Calendar issueTime;
|
||||
@XmlElement
|
||||
private Calendar issueTime;
|
||||
|
||||
@Column
|
||||
@Column
|
||||
@DataURI(position = 2)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Calendar validTime;
|
||||
@XmlElement
|
||||
private Calendar validTime;
|
||||
|
||||
@XmlElement
|
||||
@DataURI(position = 3)
|
||||
@DynamicSerializeElement
|
||||
private Integer pointNum;
|
||||
private Integer pointNum;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float lat;
|
||||
private Float lat;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float lon;
|
||||
private Float lon;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float direction;
|
||||
private Float direction;
|
||||
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private Float distanceNm;
|
||||
private Float distanceNm;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public IdftRecord() {
|
||||
this.issueTime = null;
|
||||
this.validTime = null;
|
||||
this.pointNum = IDecoderConstantsN.INTEGER_MISSING;
|
||||
this.lat = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.lon = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.direction = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.distanceNm = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.issueTime = null;
|
||||
this.validTime = null;
|
||||
this.pointNum = IDecoderConstantsN.INTEGER_MISSING;
|
||||
this.lat = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.lon = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.direction = IDecoderConstantsN.FLOAT_MISSING;
|
||||
this.distanceNm = IDecoderConstantsN.FLOAT_MISSING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,59 +153,73 @@ public class IdftRecord extends PluginDataObject{
|
|||
}
|
||||
|
||||
public String getReportType() {
|
||||
return reportType;
|
||||
return reportType;
|
||||
}
|
||||
|
||||
public void setReportType(String reportType) {
|
||||
this.reportType = reportType;
|
||||
this.reportType = reportType;
|
||||
}
|
||||
|
||||
public Calendar getIssueTime(){
|
||||
return issueTime;
|
||||
}
|
||||
public void setIssueTime(Calendar issueTime){
|
||||
this.issueTime=issueTime;
|
||||
}
|
||||
public Calendar getIssueTime() {
|
||||
return issueTime;
|
||||
}
|
||||
|
||||
public Calendar getValidTime(){
|
||||
return validTime;
|
||||
}
|
||||
public void setValidTime(Calendar validTime){
|
||||
this.validTime=validTime;
|
||||
}
|
||||
public void setIssueTime(Calendar issueTime) {
|
||||
this.issueTime = issueTime;
|
||||
}
|
||||
|
||||
public Integer getPointNum(){
|
||||
return pointNum;
|
||||
}
|
||||
public void setPointNum(Integer pointNum){
|
||||
this.pointNum=pointNum;
|
||||
}
|
||||
public Calendar getValidTime() {
|
||||
return validTime;
|
||||
}
|
||||
|
||||
public float getLat(){
|
||||
return lat;
|
||||
}
|
||||
public void setLat(float latitude){
|
||||
this.lat=latitude;
|
||||
}
|
||||
public void setValidTime(Calendar validTime) {
|
||||
this.validTime = validTime;
|
||||
}
|
||||
|
||||
public float getLon(){
|
||||
return lon;
|
||||
}
|
||||
public void setLon(float longitude){
|
||||
this.lon=longitude;
|
||||
}
|
||||
public Integer getPointNum() {
|
||||
return pointNum;
|
||||
}
|
||||
|
||||
public float getDirection(){
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(float direction){
|
||||
this.direction=direction;
|
||||
}
|
||||
public void setPointNum(Integer pointNum) {
|
||||
this.pointNum = pointNum;
|
||||
}
|
||||
|
||||
public float getDistanceNm(){
|
||||
return distanceNm;
|
||||
}
|
||||
public void setDistanceNm(float distanceNm){
|
||||
this.distanceNm=distanceNm;
|
||||
}
|
||||
public float getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(float latitude) {
|
||||
this.lat = latitude;
|
||||
}
|
||||
|
||||
public float getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(float longitude) {
|
||||
this.lon = longitude;
|
||||
}
|
||||
|
||||
public float getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(float direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public float getDistanceNm() {
|
||||
return distanceNm;
|
||||
}
|
||||
|
||||
public void setDistanceNm(float distanceNm) {
|
||||
this.distanceNm = distanceNm;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.pgen;
|
||||
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -30,7 +32,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 22, 2013 sgilbert Initial creation
|
||||
* Jun 26, 2013 bhebbard Added SequenceGenerator annotation
|
||||
*
|
||||
* Jul 22, 2013 1977 rjpeter Added getDataURI and annotations.
|
||||
* </pre>
|
||||
*
|
||||
* @author sgilbert
|
||||
|
@ -262,4 +264,10 @@ public class PgenRecord extends PersistablePluginDataObject {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue