diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java index 539f1f4b02..255356c1a8 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java @@ -26,7 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.xml.bind.JAXBException; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -84,7 +83,8 @@ public class CombinationsFileUtil { public static String SAVED_COMBO_DIR = FileUtil.join("gfe", "comboData"); - private static final SingleTypeJAXBManager jaxb = initializeJAXB(); + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(ComboData.class); @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @@ -124,23 +124,6 @@ public class CombinationsFileUtil { } } - /** - * Initializes the JAXB manager for reading/writing ComboData to/from XML. - * - * @return the JAXBManager - */ - private static SingleTypeJAXBManager initializeJAXB() { - SingleTypeJAXBManager retVal = null; - try { - retVal = new SingleTypeJAXBManager(ComboData.class); - } catch (JAXBException e) { - statusHandler - .error("Error initializing ComboData JAXBManager, combinations files will not work", - e); - } - return retVal; - } - /** * Gets the saved combo files for the menus in text formatter * diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/reference/ReferenceData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/reference/ReferenceData.java index bde0659a05..29eb447a5e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/reference/ReferenceData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/reference/ReferenceData.java @@ -22,7 +22,6 @@ package com.raytheon.uf.common.dataplugin.gfe.reference; import java.util.ArrayList; import java.util.List; -import javax.xml.bind.JAXBException; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -86,7 +85,8 @@ public class ReferenceData { private static final GeometryFactory geometryFactory = new GeometryFactory(); - private static final SingleTypeJAXBManager jaxb = initializeJAXB(); + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(ReferenceData.class); public enum RefType { NONE, QUERY, POLYGON, QUERY_POLYGON @@ -112,25 +112,6 @@ public class ReferenceData { private CoordinateType coordType; - /** - * Initializes the JAXB manager for reading/writing ReferenceData to/from - * XML. - * - * @return the JAXBManager - */ - private static SingleTypeJAXBManager initializeJAXB() { - SingleTypeJAXBManager retVal = null; - try { - retVal = new SingleTypeJAXBManager( - ReferenceData.class); - } catch (JAXBException e) { - statusHandler - .error("Error initializing ReferenceData JAXBManager, edit areas will not work", - e); - } - return retVal; - } - /** * Returns the JAXBManager that handles ReferenceData * diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/sample/SampleData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/sample/SampleData.java index 84c5cdc5a8..9c727ebd0b 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/sample/SampleData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/sample/SampleData.java @@ -25,7 +25,6 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.xml.bind.JAXBException; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -35,8 +34,6 @@ import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.serialization.adapters.CoordAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.MultiPoint; @@ -69,10 +66,8 @@ public class SampleData implements Cloneable { private static final String LINE_STRING_COORDINATE_PATTERN = "\\s*(-?\\d+(?:\\.\\d+)?)\\s+(-?\\d+(?:\\.\\d+)?)\\s*"; - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(SampleData.class); - - private static final SingleTypeJAXBManager jaxb = initializeJAXB(); + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(SampleData.class); private SampleId sampleId; @@ -80,23 +75,6 @@ public class SampleData implements Cloneable { @DynamicSerializeElement private List points; - /** - * Initializes the JAXB manager for reading/writing SampleData to/from XML. - * - * @return the JAXBManager - */ - private static SingleTypeJAXBManager initializeJAXB() { - SingleTypeJAXBManager retVal = null; - try { - retVal = new SingleTypeJAXBManager(SampleData.class); - } catch (JAXBException e) { - statusHandler - .error("Error initializing SampleData JAXBManager, sample sets will not work", - e); - } - return retVal; - } - /** * Returns the JAXBManager that handles SampleData * diff --git a/edexOsgi/com.raytheon.uf.common.monitor.cpg/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.monitor.cpg/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 8048338c9a..0000000000 --- a/edexOsgi/com.raytheon.uf.common.monitor.cpg/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.uf.common.monitor.cpg.MonitorStateXML \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.monitor.cpg/src/com/raytheon/uf/common/monitor/cpg/MonitorStateConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor.cpg/src/com/raytheon/uf/common/monitor/cpg/MonitorStateConfigurationManager.java index 17c02f719c..1c86fcc523 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor.cpg/src/com/raytheon/uf/common/monitor/cpg/MonitorStateConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor.cpg/src/com/raytheon/uf/common/monitor/cpg/MonitorStateConfigurationManager.java @@ -23,12 +23,11 @@ import java.io.File; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; -import com.raytheon.uf.common.monitor.cpg.MonitorStateXML; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; /** * Monitor State Configuration XML File Manager. @@ -39,6 +38,7 @@ import com.raytheon.uf.common.monitor.cpg.MonitorStateXML; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 05, 2009 dhladky Initial creation + * Oct 01, 2013 2361 njensen Use JAXBManager for XML * * * @@ -47,23 +47,28 @@ import com.raytheon.uf.common.monitor.cpg.MonitorStateXML; */ public class MonitorStateConfigurationManager { + + /** Path to Monitoring Area Configuration XML. */ + private static final String CONFIG_FILE_NAME = "monitoring" + + File.separatorChar + "MonitorPluginState.xml"; + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(MonitorStateXML.class); + /** Singleton instance of this class */ private static MonitorStateConfigurationManager instance = null; - /** Path to Monitoring Area Configuration XML. */ - private static final String CONFIG_FILE_NAME = "monitoring" + File.separatorChar + "MonitorPluginState.xml"; - /** * Monitoring State Configuration XML object. */ private MonitorStateXML configXml; - + /* Private Constructor */ private MonitorStateConfigurationManager() { configXml = new MonitorStateXML(); readConfigXml(); } - + /** * Get an instance of this singleton. * @@ -73,10 +78,10 @@ public class MonitorStateConfigurationManager { if (instance == null) { instance = new MonitorStateConfigurationManager(); } - + return instance; } - + /** * Save the XML configuration data to the current XML file name. */ @@ -99,29 +104,28 @@ public class MonitorStateConfigurationManager { try { System.out.println("Saving -- " + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); } catch (Exception e) { e.printStackTrace(); } - + readConfigXml(); } - + /** * Read the XML configuration data for the current XML file name. */ public void readConfigXml() { try { IPathManager pm = PathManagerFactory.getPathManager(); - LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC, - LocalizationLevel.BASE); + LocalizationContext lc = pm.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.BASE); File file = pm.getFile(lc, CONFIG_FILE_NAME); - System.out.println("Reading -- " - + file.getAbsolutePath()); - MonitorStateXML configXmltmp = (MonitorStateXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(file.getAbsolutePath()); + System.out.println("Reading -- " + file.getAbsolutePath()); + MonitorStateXML configXmltmp = jaxb.unmarshalFromXmlFile(file + .getAbsolutePath()); configXml = configXmltmp; } catch (Exception e) { @@ -129,69 +133,76 @@ public class MonitorStateConfigurationManager { System.err.println("No configuration file found"); } } - + /** * FFMP state + * * @return */ public boolean getFFMPState() { return configXml.isFfmp(); } - + /** * CWAT state + * * @return */ public boolean getCWATState() { return configXml.isCwat(); } - + /** * VIL state + * * @return */ public boolean getVILState() { return configXml.isVil(); } - + /** * QPF state + * * @return */ public boolean getQPFState() { return configXml.isQpf(); } - + /** * Fog state + * * @return */ public boolean getFogState() { return configXml.isFog(); } - + /** * Fog state + * * @return */ public boolean getPrecipRateState() { return configXml.isPrecipRate(); } - + /** * Fog state + * * @return */ public boolean getScanState() { return configXml.isScan(); } - + /** * Fog state + * * @return */ - public boolean getFSSState(){ + public boolean getFSSState() { return configXml.isFssobs(); } } - diff --git a/edexOsgi/com.raytheon.uf.common.monitor/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.monitor/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index ee67c34759..0000000000 --- a/edexOsgi/com.raytheon.uf.common.monitor/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,42 +0,0 @@ -com.raytheon.uf.common.monitor.scan.LightningReport -com.raytheon.uf.common.monitor.scan.LightningStrike -com.raytheon.uf.common.monitor.scan.ThreatReport -com.raytheon.uf.common.monitor.scan.VILReport -com.raytheon.uf.common.monitor.scan.ThreatLocation -com.raytheon.uf.common.monitor.xml.MonAreaConfigXML -com.raytheon.uf.common.monitor.xml.AreaIdXML -com.raytheon.uf.common.monitor.xml.StationIdXML -com.raytheon.uf.common.monitor.xml.FFMPTemplateXML -com.raytheon.uf.common.monitor.xml.FFMPSourceConfigXML -com.raytheon.uf.common.monitor.xml.SourceXML -com.raytheon.uf.common.monitor.xml.FFMPRunConfigXML -com.raytheon.uf.common.monitor.xml.VGBXML -com.raytheon.uf.common.monitor.xml.DomainXML -com.raytheon.uf.common.monitor.xml.FFMPRunXML -com.raytheon.uf.common.monitor.xml.ProductXML -com.raytheon.uf.common.monitor.xml.ProductRunXML -com.raytheon.uf.common.monitor.xml.FFFGDataXML -com.raytheon.uf.common.monitor.xml.FFFGSourceXML -com.raytheon.uf.common.monitor.xml.FFFGSourceItemXML -com.raytheon.uf.common.monitor.xml.FFTIDataXML -com.raytheon.uf.common.monitor.xml.FreezingLevelXML -com.raytheon.uf.common.monitor.xml.FreezingLevelEntry -com.raytheon.uf.common.monitor.scan.xml.SCANConfigCellXML -com.raytheon.uf.common.monitor.scan.xml.SCANConfigMesoXML -com.raytheon.uf.common.monitor.scan.xml.SCANConfigTvsXML -com.raytheon.uf.common.monitor.scan.xml.SCANConfigDmdXML -com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML -com.raytheon.uf.common.monitor.scan.xml.SCANMonitorConfigXML -com.raytheon.uf.common.monitor.scan.xml.SCANTrendSetsXML -com.raytheon.uf.common.monitor.scan.xml.SCANTrendSetXML -com.raytheon.uf.common.monitor.scan.xml.CWATLocationsXML -com.raytheon.uf.common.monitor.scan.xml.ScanAlarmXML -com.raytheon.uf.common.monitor.xml.SCANModelParameterXML -com.raytheon.uf.common.monitor.xml.SCANSiteRunConfigXML -com.raytheon.uf.common.monitor.xml.SCANSiteXML -com.raytheon.uf.common.monitor.xml.SourceIngestConfigXML -com.raytheon.uf.common.monitor.xml.SourceOverrideDataKeyXML -com.raytheon.uf.common.monitor.xml.SourceOverrideParamXML -com.raytheon.uf.common.monitor.xml.SourceOverrideXML - - diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/CWATLocationConfigManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/CWATLocationConfigManager.java index 9e38f1edb0..c5788ae308 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/CWATLocationConfigManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/CWATLocationConfigManager.java @@ -1,4 +1,5 @@ package com.raytheon.uf.common.monitor.config; + /** * This software was developed and / or modified by Raytheon Company, * pursuant to Contract DG133W-05-CQ-1067 with the US Government. @@ -26,44 +27,61 @@ import org.opengis.referencing.crs.ProjectedCRS; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.ScanUtils; import com.raytheon.uf.common.monitor.scan.ThreatLocation; import com.raytheon.uf.common.monitor.scan.xml.CWATLocationsXML; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.vividsolutions.jts.geom.Coordinate; - +/** + * Manages the configurations for CWAT locations + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * --/--/----                          Initial creation
+ * Oct 02, 2013 2361       njensen     Use JAXBManager for XML
+ * 
+ * 
+ * + * @author lvenable + * @version 1.0 + */ public class CWATLocationConfigManager { - - + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(CWATLocationsXML.class); + /** * FFMP Source Configuration XML object. */ protected CWATLocationsXML configXml; - + /** * Site coordinate */ public Coordinate siteCoor = null; - + /** * Site Name */ public String siteName = null; - + /** * Site CRS */ public ProjectedCRS crs = null; - /** Singleton instance of this class */ private static CWATLocationConfigManager instance = null; - + /* Private Constructor */ private CWATLocationConfigManager() { configXml = new CWATLocationsXML(); @@ -81,15 +99,19 @@ public class CWATLocationConfigManager { return instance; } + /** - * Read the XML configuration data for the current XML file name with coordinate + * Read the XML configuration data for the current XML file name with + * coordinate */ - public void readConfigXml(Coordinate siteCoor, String siteName, ProjectedCRS crs) { + public void readConfigXml(Coordinate siteCoor, String siteName, + ProjectedCRS crs) { this.siteCoor = siteCoor; this.siteName = siteName; this.crs = crs; readConfigXml(); } + /** * Read the XML configuration data for the current XML file name. */ @@ -98,18 +120,20 @@ public class CWATLocationConfigManager { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext lc = pm.getContext( LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); - File file = pm.getFile(lc, "cwat" + File.separatorChar + getSiteName() + "Locations.xml"); + File file = pm.getFile(lc, "cwat" + File.separatorChar + + getSiteName() + "Locations.xml"); System.out.println("Reading -- " + file.getAbsolutePath()); - - CWATLocationsXML configXmltmp = (CWATLocationsXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(file.getAbsolutePath()); - + + CWATLocationsXML configXmltmp = jaxb.unmarshalFromXmlFile(file + .getAbsolutePath()); + configXml = configXmltmp; - + } catch (Exception e) { System.err.println("No CWAT locations file found"); // create a new one - ArrayList locations = ScanUtils.getCWASites(getSiteCoor(), getCRS()); + ArrayList locations = ScanUtils.getCWASites( + getSiteCoor(), getCRS()); configXml = new CWATLocationsXML(); configXml.setThreats(locations); // writes one to site @@ -125,28 +149,27 @@ public class CWATLocationConfigManager { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); - LocalizationFile newXmlFile = pm.getLocalizationFile(lc, - "cwat" + File.separatorChar + getSiteName() + "Locations.xml"); + LocalizationFile newXmlFile = pm.getLocalizationFile(lc, "cwat" + + File.separatorChar + getSiteName() + "Locations.xml"); if (newXmlFile.getFile().getParentFile().exists() == false) { - //System.out.println("Creating new directory"); + // System.out.println("Creating new directory"); if (newXmlFile.getFile().getParentFile().mkdirs() == false) { - //System.out.println("Could not create new directory..."); + // System.out.println("Could not create new directory..."); } } try { System.out.println("Saving -- " + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); } catch (Exception e) { e.printStackTrace(); } } - public Coordinate getSiteCoor() { return siteCoor; @@ -155,7 +178,7 @@ public class CWATLocationConfigManager { public void setSiteCoor(Coordinate siteCoor) { this.siteCoor = siteCoor; } - + public String getSiteName() { return siteName; } @@ -163,7 +186,7 @@ public class CWATLocationConfigManager { public void setSiteCoor(String siteName) { this.siteName = siteName; } - + public ProjectedCRS getCRS() { return crs; } @@ -174,6 +197,7 @@ public class CWATLocationConfigManager { /** * Get the list of threat locations + * * @return */ public ArrayList getLocations() { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFFGXmlMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFFGXmlMgr.java index 37b9253961..11faa51b0d 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFFGXmlMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFFGXmlMgr.java @@ -30,7 +30,7 @@ import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.xml.FFFGDataXML; import com.raytheon.uf.common.monitor.xml.FFFGSourceItemXML; import com.raytheon.uf.common.monitor.xml.FFFGSourceXML; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; /** * @@ -42,7 +42,8 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Mar 10, 2010 #4517 lvenable Initial creation + * Mar 10, 2010 #4517 lvenable Initial creation + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -50,6 +51,10 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * @version 1.0 */ public class FFFGXmlMgr { + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(FFFGDataXML.class); + /** * Data XML. */ @@ -151,8 +156,7 @@ public class FFFGXmlMgr { .getAbsolutePath(); // System.out.println("*** reading XML path = " + path); - dataXML = (FFFGDataXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(path); + dataXML = jaxb.unmarshalFromXmlFile(path); setForcingConfigured(); } catch (Exception e) { // e.printStackTrace(); @@ -196,8 +200,7 @@ public class FFFGXmlMgr { try { System.out.println("--- Saving XML path = " + locFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(dataXML, locFile.getFile() - .getAbsolutePath()); + jaxb.marshalToXmlFile(dataXML, locFile.getFile().getAbsolutePath()); locFile.save(); } catch (Exception e) { e.printStackTrace(); diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPRunConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPRunConfigurationManager.java index 8fea0656f9..c328065ef1 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPRunConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPRunConfigurationManager.java @@ -41,12 +41,11 @@ import com.raytheon.uf.common.monitor.xml.ProductRunXML; import com.raytheon.uf.common.monitor.xml.SourceOverrideXML; import com.raytheon.uf.common.monitor.xml.SourceXML; 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; - /** * FFMPRunConfigurationManager * @@ -58,6 +57,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * 2012-09-04 DR 14404 gzhang Fixing ConcurrentModificationException * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. * Aug 13, 2013 1742 dhladky Concurrent mod exception on update fixed + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -67,8 +67,13 @@ public class FFMPRunConfigurationManager implements ILocalizationFileObserver { /** Path to FFMP Source config. */ private static final String CONFIG_FILE_NAME = "ffmp" - + IPathManager.SEPARATOR - + "FFMPRunConfig.xml"; + + IPathManager.SEPARATOR + "FFMPRunConfig.xml"; + + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(FFMPRunConfigurationManager.class); + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(FFMPRunConfigXML.class); /** * FFMP Run Configuration XML object. @@ -78,12 +83,9 @@ public class FFMPRunConfigurationManager implements ILocalizationFileObserver { protected boolean isPopulated; private LocalizationFile lf = null; - - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(FFMPRunConfigurationManager.class); - + private CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); - + /** Singleton instance of this class */ private static FFMPRunConfigurationManager instance = new FFMPRunConfigurationManager(); @@ -146,7 +148,7 @@ public class FFMPRunConfigurationManager implements ILocalizationFileObserver { FFMPRunConfigXML configXmltmp = null; - configXmltmp = SerializationUtil.jaxbUnmarshalFromXmlFile(FFMPRunConfigXML.class, file.getAbsolutePath()); + configXmltmp = jaxb.unmarshalFromXmlFile(file.getAbsolutePath()); configXml = configXmltmp; isPopulated = true; @@ -176,14 +178,14 @@ public class FFMPRunConfigurationManager implements ILocalizationFileObserver { try { // System.out.println("Saving -- " // + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); lf = newXmlFile; } catch (Exception e) { - statusHandler - .handle(Priority.ERROR, "Couldn't save config file.", e); + statusHandler.handle(Priority.ERROR, "Couldn't save config file.", + e); } } @@ -282,10 +284,8 @@ public class FFMPRunConfigurationManager implements ILocalizationFileObserver { } } catch (SerializationException e) { - statusHandler.handle( - Priority.WARN, - "FFMPRunConfigurationManager: " - + message.getFileName() + statusHandler.handle(Priority.WARN, + "FFMPRunConfigurationManager: " + message.getFileName() + " couldn't be updated.", e); } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPSourceConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPSourceConfigurationManager.java index 20e3e107cc..7b156c764c 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPSourceConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPSourceConfigurationManager.java @@ -38,7 +38,7 @@ import com.raytheon.uf.common.monitor.xml.FFMPSourceConfigXML; import com.raytheon.uf.common.monitor.xml.ProductXML; import com.raytheon.uf.common.monitor.xml.SourceXML; 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; @@ -54,6 +54,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * 2012-09-04 DR 14404 gzhang Fixing ConcurrentModificationException * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. * Aug 18, 2013 1742 dhladky Concurrent mod exception on update fixed + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -66,6 +67,16 @@ public class FFMPSourceConfigurationManager implements private static final String CONFIG_FILE_NAME = "ffmp" + IPathManager.SEPARATOR + "FFMPSourceConfig.xml"; + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(FFMPSourceConfigurationManager.class); + + // This needs to initialize before the instance since the constructor will + // makes use of JAXB. JVM spec 12.4.2 step 9 indicates this will + // initialize ahead of the instance since it is earlier in + // in the text source. + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(FFMPSourceConfigXML.class); + /** * FFMP Source Configuration XML object. */ @@ -85,12 +96,9 @@ public class FFMPSourceConfigurationManager implements private List accumulators = null; private LocalizationFile lf = null; - + private List listeners = new CopyOnWriteArrayList(); - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(FFMPSourceConfigurationManager.class); - /* Private Constructor */ private FFMPSourceConfigurationManager() { configXml = new FFMPSourceConfigXML(); @@ -127,8 +135,7 @@ public class FFMPSourceConfigurationManager implements lf.addFileUpdatedObserver(this); File file = lf.getFile(); - FFMPSourceConfigXML configXmltmp = SerializationUtil - .jaxbUnmarshalFromXmlFile(FFMPSourceConfigXML.class, file); + FFMPSourceConfigXML configXmltmp = jaxb.unmarshalFromXmlFile(file); configXml = configXmltmp; @@ -144,12 +151,10 @@ public class FFMPSourceConfigurationManager implements FFMPSourceConfigXML configXmltmp = null; try { - configXmltmp = SerializationUtil - .jaxbUnmarshalFromXmlFile(FFMPSourceConfigXML.class, - file); + configXmltmp = jaxb.unmarshalFromXmlFile(file); } catch (SerializationException e1) { statusHandler.handle(Priority.ERROR, - "Couldn't serialize file.", e1); + "Couldn't deserialize file.", e1); } configXml = configXmltmp; @@ -169,20 +174,19 @@ public class FFMPSourceConfigurationManager implements LocalizationFile newXmlFile = pm.getLocalizationFile(lc, CONFIG_FILE_NAME); File file = newXmlFile.getFile(); - + if (file.getParentFile().exists() == false) { file.getParentFile().mkdirs(); } - + try { - SerializationUtil.jaxbMarshalToXmlFile(configXml, - file.getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, file.getAbsolutePath()); newXmlFile.save(); lf = newXmlFile; lf.addFileUpdatedObserver(this); } catch (Exception e) { - statusHandler.handle(Priority.ERROR, - "Couldn't save config file.", e); + statusHandler.handle(Priority.ERROR, "Couldn't save config file.", + e); } } @@ -490,8 +494,10 @@ public class FFMPSourceConfigurationManager implements fl.configChanged(new MonitorConfigEvent(this)); } } catch (Exception e) { - statusHandler.handle(Priority.WARN, - "FFMPSourceConfigurationManager: " + message.getFileName() + statusHandler.handle( + Priority.WARN, + "FFMPSourceConfigurationManager: " + + message.getFileName() + " couldn't be updated.", e); } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPTemplateConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPTemplateConfigurationManager.java index e06c893c07..4f90df0533 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPTemplateConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFMPTemplateConfigurationManager.java @@ -35,7 +35,7 @@ import com.raytheon.uf.common.monitor.events.MonitorConfigEvent; import com.raytheon.uf.common.monitor.events.MonitorConfigListener; import com.raytheon.uf.common.monitor.xml.FFMPTemplateXML; import com.raytheon.uf.common.monitor.xml.VGBXML; -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; @@ -49,8 +49,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 12, 2009 lvenable Initial creation - * Oct 25, 2012 DR 15514 gzhang Adding getHucLevelsInArray() + * Oct 25, 2012 DR 15514 gzhang Adding getHucLevelsInArray() * Aug 18, 2013 1742 dhladky Concurrent mod exception on update fixed + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @author dhladky @@ -64,6 +65,9 @@ public class FFMPTemplateConfigurationManager implements private static final String CONFIG_FILE_NAME = "ffmp" + File.separatorChar + "FFMPTemplateConfig.xml"; + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(FFMPTemplateXML.class); + /** * FFMP Source Configuration XML object. */ @@ -77,10 +81,10 @@ public class FFMPTemplateConfigurationManager implements private LocalizationFile lf = null; private CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); - + private static final IUFStatusHandler statusHandler = UFStatus .getHandler(FFMPTemplateConfigurationManager.class); - + /* Private Constructor */ private FFMPTemplateConfigurationManager() { configXml = new FFMPTemplateXML(); @@ -126,9 +130,8 @@ public class FFMPTemplateConfigurationManager implements } File file = lf.getFile(); - FFMPTemplateXML configXmltmp = SerializationUtil - .jaxbUnmarshalFromXmlFile(FFMPTemplateXML.class, - file.getAbsolutePath()); + FFMPTemplateXML configXmltmp = jaxb.unmarshalFromXmlFile(file + .getAbsolutePath()); configXml = configXmltmp; } @@ -154,14 +157,14 @@ public class FFMPTemplateConfigurationManager implements try { // System.out.println("Saving -- " // + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); lf = newXmlFile; } catch (Exception e) { - statusHandler.handle(Priority.ERROR, - "Couldn't save config file.", e); + statusHandler.handle(Priority.ERROR, "Couldn't save config file.", + e); } } @@ -277,39 +280,40 @@ public class FFMPTemplateConfigurationManager implements /** * DR 15514: based on getHucLevels() */ - public String[] getHucLevelsInArray() { - - Integer hucNum = 4; - Boolean isVirtual = true; - String[] result = null; - java.util.concurrent.locks.ReentrantLock lock = new java.util.concurrent.locks.ReentrantLock(); - - synchronized(configXml){ - hucNum = getNumberOfHuc(); - isVirtual = getVirtual(); - } - - lock.lock(); - try{ - java.util.List list = new ArrayList(); - list.add("ALL"); - list.add("COUNTY"); - - if(isVirtual){ - list.add("VIRTUAL"); - } - - for (int i = hucNum - 1; i >= 0; i--){ - list.add("HUC"+i); - } - - result = list.toArray(new String[]{}); - - }finally{ - if(result==null) result = new String[]{};// guaranteed not null - lock.unlock(); - } - + public String[] getHucLevelsInArray() { + + Integer hucNum = 4; + Boolean isVirtual = true; + String[] result = null; + java.util.concurrent.locks.ReentrantLock lock = new java.util.concurrent.locks.ReentrantLock(); + + synchronized (configXml) { + hucNum = getNumberOfHuc(); + isVirtual = getVirtual(); + } + + lock.lock(); + try { + java.util.List list = new ArrayList(); + list.add("ALL"); + list.add("COUNTY"); + + if (isVirtual) { + list.add("VIRTUAL"); + } + + for (int i = hucNum - 1; i >= 0; i--) { + list.add("HUC" + i); + } + + result = list.toArray(new String[] {}); + + } finally { + if (result == null) + result = new String[] {};// guaranteed not null + lock.unlock(); + } + return result; } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFTIDataManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFTIDataManager.java index b912cdc334..a2e17e509c 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFTIDataManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/FFTIDataManager.java @@ -33,21 +33,46 @@ import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.xml.FFTIDataXML; import com.raytheon.uf.common.monitor.xml.FFTISettingXML; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; +/** + * Singleton data manager for FFTI. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * --/--/----                          Initial creation
+ * Oct 02, 2013 2361       njensen     Use JAXBManager for XML
+ * 
+ * 
+ * + * @author lvenable + * @version 1.0 + */ public class FFTIDataManager implements ILocalizationFileObserver { + /** Path to FFTI config. */ private static final String CONFIG_FILE_NAME = "ffmp" + File.separatorChar + "FFTIData.xml"; + // This needs to initialize before the instance since the constructor will + // makes use of JAXB. JVM spec 12.4.2 step 9 indicates this will + // initialize ahead of the instance since it is earlier in + // in the text source. + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(FFTIDataXML.class); + + /** Singleton instance of this class */ + private static FFTIDataManager instance = new FFTIDataManager(); + /** * FFTI Source Configuration XML object. */ protected FFTIDataXML configXml; - /** Singleton instance of this class */ - private static FFTIDataManager instance = new FFTIDataManager(); - private LocalizationFile lf = null; /* Private Constructor */ @@ -78,15 +103,13 @@ public class FFTIDataManager implements ILocalizationFileObserver { File file = lf.getFile(); - SerializationUtil.jaxbUnmarshalFromXmlFile(file.getAbsolutePath()); - FFTIDataXML configXmltmp = (FFTIDataXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(file.getAbsolutePath()); + FFTIDataXML configXmltmp = jaxb.unmarshalFromXmlFile(file + .getAbsolutePath()); configXml = configXmltmp; } catch (Exception e) { - System.err - .println("No SITE FFTI Source configuration file found."); + System.err.println("No SITE FFTI Source configuration file found."); } } @@ -112,8 +135,8 @@ public class FFTIDataManager implements ILocalizationFileObserver { try { // System.out.println("Saving -- " // + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); lf = newXmlFile; @@ -130,7 +153,7 @@ public class FFTIDataManager implements ILocalizationFileObserver { public void setCwaList(ArrayList cwaList) { this.configXml.getCwa().setCwaList(cwaList); } - + public void addCwa(String cwa) { this.configXml.getCwa().addCwa(cwa); } @@ -142,7 +165,7 @@ public class FFTIDataManager implements ILocalizationFileObserver { public ArrayList getSettingList() { return this.configXml.getSettingList(); } - + public void addSetting(FFTISettingXML setting) { this.configXml.addSetting(setting); } @@ -158,7 +181,7 @@ public class FFTIDataManager implements ILocalizationFileObserver { e.printStackTrace(); } } - + public void clear() { configXml = new FFTIDataXML(); } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/MonitorConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/MonitorConfigurationManager.java index 0063fbb5c7..39ff145627 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/MonitorConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/MonitorConfigurationManager.java @@ -35,7 +35,7 @@ import com.raytheon.uf.common.monitor.xml.AreaIdXML; import com.raytheon.uf.common.monitor.xml.AreaIdXML.ZoneType; import com.raytheon.uf.common.monitor.xml.MonAreaConfigXML; import com.raytheon.uf.common.monitor.xml.StationIdXML; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.site.SiteMap; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -54,6 +54,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Apr 29, 2011 DR#8986 zhao Read in Counties instead of Forecast Zones * Feb 21 2012 14413 zhao add code handling "adjacent areas" * Nov 20 2012 1297 skorolev Cleaned code + * Oct 02 2013 2361 njensen Use JAXBManager for XML * * * @@ -80,6 +81,9 @@ public abstract class MonitorConfigurationManager { */ public static final String MARINE_ZONE_TABLE = "mapdata.marinezones"; + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(MonAreaConfigXML.class); + /** * Monitoring Area Configuration XML object. */ @@ -131,8 +135,8 @@ public abstract class MonitorConfigurationManager { pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), filename) .getAbsolutePath(); - MonAreaConfigXML configXmltmp = (MonAreaConfigXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(monitorAreaFilePath.toString()); + MonAreaConfigXML configXmltmp = jaxb + .unmarshalFromXmlFile(monitorAreaFilePath.toString()); configXml = configXmltmp; } catch (Exception e) { statusHandler.handle(Priority.ERROR, @@ -147,8 +151,8 @@ public abstract class MonitorConfigurationManager { pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), adjAreaFilename) .getAbsolutePath(); - MonAreaConfigXML configXmltmp = (MonAreaConfigXML) SerializationUtil - .jaxbUnmarshalFromXmlFile(adjacentAreaFilePath.toString()); + MonAreaConfigXML configXmltmp = jaxb + .unmarshalFromXmlFile(adjacentAreaFilePath.toString()); adjAreaConfigXml = configXmltmp; } catch (Exception e) { statusHandler.handle(Priority.ERROR, @@ -249,8 +253,8 @@ public abstract class MonitorConfigurationManager { newXmlFile.getFile().getParentFile().mkdirs(); } try { - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); } catch (Exception e) { statusHandler.handle(Priority.ERROR, e.getMessage()); @@ -273,8 +277,8 @@ public abstract class MonitorConfigurationManager { newXmlFile.getFile().getParentFile().mkdirs(); } try { - SerializationUtil.jaxbMarshalToXmlFile(adjAreaConfigXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(adjAreaConfigXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); } catch (Exception e) { statusHandler.handle(Priority.ERROR, e.getMessage()); diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/SCANRunSiteConfigurationManager.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/SCANRunSiteConfigurationManager.java index 6e0ba62f10..fff6581f71 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/SCANRunSiteConfigurationManager.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/config/SCANRunSiteConfigurationManager.java @@ -20,7 +20,7 @@ import com.raytheon.uf.common.monitor.xml.SCANModelParameterXML; import com.raytheon.uf.common.monitor.xml.SCANSiteRunConfigXML; import com.raytheon.uf.common.monitor.xml.SCANSiteXML; 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; @@ -34,9 +34,10 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/07/2009 2037 dhladky Initial Creation. + * 02/07/2009 2037 dhladky Initial Creation. * 02/25/13 1660 dhladky Fixed configuration bug in scan. * Aug 13, 2013 1742 dhladky Concurrent mod exception on update fixed + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -44,25 +45,31 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * @version 1.0 */ - public class SCANRunSiteConfigurationManager implements ILocalizationFileObserver { /** Path to FFMP Source config. */ private static final String CONFIG_FILE_NAME = "scan" + File.separatorChar + "SCANRunSiteConfig.xml"; - + private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(SCANRunSiteConfigurationManager.class); + .getHandler(SCANRunSiteConfigurationManager.class); + + // This needs to initialize before the instance since the constructor will + // makes use of JAXB. JVM spec 12.4.2 step 9 indicates this will + // initialize ahead of the instance since it is earlier in + // in the text source. + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(SCANSiteRunConfigXML.class); + + /** Singleton instance of this class */ + private static SCANRunSiteConfigurationManager instance = new SCANRunSiteConfigurationManager(); /** * SCAN Configuration XML object. */ protected SCANSiteRunConfigXML configXml; - /** Singleton instance of this class */ - private static SCANRunSiteConfigurationManager instance = new SCANRunSiteConfigurationManager(); - private LocalizationFile lf = null; private List listeners = new CopyOnWriteArrayList(); @@ -76,7 +83,8 @@ public class SCANRunSiteConfigurationManager implements try { readConfigXml(); } catch (Exception e) { - statusHandler.handle(Priority.ERROR, "Can not read the SCAN configuration", e); + statusHandler.handle(Priority.ERROR, + "Can not read the SCAN configuration", e); } } @@ -103,19 +111,22 @@ public class SCANRunSiteConfigurationManager implements File file = lf.getFile(); // System.out.println("Reading -- " + file.getAbsolutePath()); if (!file.exists()) { - statusHandler.handle(Priority.WARN, "SCANRunSiteConfigurationManager: " + statusHandler.handle( + Priority.WARN, + "SCANRunSiteConfigurationManager: " + file.getAbsolutePath() + " does not exist."); try { createValidConfig(); } catch (Exception e) { - statusHandler.handle(Priority.ERROR,"SCANRunSiteConfigurationManager: Couldn't create valid runnable configuration"); + statusHandler + .handle(Priority.ERROR, + "SCANRunSiteConfigurationManager: Couldn't create valid runnable configuration"); } } SCANSiteRunConfigXML configXmltmp = null; - configXmltmp = SerializationUtil - .jaxbUnmarshalFromXmlFile(SCANSiteRunConfigXML.class, file.getAbsolutePath()); + configXmltmp = jaxb.unmarshalFromXmlFile(file.getAbsolutePath()); configXml = configXmltmp; isPopulated = true; @@ -152,15 +163,16 @@ public class SCANRunSiteConfigurationManager implements try { // System.out.println("Saving -- " // + newXmlFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(configXml, newXmlFile - .getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(configXml, newXmlFile.getFile() + .getAbsolutePath()); newXmlFile.save(); setPopulated(true); lf = newXmlFile; } catch (Exception e) { - statusHandler.handle(Priority.WARN, "SCANRunSiteConfigurationManager: " - + newXmlFile.getName() + " couldn't be saved.", e); + statusHandler.handle(Priority.WARN, + "SCANRunSiteConfigurationManager: " + newXmlFile.getName() + + " couldn't be saved.", e); } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/AdjacentWfoMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/AdjacentWfoMgr.java index 3be7f7f9a7..3efea1f02a 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/AdjacentWfoMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/AdjacentWfoMgr.java @@ -31,7 +31,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.MonitorAreaUtils; import com.raytheon.uf.common.monitor.scan.ScanUtils; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.site.xml.AdjacentWfoXML; import com.raytheon.uf.common.site.xml.CwaXML; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -50,6 +50,7 @@ import com.vividsolutions.jts.io.WKBReader; * ------------ ---------- ----------- -------------------------- * Dec 22, 2009 mpduff Initial creation * Jul 24, 2013 2219 mpduff Improve error handling. + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -58,9 +59,16 @@ import com.vividsolutions.jts.io.WKBReader; */ public class AdjacentWfoMgr { - private final IUFStatusHandler statusHandler = UFStatus + + /** Path to Adjacent WFO XML. */ + private static final String fileName = "allAdjacentWFOs.xml"; + + private static final IUFStatusHandler statusHandler = UFStatus .getHandler(AdjacentWfoMgr.class); + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(AdjacentWfoXML.class); + /** Configuration XML. */ private AdjacentWfoXML adjXML = null; @@ -70,9 +78,6 @@ public class AdjacentWfoMgr { private ArrayList idList = null; - /** Path to Adjacent WFO XML. */ - private static final String fileName = "allAdjacentWFOs.xml"; - /** Adjacent area geometry */ private Geometry geoAdjAreas = null; @@ -105,8 +110,7 @@ public class AdjacentWfoMgr { statusHandler.debug("**** path = " + path); - adjXML = SerializationUtil.jaxbUnmarshalFromXmlFile( - AdjacentWfoXML.class, path); + adjXML = jaxb.unmarshalFromXmlFile(path); ArrayList list = adjXML.getAreaIds(); for (CwaXML cx : list) { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningReport.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningReport.java index 64d1d09729..66e8bd54d0 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningReport.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningReport.java @@ -1,4 +1,5 @@ package com.raytheon.uf.common.monitor.scan; + /** * This software was developed and / or modified by Raytheon Company, * pursuant to Contract DG133W-05-CQ-1067 with the US Government. @@ -18,87 +19,100 @@ package com.raytheon.uf.common.monitor.scan; * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -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 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.Coordinate; -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) +/** + * A report of lightning + * + * + *
+ * SOFTWARE HISTORY
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * --/--/----                          Initial Creation
+ * Oct 02, 2013 2361       njensen     Removed XML annotations
+ * 
+ * + * + */ + @DynamicSerialize -public class LightningReport implements ISerializableObject { - - @XmlElement +public class LightningReport { + @DynamicSerializeElement - private int totalPosStrikes = 0; - @XmlElement + private int totalPosStrikes = 0; + @DynamicSerializeElement - private int totalCGStrikes = 0; - @XmlElement + private int totalCGStrikes = 0; + @DynamicSerializeElement - private int cgRate = 0; - @XmlElement + private int cgRate = 0; + @DynamicSerializeElement - private double percentPos = 0.0; - @XmlElement + private double percentPos = 0.0; + @DynamicSerializeElement - private double lat = 0.0; - @XmlElement + private double lat = 0.0; + @DynamicSerializeElement - private double lon = 0.0; - - public LightningReport() { - + private double lon = 0.0; + + public LightningReport() { + + } + + public LightningReport(Coordinate location) { + this.lat = location.y; + this.lon = location.x; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLat() { + return lat; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public double getLon() { + return lon; + } + + public int getTotalPosStrikes() { + return totalPosStrikes; + } + + public void setTotalPosStrikes(int totalPosStrikes) { + this.totalPosStrikes = totalPosStrikes; + } + + public int getTotalCGStrikes() { + return totalCGStrikes; + } + + public void setTotalCGStrikes(int totalCGStrikes) { + this.totalCGStrikes = totalCGStrikes; + } + + public int getCgRate() { + return cgRate; + } + + public void setCgRate(int cgRate) { + this.cgRate = cgRate; + } + + public double getPercentPos() { + return percentPos; + } + + public void setPercentPos(double percentPos) { + this.percentPos = percentPos; } - - public LightningReport(Coordinate location) { - this.lat = location.y; - this.lon = location.x; - } - - public void setLat(double lat) { - this.lat = lat; - } - - public double getLat() { - return lat; - } - - public void setLon(double lon) { - this.lon = lon; - } - - public double getLon() { - return lon; - } - - public int getTotalPosStrikes() { - return totalPosStrikes; - } - public void setTotalPosStrikes(int totalPosStrikes) { - this.totalPosStrikes = totalPosStrikes; - } - public int getTotalCGStrikes() { - return totalCGStrikes; - } - public void setTotalCGStrikes(int totalCGStrikes) { - this.totalCGStrikes = totalCGStrikes; - } - public int getCgRate() { - return cgRate; - } - public void setCgRate(int cgRate) { - this.cgRate = cgRate; - } - public double getPercentPos() { - return percentPos; - } - public void setPercentPos(double percentPos) { - this.percentPos = percentPos; - } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningStrike.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningStrike.java index 02ac0f8cdd..5d88bb05f7 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningStrike.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/LightningStrike.java @@ -19,12 +19,6 @@ **/ package com.raytheon.uf.common.monitor.scan; -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 com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -36,7 +30,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 05/12/2009 2307 dhladky Initial Creation. + * 05/12/2009 2307 dhladky Initial Creation. + * 10/02/2013 2361 njensen Removed XML annotations * * * @@ -44,138 +39,160 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class LightningStrike implements ISerializableObject { - - @XmlElement +public class LightningStrike { + @DynamicSerializeElement - public Double lat = 0.0; - @XmlElement + public Double lat = 0.0; + @DynamicSerializeElement - public Double lon = 0.0; - @XmlElement + public Double lon = 0.0; + @DynamicSerializeElement - public int intensity = 0; - @XmlElement + public int intensity = 0; + @DynamicSerializeElement - public int strikeType = 0; - @XmlElement + public int strikeType = 0; + @DynamicSerializeElement - public int msgType = 0; - @XmlElement + public int msgType = 0; + @DynamicSerializeElement - public int strikeCount = 0; - - /** - * Public lightning strike - * @param lat - * @param lon - * @param intensity - * @param strikeType - * @param msgType - * @param strikeCount - */ - public LightningStrike(Double lat, Double lon, int intensity, int strikeType, int msgType, int strikeCount) { - this.lat = lat; - this.lon = lon; - this.intensity = intensity; - this.strikeType = strikeType; - this.msgType = msgType; - this.strikeCount = strikeCount; - } - - /** - * Serializable - */ - public LightningStrike() { - + public int strikeCount = 0; + + /** + * Public lightning strike + * + * @param lat + * @param lon + * @param intensity + * @param strikeType + * @param msgType + * @param strikeCount + */ + public LightningStrike(Double lat, Double lon, int intensity, + int strikeType, int msgType, int strikeCount) { + this.lat = lat; + this.lon = lon; + this.intensity = intensity; + this.strikeType = strikeType; + this.msgType = msgType; + this.strikeCount = strikeCount; } - - /** - * Gets the lat - * @return - */ - public Double getLat() { - return lat; - } - /** - * sets the lat - * @param lat - */ - public void setLat(Double lat) { - this.lat = lat; - } - /** - * Gets the lon - * @return - */ - public Double getLon() { - return lon; - } - /** - * set the lon - * @param lon - */ - public void setLon(Double lon) { - this.lon = lon; - } - /** - * gets the intensity (polarity) of the strike - * @return - */ - public int getIntensity() { - return intensity; - } - /** - * Set the intensity (polarity) of strike - * @param intensity - */ - public void setIntensity(int intensity) { - this.intensity = intensity; - } - /** - * Get the type of strike - * @return - */ - public int getStrikeType() { - return strikeType; - } - /** - * Set the type of the strike - * @param strikeType - */ - public void setStrikeType(int strikeType) { - this.strikeType = strikeType; - } - /** - * get the type of the message - * @return - */ - public int getMsgType() { - return msgType; - } - /** - * Set the type of the message - * @param msgType - */ - public void setMsgType(int msgType) { - this.msgType = msgType; - } - /** - * Get the total strike count - * @return - */ - public int getStrikeCount() { - return strikeCount; - } - /** - * Set the total strike count - * @param strikeCount - */ - public void setStrikeCount(int strikeCount) { - this.strikeCount = strikeCount; - } - + + /** + * Serializable + */ + public LightningStrike() { + + } + + /** + * Gets the lat + * + * @return + */ + public Double getLat() { + return lat; + } + + /** + * sets the lat + * + * @param lat + */ + public void setLat(Double lat) { + this.lat = lat; + } + + /** + * Gets the lon + * + * @return + */ + public Double getLon() { + return lon; + } + + /** + * set the lon + * + * @param lon + */ + public void setLon(Double lon) { + this.lon = lon; + } + + /** + * gets the intensity (polarity) of the strike + * + * @return + */ + public int getIntensity() { + return intensity; + } + + /** + * Set the intensity (polarity) of strike + * + * @param intensity + */ + public void setIntensity(int intensity) { + this.intensity = intensity; + } + + /** + * Get the type of strike + * + * @return + */ + public int getStrikeType() { + return strikeType; + } + + /** + * Set the type of the strike + * + * @param strikeType + */ + public void setStrikeType(int strikeType) { + this.strikeType = strikeType; + } + + /** + * get the type of the message + * + * @return + */ + public int getMsgType() { + return msgType; + } + + /** + * Set the type of the message + * + * @param msgType + */ + public void setMsgType(int msgType) { + this.msgType = msgType; + } + + /** + * Get the total strike count + * + * @return + */ + public int getStrikeCount() { + return strikeCount; + } + + /** + * Set the total strike count + * + * @param strikeCount + */ + public void setStrikeCount(int strikeCount) { + this.strikeCount = strikeCount; + } + } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatLocation.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatLocation.java index 2815473117..849a7c54d0 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatLocation.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatLocation.java @@ -24,7 +24,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -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.Coordinate; @@ -48,28 +47,31 @@ import com.vividsolutions.jts.geom.Coordinate; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class ThreatLocation implements ISerializableObject { - +public class ThreatLocation { + @XmlElement @DynamicSerializeElement public String locationName = null; + @XmlElement @DynamicSerializeElement public String wfoName = null; + @XmlElement @DynamicSerializeElement public Double lat = null; + @XmlElement @DynamicSerializeElement public Double lon = null; - + /** * For thrift */ public ThreatLocation() { - + } - + /** * For actual use */ @@ -79,7 +81,7 @@ public class ThreatLocation implements ISerializableObject { this.lat = coor.y; this.lon = coor.x; } - + public String getLocationName() { return locationName; } @@ -87,23 +89,23 @@ public class ThreatLocation implements ISerializableObject { public void setLocationName(String locationName) { this.locationName = locationName; } - + public Double getLat() { return lat; } - + public void setLat(Double lat) { this.lat = lat; } - + public Double getLon() { return lon; } - + public void setLon(Double lon) { this.lon = lon; } - + public Coordinate getCoor() { return new Coordinate(getLon(), getLat(), 0.0); } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatReport.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatReport.java index ce4dee2903..ee2f35bfc6 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatReport.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/ThreatReport.java @@ -19,16 +19,9 @@ **/ package com.raytheon.uf.common.monitor.scan; -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 com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; - /** * CWA ThreatReport per SCAN grid box * @@ -37,7 +30,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 01/06/2009 2037 dhladky Initial Creation. + * 01/06/2009 2037 dhladky Initial Creation. + * 10/02/2013 2361 njensen Removed XML annotations * * * @@ -45,80 +39,77 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class ThreatReport implements ISerializableObject { - - @XmlElement +public class ThreatReport { + @DynamicSerializeElement - private boolean threat = false; - @XmlElement + private boolean threat = false; + @DynamicSerializeElement - private int condition = -1; - @XmlElement + private int condition = -1; + @DynamicSerializeElement - private boolean cellWithinTenNm = false; - @XmlElement + private boolean cellWithinTenNm = false; + @DynamicSerializeElement - private boolean highRefWithinTenNm = false; - @XmlElement + private boolean highRefWithinTenNm = false; + @DynamicSerializeElement - private boolean coincidentVil = false; - @XmlElement + private boolean coincidentVil = false; + @DynamicSerializeElement - private boolean vilWithinTenNm = false; - @XmlElement + private boolean vilWithinTenNm = false; + @DynamicSerializeElement - private boolean strongVilCell = false; - @XmlElement + private boolean strongVilCell = false; + @DynamicSerializeElement - private boolean ltgActiveCell = false; - @XmlElement + private boolean ltgActiveCell = false; + @DynamicSerializeElement - private double ovhdVilPct = 0; - @XmlElement + private double ovhdVilPct = 0; + @DynamicSerializeElement - private int totalCvr = 0; - @XmlElement + private int totalCvr = 0; + @DynamicSerializeElement - private double lgtPct = 0; - @XmlElement + private double lgtPct = 0; + @DynamicSerializeElement - private double mdtPct = 0; - @XmlElement + private double mdtPct = 0; + @DynamicSerializeElement - private double hvyPct = 0; - @XmlElement + private double hvyPct = 0; + @DynamicSerializeElement - private double areaPct = 0; - @XmlElement + private double areaPct = 0; + @DynamicSerializeElement - private int cgCountThirtyNm = 0; - @XmlElement + private int cgCountThirtyNm = 0; + @DynamicSerializeElement - private int cgNearSite = 0; - @XmlElement + private int cgNearSite = 0; + @DynamicSerializeElement - private int cgRateTenNm = 0; - @XmlElement + private int cgRateTenNm = 0; + @DynamicSerializeElement private String vilMessage = null; - @XmlElement + @DynamicSerializeElement private String lgtMessage = null; - @XmlElement + @DynamicSerializeElement private String tstormMessage = null; - @XmlElement + @DynamicSerializeElement private String threatMessage = null; - + /** * public constructor */ public ThreatReport() { - + } public boolean isThreat() { @@ -288,12 +279,13 @@ public class ThreatReport implements ISerializableObject { public void setThreatMessage(String threatMessage) { this.threatMessage = threatMessage; } - + /** * debugger only */ public String toString() { - return getThreatMessage()+ " "+getTstormMessage()+ " "+getLgtMessage(); + return getThreatMessage() + " " + getTstormMessage() + " " + + getLgtMessage(); } - + } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/VILReport.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/VILReport.java index 9c16dc8a46..f0afa608ee 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/VILReport.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/VILReport.java @@ -20,12 +20,6 @@ package com.raytheon.uf.common.monitor.scan; * further licensing information. **/ -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 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.Coordinate; @@ -38,39 +32,33 @@ import com.vividsolutions.jts.geom.Coordinate; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/02/2009 2037 dhladky Initial Creation. + * 06/02/2009 2037 dhladky Initial Creation. + * 10/02/2013 2361 njensen Removed XML annotations * * * * @author dhladky * @version 1.0 */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -@DynamicSerialize -public class VILReport implements ISerializableObject { - @XmlElement +@DynamicSerialize +public class VILReport { + @DynamicSerializeElement private int totalLgt = 0; - @XmlElement @DynamicSerializeElement private int totalMdt = 0; - @XmlElement @DynamicSerializeElement private int totalHvy = 0; - @XmlElement @DynamicSerializeElement private int ovhdLgt = 0; - @XmlElement @DynamicSerializeElement private int ovhdMdt = 0; - @XmlElement @DynamicSerializeElement private int ovhdHvy = 0; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/AbsConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/AbsConfigMgr.java index dca0972fde..09665f9bb2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/AbsConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/AbsConfigMgr.java @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; +import javax.xml.bind.JAXBException; + import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; @@ -34,7 +36,13 @@ import com.raytheon.uf.common.monitor.data.CommonTableConfig.SortDirection; import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanThresholdColor; import com.raytheon.uf.common.monitor.scan.xml.SCANAbstractXML; import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.monitor.scan.xml.SCANConfigCellXML; +import com.raytheon.uf.common.monitor.scan.xml.SCANConfigDmdXML; +import com.raytheon.uf.common.monitor.scan.xml.SCANConfigMesoXML; +import com.raytheon.uf.common.monitor.scan.xml.SCANConfigTvsXML; +import com.raytheon.uf.common.serialization.JAXBManager; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; /** * Abstract class used for common configuration data for the CELL, DMD, MESO, @@ -45,8 +53,9 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 21, 2009 3039 lvenable Initial creation - * Apr 25, 2013 1926 njensen Improved initialization speed + * Oct 21, 2009 3039 lvenable Initial creation + * Apr 25, 2013 1926 njensen Improved initialization speed + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -54,6 +63,12 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * @version 1.0 */ public abstract class AbsConfigMgr { + + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(AbsConfigMgr.class); + + protected static final JAXBManager jaxb = initializeJAXB(); + /** * Map of attribute names and SCANAttributesXML. */ @@ -70,6 +85,19 @@ public abstract class AbsConfigMgr { // protected String defaultConfigXml = null; protected String currentConfigFileName = null; + private static JAXBManager initializeJAXB() { + JAXBManager retVal = null; + try { + retVal = new JAXBManager(SCANConfigCellXML.class, + SCANConfigDmdXML.class, SCANConfigMesoXML.class, + SCANConfigTvsXML.class); + } catch (JAXBException e) { + statusHandler.error( + "Error initializing JAXBManager for SCAN configs", e); + } + return retVal; + } + /** * Constructor. * @@ -121,8 +149,8 @@ public abstract class AbsConfigMgr { LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), getFullDefaultConfigName()); } - cfgXML = SerializationUtil.jaxbUnmarshalFromXmlFile( - SCANAbstractXML.class, lfile.getFile()); + cfgXML = jaxb.unmarshalFromXmlFile(SCANAbstractXML.class, + lfile.getFile()); return cfgXML; } catch (Exception e) { e.printStackTrace(); @@ -150,8 +178,8 @@ public abstract class AbsConfigMgr { IPathManager pm = PathManagerFactory.getPathManager(); String path = pm.getStaticFile(newConfigFile).getAbsolutePath(); - cfgXML = SerializationUtil.jaxbUnmarshalFromXmlFile( - SCANAbstractXML.class, path.toString()); + cfgXML = jaxb.unmarshalFromXmlFile(SCANAbstractXML.class, + path.toString()); return cfgXML; } catch (Exception e) { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/CellConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/CellConfigMgr.java index 663d9b3418..8353bd587e 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/CellConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/CellConfigMgr.java @@ -25,11 +25,10 @@ import java.util.LinkedHashMap; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML; import com.raytheon.uf.common.monitor.scan.xml.SCANConfigCellXML; @@ -38,63 +37,57 @@ import com.raytheon.uf.common.monitor.scan.xml.SCANConfigCellXML; * Configuration manager for the CELL table. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Dec 2, 2009  #3039      lvenable     Initial creation
- *
+ * Dec 2, 2009  #3039      lvenable    Initial creation
+ * Oct 2, 2013  2361       njensen     Use JAXBManager for XML
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ -public class CellConfigMgr extends AbsConfigMgr -{ +public class CellConfigMgr extends AbsConfigMgr { /** * CELL configuration manager XML. */ private SCANConfigCellXML cellCfgXML; - + /** * Default configuration file name. */ private final String defaultConfigFileName = "SCANconfig_cellTable.xml"; - + /** * Constructor. */ - public CellConfigMgr() - { + public CellConfigMgr() { super(); - } + } /** * Initialize method. */ @Override - protected void init() - { + protected void init() { currentConfigFileName = defaultConfigFileName; loadDefaultConfig(); - - if (cellCfgXML == null) - { + + if (cellCfgXML == null) { System.out.println("cellCfgXML is null"); - } - else - { + } else { System.out.println("--- " + cellCfgXML.getDefaultRank()); } - } - + } + /** * Get the attributes XML. */ @Override - public ArrayList getAttributes() - { + public ArrayList getAttributes() { return cellCfgXML.getAttributesData(); } @@ -102,73 +95,65 @@ public class CellConfigMgr extends AbsConfigMgr * Load the default configuration. */ @Override - public void loadDefaultConfig() - { + public void loadDefaultConfig() { currentConfigFileName = defaultConfigFileName; - cellCfgXML = (SCANConfigCellXML)readDefaultConfig(); - createAttributeMap(getAttributes()); + cellCfgXML = (SCANConfigCellXML) readDefaultConfig(); + createAttributeMap(getAttributes()); } /** * Load a new configuration. */ @Override - public void loadNewConfig(String newCfgName) - { + public void loadNewConfig(String newCfgName) { currentConfigFileName = newCfgName; - cellCfgXML = (SCANConfigCellXML)readExistingConfig(); - createAttributeMap(getAttributes()); + cellCfgXML = (SCANConfigCellXML) readExistingConfig(); + createAttributeMap(getAttributes()); } /** * Save the current configuration. */ @Override - public void saveConfig() - { + public void saveConfig() { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext context = pm.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); String newFileName = getExistingConfigFilePath(); LocalizationFile locFile = pm.getLocalizationFile(context, newFileName); - - if (locFile.getFile().getParentFile().exists() == false) - { + + if (locFile.getFile().getParentFile().exists() == false) { System.out.println("Creating new directory"); - - if (locFile.getFile().getParentFile().mkdirs() == false) - { + + if (locFile.getFile().getParentFile().mkdirs() == false) { System.out.println("Could not create new directory..."); } } - try - { - System.out.println("Saving -- " + locFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(cellCfgXML, locFile.getFile().getAbsolutePath()); + try { + System.out.println("Saving -- " + + locFile.getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(cellCfgXML, locFile.getFile() + .getAbsolutePath()); locFile.save(); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); } - } - + } + /** * Check if the tips should be shown. */ @Override - public boolean showTips() - { + public boolean showTips() { return cellCfgXML.getTipsOption(); - } + } /** * Set the show tips flag. */ @Override - public void setShowTips(boolean showFlag) - { + public void setShowTips(boolean showFlag) { cellCfgXML.setTipsOption(showFlag); } @@ -176,15 +161,14 @@ public class CellConfigMgr extends AbsConfigMgr * Get the path to the configuration files. */ @Override - public String getConfigPath() - { + public String getConfigPath() { String fs = String.valueOf(File.separatorChar); StringBuilder sb = new StringBuilder(); - + sb.append("scan").append(fs); sb.append("config").append(fs); - sb.append("cellTableConfig").append(fs); - + sb.append("cellTableConfig").append(fs); + return sb.toString(); } @@ -192,8 +176,7 @@ public class CellConfigMgr extends AbsConfigMgr * Get the full default configuration file name. */ @Override - public String getFullDefaultConfigName() - { + public String getFullDefaultConfigName() { return getConfigPath() + defaultConfigFileName; } @@ -201,75 +184,69 @@ public class CellConfigMgr extends AbsConfigMgr * Get the default configuration name. */ @Override - public String getDefaultConfigName() - { + public String getDefaultConfigName() { return defaultConfigFileName; } - + /** * Get the clutter control attribute name. + * * @return The clutter control attribute name. */ - public String getClutterControl() - { + public String getClutterControl() { return cellCfgXML.getClutterControl(); } - + /** * Get the radius interpolation. + * * @return The radius interpolation. */ - public String getRadVar() - { + public String getRadVar() { return cellCfgXML.getRadVar(); } - + /** * Get a linked map of clutter control attribute and the associated units. - * @return A linked map of clutter control attribute and the associated units. + * + * @return A linked map of clutter control attribute and the associated + * units. */ - public LinkedHashMap getClutterAttributes() - { + public LinkedHashMap getClutterAttributes() { LinkedHashMap attrUnitsMap = new LinkedHashMap(); - ArrayList attrArray = getAttributes(); - - for (SCANAttributesXML attrXML : attrArray) - { - if (attrXML.getClutter() == true) - { + ArrayList attrArray = getAttributes(); + + for (SCANAttributesXML attrXML : attrArray) { + if (attrXML.getClutter() == true) { attrUnitsMap.put(attrXML.getAttrName(), attrXML.getUnits()); } } - + return attrUnitsMap; } - + /** * Get the SCAN CELL configuration data. + * * @return SCAN CELL configuration data. */ - public SCANConfigCellXML getScanCellCfgXML() - { + public SCANConfigCellXML getScanCellCfgXML() { return cellCfgXML; } - - public void setAlarmsDisabled(boolean flag) - { + + public void setAlarmsDisabled(boolean flag) { cellCfgXML.setAlarmsDisabled(flag); } - - public boolean getAlarmsDisabled() - { + + public boolean getAlarmsDisabled() { return cellCfgXML.getAlarmsDisabled(); } - - public void setAlarmBell(boolean flag) - { + + public void setAlarmBell(boolean flag) { cellCfgXML.setAlarmBell(flag); } - - public boolean getAlarmBell() - { + + public boolean getAlarmBell() { return cellCfgXML.getAlarmBell(); } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/DmdConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/DmdConfigMgr.java index f735b91b5e..ddf7d49093 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/DmdConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/DmdConfigMgr.java @@ -25,11 +25,10 @@ import java.util.LinkedHashMap; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML; import com.raytheon.uf.common.monitor.scan.xml.SCANConfigDmdXML; @@ -38,25 +37,25 @@ import com.raytheon.uf.common.monitor.scan.xml.SCANConfigDmdXML; * Configuration manager for the DMD table. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Dec 2, 2009  #3039      lvenable     Initial creation
- *
+ * Dec 2, 2009  #3039      lvenable    Initial creation
+ * Oct 2, 2013  2361       njensen     Use JAXBManager for XML
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ -public class DmdConfigMgr extends AbsConfigMgr -{ +public class DmdConfigMgr extends AbsConfigMgr { /** * DMD configuration manager XML. */ private SCANConfigDmdXML dmdCfgXML; - + /** * Default configuration file name. */ @@ -65,26 +64,21 @@ public class DmdConfigMgr extends AbsConfigMgr /** * Constructor. */ - public DmdConfigMgr() - { + public DmdConfigMgr() { super(); - } - + } + /** * Initialize method. */ @Override - protected void init() - { + protected void init() { currentConfigFileName = defaultConfigFileName; loadDefaultConfig(); - - if (dmdCfgXML == null) - { + + if (dmdCfgXML == null) { System.out.println("dmdCfgXML is null"); - } - else - { + } else { System.out.println("--- " + dmdCfgXML.getDefaultRank()); } } @@ -93,8 +87,7 @@ public class DmdConfigMgr extends AbsConfigMgr * Get the attributes XML. */ @Override - public ArrayList getAttributes() - { + public ArrayList getAttributes() { return dmdCfgXML.getAttributesData(); } @@ -102,10 +95,9 @@ public class DmdConfigMgr extends AbsConfigMgr * Load the default configuration. */ @Override - public void loadDefaultConfig() - { + public void loadDefaultConfig() { currentConfigFileName = defaultConfigFileName; - dmdCfgXML = (SCANConfigDmdXML)readDefaultConfig(); + dmdCfgXML = (SCANConfigDmdXML) readDefaultConfig(); createAttributeMap(getAttributes()); } @@ -113,78 +105,70 @@ public class DmdConfigMgr extends AbsConfigMgr * Load a new configuration. */ @Override - public void loadNewConfig(String newCfgName) - { + public void loadNewConfig(String newCfgName) { currentConfigFileName = newCfgName; - dmdCfgXML = (SCANConfigDmdXML)readExistingConfig(); - createAttributeMap(getAttributes()); + dmdCfgXML = (SCANConfigDmdXML) readExistingConfig(); + createAttributeMap(getAttributes()); } /** * Save the current configuration. */ @Override - public void saveConfig() - { + public void saveConfig() { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext context = pm.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); String newFileName = getExistingConfigFilePath(); LocalizationFile locFile = pm.getLocalizationFile(context, newFileName); - - if (locFile.getFile().getParentFile().exists() == false) - { + + if (locFile.getFile().getParentFile().exists() == false) { System.out.println("Creating new directory"); - - if (locFile.getFile().getParentFile().mkdirs() == false) - { + + if (locFile.getFile().getParentFile().mkdirs() == false) { System.out.println("Could not create new directory..."); } } - try - { - System.out.println("Saving -- " + locFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(dmdCfgXML, locFile.getFile().getAbsolutePath()); + try { + System.out.println("Saving -- " + + locFile.getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(dmdCfgXML, locFile.getFile() + .getAbsolutePath()); locFile.save(); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); - } + } } - + /** * Check if the tips should be shown. */ @Override - public boolean showTips() - { + public boolean showTips() { return dmdCfgXML.getTipsOption(); } - + /** * Set the show tips flag. */ @Override - public void setShowTips(boolean showFlag) - { + public void setShowTips(boolean showFlag) { dmdCfgXML.setTipsOption(showFlag); } - + /** * Get the path to the configuration files. */ @Override - public String getConfigPath() - { + public String getConfigPath() { String fs = String.valueOf(File.separatorChar); StringBuilder sb = new StringBuilder(); - + sb.append("scan").append(fs); sb.append("config").append(fs); - sb.append("dmdTableConfig").append(fs); - + sb.append("dmdTableConfig").append(fs); + return sb.toString(); } @@ -192,8 +176,7 @@ public class DmdConfigMgr extends AbsConfigMgr * Get the full default configuration file name. */ @Override - public String getFullDefaultConfigName() - { + public String getFullDefaultConfigName() { return getConfigPath() + "SCANconfig_dmdTable.xml"; } @@ -201,75 +184,69 @@ public class DmdConfigMgr extends AbsConfigMgr * Get the default configuration name. */ @Override - public String getDefaultConfigName() - { + public String getDefaultConfigName() { return defaultConfigFileName; } - + /** * Get the clutter control attribute name. + * * @return The clutter control attribute name. */ - public String getClutterControl() - { + public String getClutterControl() { return dmdCfgXML.getClutterControl(); } - + /** * Get the radius interpolation. + * * @return The radius interpolation. */ - public String getRadVar() - { + public String getRadVar() { return dmdCfgXML.getRadVar(); } - + /** * Get a linked map of clutter control attribute and the associated units. - * @return A linked map of clutter control attribute and the associated units. + * + * @return A linked map of clutter control attribute and the associated + * units. */ - public LinkedHashMap getClutterAttributes() - { + public LinkedHashMap getClutterAttributes() { LinkedHashMap attrUnitsMap = new LinkedHashMap(); - ArrayList attrArray = getAttributes(); - - for (SCANAttributesXML attrXML : attrArray) - { - if (attrXML.getClutter() == true) - { + ArrayList attrArray = getAttributes(); + + for (SCANAttributesXML attrXML : attrArray) { + if (attrXML.getClutter() == true) { attrUnitsMap.put(attrXML.getAttrName(), attrXML.getUnits()); } } - + return attrUnitsMap; } - + /** * Get the SCAN DMD configuration data. + * * @return SCAN DMD configuration data. */ - public SCANConfigDmdXML getScanDmdCfgXML() - { + public SCANConfigDmdXML getScanDmdCfgXML() { return this.dmdCfgXML; } - - public void setAlarmsDisabled(boolean flag) - { + + public void setAlarmsDisabled(boolean flag) { dmdCfgXML.setAlarmsDisabled(flag); } - - public boolean getAlarmsDisabled() - { + + public boolean getAlarmsDisabled() { return dmdCfgXML.getAlarmsDisabled(); } - - public void setAlarmBell(boolean flag) - { + + public void setAlarmBell(boolean flag) { dmdCfgXML.setAlarmBell(flag); } - - public boolean getAlarmBell() - { + + public boolean getAlarmBell() { return dmdCfgXML.getAlarmBell(); } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/MesoConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/MesoConfigMgr.java index 94bb104054..6cb945755f 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/MesoConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/MesoConfigMgr.java @@ -24,11 +24,10 @@ import java.util.ArrayList; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML; import com.raytheon.uf.common.monitor.scan.xml.SCANConfigMesoXML; @@ -37,54 +36,51 @@ import com.raytheon.uf.common.monitor.scan.xml.SCANConfigMesoXML; * Configuration manager for the MESO table. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Dec 3, 2009  #3039          lvenable     Initial creation
- *
+ * Dec 3, 2009  #3039      lvenable    Initial creation
+ * Oct 2, 2013  2361       njensen     Use JAXBManager for XML
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ -public class MesoConfigMgr extends AbsConfigMgr -{ +public class MesoConfigMgr extends AbsConfigMgr { /** * MESO configuration manager XML. */ private SCANConfigMesoXML mesoCfgXML; - + /** * Default configuration file name. */ private final String defaultConfigFileName = "SCANconfig_mesoTable.xml"; - + /** * Constructor. */ - public MesoConfigMgr() - { + public MesoConfigMgr() { super(); } - + /** * Initialize method. */ @Override - protected void init() - { + protected void init() { currentConfigFileName = defaultConfigFileName; - loadDefaultConfig(); + loadDefaultConfig(); } /** * Get the attributes XML. */ @Override - public ArrayList getAttributes() - { + public ArrayList getAttributes() { return mesoCfgXML.getAttributesData(); } @@ -92,21 +88,19 @@ public class MesoConfigMgr extends AbsConfigMgr * Load the default configuration. */ @Override - public void loadDefaultConfig() - { + public void loadDefaultConfig() { currentConfigFileName = defaultConfigFileName; - mesoCfgXML = (SCANConfigMesoXML)readDefaultConfig(); - createAttributeMap(getAttributes()); + mesoCfgXML = (SCANConfigMesoXML) readDefaultConfig(); + createAttributeMap(getAttributes()); } /** * Load a new configuration. */ @Override - public void loadNewConfig(String newCfgName) - { + public void loadNewConfig(String newCfgName) { currentConfigFileName = newCfgName; - mesoCfgXML = (SCANConfigMesoXML)readExistingConfig(); + mesoCfgXML = (SCANConfigMesoXML) readExistingConfig(); createAttributeMap(getAttributes()); } @@ -114,64 +108,56 @@ public class MesoConfigMgr extends AbsConfigMgr * Save the current configuration. */ @Override - public void saveConfig() - { + public void saveConfig() { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext context = pm.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); String newFileName = getExistingConfigFilePath(); LocalizationFile locFile = pm.getLocalizationFile(context, newFileName); - - if (locFile.getFile().getParentFile().exists() == false) - { - if (locFile.getFile().getParentFile().mkdirs() == false) - { + + if (locFile.getFile().getParentFile().exists() == false) { + if (locFile.getFile().getParentFile().mkdirs() == false) { System.out.println("Could not create new directory..."); } } - try - { - SerializationUtil.jaxbMarshalToXmlFile(mesoCfgXML, locFile.getFile().getAbsolutePath()); + try { + jaxb.marshalToXmlFile(mesoCfgXML, locFile.getFile() + .getAbsolutePath()); locFile.save(); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); - } + } } - + /** * Check if the tips should be shown. */ @Override - public boolean showTips() - { + public boolean showTips() { return mesoCfgXML.getTipsOption(); } - + /** * Set the show tips flag. */ @Override - public void setShowTips(boolean showFlag) - { + public void setShowTips(boolean showFlag) { mesoCfgXML.setTipsOption(showFlag); } - + /** * Get the path to the configuration files. */ @Override - public String getConfigPath() - { + public String getConfigPath() { String fs = String.valueOf(File.separatorChar); StringBuilder sb = new StringBuilder(); - + sb.append("scan").append(fs); sb.append("config").append(fs); - sb.append("mesoTableConfig").append(fs); - + sb.append("mesoTableConfig").append(fs); + return sb.toString(); } @@ -179,26 +165,24 @@ public class MesoConfigMgr extends AbsConfigMgr * Get the full default configuration file name. */ @Override - public String getFullDefaultConfigName() - { + public String getFullDefaultConfigName() { return getConfigPath() + defaultConfigFileName; - } + } /** * Get the default configuration name. */ @Override - public String getDefaultConfigName() - { + public String getDefaultConfigName() { return defaultConfigFileName; } - + /** * Get the SCAN MESO configuration data. + * * @return SCAN MESO configuration data. */ - public SCANConfigMesoXML getScanMesoCfgXML() - { + public SCANConfigMesoXML getScanMesoCfgXML() { return mesoCfgXML; } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/SCANMonitorConfig.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/SCANMonitorConfig.java index 8638ebdfa7..48d9c59ca4 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/SCANMonitorConfig.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/SCANMonitorConfig.java @@ -23,55 +23,68 @@ import java.io.File; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.monitor.scan.xml.SCANMonitorConfigXML; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; + +/** + * + * Configuration manager for SCAN monitor + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * --/--/----                          Initial creation
+ * Oct 02, 2013 2361       njensen     Use JAXBManager for XML
+ * 
+ * 
+ * + * @author lvenable + * @version 1.0 + */ +public class SCANMonitorConfig { + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(SCANMonitorConfigXML.class); -public class SCANMonitorConfig -{ private SCANMonitorConfigXML scanMonitorCfg; - - public SCANMonitorConfig() - { + + public SCANMonitorConfig() { readScanMonitorConfig(); } - - public double getCellTilt() - { + + public double getCellTilt() { return scanMonitorCfg.getCellTilt(); } - - public double getDmdTilt() - { + + public double getDmdTilt() { return scanMonitorCfg.getDmdTilt(); } - - public String[] getPlugins() - { + + public String[] getPlugins() { return scanMonitorCfg.getPlugins().split(" "); } - - public int getInterval() - { + + public int getInterval() { return scanMonitorCfg.getInterval(); } - private void readScanMonitorConfig() - { + private void readScanMonitorConfig() { scanMonitorCfg = null; - - try - { + + try { String fs = String.valueOf(File.separatorChar); - + IPathManager pm = PathManagerFactory.getPathManager(); - String path = pm.getStaticFile("scan" + fs + "config" + fs - + "SCANMonitorConfig.xml").getAbsolutePath(); - - scanMonitorCfg = (SCANMonitorConfigXML) SerializationUtil.jaxbUnmarshalFromXmlFile(path.toString()); - } - catch (Exception e) - { + String path = pm.getStaticFile( + "scan" + fs + "config" + fs + "SCANMonitorConfig.xml") + .getAbsolutePath(); + + scanMonitorCfg = jaxb.unmarshalFromXmlFile(path.toString()); + } catch (Exception e) { e.printStackTrace(); } - } + } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TrendSetConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TrendSetConfigMgr.java index c9cf9a135a..a4e8e953e7 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TrendSetConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TrendSetConfigMgr.java @@ -26,266 +26,263 @@ import java.util.Set; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.xml.SCANTrendSetXML; import com.raytheon.uf.common.monitor.scan.xml.SCANTrendSetsXML; +import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; /** * - * Manages the Trend Sets configuration. This will handle either CELL or DMD trend sets. + * Manages the Trend Sets configuration. This will handle either CELL or DMD + * trend sets. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Dec 3, 2009  #3039      lvenable     Initial creation
- *
+ * Dec 3, 2009  #3039      lvenable    Initial creation
+ * Oct 2, 2013   2361      njensen     Use JAXBManager for XML
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ -public class TrendSetConfigMgr -{ +public class TrendSetConfigMgr { + + private static final SingleTypeJAXBManager jaxb = SingleTypeJAXBManager + .createWithoutException(SCANTrendSetsXML.class); + /** * Configuration XML. */ private String configXml = null; - + /** * Full XML file path. */ private String fullXMLFilePath = null; - + /** * Trend sets XML. */ private SCANTrendSetsXML trendSets; - + /** * Linked hash map of trend set names and the associated attributes. */ private LinkedHashMap trendSetMap; - + /** * Constructor. - * @param defCfgXML Default configuration XML name. + * + * @param defCfgXML + * Default configuration XML name. */ - public TrendSetConfigMgr(String defCfgXML) - { + public TrendSetConfigMgr(String defCfgXML) { this.configXml = defCfgXML; - + init(); } - + /** * Initialize method. */ - private void init() - { + private void init() { trendSetMap = new LinkedHashMap(); readDefaultConfig(); - + updateTrendSetHashMap(); } - + /** * Read in the default configuration trend set XML. */ - private void readDefaultConfig() - { - try - { - IPathManager pm = PathManagerFactory.getPathManager(); - fullXMLFilePath = pm.getStaticFile(getFullConfigFileNameStr()).getAbsolutePath(); - trendSets = (SCANTrendSetsXML) SerializationUtil.jaxbUnmarshalFromXmlFile(fullXMLFilePath); - } - catch (Exception e) - { + private void readDefaultConfig() { + try { + IPathManager pm = PathManagerFactory.getPathManager(); + fullXMLFilePath = pm.getStaticFile(getFullConfigFileNameStr()) + .getAbsolutePath(); + trendSets = jaxb.unmarshalFromXmlFile(fullXMLFilePath); + } catch (Exception e) { e.printStackTrace(); - } - } - + } + } + /** * Update the trend sets hashmap by re-reading in the data. */ - private void updateTrendSetHashMap() - { + private void updateTrendSetHashMap() { trendSetMap.clear(); - + ArrayList trendSetArray = trendSets.getTrendSets(); - - for (int i = 0; i < trendSetArray.size(); i++) - { - trendSetMap.put(trendSetArray.get(i).getName(), trendSetArray.get(i).getAttributes()); - } - } - + + for (int i = 0; i < trendSetArray.size(); i++) { + trendSetMap.put(trendSetArray.get(i).getName(), trendSetArray + .get(i).getAttributes()); + } + } + /** * Get the full path/file name of the configuration XML. + * * @return Full file name and path. */ - private String getFullConfigFileNameStr() - { + private String getFullConfigFileNameStr() { String fs = String.valueOf(File.separatorChar); - String fileNameStr = "scan" + fs + "config" + fs + "trendSets" + fs + configXml; - + String fileNameStr = "scan" + fs + "config" + fs + "trendSets" + fs + + configXml; + return fileNameStr; } - + /** * Get the trend sets map. + * * @return The trend sets map. */ - public final LinkedHashMap getTrendSetMap() - { + public final LinkedHashMap getTrendSetMap() { return trendSetMap; } - + /** * Get the trend sets configuration XML. + * * @return The trend sets configuration XML. */ - public SCANTrendSetsXML getTrendSets() - { + public SCANTrendSetsXML getTrendSets() { return trendSets; } - + /** * Save the trend sets. */ - public void saveTrendSets() - { - ArrayList updateTrendSetArray = trendSets.getTrendSets(); + public void saveTrendSets() { + ArrayList updateTrendSetArray = trendSets + .getTrendSets(); updateTrendSetArray.clear(); - + Set keys = trendSetMap.keySet(); - - for (String key : keys) - { + + for (String key : keys) { SCANTrendSetXML newTrendSet = new SCANTrendSetXML(); newTrendSet.setName(key); newTrendSet.setAttributes(trendSetMap.get(key)); - + updateTrendSetArray.add(newTrendSet); } - + trendSets.setTrendSets(updateTrendSetArray); - + /* * Generate the array to save from the hashmap. */ - + IPathManager pm = PathManagerFactory.getPathManager(); - LocalizationContext context = pm.getContext(LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); - LocalizationFile locFile = pm.getLocalizationFile(context, getFullConfigFileNameStr()); - - if (locFile.getFile().exists() == false) - { - if (locFile.getFile().getParentFile().mkdirs() == false) - { - System.out.println("Did not not create directory(ies): " + locFile.getFile().getAbsolutePath()); + LocalizationContext context = pm.getContext( + LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); + LocalizationFile locFile = pm.getLocalizationFile(context, + getFullConfigFileNameStr()); + + if (locFile.getFile().exists() == false) { + if (locFile.getFile().getParentFile().mkdirs() == false) { + System.out.println("Did not not create directory(ies): " + + locFile.getFile().getAbsolutePath()); } } - - try - { - SerializationUtil.jaxbMarshalToXmlFile(trendSets, locFile.getFile().getAbsolutePath()); - - locFile.save(); - } - catch (Exception e) - { + + try { + jaxb.marshalToXmlFile(trendSets, locFile.getFile() + .getAbsolutePath()); + + locFile.save(); + } catch (Exception e) { e.printStackTrace(); - } + } } - + /** * Remove a trend set. - * @param name Trend set name to remove. + * + * @param name + * Trend set name to remove. */ - public void removeTrendSet(String name) - { + public void removeTrendSet(String name) { trendSetMap.remove(name); } - + /** * Add/Update a trend set. + * * @param name * @param attibute */ - public void addUpdateTrendSet(String name, String attibute) - { - trendSetMap.put(name, attibute); + public void addUpdateTrendSet(String name, String attibute) { + trendSetMap.put(name, attibute); } - + /** * Get a list of trend sets that do not have at least 2 attributes. + * * @return Array on trend set names. */ - public String[] getInvalidAttributeNumber() - { + public String[] getInvalidAttributeNumber() { ArrayList invalidTrends = new ArrayList(); Set keys = trendSetMap.keySet(); - - for (String key : keys) - { + + for (String key : keys) { String[] attrs = trendSetMap.get(key).split(","); - - if (attrs.length < 2) - { + + if (attrs.length < 2) { invalidTrends.add(key); } - } - + } + return invalidTrends.toArray(new String[0]); } - + /** * Get a string array of attributes for the specified trend set name. - * @param trendName Trend set name. + * + * @param trendName + * Trend set name. * @return String array of attributes. */ - public String[] getAttributes(String trendName) - { - if (trendSetMap.containsKey(trendName) == true) - { + public String[] getAttributes(String trendName) { + if (trendSetMap.containsKey(trendName) == true) { String[] attrs = trendSetMap.get(trendName).split(","); return attrs; } - - return new String[]{}; + + return new String[] {}; } - + /** * Get an array on trend set names. + * * @return Array of trend set names. */ - public String[] getTrendSetNames() - { + public String[] getTrendSetNames() { ArrayList trendNames = new ArrayList(); - + Set keys = trendSetMap.keySet(); - - for (String key : keys) - { + + for (String key : keys) { trendNames.add(key); } - + return trendNames.toArray(new String[0]); } - + /** * Reload the configuration. */ - public void reloadConfiguration() - { + public void reloadConfiguration() { readDefaultConfig(); updateTrendSetHashMap(); } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TvsConfigMgr.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TvsConfigMgr.java index 036514e77c..50854331b1 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TvsConfigMgr.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/config/TvsConfigMgr.java @@ -24,11 +24,10 @@ import java.util.ArrayList; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML; import com.raytheon.uf.common.monitor.scan.xml.SCANConfigTvsXML; @@ -37,54 +36,51 @@ import com.raytheon.uf.common.monitor.scan.xml.SCANConfigTvsXML; * Configuration manager for the TVS table. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Dec 3, 2009  #3039      lvenable     Initial creation
- *
+ * Dec 3, 2009  #3039      lvenable    Initial creation
+ * Oct 2, 2013  2361       njensen     Use JAXBManager for XML
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ -public class TvsConfigMgr extends AbsConfigMgr -{ +public class TvsConfigMgr extends AbsConfigMgr { /** * TVS configuration manager XML. */ private SCANConfigTvsXML tvsCfgXML; - + /** * Default configuration file name. */ private final String defaultConfigFileName = "SCANconfig_tvsTable.xml"; - + /** * Constructor. */ - public TvsConfigMgr() - { + public TvsConfigMgr() { super(); } - + /** * Initialize method. */ @Override - protected void init() - { + protected void init() { currentConfigFileName = defaultConfigFileName; - loadDefaultConfig(); + loadDefaultConfig(); } /** * Get the attributes XML. */ @Override - public ArrayList getAttributes() - { + public ArrayList getAttributes() { return tvsCfgXML.getAttributesData(); } @@ -92,21 +88,19 @@ public class TvsConfigMgr extends AbsConfigMgr * Load the default configuration. */ @Override - public void loadDefaultConfig() - { + public void loadDefaultConfig() { currentConfigFileName = defaultConfigFileName; - tvsCfgXML = (SCANConfigTvsXML)readDefaultConfig(); - createAttributeMap(getAttributes()); + tvsCfgXML = (SCANConfigTvsXML) readDefaultConfig(); + createAttributeMap(getAttributes()); } /** * Load a new configuration. */ @Override - public void loadNewConfig(String newCfgName) - { + public void loadNewConfig(String newCfgName) { currentConfigFileName = newCfgName; - tvsCfgXML = (SCANConfigTvsXML)readExistingConfig(); + tvsCfgXML = (SCANConfigTvsXML) readExistingConfig(); createAttributeMap(getAttributes()); } @@ -114,68 +108,61 @@ public class TvsConfigMgr extends AbsConfigMgr * Save the current configuration. */ @Override - public void saveConfig() - { + public void saveConfig() { IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext context = pm.getContext( LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); String newFileName = getExistingConfigFilePath(); LocalizationFile locFile = pm.getLocalizationFile(context, newFileName); - - if (locFile.getFile().getParentFile().exists() == false) - { + + if (locFile.getFile().getParentFile().exists() == false) { System.out.println("TVS - Creating new directory"); - - if (locFile.getFile().getParentFile().mkdirs() == false) - { + + if (locFile.getFile().getParentFile().mkdirs() == false) { System.out.println("TVS - Could not create new directory..."); } } - try - { - System.out.println("Saving -- " + locFile.getFile().getAbsolutePath()); - SerializationUtil.jaxbMarshalToXmlFile(tvsCfgXML, locFile.getFile().getAbsolutePath()); + try { + System.out.println("Saving -- " + + locFile.getFile().getAbsolutePath()); + jaxb.marshalToXmlFile(tvsCfgXML, locFile.getFile() + .getAbsolutePath()); locFile.save(); - } - catch (Exception e) - { + } catch (Exception e) { e.printStackTrace(); } - + } - + /** * Check if the tips should be shown. */ @Override - public boolean showTips() - { + public boolean showTips() { return tvsCfgXML.getTipsOption(); } - + /** * Set the show tips flag. */ @Override - public void setShowTips(boolean showFlag) - { + public void setShowTips(boolean showFlag) { tvsCfgXML.setTipsOption(showFlag); } - + /** * Get the path to the configuration files. */ @Override - public String getConfigPath() - { + public String getConfigPath() { String fs = String.valueOf(File.separatorChar); StringBuilder sb = new StringBuilder(); - + sb.append("scan").append(fs); sb.append("config").append(fs); - sb.append("tvsTableConfig").append(fs); - + sb.append("tvsTableConfig").append(fs); + return sb.toString(); } @@ -183,8 +170,7 @@ public class TvsConfigMgr extends AbsConfigMgr * Get the full default configuration file name. */ @Override - public String getFullDefaultConfigName() - { + public String getFullDefaultConfigName() { return getConfigPath() + defaultConfigFileName; } @@ -192,17 +178,16 @@ public class TvsConfigMgr extends AbsConfigMgr * Get the default configuration name. */ @Override - public String getDefaultConfigName() - { + public String getDefaultConfigName() { return defaultConfigFileName; } - + /** * Get the SCAN TVS configuration data. + * * @return SCAN TVS configuration data. */ - public SCANConfigTvsXML getScanTvsCfgXML() - { + public SCANConfigTvsXML getScanTvsCfgXML() { return tvsCfgXML; } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/CWATLocationsXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/CWATLocationsXML.java index 8b24ee2d7d..8b9ca4dfae 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/CWATLocationsXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/CWATLocationsXML.java @@ -1,6 +1,5 @@ package com.raytheon.uf.common.monitor.scan.xml; - import java.util.ArrayList; import javax.xml.bind.annotation.XmlAccessType; @@ -10,7 +9,7 @@ import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.monitor.scan.ThreatLocation; -import com.raytheon.uf.common.serialization.ISerializableObject; + /** * CWAT locations Configuration XML . * @@ -29,14 +28,15 @@ import com.raytheon.uf.common.serialization.ISerializableObject; @XmlRootElement(name = "CWATLocationsXML") @XmlAccessorType(XmlAccessType.NONE) -public class CWATLocationsXML implements ISerializableObject { - - @XmlElements( { @XmlElement(name = "threats", type = ThreatLocation.class) }) +public class CWATLocationsXML { + + @XmlElements({ @XmlElement(name = "threats", type = ThreatLocation.class) }) private ArrayList threats; public ArrayList getThreats() { return threats; } + public void setThreats(ArrayList threats) { this.threats = threats; } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAbstractXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAbstractXML.java index 8fd783a14c..8928b1bd9b 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAbstractXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAbstractXML.java @@ -19,11 +19,7 @@ **/ package com.raytheon.uf.common.monitor.scan.xml; -//import com.raytheon.uf.common.serialization.ISerializableObject; - -public abstract class SCANAbstractXML -{ - public SCANAbstractXML() - { +public abstract class SCANAbstractXML { + public SCANAbstractXML() { } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAttributesXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAttributesXML.java index 84f4532342..3dd6cc4738 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAttributesXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANAttributesXML.java @@ -23,67 +23,63 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class SCANAttributesXML implements ISerializableObject -{ +public class SCANAttributesXML { @XmlElement(name = "AttrName") private String attrName; - + @XmlElement(name = "Low") private double low; - + @XmlElement(name = "Mid") private double mid; - + @XmlElement(name = "Upper") private double upper; - + @XmlElement(name = "Rank") private String rank; - + @XmlElement(name = "Trend") private boolean trend; - + @XmlElement(name = "TimeHeight") private boolean timeHeight; - + @XmlElement(name = "Colored") private boolean colored; - + @XmlElement(name = "Clutter") private boolean clutter; - + @XmlElement(name = "InTable") private boolean inTable; - + @XmlElement(name = "Min") private double min; - + @XmlElement(name = "Interval") private double interval; - + @XmlElement(name = "Range") private double range; - + @XmlElement(name = "Alarm") private int alarm; - + @XmlElement(name = "AbsAlarm") private int absAlarm; - -// @XmlElement(name = "AlarmDisabled") -// private boolean alarmDisabled; - + + // @XmlElement(name = "AlarmDisabled") + // private boolean alarmDisabled; + @XmlElement(name = "HasAlarm") private boolean hasAlarm; - + @XmlElement(name = "Units") private String units; - - public SCANAttributesXML() - { + + public SCANAttributesXML() { } public String getAttrName() { @@ -206,13 +202,13 @@ public class SCANAttributesXML implements ISerializableObject this.absAlarm = absAlarm; } -// public boolean getAlarmDisabled() { -// return alarmDisabled; -// } -// -// public void setAlarmDisabled(boolean alarmDisabled) { -// this.alarmDisabled = alarmDisabled; -// } + // public boolean getAlarmDisabled() { + // return alarmDisabled; + // } + // + // public void setAlarmDisabled(boolean alarmDisabled) { + // this.alarmDisabled = alarmDisabled; + // } public boolean getHasAlarm() { return hasAlarm; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigCellXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigCellXML.java index 4f9caced78..d32cd37ade 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigCellXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigCellXML.java @@ -27,12 +27,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "ScanConfigCellTable") @XmlAccessorType(XmlAccessType.NONE) -public class SCANConfigCellXML extends SCANAbstractXML implements - ISerializableObject { +public class SCANConfigCellXML extends SCANAbstractXML { + @XmlElement(name = "LinkToFrame") private boolean linkToFrame; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigDmdXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigDmdXML.java index dd1214c9fc..236efad522 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigDmdXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigDmdXML.java @@ -27,53 +27,49 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "ScanConfigDMDTable") @XmlAccessorType(XmlAccessType.NONE) -public class SCANConfigDmdXML extends SCANAbstractXML implements ISerializableObject -{ +public class SCANConfigDmdXML extends SCANAbstractXML { @XmlElement(name = "LinkToFrame") private boolean linkToFrame; - + @XmlElement(name = "VertOption") private boolean vertOption; - + @XmlElement(name = "TipsOption") private boolean tipsOption; - + @XmlElement(name = "FilterOption") private boolean filterOption; - + @XmlElement(name = "ZoomFactor") private int zoomFactor; - + @XmlElement(name = "OverlapOpt") private boolean overlapOpt; - + @XmlElement(name = "TrackOpt") private boolean trackOpt; - + @XmlElement(name = "ClutterControl") private String clutterControl; - + @XmlElement(name = "DefaultRank") private String defaultRank; - + @XmlElement(name = "RadVar") private String radVar; - + @XmlElement(name = "AlarmsDisabled") private boolean alarmsDisabled; - + @XmlElement(name = "AlarmBellOn") private boolean alarmBellOn; - - @XmlElements( { @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) + + @XmlElements({ @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) private ArrayList attributesData; - public SCANConfigDmdXML() - { + public SCANConfigDmdXML() { } public boolean getLinkToFrame() { @@ -155,7 +151,7 @@ public class SCANConfigDmdXML extends SCANAbstractXML implements ISerializableOb public void setRadVar(String radVar) { this.radVar = radVar; } - + public boolean getAlarmsDisabled() { return alarmsDisabled; } @@ -163,7 +159,7 @@ public class SCANConfigDmdXML extends SCANAbstractXML implements ISerializableOb public void setAlarmsDisabled(boolean alarmsDisabled) { this.alarmsDisabled = alarmsDisabled; } - + public boolean getAlarmBell() { return alarmBellOn; } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigMesoXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigMesoXML.java index 99a282f882..506ba2c5c7 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigMesoXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigMesoXML.java @@ -27,35 +27,31 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "ScanConfigMesoTable") @XmlAccessorType(XmlAccessType.NONE) -public class SCANConfigMesoXML extends SCANAbstractXML implements ISerializableObject -{ +public class SCANConfigMesoXML extends SCANAbstractXML { @XmlElement(name = "LinkToFrame") private boolean linkToFrame; - + @XmlElement(name = "VertOption") private boolean vertOption; - + @XmlElement(name = "TipsOption") private boolean tipsOption; - + @XmlElement(name = "FilterOption") private boolean filterOption; - + @XmlElement(name = "ZoomFactor") private int zoomFactor; - + @XmlElement(name = "DefaultRank") private String defaultRank; - - @XmlElements( { @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) + + @XmlElements({ @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) private ArrayList attributesData; - - public SCANConfigMesoXML() - { + + public SCANConfigMesoXML() { } public boolean getLinkToFrame() { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigTvsXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigTvsXML.java index 4e1b5f07f5..7aa73036b2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigTvsXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANConfigTvsXML.java @@ -27,35 +27,31 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "ScanConfigTvsTable") @XmlAccessorType(XmlAccessType.NONE) -public class SCANConfigTvsXML extends SCANAbstractXML implements ISerializableObject -{ +public class SCANConfigTvsXML extends SCANAbstractXML { @XmlElement(name = "LinkToFrame") private boolean linkToFrame; - + @XmlElement(name = "VertOption") private boolean vertOption; - + @XmlElement(name = "TipsOption") private boolean tipsOption; - + @XmlElement(name = "FilterOption") private boolean filterOption; - + @XmlElement(name = "ZoomFactor") private int zoomFactor; - + @XmlElement(name = "DefaultRank") private String defaultRank; - - @XmlElements( { @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) + + @XmlElements({ @XmlElement(name = "Attribute", type = SCANAttributesXML.class) }) private ArrayList attributesData; - - public SCANConfigTvsXML() - { + + public SCANConfigTvsXML() { } public boolean getLinkToFrame() { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANMonitorConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANMonitorConfigXML.java index f68abd3c86..3e0bdd134f 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANMonitorConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANMonitorConfigXML.java @@ -24,26 +24,22 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "ScanMonitorConfig") @XmlAccessorType(XmlAccessType.NONE) -public class SCANMonitorConfigXML implements ISerializableObject -{ +public class SCANMonitorConfigXML { @XmlElement(name = "CellTilt") private double cellTilt; - + @XmlElement(name = "DmdTilt") private double dmdTilt; - + @XmlElement(name = "Interval") private int interval; - + @XmlElement(name = "Plugins") private String plugins; - - public SCANMonitorConfigXML() - { + + public SCANMonitorConfigXML() { } public double getCellTilt() { @@ -68,13 +64,13 @@ public class SCANMonitorConfigXML implements ISerializableObject public void setInterval(int interval) { this.interval = interval; - } - + } + public String getPlugins() { return plugins; } public void setPlugins(String plugins) { this.plugins = plugins; - } + } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetXML.java index 6683c165a8..e7386b4d90 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetXML.java @@ -23,20 +23,16 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class SCANTrendSetXML implements ISerializableObject -{ - +public class SCANTrendSetXML { + @XmlElement(name = "Name") private String name; - + @XmlElement(name = "Attributes") private String attributes; - - public SCANTrendSetXML() - { + + public SCANTrendSetXML() { } public String getName() { diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetsXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetsXML.java index 288a6a6ef9..f08f1fad4e 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetsXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/SCANTrendSetsXML.java @@ -27,26 +27,21 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "TrendSets") @XmlAccessorType(XmlAccessType.NONE) -public class SCANTrendSetsXML implements ISerializableObject -{ - @XmlElements( { @XmlElement(name = "TrendSet", type = SCANTrendSetXML.class) }) +public class SCANTrendSetsXML { + + @XmlElements({ @XmlElement(name = "TrendSet", type = SCANTrendSetXML.class) }) private ArrayList trendSets; - - public SCANTrendSetsXML() - { + + public SCANTrendSetsXML() { } - public ArrayList getTrendSets() - { + public ArrayList getTrendSets() { return trendSets; } - public void setTrendSets(ArrayList trendSets) - { + public void setTrendSets(ArrayList trendSets) { this.trendSets = trendSets; } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/ScanAlarmXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/ScanAlarmXML.java index 9479cd1b97..1eaea1f534 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/ScanAlarmXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/scan/xml/ScanAlarmXML.java @@ -24,41 +24,37 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * Scan Alarm XML class. - * + * * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Nov 21, 2010 lvenable Initial creation - * + * + * Date Ticket# Engineer Description ------------ ---------- ----------- + * -------------------------- Nov 21, 2010 lvenable Initial creation + * * - * + * * @author lvenable - * @version 1.0 + * @version 1.0 */ @XmlRootElement(name = "ScanAlarms") @XmlAccessorType(XmlAccessType.NONE) -public class ScanAlarmXML implements ISerializableObject -{ +public class ScanAlarmXML { + @XmlElement(name = "CELL") private int cellAlarmTime; - + @XmlElement(name = "DMD") private int dmdAlarmTime; - + @XmlElement(name = "MESO") private int mesoAlarmTime; - + @XmlElement(name = "TVS") private int tvsAlarmTime; - - public ScanAlarmXML() - { + + public ScanAlarmXML() { } public int getCellAlarmTime() { @@ -91,5 +87,5 @@ public class ScanAlarmXML implements ISerializableObject public void setTvsAlarmTime(int tvsArlarmTime) { this.tvsAlarmTime = tvsArlarmTime; - } + } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/AreaIdXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/AreaIdXML.java index 3f0ea4d40e..5113ebbea3 100755 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/AreaIdXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/AreaIdXML.java @@ -27,8 +27,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * Monitoring area configuration xml. * @@ -45,23 +43,23 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class AreaIdXML implements ISerializableObject { - - @XmlElements( { @XmlElement(name = "StationID", type = StationIdXML.class) }) +public class AreaIdXML { + + @XmlElements({ @XmlElement(name = "StationID", type = StationIdXML.class) }) private ArrayList stationIds = new ArrayList(); - + @XmlAttribute(name = "id") private String areaId; - + @XmlAttribute(name = "type") private ZoneType type; - + @XmlAttribute(name = "cLat", required = false) private Double cLat; - + @XmlAttribute(name = "cLon", required = false) private Double cLon; - + public enum ZoneType { MARITIME, REGULAR; }; @@ -85,7 +83,8 @@ public class AreaIdXML implements ISerializableObject { } /** - * @param areaId the areaId to set + * @param areaId + * the areaId to set */ public void setAreaId(String areaId) { this.areaId = areaId; @@ -103,7 +102,8 @@ public class AreaIdXML implements ISerializableObject { } /** - * @param type the type to set + * @param type + * the type to set */ public void setType(ZoneType type) { this.type = type; @@ -117,7 +117,8 @@ public class AreaIdXML implements ISerializableObject { } /** - * @param lat the cLat to set + * @param lat + * the cLat to set */ public void setCLat(Double lat) { cLat = lat; @@ -131,7 +132,8 @@ public class AreaIdXML implements ISerializableObject { } /** - * @param lon the cLon to set + * @param lon + * the cLon to set */ public void setCLon(Double lon) { cLon = lon; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGDataXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGDataXML.java index 674d7c11a0..c18e283479 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGDataXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGDataXML.java @@ -29,7 +29,6 @@ import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.monitor.config.ValueNameIdData; -import com.raytheon.uf.common.serialization.ISerializableObject; /** * @@ -51,7 +50,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; */ @XmlRootElement(name = "FFFGData") @XmlAccessorType(XmlAccessType.NONE) -public class FFFGDataXML implements ISerializableObject { +public class FFFGDataXML { @XmlElement(name = "ExpDateTimeInMillis") private Long expTimeInMillis; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceItemXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceItemXML.java index b251c9ddca..e5acb0d4f2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceItemXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceItemXML.java @@ -23,44 +23,41 @@ 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; - /** * * This class holds the Source Item XML data. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Mar 10, 2010 #4517      lvenable     Initial creation
- *
+ * 
  * 
- * + * * @author lvenable * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class FFFGSourceItemXML implements ISerializableObject -{ +public class FFFGSourceItemXML { + @XmlAttribute(name = "type") private String type; - + @XmlAttribute(name = "name") private String name; - + @XmlAttribute(name = "id") private Long id; @XmlAttribute(name = "value") private String value; - - public FFFGSourceItemXML() - { + + public FFFGSourceItemXML() { } - + public String getType() { return type; } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceXML.java index d76e817ca4..6f1fcc3d5a 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFFGSourceXML.java @@ -29,7 +29,6 @@ import javax.xml.bind.annotation.XmlElements; import com.raytheon.uf.common.monitor.config.FFFGConfig.GuidSectType; import com.raytheon.uf.common.monitor.config.ValueNameIdData; -import com.raytheon.uf.common.serialization.ISerializableObject; /** * @@ -50,7 +49,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class FFFGSourceXML implements ISerializableObject { +public class FFFGSourceXML { @XmlElement(name = "SourceName") private String sourceName; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunConfigXML.java index f17b6ce0fd..87cfa50c8f 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunConfigXML.java @@ -27,8 +27,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * VGB's * @@ -46,9 +44,9 @@ import com.raytheon.uf.common.serialization.ISerializableObject; */ @XmlRootElement(name = "FFMPRunConfig") @XmlAccessorType(XmlAccessType.NONE) -public class FFMPRunConfigXML implements ISerializableObject { - - @XmlElements( { @XmlElement(name = "runner", type = FFMPRunXML.class) }) +public class FFMPRunConfigXML { + + @XmlElements({ @XmlElement(name = "runner", type = FFMPRunXML.class) }) private ArrayList runner; public ArrayList getFFMPRun() { @@ -58,7 +56,7 @@ public class FFMPRunConfigXML implements ISerializableObject { public void setFFMPRun(ArrayList runner) { this.runner = runner; } - + public void add(FFMPRunXML run) { if (runner == null) { runner = new ArrayList(); diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunXML.java index d8d2ead2e0..7ec7c51df9 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPRunXML.java @@ -26,8 +26,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * VGB's * @@ -44,7 +42,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class FFMPRunXML implements ISerializableObject { +public class FFMPRunXML { @XmlElements({ @XmlElement(name = "sourceIngestConfig", type = SourceIngestConfigXML.class) }) private ArrayList sourceIngests; @@ -57,7 +55,7 @@ public class FFMPRunXML implements ISerializableObject { @XmlElements({ @XmlElement(name = "domain", type = DomainXML.class) }) private ArrayList domains; - + @XmlElement(name = "cacheDir") private String cacheDir; @@ -214,12 +212,12 @@ public class FFMPRunXML implements ISerializableObject { } } - public void setCacheDir(String cacheDir) { - this.cacheDir = cacheDir; - } + public void setCacheDir(String cacheDir) { + this.cacheDir = cacheDir; + } - public String getCacheDir() { - return cacheDir; - } + public String getCacheDir() { + return cacheDir; + } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPSourceConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPSourceConfigXML.java index 7d639711b9..054a084752 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPSourceConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPSourceConfigXML.java @@ -28,6 +28,7 @@ package com.raytheon.uf.common.monitor.xml; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 01, 2010 dhladky Initial creation + * Oct 02, 2013 2361 njensen Use JAXBManager for XML * * * @@ -43,11 +44,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "FFMPSourceConfig") @XmlAccessorType(XmlAccessType.NONE) -public class FFMPSourceConfigXML implements ISerializableObject { +public class FFMPSourceConfigXML { @XmlElements({ @XmlElement(name = "source", type = SourceXML.class) }) private ArrayList source; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPTemplateXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPTemplateXML.java index 8acc0bc58c..07b2f2a5d2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPTemplateXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFMPTemplateXML.java @@ -25,11 +25,26 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; +/** + * The FFMP Template configuration + * + *
+ * 
+ * SOFTWARE HISTORY
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * --/--/----                          Initial creation
+ * 
+ * 
+ * 
+ * + * @author dhladky + * @version 1.0 + */ @XmlRootElement(name = "FFMPTemplate") @XmlAccessorType(XmlAccessType.NONE) -public class FFMPTemplateXML implements ISerializableObject { +public class FFMPTemplateXML { @XmlAttribute(name = "hucDepth") private Integer hucDepth; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIAttributeXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIAttributeXML.java index 1b0f5f7128..1ab0ac5518 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIAttributeXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIAttributeXML.java @@ -4,10 +4,8 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTIAttributeXML implements ISerializableObject { +public class FFTIAttributeXML { @XmlElement(name = "Name") protected String attribName; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTICWAsXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTICWAsXML.java index 8e74e055dc..be0c71607a 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTICWAsXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTICWAsXML.java @@ -7,11 +7,10 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTICWAsXML implements ISerializableObject { - @XmlElements ({ @XmlElement(name = "CWA", type = String.class) }) +public class FFTICWAsXML { + + @XmlElements({ @XmlElement(name = "CWA", type = String.class) }) private ArrayList cwaList; public FFTICWAsXML() { @@ -26,12 +25,13 @@ public class FFTICWAsXML implements ISerializableObject { } /** - * @param cwa the cwa to set + * @param cwa + * the cwa to set */ public void setCwaList(ArrayList cwaList) { this.cwaList = cwaList; } - + public void addCwa(String cwa) { this.cwaList.add(cwa); } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIDataXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIDataXML.java index 6a1c7965db..43e9624d06 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIDataXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTIDataXML.java @@ -43,11 +43,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlRootElement(name = "FFTIData") @XmlAccessorType(XmlAccessType.NONE) -public class FFTIDataXML implements ISerializableObject { +public class FFTIDataXML { @XmlElement(name = "CWAs", type = FFTICWAsXML.class) private FFTICWAsXML cwa; @@ -59,7 +57,7 @@ public class FFTIDataXML implements ISerializableObject { cwa = new FFTICWAsXML(); settingList = new ArrayList(); } - + /** * @return the cwaList */ @@ -89,7 +87,7 @@ public class FFTIDataXML implements ISerializableObject { public void setSettingList(ArrayList settingList) { this.settingList = settingList; } - + public void addSetting(FFTISettingXML setting) { if (settingList == null) { settingList = new ArrayList(); diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISetXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISetXML.java index acd28fb8e9..878a612d5d 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISetXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISetXML.java @@ -7,10 +7,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTISetXML implements ISerializableObject { +public class FFTISetXML { + @XmlElement(name = "type") private String type; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISettingXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISettingXML.java index 408d189e6b..c629ef330d 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISettingXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISettingXML.java @@ -6,10 +6,9 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTISettingXML implements ISerializableObject { +public class FFTISettingXML { + @XmlElement(name = "attribute", type = FFTIAttributeXML.class) private FFTIAttributeXML attribute; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceSetXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceSetXML.java index 1de7948389..4432891975 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceSetXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceSetXML.java @@ -4,10 +4,9 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTISourceSetXML implements ISerializableObject { +public class FFTISourceSetXML { + @XmlElement(name = "sourceType") private String sourceType; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceXML.java index 1f751e6579..31ef518bf8 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FFTISourceXML.java @@ -7,10 +7,8 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlAccessorType(XmlAccessType.NONE) -public class FFTISourceXML implements ISerializableObject { +public class FFTISourceXML { @XmlElements({ @XmlElement(name = "DisplayName", type = String.class) }) protected ArrayList displayNameList; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FreezingLevelXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FreezingLevelXML.java index 7b8a373bf7..384cb622fb 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FreezingLevelXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/FreezingLevelXML.java @@ -8,7 +8,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -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.Coordinate; @@ -16,7 +15,7 @@ import com.vividsolutions.jts.geom.Coordinate; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class FreezingLevelXML implements ISerializableObject { +public class FreezingLevelXML { @DynamicSerializeElement @XmlElement(name = "forecastHour") diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/MonAreaConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/MonAreaConfigXML.java index 04895c4f32..ad6685d93a 100755 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/MonAreaConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/MonAreaConfigXML.java @@ -27,8 +27,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * Monitoring area configuration xml. * @@ -46,18 +44,18 @@ import com.raytheon.uf.common.serialization.ISerializableObject; */ @XmlRootElement(name = "MonitorAreaConfig") @XmlAccessorType(XmlAccessType.NONE) -public class MonAreaConfigXML implements ISerializableObject { - - @XmlElements( { @XmlElement(name = "AreaID", type = AreaIdXML.class) }) +public class MonAreaConfigXML { + + @XmlElements({ @XmlElement(name = "AreaID", type = AreaIdXML.class) }) private ArrayList areaIds = new ArrayList(); - - @XmlElements( {@XmlElement(name = "timeWindow", type = Integer.class) }) + + @XmlElements({ @XmlElement(name = "timeWindow", type = Integer.class) }) private int timeWindow; - @XmlElements( {@XmlElement(name = "shipDistance", type = Integer.class) }) + @XmlElements({ @XmlElement(name = "shipDistance", type = Integer.class) }) private int shipDistance; - - @XmlElements( {@XmlElement(name = "useAlgorithms", type = Boolean.class) }) + + @XmlElements({ @XmlElement(name = "useAlgorithms", type = Boolean.class) }) private boolean useAlgorithms; public MonAreaConfigXML() { @@ -79,7 +77,8 @@ public class MonAreaConfigXML implements ISerializableObject { } /** - * @param timeWindow the timeWindow to set + * @param timeWindow + * the timeWindow to set */ public void setTimeWindow(int timeWindow) { this.timeWindow = timeWindow; @@ -93,7 +92,8 @@ public class MonAreaConfigXML implements ISerializableObject { } /** - * @param shipDistance the shipDistance to set + * @param shipDistance + * the shipDistance to set */ public void setShipDistance(int shipDistance) { this.shipDistance = shipDistance; @@ -107,12 +107,13 @@ public class MonAreaConfigXML implements ISerializableObject { } /** - * @param useAlgorithms the useAlgorithms to set + * @param useAlgorithms + * the useAlgorithms to set */ public void setUseAlgorithms(boolean useAlgorithms) { this.useAlgorithms = useAlgorithms; } - + public void addAreaId(AreaIdXML areaXml) { areaIds.add(areaXml); } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductRunXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductRunXML.java index 510cd688b5..2e2fb8b32a 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductRunXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductRunXML.java @@ -11,7 +11,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE; -import com.raytheon.uf.common.serialization.ISerializableObject; /** * XML @@ -28,7 +27,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; */ @XmlRootElement(name = "FFMPRunXML") @XmlAccessorType(XmlAccessType.NONE) -public class ProductRunXML implements ISerializableObject { +public class ProductRunXML { @XmlAttribute(name = "name") private String productName; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductXML.java index 62df49b1e2..16cfd5dff2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/ProductXML.java @@ -42,10 +42,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; -import com.raytheon.uf.common.serialization.ISerializableObject; @XmlAccessorType(XmlAccessType.NONE) -public class ProductXML implements ISerializableObject { +public class ProductXML { @XmlAttribute(name = "primarySource") protected String primarySource; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANModelParameterXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANModelParameterXML.java index 6498f0a9aa..807f8a57ff 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANModelParameterXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANModelParameterXML.java @@ -4,10 +4,8 @@ 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; - @XmlAccessorType(XmlAccessType.NONE) -public class SCANModelParameterXML implements ISerializableObject { +public class SCANModelParameterXML { @XmlAttribute(name = "parameterName") private String parameterName; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteRunConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteRunConfigXML.java index c6d1e60a3c..9672eebe0f 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteRunConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteRunConfigXML.java @@ -9,11 +9,10 @@ import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import com.raytheon.uf.common.dataplugin.radar.util.RadarsInUseUtil; -import com.raytheon.uf.common.serialization.ISerializableObject; @XmlRootElement(name = "SCANSiteRunConfig") @XmlAccessorType(XmlAccessType.NONE) -public class SCANSiteRunConfigXML implements ISerializableObject { +public class SCANSiteRunConfigXML { @XmlElements({ @XmlElement(name = "site") }) private ArrayList sites; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteXML.java index dacd57f9c9..2f1c12d49a 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SCANSiteXML.java @@ -8,10 +8,8 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - @XmlAccessorType(XmlAccessType.NONE) -public class SCANSiteXML implements ISerializableObject { +public class SCANSiteXML { @XmlElement(name = "scanSite") private String scanSite; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceIngestConfigXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceIngestConfigXML.java index 27af62b4d1..56459f8532 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceIngestConfigXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceIngestConfigXML.java @@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * XML for Source datakey contributions in FFMPRunConfig * @@ -44,7 +42,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class SourceIngestConfigXML implements ISerializableObject { +public class SourceIngestConfigXML { @XmlAttribute(name = "name") protected String sourceName; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceXML.java index fc586bae7e..12ee0548a2 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/SourceXML.java @@ -43,10 +43,9 @@ import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.GUIDANCE_TYPE; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.RATEORACCCUM; -import com.raytheon.uf.common.serialization.ISerializableObject; @XmlAccessorType(XmlAccessType.NONE) -public class SourceXML implements ISerializableObject { +public class SourceXML { @XmlElement(name = "SourceName") protected String sourceName; @@ -87,9 +86,9 @@ public class SourceXML implements ISerializableObject { @XmlElement(name = "interpolatedGuidanceTransition") protected boolean interpolatedGuidanceTransition; - //@XmlElement(name = "unit") // DR 14412 + // @XmlElement(name = "unit") // DR 14412 protected String unit; - + public static final String UNIT_TXT = "inches"; // DR 14412 @XmlElement(name = "conversion") @@ -288,8 +287,8 @@ public class SourceXML implements ISerializableObject { } public String getUnit() { - if( unit == null || unit.isEmpty()) // DR 14412 - unit = UNIT_TXT; + if (unit == null || unit.isEmpty()) // DR 14412 + unit = UNIT_TXT; return unit; } @@ -420,31 +419,28 @@ public class SourceXML implements ISerializableObject { * @param key * @param param * @return - *//* 2012-04-18: Old version: keep for reference: Gang Zhang - private boolean isOverride(String key, String param) { - if (sourceOverrideDataMap != null) { - if (sourceOverrideDataMap.containsKey(key)) { - if (sourceOverrideDataMap.get(key).contains(param)) { - return true; - } - } - } - - return false; - } -*/ - /**2012-04-18: code is from David Hladky in Omaha - * for DR 14619/14620. Gang Zhang is checked in - * Check to see if we are overridden + */ + /* + * 2012-04-18: Old version: keep for reference: Gang Zhang private boolean + * isOverride(String key, String param) { if (sourceOverrideDataMap != null) + * { if (sourceOverrideDataMap.containsKey(key)) { if + * (sourceOverrideDataMap.get(key).contains(param)) { return true; } } } + * + * return false; } + */ + /** + * 2012-04-18: code is from David Hladky in Omaha for DR 14619/14620. Gang + * Zhang is checked in Check to see if we are overridden * * @param key * @param param * @return - */ + */ private boolean isOverride(String key, String param) { if (sourceOverrideDataMap != null) { if (sourceOverrideDataMap.containsKey(key)) { - for (SourceOverrideParamXML paramx: sourceOverrideDataMap.get(key)) { + for (SourceOverrideParamXML paramx : sourceOverrideDataMap + .get(key)) { if (paramx.getParam().equals(param)) { return true; } @@ -453,5 +449,5 @@ public class SourceXML implements ISerializableObject { } return false; - } + } } diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/StationIdXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/StationIdXML.java index ddd9602105..52a1bf7189 100755 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/StationIdXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/StationIdXML.java @@ -23,8 +23,6 @@ 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; - /** * Monitoring area configuration xml. * @@ -41,18 +39,18 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class StationIdXML implements ISerializableObject { - +public class StationIdXML { + @XmlAttribute(name = "type") private String type; - + @XmlAttribute(name = "name") private String name; - + public static final String MARITIME = "MARITIME"; - + public static final String METAR = "METAR"; - + public static final String MESONET = "MESONET"; public StationIdXML() { @@ -74,7 +72,8 @@ public class StationIdXML implements ISerializableObject { } /** - * @param name the name to set + * @param name + * the name to set */ public void setName(String name) { this.name = name; diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/VGBXML.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/VGBXML.java index 3f9cb1f0c3..e1484d4348 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/VGBXML.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/xml/VGBXML.java @@ -26,8 +26,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; -import com.raytheon.uf.common.serialization.ISerializableObject; - /** * VGB's * @@ -44,9 +42,9 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) -public class VGBXML implements ISerializableObject { +public class VGBXML { - @XmlElements( { @XmlElement(name = "vgb") } ) + @XmlElements({ @XmlElement(name = "vgb") }) private ArrayList lids = new ArrayList(); /** @@ -57,14 +55,16 @@ public class VGBXML implements ISerializableObject { } /** - * @param the lids to set + * @param the + * lids to set */ public void setLid(ArrayList lids) { this.lids = lids; } - + /** * Add one + * * @param slid */ public void add(String lid) { diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ISerializableObject.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ISerializableObject.java index 1faf167c4c..1edbefab81 100644 --- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ISerializableObject.java +++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ISerializableObject.java @@ -29,16 +29,28 @@ package com.raytheon.uf.common.serialization; * *
  * SOFTWARE HISTORY
- * Date			Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * Aug 11, 2008				njensen	    Initial creation
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * Aug 11, 2008             njensen     Initial creation
+ * Oct 02, 2013 2361        njensen     Deprecated
  * 
  * 
* * @author njensen * @version 1.0 + * @deprecated This interface is deprecated but may still be required until it + * is completely removed from the system. DynamicSerialize no longer + * requires ISerializableObjects, just use the DynamicSerialize + * annotations. JAXB/XML only requires it if you use the global JAXB + * context through {@link SerializationUtil}, however that is a + * performance hit and deprecated and you should instead create your + * own {@link JAXBManager}. Hibernate still requires + * ISerializableObject but an alternative will be provided in the + * near future. + * */ +@Deprecated public interface ISerializableObject { } diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/JAXBManager.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/JAXBManager.java index b2e20b2788..cbe39977c6 100644 --- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/JAXBManager.java +++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/JAXBManager.java @@ -127,7 +127,10 @@ public class JAXBManager { * @throws JAXBException */ public JAXBManager(Class... clazz) throws JAXBException { + long t0 = System.currentTimeMillis(); jaxbContext = JAXBContext.newInstance(clazz); + System.out.println("JAXB context with " + clazz.length + + " classes inited in: " + (System.currentTimeMillis() - t0)); } /** diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SingleTypeJAXBManager.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SingleTypeJAXBManager.java index 5f682c6f1f..dfebaafc4b 100644 --- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SingleTypeJAXBManager.java +++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SingleTypeJAXBManager.java @@ -23,6 +23,9 @@ import java.io.File; import javax.xml.bind.JAXBException; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; + /** * A JAXBManager that only supports a single class (including any classes that * are contained within that class). Useful when dealing specifically with an @@ -47,6 +50,9 @@ import javax.xml.bind.JAXBException; public class SingleTypeJAXBManager extends JAXBManager { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(SingleTypeJAXBManager.class); + protected Class type; /** @@ -86,4 +92,29 @@ public class SingleTypeJAXBManager extends JAXBManager { return super.unmarshalFromXmlFile(type, new File(filePath)); } + /** + * Creates a SingleTypeJAXBManager for a specified type, but catches any + * JAXBExceptions thrown and logs them. If an exception does occur, returns + * null. + * + * @param clazz + * the class of the object to read/write XML for + * @return the SingleTypeJAXBManager or null if an exception occurred + */ + public static SingleTypeJAXBManager createWithoutException( + Class clazz) { + SingleTypeJAXBManager retVal = null; + try { + retVal = new SingleTypeJAXBManager(clazz); + } catch (JAXBException e) { + // technically this should only ever happen if a developer messes + // up, so we're going to print the stacktrace too as extra warning + e.printStackTrace(); + statusHandler.error("Error initializing SingleTypeJAXBManager for " + + clazz.getName(), e); + } + + return retVal; + } + }