Integrating Richard's changes with 12.2.1

Change-Id: I1831502d72bed7b804287bb7c3e4ea501514ada4

Former-commit-id: d18a15535a [formerly 729a478cf151a4d61bb31adba4193c3fc33717a1]
Former-commit-id: afe3c5db9c
This commit is contained in:
Nate Jensen 2012-02-28 09:37:45 -06:00
parent 40d7357165
commit 74b6e7b389
2 changed files with 883 additions and 952 deletions

View file

@ -19,68 +19,66 @@
* @version 1
*/
package gov.noaa.nws.ncep.common.dataplugin.mcidas;
import java.util.Calendar;
import java.util.Date;
package gov.noaa.nws.ncep.common.dataplugin.mcidas;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import java.util.Calendar;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
import com.raytheon.uf.common.dataplugin.persist.PersistablePluginDataObject;
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
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 gov.noaa.nws.ncep.common.dataplugin.mcidas.McidasMapCoverage;
@Entity
@Entity
@Table(name = "mcidas", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class McidasRecord extends PersistablePluginDataObject implements
IPersistable, ISpatialEnabled {
private static final long serialVersionUID = 1L;
/** The satellite name */
@Column(length = 32)
@DataURI(position = 1)
@XmlAttribute
@DynamicSerializeElement
private String satelliteName;
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class McidasRecord extends PersistablePluginDataObject implements
IPersistable, ISpatialEnabled {
private static final long serialVersionUID = 1L;
/** The satellite name */
@Column(length = 32)
@DataURI(position = 1)
@XmlAttribute
@DynamicSerializeElement
private String satelliteName;
/** The area name */
@Column(length = 64)
@DataURI(position = 2)
@XmlAttribute
@DynamicSerializeElement
private String areaName;
/** The resolution */
/** The resolution */
@Column
@DataURI(position = 3)
@XmlAttribute
@DynamicSerializeElement
private Integer resolution;
/** The image type */
@Column(length = 32)
@DataURI(position = 4)
@ -95,48 +93,48 @@ public class McidasRecord extends PersistablePluginDataObject implements
@XmlAttribute
@DynamicSerializeElement
private Calendar creationTime;
/**
* The image time
*/
@Column
@XmlAttribute
@DynamicSerializeElement
private Calendar imageTime;
/**
* Size of logical records in bytes for product.
*/
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer sizeRecords;
/** Satellite projection */
@Column(length=16)
/**
* The image time
*/
@Column
@XmlAttribute
@DynamicSerializeElement
private String projection;
/** The report type */
@Column(length=16)
@DynamicSerializeElement
private Calendar imageTime;
/**
* Size of logical records in bytes for product.
*/
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer sizeRecords;
/** Satellite projection */
@Column(length = 16)
@XmlAttribute
@DynamicSerializeElement
private String projection;
/** The report type */
@Column(length = 16)
@XmlAttribute
@DynamicSerializeElement
private String reportType;
/** The calibration type */
@Column(length=16)
/** The calibration type */
@Column(length = 16)
@XmlAttribute
@DynamicSerializeElement
private String calType;
/** The satellite ID */
/** The satellite ID */
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer satelliteId;
/** The image type number */
/** The image type number */
@Column
@XmlAttribute
@DynamicSerializeElement
@ -146,155 +144,139 @@ public class McidasRecord extends PersistablePluginDataObject implements
* Length of prefix in bytes.
*/
private Integer prefix;
/*
* Validation code. if these bytes are non-zero, they must match the first four
* bytes of each DATA block line prefix or the line's data is ignored.
* Validation code. if these bytes are non-zero, they must match the first
* four bytes of each DATA block line prefix or the line's data is ignored.
*/
private Integer validCode;
/*
* File name ingested to the end point.
*/
private String inputFileName;
@ManyToOne
@PrimaryKeyJoinColumn
@XmlElement
@DynamicSerializeElement
@ManyToOne
@PrimaryKeyJoinColumn
@XmlElement
@DynamicSerializeElement
private McidasMapCoverage coverage;
/** Area file header block */
@Transient
private byte[] headerBlock;
@Override
public McidasMapCoverage getSpatialObject() {
return coverage;
}
public McidasMapCoverage getCoverage() {
return coverage;
}
public void setCoverage(McidasMapCoverage coverage) {
this.coverage = coverage;
}
/**
* No-arg constructor.
*/
public McidasRecord() {
satelliteName = null;
imageType = null;
resolution = null;
projection = null;
imageTime = null;
areaName = null;
}
/**
* Constructs a McIDAS satellite record from a dataURI
*
* @param uri
* The dataURI
*/
public McidasRecord(String uri) {
super(uri);
}
/**
* Get the time to use for persisting this data.
*
* @return The persistence time for this data.
*/
@Override
public Date getPersistenceTime() {
Calendar c = getInsertTime();
if (c == null)
return null;
return c.getTime();
@Override
public McidasMapCoverage getSpatialObject() {
return coverage;
}
public McidasMapCoverage getCoverage() {
return coverage;
}
public void setCoverage(McidasMapCoverage coverage) {
this.coverage = coverage;
}
/**
* No-arg constructor.
*/
public McidasRecord() {
satelliteName = null;
imageType = null;
resolution = null;
projection = null;
imageTime = null;
areaName = null;
}
/**
* Constructs a McIDAS satellite record from a dataURI
*
* @param uri
* The dataURI
*/
public McidasRecord(String uri) {
super(uri);
}
/**
* Set the time to be used for the persistence time for this object.
*
* @param persistTime
* The persistence time to be used.
*/
public void setPersistenceTime(Calendar persistTime) {
setInsertTime(persistTime);
}
public Integer getSizeRecords() {
return sizeRecords;
}
public void setSizeRecords(Integer sizeRecords) {
this.sizeRecords = sizeRecords;
}
/**
* Get the IDecoderGettable reference for this record.
*
* @return The IDecoderGettable reference for this record. Null for this
* class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return null;
}
public String getReportType() {
return reportType;
}
public void setReportType(String reportType) {
this.reportType = reportType;
}
public String getSatelliteName() {
return satelliteName;
}
/**
* Set the time to be used for the persistence time for this object.
*
* @param persistTime
* The persistence time to be used.
*/
public void setPersistenceTime(Calendar persistTime) {
setInsertTime(persistTime);
}
public Integer getSizeRecords() {
return sizeRecords;
}
public void setSizeRecords(Integer sizeRecords) {
this.sizeRecords = sizeRecords;
}
/**
* Get the IDecoderGettable reference for this record.
*
* @return The IDecoderGettable reference for this record. Null for this
* class.
*/
@Override
public IDecoderGettable getDecoderGettable() {
return null;
}
public String getReportType() {
return reportType;
}
public void setReportType(String reportType) {
this.reportType = reportType;
}
public String getSatelliteName() {
return satelliteName;
}
public Calendar getCreationTime() {
return creationTime;
}
return creationTime;
}
public void setCreationTime(Calendar creationTime) {
this.creationTime = creationTime;
}
public void setCreationTime(Calendar creationTime) {
this.creationTime = creationTime;
}
public Calendar getImageTime() {
return imageTime;
}
public Calendar getImageTime() {
return imageTime;
}
public void setImageTime(Calendar imageTime) {
this.imageTime = imageTime;
}
public void setImageTime(Calendar imageTime) {
this.imageTime = imageTime;
}
public String getProjection() {
return projection;
}
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
public void setSatelliteName(String satelliteName) {
this.satelliteName = satelliteName;
}
public String getImageType() {
return imageType;
}
public void setImageType(String imageType) {
this.imageType = imageType;
}
public void setSatelliteName(String satelliteName) {
this.satelliteName = satelliteName;
}
public String getImageType() {
return imageType;
}
public void setImageType(String imageType) {
this.imageType = imageType;
}
public Integer getResolution() {
return resolution;
@ -302,75 +284,70 @@ public class McidasRecord extends PersistablePluginDataObject implements
public void setResolution(Integer resolution) {
this.resolution = resolution;
}
public byte[] getHeaderBlock() {
return headerBlock;
}
}
public void setHeaderBlock(byte[] headerBlock) {
this.headerBlock = headerBlock;
}
public byte[] getHeaderBlock() {
return headerBlock;
}
public String getAreaName() {
return areaName;
}
public void setHeaderBlock(byte[] headerBlock) {
this.headerBlock = headerBlock;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getAreaName() {
return areaName;
}
public Integer getPrefix() {
return prefix;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public void setPrefix(Integer prefix) {
this.prefix = prefix;
}
public Integer getPrefix() {
return prefix;
}
public Integer getValidCode() {
return validCode;
}
public void setPrefix(Integer prefix) {
this.prefix = prefix;
}
public void setValidCode(Integer validCode) {
this.validCode = validCode;
}
public String getInputFileName() {
return inputFileName;
}
public Integer getValidCode() {
return validCode;
}
public void setValidCode(Integer validCode) {
this.validCode = validCode;
}
public String getInputFileName() {
return inputFileName;
}
public void setInputFileName(String inputFileName) {
this.inputFileName = inputFileName;
}
public void setInputFileName(String inputFileName) {
this.inputFileName = inputFileName;
}
public String getCalType() {
return calType;
}
return calType;
}
public void setCalType(String calType) {
this.calType = calType;
}
public void setCalType(String calType) {
this.calType = calType;
}
public Integer getSatelliteId() {
return satelliteId;
}
public Integer getSatelliteId() {
return satelliteId;
}
public void setSatelliteId(Integer satelliteId) {
this.satelliteId = satelliteId;
}
public void setSatelliteId(Integer satelliteId) {
this.satelliteId = satelliteId;
}
public Integer getImageTypeNumber() {
return imageTypeNumber;
}
public Integer getImageTypeNumber() {
return imageTypeNumber;
}
public void setImageTypeNumber(Integer imageTypeNumber) {
this.imageTypeNumber = imageTypeNumber;
}
public void setImageTypeNumber(Integer imageTypeNumber) {
this.imageTypeNumber = imageTypeNumber;
}
@Override
public void setPersistenceTime(Date persistTime) {
// TODO Auto-generated method stub
}
}