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 jaxb = SingleTypeJAXBManager + .createWithoutException(GeospatialTimeSet.class); + public static void generateUniqueGeospatialMetadataGeometries() { String mySite = SiteUtil.getSite(); DialogConfiguration dialogConfig = null; @@ -394,23 +401,27 @@ public class GeospatialDataGenerator { // clip against County Warning Area if (!areaSource.equalsIgnoreCase(WarningConstants.MARINE)) { String cwaSource = "cwa"; - List cwaAreaFields = new ArrayList(Arrays.asList("wfo", "gid")); + List cwaAreaFields = new ArrayList(Arrays.asList( + "wfo", "gid")); HashMap cwaMap = new HashMap( 2); cwaMap.put("wfo", new RequestConstraint(site, ConstraintType.LIKE)); - SpatialQueryResult[] cwaFeatures = SpatialQueryFactory.create().query( - cwaSource, cwaAreaFields.toArray(new String[cwaAreaFields.size()]), - null, cwaMap, SearchMode.WITHIN); + SpatialQueryResult[] cwaFeatures = SpatialQueryFactory.create() + .query(cwaSource, + cwaAreaFields.toArray(new String[cwaAreaFields + .size()]), null, cwaMap, SearchMode.WITHIN); Geometry multiPolygon = null; Geometry clippedGeom = null; for (int i = 0; i < features.length; i++) { multiPolygon = null; for (int j = 0; j < cwaFeatures.length; j++) { - clippedGeom = features[i].geometry.intersection(cwaFeatures[j].geometry); + clippedGeom = features[i].geometry + .intersection(cwaFeatures[j].geometry); if (clippedGeom instanceof GeometryCollection) { - GeometryCollection gc = (GeometryCollection)clippedGeom; + GeometryCollection gc = (GeometryCollection) clippedGeom; if (multiPolygon != null) - multiPolygon = multiPolygon.union(convertToMultiPolygon(gc)); + multiPolygon = multiPolygon + .union(convertToMultiPolygon(gc)); else multiPolygon = convertToMultiPolygon(gc); } @@ -440,7 +451,8 @@ public class GeospatialDataGenerator { /** * Convert a GeometryCollection to a MultiPolygon. - * @param gc + * + * @param gc */ private static MultiPolygon convertToMultiPolygon(GeometryCollection gc) { GeometryCollectionIterator iter = new GeometryCollectionIterator(gc); @@ -451,11 +463,11 @@ public class GeospatialDataGenerator { Object o = iter.next(); if (o instanceof MultiPolygon) { if (mp == null) - mp = (MultiPolygon)o; + mp = (MultiPolygon) o; else - mp = (MultiPolygon)mp.union((MultiPolygon)o); + mp = (MultiPolygon) mp.union((MultiPolygon) o); } else if (o instanceof Polygon) { - polygons.add((Polygon)o); + polygons.add((Polygon) o); } else if (o instanceof LineString || o instanceof Point) { LinearRing lr = null; Coordinate[] coords = null; @@ -463,12 +475,12 @@ public class GeospatialDataGenerator { Coordinate[] cs = ((LineString) o).getCoordinates(); if (cs.length < 4) { coords = new Coordinate[4]; - for (int j = 0; j< cs.length; j++) + for (int j = 0; j < cs.length; j++) coords[j] = new Coordinate(cs[j]); for (int j = cs.length; j < 4; j++) - coords[j] = new Coordinate(cs[3-j]); + coords[j] = new Coordinate(cs[3 - j]); } else { - coords = new Coordinate[cs.length+1]; + coords = new Coordinate[cs.length + 1]; for (int j = 0; j < cs.length; j++) coords[j] = new Coordinate(cs[j]); coords[cs.length] = new Coordinate(cs[0]); @@ -476,14 +488,15 @@ public class GeospatialDataGenerator { } else { coords = new Coordinate[4]; for (int i = 0; i < 4; i++) - coords[i] = ((Point)o).getCoordinate(); + coords[i] = ((Point) o).getCoordinate(); } - lr = (((Geometry)o).getFactory()).createLinearRing(coords); + lr = (((Geometry) o).getFactory()).createLinearRing(coords); Polygon poly = (new GeometryFactory()).createPolygon(lr, null); - polygons.add((Polygon)poly); + polygons.add((Polygon) poly); } else { statusHandler.handle(Priority.WARN, - "Unprocessed Geometry object: " + o.getClass().getName()); + "Unprocessed Geometry object: " + + o.getClass().getName()); } } if (mp == null && polygons.size() == 0) @@ -491,7 +504,8 @@ public class GeospatialDataGenerator { if (polygons.size() > 0) { Polygon[] p = polygons.toArray(new Polygon[0]); if (mp != null) - mp = (MultiPolygon)mp.union(new MultiPolygon(p, gc.getFactory())); + mp = (MultiPolygon) mp.union(new MultiPolygon(p, gc + .getFactory())); else mp = new MultiPolygon(p, gc.getFactory()); } @@ -560,7 +574,7 @@ public class GeospatialDataGenerator { .query(timezonePathcastTable, new String[] { timezonePathcastField }, hull, null, false, SearchMode.INTERSECTS); - + rval = new GeospatialData[timeZoneResults.length]; for (int i = 0; i < timeZoneResults.length; i++) { SpatialQueryResult result = timeZoneResults[i]; @@ -569,7 +583,7 @@ public class GeospatialDataGenerator { data.attributes = result.attributes; rval[i] = data; } - + // set time zone and area field if (timeZoneResults.length == 1) { SpatialQueryResult tz = timeZoneResults[0]; @@ -651,7 +665,7 @@ public class GeospatialDataGenerator { GeospatialTimeSet set = new GeospatialTimeSet(); set.setData(new ArrayList(times.values())); - String xml = SerializationUtil.marshalToXml(set); + String xml = jaxb.marshalToXml(set); lf = pathMgr.getLocalizationFile(context, GeospatialFactory.METADATA_FILE); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 1aeec0c629..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,3 +0,0 @@ -com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingRecord -com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingLayer -com.raytheon.uf.common.dataplugin.acarssounding.tools.Airports \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingLayer.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingLayer.java index 524c0121f4..cc6b7e7fce 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingLayer.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingLayer.java @@ -30,22 +30,17 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -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 com.raytheon.uf.common.geospatial.ISpatialEnabled; import com.raytheon.uf.common.geospatial.ISpatialObject; import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Point; /** - * TODO Add Description + * Layer for an ACARS Sounding * *
  * 
@@ -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 LOCATION_UNIT = NonSI.DEGREE_ANGLE; - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - } - // Time of the observation. @Column @DataURI(position = 1, embedded = true) @DynamicSerializeElement - @XmlAttribute private Calendar timeObs; @Embedded @DataURI(position = 2, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; @Column(length = 32) @DynamicSerializeElement - @XmlElement private String tailNumber; // Flight phase (A[scending] D[escending]) @Column(length = 1) @DynamicSerializeElement - @XmlElement private String phase = null; // oldest observation time in this sounding @Column @DynamicSerializeElement - @XmlElement private Long oldestTime = Long.MAX_VALUE; // newest observation time in this sounding @Column @DynamicSerializeElement - @XmlElement private Long newestTime = Long.MIN_VALUE; // The level data for this observation. @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", fetch = FetchType.EAGER) - @XmlElement @DynamicSerializeElement private Set levels; @@ -345,42 +323,6 @@ public class ACARSSoundingRecord extends PluginDataObject implements } } - /** - * This class does not implement IDecoderGettable so return null. - * - * @return Always null for this class. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public Amount getValue(String pName) { - Amount a = null; - if ("NLAT".equals(pName)) { - a = new Amount(getLatitude(), LOCATION_UNIT); - } else if ("NLON".equals(pName)) { - a = new Amount(getLongitude(), LOCATION_UNIT); - } - return a; - } - - @Override - public Collection getValues(String paramName) { - return null; - } - - @Override - public String getString(String paramName) { - return null; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airports.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airports.java index f90531526d..b988a11b11 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airports.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airports.java @@ -32,13 +32,11 @@ import javax.xml.bind.annotation.XmlRootElement; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.uf.common.serialization.ISerializableObject; -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.edex.decodertools.core.LatLonPoint; /** - * TODO Add Description + * Container for a list of airports read from an XML file * *
  * 
@@ -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 jaxb = new SingleTypeJAXBManager( + Airports.class); + airports = jaxb.unmarshalFromXmlFile(filePath + File.separator + + fileName); logger.info(String.format("%4d airports read from config.", airports.getAirport().size())); - } catch (SerializationException e) { + } catch (Exception e) { logger.error("Error unmarshaling airports ", e); } airports.createMapping(); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 4a7fc5d8ae..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java index 4f649f7b34..645dad3fa0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java @@ -29,14 +29,9 @@ import javax.persistence.SequenceGenerator; 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.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.dataplugin.binlightning.impl.LightningStrikePoint; @@ -83,6 +78,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Oct 22, 2013 2361 njensen Removed XML annotations * * * @@ -98,9 +94,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; */ @org.hibernate.annotations.Table(appliesTo = BinLightningRecord.PLUGIN_NAME, indexes = { @Index(name = "binlightning_refTimeIndex", columnNames = { "refTime", "forecastTime" }) }) -@XmlRootElement @DynamicSerialize -@XmlAccessorType(XmlAccessType.NONE) public class BinLightningRecord extends PersistablePluginDataObject implements IPersistable { @@ -151,20 +145,17 @@ public class BinLightningRecord extends PersistablePluginDataObject implements @DataURI(position = 1) @Column @DynamicSerializeElement - @XmlAttribute private Calendar startTime; // Persisted value - Latest strike time in the collection. @DataURI(position = 2) @Column @DynamicSerializeElement - @XmlAttribute private Calendar stopTime; // JJG - source of lightning data @Column(length = 5) @DataURI(position = 3) - @XmlAttribute @DynamicSerializeElement private String lightSource; @@ -448,17 +439,6 @@ public class BinLightningRecord extends PersistablePluginDataObject implements this.lightSource = lightSource; } - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. Null for this - * class. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - /** * Sets the data arrays from the store. * diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index eeda105da7..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.uf.common.dataplugin.bufrhdw.BufrHDWObs \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 04aaf6ed76..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,2 +0,0 @@ -com.raytheon.uf.common.dataplugin.bufrua.UAObs -com.raytheon.uf.common.dataplugin.bufrua.UAObsLevel diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java index afc74a7de2..09c4ef931e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java @@ -20,21 +20,10 @@ package com.raytheon.uf.common.dataplugin.bufrua; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.HashMap; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.measure.quantity.Angle; -import javax.measure.quantity.Length; -import javax.measure.quantity.Temperature; -import javax.measure.quantity.Velocity; -import javax.measure.unit.NonSI; -import javax.measure.unit.SI; -import javax.measure.unit.Unit; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column; @@ -44,15 +33,9 @@ import javax.persistence.SequenceGenerator; 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 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.dataplugin.persist.IPersistable; @@ -63,7 +46,6 @@ import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; import com.vividsolutions.jts.geom.Geometry; /** @@ -95,6 +77,7 @@ import com.vividsolutions.jts.geom.Geometry; * Jul 19, 2013 1992 bsteffen Remove redundant time columns from * bufrua. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Oct 22, 2013 2361 njensen Remove XML annotations and IDecoderGettable * * * @@ -110,11 +93,9 @@ import com.vividsolutions.jts.geom.Geometry; */ @org.hibernate.annotations.Table(appliesTo = UAObs.PLUGIN_NAME, indexes = { @Index(name = "bufrua_refTimeIndex", columnNames = { "refTime", "forecastTime" }) }) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class UAObs extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IPointData, IPersistable { private static final long serialVersionUID = 1L; @@ -139,33 +120,6 @@ public class UAObs extends PersistablePluginDataObject implements public static final String PLUGIN_NAME = "bufrua"; - public static final Unit DISTANCE_UNIT = SI.METER; - - public static final Unit TEMPERATURE_UNIT = SI.KELVIN; - - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("GH", UA_GEOHGT); - PARM_MAP.put("Px", UA_PRESSURE); - - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("DpT", SFC_DWPT); - - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - } - - public static final String UA_PARAM_PTRN = ".*:PRESS=\\d{2,4}"; - // Non persisted value. Hold the last requested parameter name. @Transient private String parameterName = null; @@ -177,20 +131,17 @@ public class UAObs extends PersistablePluginDataObject implements // The observation report type. @DataURI(position = 1) @Column - @XmlAttribute @DynamicSerializeElement private Integer reportType; @Embedded @DataURI(position = 4, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; // Correction indicator from wmo header @DataURI(position = 2) @Column - @XmlAttribute @DynamicSerializeElement private String corIndicator; @@ -201,48 +152,40 @@ public class UAObs extends PersistablePluginDataObject implements // Text of the WMO header @DataURI(position = 3) @Column - @XmlAttribute @DynamicSerializeElement private String wmoHeader; // Station pressure in Pascals. @Column - @XmlAttribute @DynamicSerializeElement private Integer pressure_station; // The total cloud cover in 1/8s coverage. @Column - @XmlAttribute @DynamicSerializeElement private Integer totalCloudCover; // The platform directio in angular degrees. @Column - @XmlAttribute @DynamicSerializeElement private Integer platformDirection; // The platform movement in meters per second. @Column - @XmlAttribute @DynamicSerializeElement private Double platformMovement; // ICAO of station if known. @Column - @XmlAttribute @DynamicSerializeElement private String stationName; // The level data for this observation. @Transient - @XmlElement @DynamicSerializeElement private List levels; @Column(insertable = false, updatable = false) - @XmlAttribute @DynamicSerializeElement private Integer idx; @@ -543,16 +486,6 @@ public class UAObs extends PersistablePluginDataObject implements identifier = dataURI; } - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } - /** * */ @@ -569,203 +502,6 @@ public class UAObs extends PersistablePluginDataObject implements this.pointDataView = pointDataView; } - /** - * 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. The - * parameter name may include level information for these observation data. - * The format for parameter is: - * - *
-     *    "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 getValues(String paramName) { - return null; - } - - /** - * Determine if the parameter is a level request, and parse out the pressure - * level and parameter name if so. - * - * @param parameter - * The parameter string to parse. - * @return This is a level parameter. - */ - private boolean parseParameter(String parameter) { - boolean goodParse = false; - Pattern p = Pattern.compile(UA_PARAM_PTRN); - Matcher m = p.matcher(parameter); - if (m.find()) { - int start = parameter.indexOf(":PRESS="); - if (start > 0) { - parameterName = parameter.substring(0, start); - start += ":PRESS=".length(); - levelId = Integer.parseInt(parameter.substring(start)); - } - goodParse = true; - } - return goodParse; - } - - /** - * Get a specified pressure level data if it exists. If the specified level - * is below the declared surface pressure a null reference is returned. - * - * @param level - * A pressure level to get. - * @return The requested level, if found, null reference if not. - */ - private UAObsLevel getLevel(Integer level) { - UAObsLevel retValue = null; - if (level != null) { - level = level * 100; - for (UAObsLevel l : levels) { - if (IDecoderConstants.MANPRE_LEVEL.equals(l.getVertSig()) - || IDecoderConstants.SIGPRE_LEVEL - .equals(l.getVertSig())) { - - if (level.equals(l.getPressure())) { - retValue = l; - break; - } - } - } - } - if (retValue != null) { - UAObsLevel sfc = getSurfaceLevel(); - if (sfc != null) { - if (LayerTools.isLowerThan(sfc, retValue)) { - retValue = null; - } - } - } - return retValue; - } - - /** - * Get the defined surface level. If a surface level cannot be found, then - * return null. - * - * @return The surface level found, or null. - */ - private UAObsLevel getSurfaceLevel() { - UAObsLevel retValue = null; - if (levels != null) { - for (UAObsLevel level : levels) { - if (IDecoderConstants.SFC_LEVEL.equals(level.getVertSig())) { - retValue = level; - break; - } - } - } - return retValue; - } - - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } - @Override public SurfaceObsLocation getSpatialObject() { return location; @@ -850,7 +586,6 @@ public class UAObs extends PersistablePluginDataObject implements return wmoHeader; } - @Override @Column @Access(AccessType.PROPERTY) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsLevel.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsLevel.java index 2c2fbf5945..533e285222 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsLevel.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsLevel.java @@ -21,11 +21,6 @@ package com.raytheon.uf.common.dataplugin.bufrua; import java.io.Serializable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; - -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -42,14 +37,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * ------------ ---------- ----------- -------------------------- * 20071127 382 jkorman Initial Coding. * 20080630 1215 jkorman Implemented Serializable. + * 20131022 2361 njensen Remove XML annotations * * * @author jkorman * @version 1.0 */ -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class UAObsLevel implements Serializable, ISerializableObject { +public class UAObsLevel implements Serializable { private static final long serialVersionUID = 1L; @@ -63,50 +58,41 @@ public class UAObsLevel implements Serializable, ISerializableObject { // 5 Significant level, temperature and/or relative humidity // 6 Significant level, wind // All 7 Missing value - @XmlAttribute @DynamicSerializeElement private Integer vertSig = null; // Observation pressure in Pascals - @XmlAttribute @DynamicSerializeElement private Integer pressure = null; // Observation geopotential height in meters. - @XmlAttribute @DynamicSerializeElement private Integer geoHeight = null; // Observation dry air temperature in degrees Kelvin. - @XmlAttribute @DynamicSerializeElement private Double temp = null; // Observation dewpoint temperature in degrees Kelvin. - @XmlAttribute @DynamicSerializeElement private Double dwpt = null; // Observation wind direction in angular degrees. Integer - @XmlAttribute @DynamicSerializeElement private Integer windDirection = null; // Observation wind speed in meters per second. // Decimal(5,2) - @XmlAttribute @DynamicSerializeElement private Double windSpeed = null; // Observation 1 KM below level wind shear in meters per second. // Decimal(5,2) - @XmlAttribute @DynamicSerializeElement private Double loShear = null; // Observation 1 KM above level wind shear in meters per second. // Decimal(5,2) - @XmlAttribute @DynamicSerializeElement private Double hiShear = null; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index f61426db78..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,9 +0,0 @@ -com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData -com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID -com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord -com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation -com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo -com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID -com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmStorageInfo -com.raytheon.uf.common.dataplugin.gfe.server.lock.Lock -com.raytheon.uf.common.dataplugin.gfe.GridDataHistory \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.java index e9c51e89da..2d0b1203b0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.java @@ -27,11 +27,6 @@ import javax.persistence.Embeddable; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Transient; -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.adapters.XmlJavaTypeAdapter; import org.geotools.coverage.grid.GeneralGridEnvelope; import org.geotools.coverage.grid.GridGeometry2D; @@ -44,9 +39,6 @@ import org.opengis.referencing.datum.PixelInCell; import org.opengis.referencing.operation.MathTransform; import com.raytheon.uf.common.geospatial.MapUtil; -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.adapters.CoordAdapter; -import com.raytheon.uf.common.serialization.adapters.PointAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -65,6 +57,7 @@ import com.vividsolutions.jts.geom.Coordinate; * 04/24/13 #1935 randerso Fixed date line spanning issue * 08/06/13 #1571 randerso Added hibernate annotations * Removed constructor with int for ProjectionType + * 10/22/13 #2361 njensen Remove XML annotations * * * @@ -72,9 +65,8 @@ import com.vividsolutions.jts.geom.Coordinate; * @version 1.0 */ @Embeddable -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class ProjectionData implements ISerializableObject { +public class ProjectionData { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(ProjectionData.class); @@ -101,68 +93,51 @@ public class ProjectionData implements ISerializableObject { }; @Column(length = 32, nullable = false) - @XmlAttribute @DynamicSerializeElement private String projectionID; @Column(length = 20, nullable = false) @Enumerated(EnumType.STRING) - @XmlAttribute @DynamicSerializeElement private ProjectionType projectionType; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = CoordAdapter.class) @DynamicSerializeElement private Coordinate latLonLL; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = CoordAdapter.class) @DynamicSerializeElement private Coordinate latLonUR; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = CoordAdapter.class) @DynamicSerializeElement private Coordinate latLonOrigin; @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement private double stdParallelOne; @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement private double stdParallelTwo; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = PointAdapter.class) @DynamicSerializeElement private Point gridPointLL; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = PointAdapter.class) @DynamicSerializeElement private Point gridPointUR; @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement private double latIntersect; @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement private double lonCenter; @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement private double lonOrigin; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.java index c62feb51ed..f55048c570 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.java @@ -36,11 +36,6 @@ import javax.persistence.SequenceGenerator; 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.adapters.XmlJavaTypeAdapter; import jep.INumpyable; @@ -73,9 +68,6 @@ import com.raytheon.uf.common.geospatial.CRSCache; import com.raytheon.uf.common.geospatial.IGridGeometryProvider; import com.raytheon.uf.common.geospatial.ISpatialObject; import com.raytheon.uf.common.geospatial.MapUtil; -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.adapters.CoordAdapter; -import com.raytheon.uf.common.serialization.adapters.GeometryAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -106,6 +98,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; * 08/06/13 #1571 randerso Added hibernate annotations, javadoc cleanup, * made init method public for use in GFEDao * 09/30/13 #2333 mschenke Added method to construct from {@link IGridGeometryProvider} + * 10/22/13 #2361 njensen Remove XML annotations * * * @@ -115,10 +108,9 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; */ @Entity @Table(name = "gfe_gridlocation", uniqueConstraints = { @UniqueConstraint(columnNames = { "dbId_id" }) }) -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class GridLocation extends PersistableDataObject implements - ISpatialObject, ISerializableObject { + ISpatialObject { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GridLocation.class); @@ -177,24 +169,20 @@ public class GridLocation extends PersistableDataObject implements private DatabaseID dbId; @Column(length = 8, nullable = false) - @XmlAttribute @DynamicSerializeElement private String siteId; /** Number of points along the x-axis */ @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement protected Integer nx; /** Number of points along the y-axis */ @Column(nullable = false) - @XmlAttribute @DynamicSerializeElement protected Integer ny; @Column(length = 32, nullable = false) - @XmlAttribute @DynamicSerializeElement private String timeZone; @@ -202,30 +190,22 @@ public class GridLocation extends PersistableDataObject implements private Coordinate gridCellSize; @Embedded - @XmlElement @DynamicSerializeElement private ProjectionData projection; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = CoordAdapter.class) @DynamicSerializeElement private Coordinate origin; @Column(nullable = false) - @XmlElement - @XmlJavaTypeAdapter(value = CoordAdapter.class) @DynamicSerializeElement private Coordinate extent; @Transient - @XmlElement - @XmlJavaTypeAdapter(value = GeometryAdapter.class) @DynamicSerializeElement private Polygon geometry; @Transient - @XmlElement @DynamicSerializeElement private String crsWKT; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.java index 43f3fd00c3..b5452b72ac 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.java @@ -45,7 +45,6 @@ import org.hibernate.annotations.OnDeleteAction; import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType; import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -67,6 +66,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * added isValid method to match A1 * 04/02/2013 #1774 randerso Improved error message in validCheck * 08/06/13 #1571 randerso Added hibernate annotations, javadoc cleanup + * 10/22/2013 #2361 njensen Remove ISerializableObject * * * @@ -76,9 +76,11 @@ import com.raytheon.uf.common.status.UFStatus.Priority; @Embeddable @DynamicSerialize -public class GridParmInfo implements Cloneable, ISerializableObject { +public class GridParmInfo implements Cloneable { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GridParmInfo.class); + static { // TODO: is this the right place for these? diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmStorageInfo.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmStorageInfo.java index 193da9a784..8fc4a079f9 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmStorageInfo.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmStorageInfo.java @@ -31,8 +31,6 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.UniqueConstraint; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * Derived class that consolidates storage info for a Parm. * @@ -44,6 +42,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * 08/05/2013 #1571 randerso Moved to com.raytheon.uf.common.dataplugin * Added GridParmInfo as a field. * Added hibernate annotations + * 10/22/2013 #2361 njensen Remove ISerializableObject * * * @@ -53,7 +52,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; @Entity @Table(name = "gfe_parminfo", uniqueConstraints = { @UniqueConstraint(columnNames = { "parmId_id" }) }) -public class ParmStorageInfo implements ISerializableObject { +public class ParmStorageInfo { /** * Auto-generated surrogate key diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.java index 9b984825d8..9e1387efcb 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.java @@ -27,7 +27,6 @@ import javax.persistence.Column; import javax.persistence.Embeddable; import com.raytheon.uf.common.dataplugin.gfe.serialize.TimeConstraintsAdapter; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; @@ -47,6 +46,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * 03/20/2013 #1774 randerso Added isValid method, use TimeUtil constants, * added serialization adapter, removed setters. * 08/06/13 #1571 randerso Added hibernate annotations, javadoc cleanup + * 10/22/2013 #2361 njensen Remove ISerializableObject * * * @@ -57,7 +57,8 @@ import com.raytheon.uf.common.time.util.TimeUtil; @Embeddable @DynamicSerialize @DynamicSerializeTypeAdapter(factory = TimeConstraintsAdapter.class) -public class TimeConstraints implements ISerializableObject { +public class TimeConstraints { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(TimeConstraints.class); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index efef19c8b4..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,2 +0,0 @@ -com.raytheon.uf.common.dataplugin.goessounding.GOESSounding -com.raytheon.uf.common.dataplugin.goessounding.GOESSoundingLevel \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSoundingLevel.java b/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSoundingLevel.java index d184e87a61..0e68c26727 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSoundingLevel.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSoundingLevel.java @@ -22,11 +22,7 @@ package com.raytheon.uf.common.dataplugin.goessounding; import java.io.Serializable; import javax.persistence.Column; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -37,7 +33,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080414 1077 jkorman Initial implementation. + * 20080414 1077 jkorman Initial implementation.' + * 20132022 2361 njensen Remove XML annotations * * * @@ -45,28 +42,23 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -@XmlAccessorType(XmlAccessType.NONE) -public class GOESSoundingLevel implements Serializable, ISerializableObject { +public class GOESSoundingLevel implements Serializable { private static final long serialVersionUID = 1L; @Column - @XmlAttribute @DynamicSerializeElement private Integer pressure; @Column - @XmlAttribute @DynamicSerializeElement private Double temperature; @Column - @XmlAttribute @DynamicSerializeElement private Double dewpoint; @Column - @XmlAttribute @DynamicSerializeElement private Integer height; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 23a813ba5d..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,2 +0,0 @@ -com.raytheon.uf.common.dataplugin.poessounding.POESSounding -com.raytheon.uf.common.dataplugin.poessounding.POESSoundingLevel \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSoundingLevel.java b/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSoundingLevel.java index 9e6fd7031c..e33f2dd8e1 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSoundingLevel.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSoundingLevel.java @@ -21,11 +21,6 @@ package com.raytheon.uf.common.dataplugin.poessounding; import java.io.Serializable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; - -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -37,6 +32,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080303 1026 jkorman Initial implementation. + * 20131022 2361 njensen Remove XML annotations * * * @@ -44,20 +40,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @DynamicSerialize -@XmlAccessorType(XmlAccessType.NONE) -public class POESSoundingLevel implements Serializable, ISerializableObject { +public class POESSoundingLevel implements Serializable { private static final long serialVersionUID = 1L; - @XmlAttribute @DynamicSerializeElement private Integer pressure; - @XmlAttribute @DynamicSerializeElement private Double temperature; - @XmlAttribute @DynamicSerializeElement private Double mixingRatio; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 3ba4da8d0c..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.uf.common.dataplugin.tcs.TropicalCycloneSummary \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java index 89ae09e699..8d5816ff6e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java @@ -31,14 +31,9 @@ import javax.persistence.SequenceGenerator; 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.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.dataplugin.persist.PersistablePluginDataObject; @@ -65,6 +60,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 * * * @@ -80,8 +76,6 @@ import com.vividsolutions.jts.geom.Geometry; */ @org.hibernate.annotations.Table(appliesTo = "tcs", indexes = { @Index(name = "tcs_refTimeIndex", columnNames = { "refTime", "forecastTime" }) }) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class TropicalCycloneSummary extends PersistablePluginDataObject implements ISpatialEnabled, IPointData { @@ -94,11 +88,9 @@ public class TropicalCycloneSummary extends PersistablePluginDataObject // Text of the WMO header @Transient - @XmlElement @DynamicSerializeElement private String wmoHeader = ""; - @XmlElement @DynamicSerializeElement @Column @DataURI(position = 1) @@ -106,36 +98,29 @@ public class TropicalCycloneSummary extends PersistablePluginDataObject @Embedded @DataURI(position = 2, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; - @XmlElement @DynamicSerializeElement @Transient protected String name; - @XmlElement @DynamicSerializeElement @Transient private boolean tropical; - @XmlElement @DynamicSerializeElement @Transient private String displayTime; - @XmlElement @DynamicSerializeElement @Transient private int pressure; - @XmlElement @DynamicSerializeElement @Transient protected int windSpeed; - @XmlElement @DynamicSerializeElement @Transient protected ArrayList radiusList; @@ -199,11 +184,6 @@ public class TropicalCycloneSummary extends PersistablePluginDataObject identifier = dataURI; } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - @Override public SurfaceObsLocation getSpatialObject() { return location; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 6c10e4593a..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,3 +0,0 @@ -com.raytheon.uf.common.dataplugin.vaa.VAARecord -com.raytheon.uf.common.dataplugin.vaa.VAASubPart -com.raytheon.uf.common.dataplugin.vaa.VAALocation \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAALocation.java b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAALocation.java index f773da1e6a..2dd1df4aab 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAALocation.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAALocation.java @@ -28,64 +28,56 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * TODO Add Description + * Location for a VAARecord * *
- *
+ * 
  * 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 subParts = new HashSet(); @@ -236,11 +217,6 @@ public class VAARecord extends PluginDataObject implements ISpatialEnabled { this.wmoHeader = wmoHeader; } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - @Override public SurfaceObsLocation getSpatialObject() { return location; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAASubPart.java b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAASubPart.java index 316e355e72..a023c8b509 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAASubPart.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAASubPart.java @@ -33,72 +33,62 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * TODO Add Description + * SubPart of a VAARecord * *
- *
+ * 
  * 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 locations = new HashSet(); - /** * @return the parentID */ @@ -107,7 +97,8 @@ public class VAASubPart implements Serializable, ISerializableObject { } /** - * @param parentID the parentID to set + * @param parentID + * the parentID to set */ public void setParentId(VAARecord parentID) { this.parentId = parentID; @@ -115,21 +106,22 @@ public class VAASubPart implements Serializable, ISerializableObject { /** * 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 - */ + /** + * Set the record id. + * + * @param record + */ public void setRecordId(Integer recordId) { this.recordId = recordId; } - + /** * @return the subText */ @@ -138,7 +130,8 @@ public class VAASubPart implements Serializable, ISerializableObject { } /** - * @param subText the subText to set + * @param subText + * the subText to set */ public void setSubText(String subText) { this.subText = subText; @@ -152,17 +145,18 @@ public class VAASubPart implements Serializable, ISerializableObject { } /** - * @param shapeType the shapeType to set + * @param shapeType + * the shapeType to set */ public void setShapeType(String shapeType) { this.shapeType = shapeType; } public void addVertex(double lat, double lon, int index) { - if(locations == null) { + if (locations == null) { locations = new HashSet(); } - locations.add(new VAALocation(lat,lon,index,this)); + locations.add(new VAALocation(lat, lon, index, this)); } /** @@ -173,10 +167,11 @@ public class VAASubPart implements Serializable, ISerializableObject { } /** - * @param locations the locations to set + * @param locations + * the locations to set */ public void setLocations(Set locations) { - for(VAALocation loc : locations) { + for (VAALocation loc : locations) { loc.setParentId(this); } this.locations = locations; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 04a1422726..0000000000 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,8 +0,0 @@ -com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord -com.raytheon.uf.common.dataplugin.warning.WarningRecord -com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord -com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration -com.raytheon.uf.common.dataplugin.warning.config.DialogConfiguration -com.raytheon.uf.common.dataplugin.warning.gis.GeospatialMetadata -com.raytheon.uf.common.dataplugin.warning.gis.GeospatialTime -com.raytheon.uf.common.dataplugin.warning.gis.GeospatialTimeSet \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java index 5b42c2e530..e0d2d4826e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/DialogConfiguration.java @@ -10,12 +10,33 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.dataplugin.warning.util.FileUtil; -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; + +/** + * + * Configuration for warngen dialog + * + *
+ * 
+ *    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 jaxb = SingleTypeJAXBManager + .createWithoutException(DialogConfiguration.class); + @XmlElement private String warngenOfficeShort; @@ -39,14 +60,14 @@ public class DialogConfiguration implements ISerializableObject { @XmlElement private long followupListRefeshDelay; - + @XmlElement private GridSpacing gridSpacing; public static DialogConfiguration loadDialogConfig(String localSite) throws FileNotFoundException, IOException, JAXBException { String xml = FileUtil.open("config.xml", localSite); - return (DialogConfiguration) SerializationUtil.unmarshalFromXml(xml); + return (DialogConfiguration) jaxb.unmarshalFromXml(xml); } public String getWarngenOfficeShort() { @@ -120,5 +141,5 @@ public class DialogConfiguration implements ISerializableObject { public void setGridSpacing(GridSpacing gridSpacing) { this.gridSpacing = gridSpacing; } - + } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java index 948179a85f..e85909ace0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/config/WarngenConfiguration.java @@ -41,8 +41,7 @@ import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType; import com.raytheon.uf.common.dataplugin.warning.util.FileUtil; -import com.raytheon.uf.common.serialization.ISerializableObject; -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; @@ -60,6 +59,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Aug 26, 2008 #1502 bclement Added JAXB annotations * May 26, 2010 #4649 Qinglu Lin Made including TO.A and SV.A mandatory * Apr 24, 2013 1943 jsanchez Marked areaConfig as Deprecated. + * Oct 22, 2013 2361 njensen Removed ISerializableObject * * * @@ -68,11 +68,15 @@ import com.raytheon.uf.common.status.UFStatus.Priority; */ @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "warngenConfig") -public class WarngenConfiguration implements ISerializableObject { +public class WarngenConfiguration { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(WarngenConfiguration.class); - private static Pattern p = Pattern + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(WarngenConfiguration.class); + + private static final Pattern p = Pattern .compile("<\\s{0,}include\\s{1,}file\\s{0,}=\\s{0,}\"(.*)\"\\s{0,}/>"); @XmlElement @@ -178,7 +182,7 @@ public class WarngenConfiguration implements ISerializableObject { + " in template " + templateName, e); } - config = (WarngenConfiguration) SerializationUtil.unmarshalFromXml(xml); + config = (WarngenConfiguration) jaxb.unmarshalFromXml(xml); // Sets the lists of bullets and dam bullets if (config.getBulletActionGroups() != null) { @@ -204,7 +208,8 @@ public class WarngenConfiguration implements ISerializableObject { } // AreaConfiguration is deprecated. This is only meant for backwards - // compatibility while areaConfig is phased out with updated templates from the template team. + // compatibility while areaConfig is phased out with updated templates + // from the template team. if (config.getAreaConfig() != null) { ArrayList areaSources = null; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java index 14833b4abc..b1cd80e182 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java @@ -38,6 +38,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.serialization.comm.RequestRouter; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -45,7 +46,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; /** - * TODO Add Description + * Retrieves geospatial data from disk if present, otherwise forwards request to + * maps database * *
  * 
@@ -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 jaxb = SingleTypeJAXBManager + .createWithoutException(GeospatialTimeSet.class); + public static GeospatialData[] getGeoSpatialList(String site, GeospatialMetadata metaData) throws SpatialException { Map lastRunTimeMap = loadLastRunGeoTimeSet(site); @@ -171,9 +178,7 @@ public class GeospatialFactory { METADATA_FILE); if (lf.exists()) { try { - rval = ((GeospatialTimeSet) SerializationUtil - .jaxbUnmarshalFromInputStream(lf.openInputStream())) - .getDataAsMap(); + rval = jaxb.unmarshalFromXmlFile(lf.getFile()).getDataAsMap(); } catch (Exception e) { statusHandler .handle(Priority.WARN, @@ -248,8 +253,8 @@ public class GeospatialFactory { if (lf.exists()) { byte[] data = lf.read(); - return (GeospatialDataSet) SerializationUtil - .transformFromThrift(data); + return SerializationUtil.transformFromThrift( + GeospatialDataSet.class, data); } else { System.out.println("Attempted to load: " + lf.getName() + " for site " + site + ", but file does not exist."); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialMetadata.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialMetadata.java index 36aecb10cf..364006ba1e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialMetadata.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialMetadata.java @@ -30,7 +30,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * TODO Add Description + * Geospatial data for a warngen configuration * *
  * 
@@ -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; /**