diff --git a/edexOsgi/com.raytheon.edex.plugin.warning/src/com/raytheon/edex/plugin/warning/gis/GeospatialDataGenerator.java b/edexOsgi/com.raytheon.edex.plugin.warning/src/com/raytheon/edex/plugin/warning/gis/GeospatialDataGenerator.java index 771a099b24..4410294e69 100644 --- a/edexOsgi/com.raytheon.edex.plugin.warning/src/com/raytheon/edex/plugin/warning/gis/GeospatialDataGenerator.java +++ b/edexOsgi/com.raytheon.edex.plugin.warning/src/com/raytheon/edex/plugin/warning/gis/GeospatialDataGenerator.java @@ -58,6 +58,7 @@ import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -81,7 +82,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; /** - * TODO Add Description + * Saves off geospatial data from the maps database using the warngen + * configurations to improve performance of various operations in warngen. * *
* @@ -93,6 +95,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; * Mar 29, 2012 #14691 Qinglu Lin Added returned value of getFeArea() of * AreaConfiguration to areaFields List. * May 7, 2013 15690 Qinglu Lin Added convertToMultiPolygon() and updated queryGeospatialData(). + * Oct 22, 2013 2361 njensen Use JAXBManager for XML ** * @author rjpeter @@ -100,9 +103,13 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; */ public class GeospatialDataGenerator { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GeospatialDataGenerator.class); + private static final SingleTypeJAXBManager
* @@ -53,6 +48,7 @@ import com.vividsolutions.jts.geom.Point; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 30, 2009 jkorman Initial creation + * Oct 22, 2013 2361 njensen Remove XML annotations * ** @@ -62,10 +58,8 @@ import com.vividsolutions.jts.geom.Point; @Entity @Table(name = "acarssoundinglayer") -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class ACARSSoundingLayer implements Serializable, ISerializableObject, - ISpatialEnabled { +public class ACARSSoundingLayer implements Serializable, ISpatialEnabled { private static final long serialVersionUID = 1L; @@ -81,103 +75,86 @@ public class ACARSSoundingLayer implements Serializable, ISerializableObject, // Time of the observation. @Column @DynamicSerializeElement - @XmlAttribute private Calendar timeObs; @Column(length = 32) @DynamicSerializeElement - @XmlElement private String tailNumber; @Embedded - @XmlElement @DynamicSerializeElement private AircraftObsLocation location; // Flight phase @Column @DynamicSerializeElement - @XmlElement private Integer flightPhase; // Observation air temperature in degrees Kelvin. @Column @DynamicSerializeElement - @XmlElement private Double temp; // Observation dewpoint temperature in degrees Kelvin. // Decimal(5,2) @Column @DynamicSerializeElement - @XmlElement private Double dwpt; // Relative Humidity in percent. Decimal(5,2) @Column @DynamicSerializeElement - @XmlElement private Double humidity; // Mixing ratio in Kg/Kg @Column @DynamicSerializeElement - @XmlElement private Double mixingRatio; // Observation wind direction in angular degrees. Integer @Column @DynamicSerializeElement - @XmlElement private Integer windDirection; // Observation wind speed in meters per second. // Decimal(5,2) @Column @DynamicSerializeElement - @XmlElement private Double windSpeed; // Base height of reported icing. @Column @DynamicSerializeElement - @XmlElement private Integer iceBaseHgt; // Top height of reported icing. @Column @DynamicSerializeElement - @XmlElement private Integer iceTopHgt; // Intensity of reported icing. @Column @DynamicSerializeElement - @XmlElement private Integer icing; // Base height of reported turbulence. @Column @DynamicSerializeElement - @XmlElement private Integer turbBaseHgt; // Top height of reported turbulence. @Column @DynamicSerializeElement - @XmlElement private Integer turbTopHgt; // Intensity of reported turbulence. @Column @DynamicSerializeElement - @XmlElement private Integer turbulence; // Indicated or calculated pressure. @Column @DynamicSerializeElement - @XmlElement private Double pressure; /** @@ -608,29 +585,27 @@ public class ACARSSoundingLayer implements Serializable, ISerializableObject, return false; return true; } - - public static final void main(String [] args) { - + + public static final void main(String[] args) { + ACARSSoundingLayer layerA = new ACARSSoundingLayer(); AircraftObsLocation locA = new AircraftObsLocation(); locA.setLocation(40.2, -101.5); locA.setFlightLevel(1052); layerA.setLocation(locA); layerA.setTailNumber("ABCDEF"); - + ACARSSoundingLayer layerB = new ACARSSoundingLayer(); AircraftObsLocation locB = new AircraftObsLocation(); locB.setLocation(40.2, -101.5); locB.setFlightLevel(1052); layerB.setLocation(locB); layerB.setTailNumber("ABCDEF"); - + System.out.println(layerA.hashCode()); - + System.out.println(layerB.hashCode()); - + } - - - + } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java index 54f4ed92a9..b4cba89404 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java @@ -20,8 +20,6 @@ package com.raytheon.uf.common.dataplugin.acarssounding; import java.util.Calendar; -import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.Set; @@ -39,15 +37,9 @@ import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; 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.Index; -import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.geospatial.ISpatialEnabled; @@ -71,6 +63,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Oct 22, 2013 2361 njensen Remove XML annotations and IDecoderGettable * * * @@ -86,61 +79,46 @@ import com.vividsolutions.jts.geom.Geometry; */ @org.hibernate.annotations.Table(appliesTo = "acarssounding", indexes = { @Index(name = "acarssounding_refTimeIndex", columnNames = { "refTime", "forecastTime" }) }) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class ACARSSoundingRecord extends PluginDataObject implements - ISpatialEnabled, IDecoderGettable { + ISpatialEnabled { private static final long serialVersionUID = 1L; public static final Unit
* @@ -46,6 +44,7 @@ import com.raytheon.uf.edex.decodertools.core.LatLonPoint; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 16, 2009 jkorman Initial creation + * Oct 22, 2013 2361 njensen Use JAXBManager for XML * ** @@ -55,7 +54,7 @@ import com.raytheon.uf.edex.decodertools.core.LatLonPoint; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class Airports implements ISerializableObject { +public class Airports { private Log logger = LogFactory.getLog(getClass()); @@ -175,13 +174,14 @@ public class Airports implements ISerializableObject { Airports airports = null; try { - airports = (Airports) SerializationUtil - .jaxbUnmarshalFromXmlFile(filePath + File.separator - + fileName); + SingleTypeJAXBManager
- * "parameterName" may be one of - * "GH" geopotential height - * "Px" pressure - * "T" temperature - * "DpT" dewpoint - * "WS" wind speed - * "WD" wind direction - * followed by a level specification ":PRESS=xxxx" where xxxx is a level - * in hPa (millibars). To retrieve the temperature from the 850hPa level - * use the following getValue("T:PRESS=850"); - * - * Some data is specific to the observation, latitude/longitude for - * example. These data may be retrieved using the parameter minus any level - * information as follows - * "NLAT" station latitude - * "NLON" station longitude - *- * - * If the sounding data defines a surface level, and a request for a level - * below surface is requested, a null value is returned. - * - * @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; - - if (parseParameter(paramName)) { - String pName = PARM_MAP.get(parameterName); - if ((pName != null) && (levels != null) && (levels.size() > 0)) { - - UAObsLevel obsLevel = getLevel(levelId); - if (obsLevel != null) { - Integer iValue = null; - Double dValue = null; - if (UA_GEOHGT.equals(pName)) { - iValue = obsLevel.getGeoHeight(); - if (iValue != null) { - a = new Amount(iValue, DISTANCE_UNIT); - } - } else if (SFC_TEMP.equals(pName)) { - dValue = obsLevel.getTemp(); - if (dValue != null) { - a = new Amount(dValue, TEMPERATURE_UNIT); - } - } else if (SFC_DWPT.equals(pName)) { - dValue = obsLevel.getDwpt(); - if (dValue != null) { - a = new Amount(dValue, TEMPERATURE_UNIT); - } - } else if (SFC_WNDSPD.equals(pName)) { - dValue = obsLevel.getWindSpeed(); - if (dValue != null) { - a = new Amount(dValue, WIND_SPEED_UNIT); - } - } else if (SFC_WNDDIR.equals(pName)) { - iValue = obsLevel.getWindDirection(); - if (iValue != null) { - a = new Amount(iValue, WIND_DIR_UNIT); - } - } - } - } - } else { - // Assume we are trying to get an observation attribute. - 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 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 Collection
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 17, 2009 jkorman Initial creation - * + * Oct 22, 2013 2361 njensen Remove XML annotations + * *- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ @Entity -@Table(name="vaa_location") -@XmlAccessorType(XmlAccessType.NONE) +@Table(name = "vaa_location") @DynamicSerialize -public class VAALocation implements Serializable, ISerializableObject { +public class VAALocation implements Serializable { private static final long serialVersionUID = 1L; - + @Id @GeneratedValue private Integer recordId = null; - // + // @ManyToOne - @JoinColumn(name="parentId", nullable=false) + @JoinColumn(name = "parentId", nullable = false) private VAASubPart parentId; - // Point latitude @Column - @XmlElement @DynamicSerializeElement private double latitude; // Point longitude @Column - @XmlElement @DynamicSerializeElement - private double longitude; - + private double longitude; + // Position index. These points are kept in a set. Order // is not preserved. @Column - @XmlElement @DynamicSerializeElement private Integer index; @@ -95,50 +87,52 @@ public class VAALocation implements Serializable, ISerializableObject { public VAALocation() { // Empty constructor for bean operations } - + /** * * @param lat * @param lon * @param index */ - public VAALocation(double lat, double lon,int index, VAASubPart parent) { + public VAALocation(double lat, double lon, int index, VAASubPart parent) { latitude = lat; longitude = lon; this.index = index; parentId = parent; } - + /** * Get the record id. - * + * * @return The recordId. If not set returns null. */ - public Integer getRecordId() { + public Integer getRecordId() { return recordId; } - /** - * Set the record id. - * @param record - */ - public void setRecordId(Integer recordId) { + /** + * Set the record id. + * + * @param record + */ + public void setRecordId(Integer recordId) { this.recordId = recordId; } - /** - * @return the parentID - */ - public VAASubPart getParentId() { - return parentId; - } + /** + * @return the parentID + */ + public VAASubPart getParentId() { + return parentId; + } - /** - * @param parentID the parentID to set - */ - public void setParentId(VAASubPart parent) { - this.parentId = parent; - } + /** + * @param parentID + * the parentID to set + */ + public void setParentId(VAASubPart parent) { + this.parentId = parent; + } /** * @return the latitude @@ -148,7 +142,8 @@ public class VAALocation implements Serializable, ISerializableObject { } /** - * @param latitude the latitude to set + * @param latitude + * the latitude to set */ public void setLatitude(double latitude) { this.latitude = latitude; @@ -162,7 +157,8 @@ public class VAALocation implements Serializable, ISerializableObject { } /** - * @param longitude the longitude to set + * @param longitude + * the longitude to set */ public void setLongitude(double longitude) { this.longitude = longitude; @@ -176,7 +172,8 @@ public class VAALocation implements Serializable, ISerializableObject { } /** - * @param index the index to set + * @param index + * the index to set */ public void setIndex(Integer index) { this.index = index; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java index b3d62641c8..39da6ebbf4 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java @@ -33,14 +33,9 @@ import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; 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 com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.geospatial.ISpatialEnabled; @@ -50,7 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.vividsolutions.jts.geom.Geometry; /** - * + * Record for Volcanic Ash Advisory * *
* @@ -64,8 +59,8 @@ import com.vividsolutions.jts.geom.Geometry; * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * Aug 30, 2013 2298 rjpeter Make getPluginName abstract - * * PluginDataObject. + * Oct 22, 2013 2361 njensen Remove XML annotations * ** @@ -82,8 +77,6 @@ import com.vividsolutions.jts.geom.Geometry; */ @org.hibernate.annotations.Table(appliesTo = "vaa", indexes = { @Index(name = "vaa_refTimeIndex", columnNames = { "refTime", "forecastTime" }) }) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class VAARecord extends PluginDataObject implements ISpatialEnabled { @@ -91,7 +84,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { @Embedded @DataURI(position = 1, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; @@ -100,7 +92,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { */ @Column(length = 8) @DataURI(position = 2) - @XmlElement @DynamicSerializeElement private String recordType; @@ -109,19 +100,16 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { */ @Column(length = 16) @DataURI(position = 3) - @XmlElement @DynamicSerializeElement private String advisoryNumber; // Correction indicator from wmo header @DataURI(position = 4) @Column(length = 8) - @XmlElement @DynamicSerializeElement private String corIndicator; @Column(length = 32) - @XmlElement @DynamicSerializeElement private String centerId; @@ -129,7 +117,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { * */ @Column(length = 2048) - @XmlElement @DynamicSerializeElement private String message; @@ -137,7 +124,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { * */ @Column(length = 512) - @XmlElement @DynamicSerializeElement private String anal00Hr; @@ -145,7 +131,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { * */ @Column(length = 512) - @XmlElement @DynamicSerializeElement private String fcst06Hr; @@ -153,7 +138,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { * */ @Column(length = 512) - @XmlElement @DynamicSerializeElement private String fcst12Hr; @@ -161,18 +145,15 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { * */ @Column(length = 512) - @XmlElement @DynamicSerializeElement private String fcst18Hr; // Text of the WMO header @Column(length = 64) - @XmlElement @DynamicSerializeElement private String wmoHeader = ""; @DynamicSerializeElement - @XmlElement @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId", fetch = FetchType.EAGER) private Set
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 17, 2009 jkorman Initial creation - * + * Oct 22, 2013 2361 njensen Remove XML annotations + * *- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ @Entity -@Table(name="vaa_subpart") -@XmlAccessorType(XmlAccessType.NONE) +@Table(name = "vaa_subpart") @DynamicSerialize -public class VAASubPart implements Serializable, ISerializableObject { +public class VAASubPart implements Serializable { private static final long serialVersionUID = 1L; - + @Id @GeneratedValue private Integer recordId = null; - // The record this object belongs to + // The record this object belongs to @ManyToOne - @JoinColumn(name="parentId", nullable=false) + @JoinColumn(name = "parentId", nullable = false) private VAARecord parentId; - + @Column(length = 32) - @XmlElement @DynamicSerializeElement - private String subText; - + private String subText; + /** - * Shape of ash area - * "LINE" : - * "AREA" - * + * Shape of ash area "LINE" : "AREA" + * */ @Column(length = 8) - @XmlElement @DynamicSerializeElement - private String shapeType; - - /** + private String shapeType; + + /** * Vertex locations */ @DynamicSerializeElement - @XmlElement @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId", fetch = FetchType.EAGER) private Set
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * --/--/---- Initial creation + * 10/22/2013 2361 njensen Use JAXBManager for XML + * + *+ * + * + */ @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "configuration") -public class DialogConfiguration implements ISerializableObject { +public class DialogConfiguration { + + private static final SingleTypeJAXBManager
* @@ -60,6 +62,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; * So, do not add the returned value of getFeAreaField() * to areaFields. * Jan 9, 2013 15600 Qinglu Lin Execute "timezones = myTimeZones;" even if timezones != null. + * Oct 22, 2013 2361 njensen Use JAXBManager for XML * ** @@ -68,6 +71,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; */ public class GeospatialFactory { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GeospatialFactory.class); @@ -77,6 +81,9 @@ public class GeospatialFactory { private static GeospatialData[] timezones; + private static SingleTypeJAXBManager
* @@ -48,6 +48,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class GeospatialMetadata { + @XmlAttribute @DynamicSerializeElement private String areaSource; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTime.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTime.java index 6952176980..1a11dfb91e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTime.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTime.java @@ -25,7 +25,8 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; /** - * TODO Add Description + * Wrapper for GeospatialConfiguration representing last time a the geometry + * data was created for a warngen configuration * ** diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTimeSet.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTimeSet.java index d7bfe76a4d..3f86c2ffd0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTimeSet.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialTimeSet.java @@ -29,7 +29,8 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** - * TODO Add Description + * Collection of GeospatialTime representing a set of generated geospatial data + * for warngen configurations * ** diff --git a/edexOsgi/com.raytheon.uf.common.gridcoverage/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.gridcoverage/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 417b02f0b1..0000000000 --- a/edexOsgi/com.raytheon.uf.common.gridcoverage/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,5 +0,0 @@ -com.raytheon.uf.common.gridcoverage.LatLonGridCoverage -com.raytheon.uf.common.gridcoverage.MercatorGridCoverage -com.raytheon.uf.common.gridcoverage.PolarStereoGridCoverage -com.raytheon.uf.common.gridcoverage.LambertConformalGridCoverage -com.raytheon.uf.common.gridcoverage.StereographicGridCoverage \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index dc4d446881..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,2 +0,0 @@ -com.raytheon.uf.edex.plugin.mesowest.common.MESOWestRecord -com.raytheon.uf.edex.plugin.mesowest.MESOWestFilter \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestFilter.java b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestFilter.java index 8f4bf1979e..e3c0f8d9db 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestFilter.java @@ -24,10 +24,6 @@ import static com.raytheon.uf.common.localization.LocalizationContext.Localizati import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; import java.util.List; import javax.xml.bind.JAXBContext; @@ -45,14 +41,15 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.JAXBManager; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractFilterElement; import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractObsFilter; +import com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter; import com.raytheon.uf.edex.decodertools.core.filterimpl.RectFilterElement; /** - * + * A filter for mesowest data that is configured through XML. * ** @@ -61,6 +58,8 @@ import com.raytheon.uf.edex.decodertools.core.filterimpl.RectFilterElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 23, 2009 jkorman Initial creation + * Oct 22, 2013 2361 njensen Use JAXBManager for XML + * * ** @@ -88,22 +87,14 @@ public class MESOWestFilter extends AbstractObsFilter { File siteDir = manager.getFile(siteContext, ""); if (siteDir.exists()) { - File srcFile = new File(siteDir, FILTER_CONFIG); - - byte[] data = new byte[(int) srcFile.length()]; - - InputStream stream = getInputStream(srcFile); try { - stream.read(data); - stream.close(); - - AbstractObsFilter filter = (AbstractObsFilter) SerializationUtil - .unmarshalFromXml(new String(data)); - - setFilterElements(filter.getFilterElements()); - setFilterName(filter.getFilterName()); - } catch (IOException e) { - logger.error("Unable to read filter config", e); + File srcFile = new File(siteDir, FILTER_CONFIG); + JAXBManager jaxb = new JAXBManager(MESOWestFilter.class, + PluginDataObjectFilter.class); + AbstractObsFilter filter = jaxb.unmarshalFromXmlFile( + AbstractObsFilter.class, srcFile); + this.setFilterElements(filter.getFilterElements()); + this.setFilterName(filter.getFilterName()); } catch (JAXBException e) { logger.error("Unable to unmarshall filter config", e); } @@ -218,20 +209,4 @@ public class MESOWestFilter extends AbstractObsFilter { } } - /** - * - * @param file - * @return - */ - private static FileInputStream getInputStream(File file) { - FileInputStream fis = null; - - try { - fis = new FileInputStream(file); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - return fis; - } - } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java index 04a4dfc50b..83bef6ec7f 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java @@ -39,11 +39,6 @@ import javax.persistence.Entity; import javax.persistence.SequenceGenerator; import javax.persistence.Table; 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 com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; @@ -55,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.vividsolutions.jts.geom.Geometry; /** - * + * Record for mesowest data * ** @@ -68,6 +63,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Oct 22, 2013 2361 njensen Remove XML annotations * ** @@ -77,8 +73,6 @@ import com.vividsolutions.jts.geom.Geometry; @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "mesowestseq") @Table(name = "mesowest", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class MESOWestRecord extends PluginDataObject implements ISpatialEnabled, IDecoderGettable { @@ -117,152 +111,127 @@ public class MESOWestRecord extends PluginDataObject implements } @DataURI(position = 1) - @XmlElement @DynamicSerializeElement private String networkType; // Time of the observation. @DataURI(position = 2) - @XmlAttribute @DynamicSerializeElement private Calendar timeObs; @Embedded @DataURI(position = 3, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; // Observation air temperature in degrees Kelvin. @Column @DynamicSerializeElement - @XmlElement private Double temp; // Observation dewpoint temperature in degrees Kelvin. @Column @DynamicSerializeElement - @XmlElement private Double dwpt; // 24 Hour maximum temperature in degrees Kelvin. @Column @DynamicSerializeElement - @XmlElement private Double maxT24; // 24 Hour minimum temperature in degrees Kelvin. @Column @DynamicSerializeElement - @XmlElement private Double minT24; // Relative Humidity in percent. @Column @DynamicSerializeElement - @XmlElement private Double humidity; // Observation wind direction in angular degrees. Integer @Column @DynamicSerializeElement - @XmlElement private Double windDirection; // Observation wind speed in meters per second. @Column @DynamicSerializeElement - @XmlElement private Double windSpeed; // Observation wind gust in meters per second. @Column @DynamicSerializeElement - @XmlElement private Double windGust; // Observation pressure in Pa. @Column @DynamicSerializeElement - @XmlElement private Double pressure; // Observation pressure in Pa. @Column @DynamicSerializeElement - @XmlElement private Double seaLevelPressure; // Observation pressure in Pa. @Column @DynamicSerializeElement - @XmlElement private Double altimeter; // Observation precip in mm. @Column @DynamicSerializeElement - @XmlElement private Double precip; // 1 minute precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_01M; // 5 minute precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_05M; // 10 minute precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_10M; // 15 minute precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_15M; // 30 minute precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_30M; // 1 hour precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_01H; // 3 hour precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_03H; // 6 hour precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_06H; // 24 hour precip in inches. @Column @DynamicSerializeElement - @XmlElement private Double precip_24H; // Raw observation text @Column @DynamicSerializeElement - @XmlElement private String obsText; /**