From e560ce48800aecaca10376945d6f2b8f789795bd Mon Sep 17 00:00:00 2001 From: Brad Gonzales Date: Fri, 16 May 2014 08:47:29 -0500 Subject: [PATCH] Omaha #3002 Moved common taf code to com.raytheon.uf.common.dataplugin.taf. Amend: updated manifest. Removed static imports. Refactored String constants to Pattern constants in TafConstants. Refactored com.raytheon.edex.plugin.taf to com.raytheon.uf.edex.taf. Renamed com.raytheon.edex.plugin.taf project to com.raytheon.uf.edex.taf. fixed .project. Updated yet more Patterns. Change-Id: Ia5db9d185c6c32e6ce25748ae4b3b6fb389b2acc Former-commit-id: f73ed1c8ee81f3ae1ffdf44ba4726453e7e0b9d2 --- .../META-INF/MANIFEST.MF | 4 +- .../climatology/WeatherPlotDataManager.java | 3 +- .../viz/aviation/editor/LoaderDialog.java | 3 +- .../aviation/editor/TafViewerEditorDlg.java | 3 +- .../viz/aviation/guidance/TugViewer.java | 3 +- .../viz/aviation/model/TimeGroup.java | 14 ++- .../viz/aviation/monitor/SiteMonitor.java | 3 +- .../aviation/monitor/TafMonitorObserver.java | 3 +- .../viz/aviation/monitor/TafSiteComp.java | 3 +- .../viz/aviation/monitor/TafUtil.java | 5 +- .../feature.xml | 2 +- .../edex/plugin/taf/common/package-info.java | 23 ----- .../.classpath | 0 .../.project | 28 ++++++ .../.settings/org.eclipse.jdt.core.prefs | 0 .../META-INF/MANIFEST.MF | 20 +++++ .../build.properties | 4 + .../common/dataplugin/taf}/ChangeGroup.java | 87 +++++++------------ .../uf/common/dataplugin/taf}/IcingLayer.java | 3 +- .../uf/common/dataplugin/taf}/TAFParts.java | 3 +- .../dataplugin/taf}/TAFWeatherTools.java | 3 +- .../common/dataplugin/taf}/TAFWxElements.java | 4 +- .../common/dataplugin/taf}/TafConstants.java | 60 ++++++++----- .../uf/common/dataplugin/taf}/TafPeriod.java | 3 +- .../uf/common/dataplugin/taf}/TafRecord.java | 4 +- .../common/dataplugin/taf}/TafSkyCover.java | 3 +- .../dataplugin/taf}/TafWeatherCondition.java | 4 +- .../dataplugin/taf}/TemperatureForecast.java | 4 +- .../dataplugin/taf}/TurbulenceLayer.java | 4 +- .../feature.xml | 9 +- .../.classpath | 7 ++ .../.project | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 7 ++ .../META-INF/MANIFEST.MF | 12 ++- .../build.properties | 0 .../com.raytheon.edex.plugin.taf.ecl | 0 .../res/conf/attributes.xml | 0 .../res/scripts/tafIndices.sql | 0 .../res/spring/taf-common.xml | 6 +- .../res/spring/taf-ingest.xml | 4 +- .../uf}/edex/plugin/taf/TafDecoder.java | 9 +- .../uf}/edex/plugin/taf/dao/TafDao.java | 5 +- .../taf/decoder/TAFChangeGroupFactory.java | 34 ++++---- .../edex/plugin/taf/decoder/TAFParser.java | 81 ++++++++--------- .../edex/plugin/taf/decoder/TAFSubGroup.java | 84 +++++++++--------- .../edex/plugin/taf/decoder/TafSeparator.java | 57 ++++++------ .../edex/plugin/taf/decoder/package-info.java | 2 +- .../uf}/edex/plugin/taf/package-info.java | 2 +- .../edex_static/base/distribution/taf.xml | 0 49 files changed, 325 insertions(+), 299 deletions(-) delete mode 100644 edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/package-info.java rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.common.dataplugin.taf}/.classpath (100%) create mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.taf/.project rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.common.dataplugin.taf}/.settings/org.eclipse.jdt.core.prefs (100%) create mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.taf/META-INF/MANIFEST.MF create mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.taf/build.properties rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/ChangeGroup.java (88%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/IcingLayer.java (97%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TAFParts.java (94%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TAFWeatherTools.java (99%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TAFWxElements.java (97%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TafConstants.java (54%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TafPeriod.java (99%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TafRecord.java (98%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TafSkyCover.java (97%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TafWeatherCondition.java (98%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TemperatureForecast.java (97%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common => com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf}/TurbulenceLayer.java (97%) create mode 100644 edexOsgi/com.raytheon.uf.edex.plugin.taf/.classpath rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/.project (93%) create mode 100644 edexOsgi/com.raytheon.uf.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/META-INF/MANIFEST.MF (63%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/build.properties (100%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/com.raytheon.edex.plugin.taf.ecl (100%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/res/conf/attributes.xml (100%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/res/scripts/tafIndices.sql (100%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/res/spring/taf-common.xml (74%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/res/spring/taf-ingest.xml (92%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/TafDecoder.java (91%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/dao/TafDao.java (92%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/decoder/TAFChangeGroupFactory.java (94%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/decoder/TAFParser.java (86%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/decoder/TAFSubGroup.java (69%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/decoder/TafSeparator.java (83%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/decoder/package-info.java (94%) rename edexOsgi/{com.raytheon.edex.plugin.taf/src/com/raytheon => com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf}/edex/plugin/taf/package-info.java (95%) rename edexOsgi/{com.raytheon.edex.plugin.taf => com.raytheon.uf.edex.plugin.taf}/utility/edex_static/base/distribution/taf.xml (100%) diff --git a/cave/com.raytheon.viz.aviation/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.aviation/META-INF/MANIFEST.MF index bf91f504a6..f657364190 100644 --- a/cave/com.raytheon.viz.aviation/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.aviation/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.common.dataplugin.ccfp, com.raytheon.uf.common.pointdata;bundle-version="1.11.7", com.raytheon.uf.common.serialization, - com.raytheon.edex.plugin.taf;bundle-version="1.12.1174", com.raytheon.viz.pointdata;bundle-version="1.11.7", com.raytheon.uf.common.python;bundle-version="1.11.7", org.jep;bundle-version="1.0.0", @@ -27,7 +26,8 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.common.tafqueue;bundle-version="1.0.0", org.apache.commons.lang;bundle-version="2.3.0", com.raytheon.uf.common.auth;bundle-version="1.12.1174", - com.raytheon.uf.viz.datacube + com.raytheon.uf.viz.datacube, + com.raytheon.uf.common.dataplugin.taf Bundle-ActivationPolicy: lazy Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Export-Package: com.raytheon.viz.aviation, diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDataManager.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDataManager.java index 593607f89d..eac4cd7f5b 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDataManager.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WeatherPlotDataManager.java @@ -34,7 +34,7 @@ import javax.xml.bind.JAXB; import jep.JepException; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.PathManagerFactory; @@ -70,6 +70,7 @@ import com.raytheon.viz.aviation.xml.WxPlotCfg; * Apr 28, 2011 8065 rferrel Use cache data * Nov 26, 2012 1298 rferrel Non-blocking dialog cleanup now use * IUFStatusHandler for error messages. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/LoaderDialog.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/LoaderDialog.java index 3850b91c62..5227a15935 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/LoaderDialog.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/LoaderDialog.java @@ -44,7 +44,7 @@ import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.viz.aviation.monitor.TafUtil; import com.raytheon.viz.aviation.resource.ResourceConfigMgr; @@ -72,6 +72,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 9/9/2010 5468 rferrel Check for no TAF loaded for a site * 10/1/2010 4345 rferrel Made products display the same as AWIPS I * 10/04/2012 1229 rferrel Made non-blocking. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java index de365e1c17..e9654a0f92 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java @@ -91,7 +91,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; @@ -235,6 +235,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 02/19/2014 16980 zhao add code to ensure the Alt flag is false after the Alt kay is released * 21Mar2014 #2925 lvenable Fixed NPE error found during testing. * 06May2014 3091 rferrel Use OUP authorization to bring up send dialog. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/guidance/TugViewer.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/guidance/TugViewer.java index 8b4ac27fc2..be457f0fd0 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/guidance/TugViewer.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/guidance/TugViewer.java @@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; import com.raytheon.viz.aviation.cachedata.CacheGuidanceRequest; import com.raytheon.viz.aviation.cachedata.TampCacheGuidanceRequest; @@ -54,6 +54,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag; * and routine button's values. * 14 APR 2011 8065 rferrel Add flag to indicate display is current * and implement data caching + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/model/TimeGroup.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/model/TimeGroup.java index 9b4e84b3a7..08a26105dc 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/model/TimeGroup.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/model/TimeGroup.java @@ -20,13 +20,6 @@ package com.raytheon.viz.aviation.model; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO; - import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -34,6 +27,7 @@ import java.util.TimeZone; import com.raytheon.uf.common.dataplugin.obs.metar.MetarRecord; import com.raytheon.uf.common.dataplugin.obs.metar.util.SkyCover; +import com.raytheon.uf.common.dataplugin.taf.TafConstants; import com.raytheon.viz.aviation.model.CloudGroup.CloudCategory; /** @@ -62,6 +56,7 @@ import com.raytheon.viz.aviation.model.CloudGroup.CloudCategory; * 1/15/2009 1816 grichard Correct TAF to conform to 10-813 NWSI. * 4/29/2009 1982 grichard Correct TAF to conform to 10-813 NWSI. * 5/11/2009 1816 grichard Corrected visibility for metar change. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @@ -810,8 +805,9 @@ public class TimeGroup implements Comparable { /* Becoming (BECMG) */ /* Tempo (TEMPO) */ /* Probability (PROB) */ - FM(CG_FM), BECMG(CG_BECMG), INITIAL(CG_INITIAL), TEMPO(CG_TEMPO), PROB( - CG_PROB), PROB_TEMPO(CG_PROB_TEMPO); + FM(TafConstants.CG_FM), BECMG(TafConstants.CG_BECMG), INITIAL( + TafConstants.CG_INITIAL), TEMPO(TafConstants.CG_TEMPO), PROB( + TafConstants.CG_PROB), PROB_TEMPO(TafConstants.CG_PROB_TEMPO); /* * See: NWS Operations Manual W/OM12 Part D-31 for more information. */ diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java index d789633e37..e6e7ad7d7a 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java @@ -34,7 +34,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; @@ -65,6 +65,7 @@ import com.raytheon.viz.aviation.xml.MonitorCfg; * 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer * 11AUG2012 14570 zhao Added 'cat' to alert_key_map * 02Jan2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafMonitorObserver.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafMonitorObserver.java index 9e58c6ab29..7776eaf9e2 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafMonitorObserver.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafMonitorObserver.java @@ -22,7 +22,7 @@ package com.raytheon.viz.aviation.monitor; import java.util.ArrayList; import java.util.Collection; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.viz.core.alerts.AlertMessage; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; import com.raytheon.viz.aviation.guidance.GuidanceRequest; @@ -42,6 +42,7 @@ import com.raytheon.viz.aviation.observer.TafMonitorDlg; * Sep 2, 2009 njensen Initial creation * Nov 12, 2010 6195 rferrel Clear guidance's TAF cache when * an alert received. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java index 0901079788..49573a354b 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java @@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.VizApp; @@ -94,6 +94,7 @@ import com.raytheon.viz.avnconfig.IStatusSettable; * 01/02/2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI * 03/07/2013 1735 rferrel Flag to indicate grid data is needed. * 19Mar2014 #2925 lvenable Added dispose checks for runAsync. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @author lvenable diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafUtil.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafUtil.java index d691657a2c..ad0a2eb7f3 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafUtil.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafUtil.java @@ -27,10 +27,10 @@ import java.util.HashMap; import java.util.Map; import java.util.TimeZone; -import com.raytheon.edex.plugin.taf.common.TafRecord; -import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.uf.common.dataplugin.PluginDataObject; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; +import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -53,6 +53,7 @@ import com.raytheon.uf.viz.datacube.DataCubeContainer; * Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references * Feb 24, 2014 2830 njensen Sort dataTimes in getLatestTafs() * so it works correctly + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/cave/com.raytheon.viz.avnfps.feature/feature.xml b/cave/com.raytheon.viz.avnfps.feature/feature.xml index d86a1d8988..021b3248fa 100644 --- a/cave/com.raytheon.viz.avnfps.feature/feature.xml +++ b/cave/com.raytheon.viz.avnfps.feature/feature.xml @@ -42,7 +42,7 @@ version="0.0.0"/> + + com.raytheon.uf.common.dataplugin.taf + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/.settings/org.eclipse.jdt.core.prefs diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.taf/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..32db4d81a2 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 1 +Bundle-Name: Taf Plug-in +Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.taf +Bundle-Version: 1.14.0.qualifier +Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization +Bundle-Vendor: RAYTHEON +Export-Package: com.raytheon.uf.common.dataplugin.taf +Require-Bundle: org.apache.commons.lang, + javax.persistence +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: com.raytheon.uf.common.dataplugin, + com.raytheon.uf.common.dataplugin.annotations, + com.raytheon.uf.common.dataplugin.persist, + com.raytheon.uf.common.geospatial, + com.raytheon.uf.common.pointdata.spatial, + com.raytheon.uf.common.serialization.annotations, + com.raytheon.uf.common.time.util, + com.raytheon.uf.common.wmo, + org.hibernate.annotations diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.taf/build.properties b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/build.properties new file mode 100644 index 0000000000..34d2e4d2da --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/ChangeGroup.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/ChangeGroup.java similarity index 88% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/ChangeGroup.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/ChangeGroup.java index 6956c8079d..10a83a2fc3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/ChangeGroup.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/ChangeGroup.java @@ -18,33 +18,13 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; - -import static com.raytheon.edex.plugin.taf.common.TafConstants.ALTIMETER_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CHANGE_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.ICING_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.SKY_COVER_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.TEMP_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.TURBULENCE_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.VISIBILITY_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.VS_6PLUS_M; -import static com.raytheon.edex.plugin.taf.common.TafConstants.VS_6PLUS_SM; -import static com.raytheon.edex.plugin.taf.common.TafConstants.WIND_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.WIND_SHEAR_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.WX_CAVOK; -import static com.raytheon.edex.plugin.taf.common.TafConstants.WX_NSW; +package com.raytheon.uf.common.dataplugin.taf; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.UUID; import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.persistence.CascadeType; import javax.persistence.Column; @@ -62,7 +42,7 @@ import javax.persistence.Transient; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; -import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.common.time.util.TimeUtil; /** * This class represents a forecast group found in a taf message. @@ -81,8 +61,11 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Oct 21, 2008 1515 jkorman Added 30 Hour capability changes. * Jun 28, 2012 #827 dgilling Annotate id field for * serialization. - * Nov 01, 2013 2361 njensen Remove XML annotations + * Nov 01, 2013 2361 njensen Remove XML annotations * Feb 10, 2014 2777 rferrel set the parentId when assinging sets. + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. + * Changed groupPattern to static field. + * Refactored Strings to Patterns in TafConstants. * * * @@ -247,8 +230,8 @@ public class ChangeGroup extends PersistableDataObject { changeGroup = group; tafValidPeriod = tafIssuePeriod; - tafChangePeriod = new TafPeriod(TimeTools.copy(tafValidPeriod - .getStartDate()), TimeTools.copy(tafValidPeriod.getEndDate())); + tafChangePeriod = new TafPeriod(TimeUtil.newCalendar(tafValidPeriod + .getStartDate()), TimeUtil.newCalendar(tafValidPeriod.getEndDate())); decode(extractTime(group)); } @@ -297,8 +280,7 @@ public class ChangeGroup extends PersistableDataObject { private String extractTime(String groupData) { StringBuilder grpData = new StringBuilder(groupData); checkGroupDataEnd(grpData); - Pattern groupPattern = Pattern.compile(CHANGE_GROUP_EXP); - Matcher matcher = groupPattern.matcher(grpData); + Matcher matcher = TafConstants.CHANGE_GROUP_EXP.matcher(grpData); int stopPos = -1; if (matcher.find()) { @@ -312,10 +294,10 @@ public class ChangeGroup extends PersistableDataObject { probability = Integer.parseInt(prob.substring(4, 6)); s = (matcher.group(7) != null) ? matcher.group(7).trim() : null; - if (CG_TEMPO.equals(s)) { - chgGrp = CG_PROB_TEMPO; + if (TafConstants.CG_TEMPO.equals(s)) { + chgGrp = TafConstants.CG_PROB_TEMPO; } else { - chgGrp = CG_PROB; + chgGrp = TafConstants.CG_PROB; } } @@ -328,14 +310,14 @@ public class ChangeGroup extends PersistableDataObject { int t2 = Integer.parseInt(s.substring(2, 4)); // FM group is hour/minute - if (CG_FM.equals(chgGrp)) { + if (TafConstants.CG_FM.equals(chgGrp)) { tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSss( t1, t2, tafValidPeriod); } else { // All the rest are hour/hour tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSEE( t1, t2, tafValidPeriod, - CG_BECMG.equals(change_indicator)); + TafConstants.CG_BECMG.equals(change_indicator)); } } } @@ -359,10 +341,9 @@ public class ChangeGroup extends PersistableDataObject { icing_layers = new HashSet(); temp_forecasts = new HashSet(); - Pattern groupPattern = Pattern.compile(WIND_GROUP_EXP); // Extracting the wind group checkGroupDataEnd(grpData); - Matcher matcher = groupPattern.matcher(grpData); + Matcher matcher = TafConstants.WIND_GROUP_EXP.matcher(grpData); int stopPos = -1; if (matcher.find()) { @@ -395,11 +376,10 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting icing information - groupPattern = Pattern.compile(ICING_GROUP_EXP); checkGroupDataEnd(grpData); int start = grpData.length(); int stop = -1; - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.ICING_GROUP_EXP.matcher(grpData); while (matcher.find()) { icing_layers.add(new IcingLayer(this, matcher.group(1), matcher .group(2), matcher.group(3))); @@ -411,11 +391,10 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting turbulence information - groupPattern = Pattern.compile(TURBULENCE_GROUP_EXP); checkGroupDataEnd(grpData); start = grpData.length(); stop = -1; - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.TURBULENCE_GROUP_EXP.matcher(grpData); while (matcher.find()) { turbulence_layers.add(new TurbulenceLayer(this, matcher.group(1), matcher.group(2), matcher.group(3))); @@ -426,11 +405,10 @@ public class ChangeGroup extends PersistableDataObject { grpData.delete(start, stop); } - groupPattern = Pattern.compile(TEMP_GROUP_EXP); checkGroupDataEnd(grpData); start = grpData.length(); stop = -1; - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.TEMP_GROUP_EXP.matcher(grpData); while (matcher.find()) { temp_forecasts.add(new TemperatureForecast(this, matcher.group(1), matcher.group(2), matcher.group(3))); @@ -442,9 +420,8 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting altimeter information - groupPattern = Pattern.compile(ALTIMETER_GROUP_EXP); checkGroupDataEnd(grpData); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.ALTIMETER_GROUP_EXP.matcher(grpData); if (matcher.find()) { altim_in_hg = Double .toString(Double.parseDouble(matcher.group(1)) / 100); @@ -452,9 +429,8 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting wind shear information - groupPattern = Pattern.compile(WIND_SHEAR_GROUP_EXP); checkGroupDataEnd(grpData); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.WIND_SHEAR_GROUP_EXP.matcher(grpData); if (matcher.find()) { this.wind_shear_hgt_ft_agl = Integer.parseInt(matcher.group(1)) * 100; @@ -464,30 +440,27 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting the visibility - groupPattern = Pattern.compile(WX_CAVOK); checkGroupDataEnd(grpData); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.WX_CAVOK.matcher(grpData); if (matcher.find()) { // CAVOK implies 6+ visibility and no cloud or weather groups! - visibility_mi = VS_6PLUS_SM; + visibility_mi = TafConstants.VS_6PLUS_SM; grpData.delete(matcher.start(), matcher.end()); } else { // Extracting the visibility - groupPattern = Pattern.compile(VISIBILITY_GROUP_EXP); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.VISIBILITY_GROUP_EXP.matcher(grpData); if (matcher.find()) { visibility_mi = matcher.group(1); grpData.delete(matcher.start(), matcher.end()); } else { // Statue miles vis didn't work so check metric - groupPattern = Pattern.compile("\\d{4}"); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.FourDigitMetric.matcher(grpData); if (matcher.find()) { if (matcher.end() < 6) { visibility_mi = matcher.group(); - if (VS_6PLUS_M.equals(visibility_mi)) { - visibility_mi = VS_6PLUS_SM; + if (TafConstants.VS_6PLUS_M.equals(visibility_mi)) { + visibility_mi = TafConstants.VS_6PLUS_SM; } grpData.delete(matcher.start(), matcher.end()); } @@ -495,13 +468,12 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting the weather - groupPattern = Pattern.compile(WX_NSW); checkGroupDataEnd(grpData); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.WX_NSW.matcher(grpData); if (matcher.find()) { TafWeatherCondition wxCon = new TafWeatherCondition(); wxCon.setSequenceId(1); - wxCon.setOther(WX_NSW); + wxCon.setOther(TafConstants.WX_NSW.pattern()); weather.add(wxCon); wxCon.setParentID(this); grpData.delete(matcher.start(), matcher.end()); @@ -519,9 +491,8 @@ public class ChangeGroup extends PersistableDataObject { } // Extracting the sky cover - groupPattern = Pattern.compile(SKY_COVER_GROUP_EXP); checkGroupDataEnd(grpData); - matcher = groupPattern.matcher(grpData); + matcher = TafConstants.SKY_COVER_GROUP_EXP.matcher(grpData); start = grpData.length(); stop = -1; diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/IcingLayer.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/IcingLayer.java similarity index 97% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/IcingLayer.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/IcingLayer.java index 2ea5d818a0..e2dc739c47 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/IcingLayer.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/IcingLayer.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import javax.persistence.Column; import javax.persistence.Entity; @@ -45,6 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 8/30/06 bphillip Initial Creation * 6/21/07 180 bphillip Updated for use with plugin persistance pattern * Nov 01, 2013 2361 njensen Remove XML annotations + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParts.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFParts.java similarity index 94% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParts.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFParts.java index da3db29501..8583e70aa4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParts.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFParts.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.decoder; +package com.raytheon.uf.common.dataplugin.taf; /**TODO Add Description * @@ -28,6 +28,7 @@ package com.raytheon.edex.plugin.taf.decoder; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080424 1001 jkorman Initial implementation. + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWeatherTools.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWeatherTools.java similarity index 99% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWeatherTools.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWeatherTools.java index 38c2416154..69e9e66f00 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWeatherTools.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWeatherTools.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +37,7 @@ import java.util.Set; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080605 1001 jkorman Initial implementation. + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWxElements.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWxElements.java similarity index 97% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWxElements.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWxElements.java index e1c8caafb7..b4e472f5c1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TAFWxElements.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TAFWxElements.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; /** * Intermediate data element used to parse weather data elements. It differs from @@ -32,7 +32,7 @@ package com.raytheon.edex.plugin.taf.common; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080605 1001 jkorman Initial implementation. - * + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * @author jkorman diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafConstants.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafConstants.java similarity index 54% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafConstants.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafConstants.java index d8b085fc64..37788c8150 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafConstants.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafConstants.java @@ -17,7 +17,9 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; + +import java.util.regex.Pattern; /** * String constants used in the TAF Plugin. @@ -27,6 +29,9 @@ package com.raytheon.edex.plugin.taf.common; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 4, 2008 1444 grichard Initial creation. + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. + * Changed String patterns to Patterns. + * Refactored Strings to Patterns in TafConstants. * * * @author grichard @@ -36,28 +41,36 @@ package com.raytheon.edex.plugin.taf.common; public final class TafConstants { /** Regular expression for extracting wind information */ - public static final String WIND_GROUP_EXP = "(\\d{3}|VRB)(\\d{2,3})((G)(\\d{2,3}))?(KT|MPS|KMH)()"; + public static final Pattern WIND_GROUP_EXP = Pattern + .compile("(\\d{3}|VRB)(\\d{2,3})((G)(\\d{2,3}))?(KT|MPS|KMH)()"); /** Regular expression for extracting visibility information */ - public static final String VISIBILITY_GROUP_EXP = "(P?[0-6]|[0-6] [13]/[24]|[13]/[24])SM"; + public static final Pattern VISIBILITY_GROUP_EXP = Pattern + .compile("(P?[0-6]|[0-6] [13]/[24]|[13]/[24])SM"); /** Regular expression for extracting sky coverage information */ - public static final String SKY_COVER_GROUP_EXP = "(((FEW|SCT|BKN|OVC|VV)((\\d{3}|///)((CB|TCU)?)))|((SKC|CLR|NSC)))"; + public static final Pattern SKY_COVER_GROUP_EXP = Pattern + .compile("(((FEW|SCT|BKN|OVC|VV)((\\d{3}|///)((CB|TCU)?)))|((SKC|CLR|NSC)))"); /** Regular expression for extracting wind shear information */ - public static final String WIND_SHEAR_GROUP_EXP = "WS([0-9]{3})/([0-9]{3})([0-9]{2})KT"; + public static final Pattern WIND_SHEAR_GROUP_EXP = Pattern + .compile("WS([0-9]{3})/([0-9]{3})([0-9]{2})KT"); /** Regular expression for extracting icing information */ - public static final String ICING_GROUP_EXP = "6([0-9])([0-9]{3})([0-9])"; + public static final Pattern ICING_GROUP_EXP = Pattern + .compile("6([0-9])([0-9]{3})([0-9])"); /** Regular expression for extracting turbulence information */ - public static final String TURBULENCE_GROUP_EXP = "5([0-9])([0-9]{3})([0-9])"; + public static final Pattern TURBULENCE_GROUP_EXP = Pattern + .compile("5([0-9])([0-9]{3})([0-9])"); /** Regular expression for extracting temperature information */ - public static final String TEMP_GROUP_EXP = "T(M)?([0-9]{2})/([0-9]{2})Z"; + public static final Pattern TEMP_GROUP_EXP = Pattern + .compile("T(M)?([0-9]{2})/([0-9]{2})Z"); /** Regular expression for extracting altimeter information */ - public static final String ALTIMETER_GROUP_EXP = "QNH([23]\\d{3})INS"; + public static final Pattern ALTIMETER_GROUP_EXP = Pattern + .compile("QNH([23]\\d{3})INS"); /** * Pattern used for extracting change groups @@ -77,7 +90,8 @@ public final class TafConstants { * */ - public static final String CHANGE_GROUP_EXP = "((FM|((BECMG )|((PROB[34]0) +(TEMPO )?)|(TEMPO )))((\\d{6})|(([0-3]\\d{3})/([0-3]\\d{3})))( ))"; + public static final Pattern CHANGE_GROUP_EXP = Pattern + .compile("((FM|((BECMG )|((PROB[34]0) +(TEMPO )?)|(TEMPO )))((\\d{6})|(([0-3]\\d{3})/([0-3]\\d{3})))( ))"); public static final String CG_FM = "FM"; @@ -95,9 +109,9 @@ public final class TafConstants { public static final String VS_6PLUS_M = "9999"; - public static final String WX_NSW = "NSW"; + public static final Pattern WX_NSW = Pattern.compile("NSW"); - public static final String WX_CAVOK = "CAVOK"; + public static final Pattern WX_CAVOK = Pattern.compile("CAVOK"); public static final String CLD_SKC = "SKC"; @@ -109,20 +123,20 @@ public final class TafConstants { public static final String COR_IND = "COR"; - public static final String REPORT_HEADER = "(TAF )?((AMD|COR) )*?" - + "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{5})( )"; + public static final Pattern REPORT_HEADER = Pattern + .compile("(TAF )?((AMD|COR) )*?" + + "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{5})( )"); - public static final String REPORT_HEADER30 = "(TAF )?((AMD|COR) )*?" - + "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?(\\d{4}/\\d{4})( )"; + public static final Pattern REPORT_HEADER30 = Pattern + .compile("(TAF )?((AMD|COR) )*?" + + "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?(\\d{4}/\\d{4})( )"); - public static final String RPT_HDR_TAF = "(TAF((\\s)+(AMD|COR))?)"; + public static final Pattern RPT_HDR_TAF = Pattern + .compile("(TAF((\\s)+(AMD|COR))?)"); - public static final String RPT_HDR_CCCC = "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{3})/([0-3]\\d{3})( )"; + public static final Pattern RPT_HDR_CCCC = Pattern + .compile("([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{3})/([0-3]\\d{3})( )"); - /** - * Constructor. - */ - private TafConstants() { - } + public static final Pattern FourDigitMetric = Pattern.compile("\\d{4}"); } diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafPeriod.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafPeriod.java similarity index 99% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafPeriod.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafPeriod.java index bd315aef7f..255372e6a9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafPeriod.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafPeriod.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import java.io.Serializable; import java.util.Calendar; @@ -48,6 +48,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; * 30Aug2006 B. Phillippe Modified for use to decode TAFs for AWIPS * Nov 01, 2013 2361 njensen Remove XML annotations * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafRecord.java similarity index 98% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafRecord.java index abe688217b..a7bff2c121 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafRecord.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import java.util.Date; import java.util.HashSet; @@ -67,7 +67,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Nov 01, 2013 2361 njensen Remove XML annotations * Feb 10, 2014 2777 rferrel Assign parent id when setting ChangeGroup. * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. - * + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * @author bphillip diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafSkyCover.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafSkyCover.java similarity index 97% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafSkyCover.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafSkyCover.java index 52d8a8a115..9ffa8ed8ec 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafSkyCover.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafSkyCover.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import javax.persistence.Column; import javax.persistence.Entity; @@ -46,6 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 6/21/2007 180 Phillippe initial creation. * 4/16/2008 934 grichard Added toString overridden method. * Nov 01, 2013 2361 njensen Remove XML annotations + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafWeatherCondition.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafWeatherCondition.java similarity index 98% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafWeatherCondition.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafWeatherCondition.java index 9ebc953fdb..64e1e54a85 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafWeatherCondition.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TafWeatherCondition.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import javax.persistence.Column; import javax.persistence.Entity; @@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 6/21/2007 180 Phillippe Initial creation * 20081106 1515 jkorman Changed length of "other" attribute. * Nov 01, 2013 2361 njensen Remove XML annotations - * + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * @author bphillip diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TemperatureForecast.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TemperatureForecast.java similarity index 97% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TemperatureForecast.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TemperatureForecast.java index cd04ed2441..e36ea8328f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TemperatureForecast.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TemperatureForecast.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import javax.persistence.Column; import javax.persistence.Entity; @@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 8/30/2006 bphillip Initial Creation * 6/21/2007 180 bphillip Updated for use with plugin persistence pattern * Nov 01, 2013 2361 njensen Remove XML annotations - * + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * @author bphillip diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TurbulenceLayer.java b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TurbulenceLayer.java similarity index 97% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TurbulenceLayer.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TurbulenceLayer.java index 476371c366..7a46427c32 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TurbulenceLayer.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.taf/src/com/raytheon/uf/common/dataplugin/taf/TurbulenceLayer.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf.common; +package com.raytheon.uf.common.dataplugin.taf; import javax.persistence.Column; import javax.persistence.Entity; @@ -45,7 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * 8/30/2006 bphillip Initial Creation * 6/21/2007 bphillip Updated for use with plugin persistance pattern * Nov 01, 2013 2361 njensen Remove XML annotations - * + * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf. * * * @author bphillip diff --git a/edexOsgi/com.raytheon.uf.edex.dataplugins.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.dataplugins.feature/feature.xml index 46b70f5435..16f9a12b67 100644 --- a/edexOsgi/com.raytheon.uf.edex.dataplugins.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.dataplugins.feature/feature.xml @@ -242,7 +242,14 @@ unpack="false"/> + + + + + + + + diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/.project b/edexOsgi/com.raytheon.uf.edex.plugin.taf/.project similarity index 93% rename from edexOsgi/com.raytheon.edex.plugin.taf/.project rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/.project index c482d894f1..7d4612701c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/.project +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/.project @@ -1,6 +1,6 @@ - com.raytheon.edex.plugin.taf + com.raytheon.uf.edex.plugin.taf diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.uf.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..02f4db20f0 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Thu Mar 26 10:25:50 CDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.taf/META-INF/MANIFEST.MF similarity index 63% rename from edexOsgi/com.raytheon.edex.plugin.taf/META-INF/MANIFEST.MF rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/META-INF/MANIFEST.MF index e74d98717e..22a2329cda 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/META-INF/MANIFEST.MF @@ -1,18 +1,16 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Taf Plug-in -Bundle-SymbolicName: com.raytheon.edex.plugin.taf -Bundle-Version: 1.12.1174.qualifier +Bundle-SymbolicName: com.raytheon.uf.edex.plugin.taf +Bundle-Version: 1.14.0 Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization Bundle-Vendor: RAYTHEON -Export-Package: com.raytheon.edex.plugin.taf, - com.raytheon.edex.plugin.taf.common, - com.raytheon.edex.plugin.taf.decoder +Export-Package: com.raytheon.uf.edex.plugin.taf, + com.raytheon.uf.edex.plugin.taf.decoder Require-Bundle: com.raytheon.edex.common, com.raytheon.uf.edex.pointdata, com.raytheon.uf.edex.decodertools;bundle-version="1.0.0", - org.apache.commons.lang, - javax.persistence + com.raytheon.uf.common.dataplugin.taf Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: com.raytheon.uf.common.wmo, org.apache.commons.logging diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/build.properties b/edexOsgi/com.raytheon.uf.edex.plugin.taf/build.properties similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/build.properties rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/build.properties diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/com.raytheon.edex.plugin.taf.ecl b/edexOsgi/com.raytheon.uf.edex.plugin.taf/com.raytheon.edex.plugin.taf.ecl similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/com.raytheon.edex.plugin.taf.ecl rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/com.raytheon.edex.plugin.taf.ecl diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/res/conf/attributes.xml b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/conf/attributes.xml similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/res/conf/attributes.xml rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/res/conf/attributes.xml diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/res/scripts/tafIndices.sql b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/scripts/tafIndices.sql similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/res/scripts/tafIndices.sql rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/res/scripts/tafIndices.sql diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-common.xml b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-common.xml similarity index 74% rename from edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-common.xml rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-common.xml index e047986bba..8ef865defb 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-common.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-common.xml @@ -4,9 +4,9 @@ - - - + + + com.raytheon.uf.common.pointdata diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-ingest.xml similarity index 92% rename from edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-ingest.xml index 63a6bb5378..d1c81dcd0b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/res/spring/taf-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/res/spring/taf-ingest.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - + + diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/TafDecoder.java similarity index 91% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/TafDecoder.java index 4133df37c2..49489850f3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/TafDecoder.java @@ -18,15 +18,15 @@ * further licensing information. **/ -package com.raytheon.edex.plugin.taf; +package com.raytheon.uf.edex.plugin.taf; import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.plugin.AbstractDecoder; -import com.raytheon.edex.plugin.taf.common.TafRecord; -import com.raytheon.edex.plugin.taf.decoder.TAFParser; -import com.raytheon.edex.plugin.taf.decoder.TAFParts; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TAFParts; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.wmo.WMOHeader; +import com.raytheon.uf.edex.plugin.taf.decoder.TAFParser; /** * @@ -43,6 +43,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; * Apr 25, 2008 1001 jkorman Extracted decoder code into TAFParser. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed constrcutDataURI() call + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @author bphillip diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/dao/TafDao.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/dao/TafDao.java similarity index 92% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/dao/TafDao.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/dao/TafDao.java index f7c7da71e9..2c5fe6d7c4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/dao/TafDao.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/dao/TafDao.java @@ -17,12 +17,12 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.dao; +package com.raytheon.uf.edex.plugin.taf.dao; import java.util.List; import com.raytheon.edex.db.dao.DefaultPluginDao; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.edex.database.DataAccessLayerException; @@ -36,6 +36,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20080103 384 jkorman Initial Coding. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @author jkorman diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFChangeGroupFactory.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFChangeGroupFactory.java similarity index 94% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFChangeGroupFactory.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFChangeGroupFactory.java index 27ca98f5b9..6d291c9336 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFChangeGroupFactory.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFChangeGroupFactory.java @@ -17,13 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.decoder; - -import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER30; -import static com.raytheon.edex.plugin.taf.decoder.TAFParser.cvtInt; -import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.STATION_ID; +package com.raytheon.uf.edex.plugin.taf.decoder; import java.util.ArrayList; import java.util.Calendar; @@ -35,9 +29,11 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import com.raytheon.edex.exception.DecoderException; -import com.raytheon.edex.plugin.taf.common.ChangeGroup; -import com.raytheon.edex.plugin.taf.common.TafPeriod; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.ChangeGroup; +import com.raytheon.uf.common.dataplugin.taf.TAFParts; +import com.raytheon.uf.common.dataplugin.taf.TafConstants; +import com.raytheon.uf.common.dataplugin.taf.TafPeriod; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.util.TimeUtil; @@ -54,6 +50,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; * add 30 Hour tafs. * Nov 12, 2013 2546 bclement added check for legacy valid time * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @author jkorman @@ -402,11 +399,10 @@ public class TAFChangeGroupFactory { StringBuilder sb = new StringBuilder(tafHeader.getExtension()); // The pattern regex needs a terminating space. sb.append(" "); - Pattern headerPattern = Pattern.compile(REPORT_HEADER30); - Matcher matcher = headerPattern.matcher(sb); + Matcher matcher = TafConstants.REPORT_HEADER30.matcher(sb); if (matcher.find()) { - stationId = matcher.group(STATION_ID); + stationId = matcher.group(TafSeparator.STATION_ID); } Matcher m = PAT_VALID_TIME.matcher(sb); @@ -419,9 +415,9 @@ public class TAFChangeGroupFactory { issueTm = sb.substring(m.start(), m.end()); issueTimeString = issueTm; - int iDay = cvtInt(issueTm.substring(0, 2)); - int iHour = cvtInt(issueTm.substring(2, 4)); - int iMin = cvtInt(issueTm.substring(4, 6)); + int iDay = TAFParser.cvtInt(issueTm.substring(0, 2)); + int iHour = TAFParser.cvtInt(issueTm.substring(2, 4)); + int iMin = TAFParser.cvtInt(issueTm.substring(4, 6)); issueTime = TimeUtil.newGmtCalendar(wmoHeader.getYear(), wmoHeader.getMonth(), wmoHeader.getDay()); @@ -562,10 +558,12 @@ public class TAFChangeGroupFactory { record.setStationId(stationId); - if (isCOR || (tafParts.getTafHeader().indexOf(COR_IND) >= 0)) { + if (isCOR + || (tafParts.getTafHeader().indexOf(TafConstants.COR_IND) >= 0)) { record.setCorIndicator("COR"); } - if (isAMD || (tafParts.getTafHeader().indexOf(AMD_IND) >= 0)) { + if (isAMD + || (tafParts.getTafHeader().indexOf(TafConstants.AMD_IND) >= 0)) { record.setAmdIndicator("AMD"); } diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFParser.java similarity index 86% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParser.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFParser.java index 57749f03c7..0d2dc9e567 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFParser.java @@ -17,21 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.decoder; - -import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CHANGE_GROUP_EXP; -import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER; -import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.ISSUE_TIME; -import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.STATION_ID; -import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.VALID_TIME; +package com.raytheon.uf.edex.plugin.taf.decoder; import java.util.ArrayList; import java.util.Calendar; @@ -45,9 +31,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.raytheon.edex.exception.DecoderException; -import com.raytheon.edex.plugin.taf.common.ChangeGroup; -import com.raytheon.edex.plugin.taf.common.TafPeriod; -import com.raytheon.edex.plugin.taf.common.TafRecord; +import com.raytheon.uf.common.dataplugin.taf.ChangeGroup; +import com.raytheon.uf.common.dataplugin.taf.TAFParts; +import com.raytheon.uf.common.dataplugin.taf.TafConstants; +import com.raytheon.uf.common.dataplugin.taf.TafPeriod; +import com.raytheon.uf.common.dataplugin.taf.TafRecord; import com.raytheon.uf.common.pointdata.spatial.ObStation; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; @@ -70,6 +58,8 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; * Oct 21, 2008 1515 jkorman Added 30 Hour capability changes. * Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. + * Refactored Strings to Patterns in TafConstants. * * * @author jkorman @@ -83,7 +73,8 @@ public class TAFParser { // COR hhmm // AMD hhmm // 01234567 - private static final String AMD_COR_TIME = "(" + AMD_IND + "|" + COR_IND + private static final String AMD_COR_TIME = "(" + TafConstants.AMD_IND + "|" + + TafConstants.COR_IND + ") \\d{4}"; private static final int HOUR_START = 4; @@ -218,10 +209,10 @@ public class TAFParser { record.setWmoHeader(header.getWmoHeader()); if (isAMD) { - record.setAmdIndicator(AMD_IND); + record.setAmdIndicator(TafConstants.AMD_IND); } if (isCOR) { - record.setCorIndicator(COR_IND); + record.setCorIndicator(TafConstants.COR_IND); } ObStation location = null; @@ -251,12 +242,12 @@ public class TAFParser { record = new TafRecord(); - Pattern headerPattern = Pattern.compile(REPORT_HEADER); - Matcher matcher = headerPattern.matcher(tafParts.getTafHeader()); + Matcher matcher = TafConstants.REPORT_HEADER.matcher(tafParts + .getTafHeader()); if (matcher.find()) { - String s = matcher.group(STATION_ID); + String s = matcher.group(TafSeparator.STATION_ID); if (s != null) { record.setStationId(s); } else { @@ -264,7 +255,7 @@ public class TAFParser { return; } - s = matcher.group(ISSUE_TIME); + s = matcher.group(TafSeparator.ISSUE_TIME); if (s != null) { issueDate = transformDate(s, header); issueDate.set(Calendar.MILLISECOND, 0); @@ -273,8 +264,10 @@ public class TAFParser { // date-time. So we need to create one. // Create an issue time from the valid period data. StringBuilder sb = new StringBuilder(); - sb.append(matcher.group(VALID_TIME).substring(0, 2)); - sb.append(matcher.group(VALID_TIME).substring(2, 4)); + sb.append(matcher.group(TafSeparator.VALID_TIME) + .substring(0, 2)); + sb.append(matcher.group(TafSeparator.VALID_TIME) + .substring(2, 4)); sb.append("00Z"); issueDate = transformDate(sb.toString(), header); issueDate.set(Calendar.MILLISECOND, 0); @@ -285,10 +278,10 @@ public class TAFParser { checkAMDCOR(issueDate, tafParts.getTafBody()); s = tafParts.getTafHeader(); if (!isCOR) { - isCOR = s.indexOf(COR_IND) >= 0; + isCOR = s.indexOf(TafConstants.COR_IND) >= 0; } if (!isAMD) { - isAMD = s.indexOf(AMD_IND) >= 0; + isAMD = s.indexOf(TafConstants.AMD_IND) >= 0; } record.setIssue_time(issueDate.getTime()); @@ -402,8 +395,8 @@ public class TAFParser { issueDate = null; } } - isCOR = s.indexOf(COR_IND) >= 0; - isAMD = s.indexOf(AMD_IND) >= 0; + isCOR = s.indexOf(TafConstants.COR_IND) >= 0; + isAMD = s.indexOf(TafConstants.AMD_IND) >= 0; } return issueDate; } @@ -438,8 +431,7 @@ public class TAFParser { String reportBody = sb.toString(); - Pattern p = Pattern.compile(CHANGE_GROUP_EXP); - Matcher m = p.matcher(reportBody); + Matcher m = TafConstants.CHANGE_GROUP_EXP.matcher(reportBody); // Collect all of the start positions ArrayList positions = new ArrayList(); @@ -484,9 +476,9 @@ public class TAFParser { */ public static boolean isChangeGroup(String groupValue) { - boolean isTemp = CG_FM.equals(groupValue); - isTemp = isTemp || CG_BECMG.equals(groupValue); - isTemp = isTemp || CG_INITIAL.equals(groupValue); + boolean isTemp = TafConstants.CG_FM.equals(groupValue); + isTemp = isTemp || TafConstants.CG_BECMG.equals(groupValue); + isTemp = isTemp || TafConstants.CG_INITIAL.equals(groupValue); return isTemp; } @@ -497,9 +489,9 @@ public class TAFParser { */ public static boolean isTempGroup(String groupValue) { - boolean isTemp = CG_TEMPO.equals(groupValue); - isTemp = isTemp || CG_PROB_TEMPO.equals(groupValue); - isTemp = isTemp || CG_PROB.equals(groupValue); + boolean isTemp = TafConstants.CG_TEMPO.equals(groupValue); + isTemp = isTemp || TafConstants.CG_PROB_TEMPO.equals(groupValue); + isTemp = isTemp || TafConstants.CG_PROB.equals(groupValue); return isTemp; } @@ -521,10 +513,13 @@ public class TAFParser { private static String formatTAF(String taf) { StringBuilder sb = new StringBuilder(taf); int n = 0; - String[] find = { "\r " + CG_FM, "\r " + CG_BECMG, "\r " + CG_TEMPO, - "\r " + CG_PROB, }; - String[] replace = { "\r " + CG_FM, "\r " + CG_BECMG, - "\r " + CG_TEMPO, "\r " + CG_PROB, }; + String[] find = { "\r " + TafConstants.CG_FM, + "\r " + TafConstants.CG_BECMG, "\r " + TafConstants.CG_TEMPO, + "\r " + TafConstants.CG_PROB, }; + String[] replace = { "\r " + TafConstants.CG_FM, + "\r " + TafConstants.CG_BECMG, + "\r " + TafConstants.CG_TEMPO, + "\r " + TafConstants.CG_PROB, }; for (int i = 0; i < find.length; i++) { while ((n = sb.indexOf(find[i])) >= 0) { sb.replace(n, n + find[i].length(), replace[i]); diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFSubGroup.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFSubGroup.java similarity index 69% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFSubGroup.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFSubGroup.java index 1664a792d8..cbdd91ceeb 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TAFSubGroup.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TAFSubGroup.java @@ -17,15 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.decoder; - -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO; -import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO; -import static com.raytheon.edex.plugin.taf.decoder.TAFParser.cvtInt; +package com.raytheon.uf.edex.plugin.taf.decoder; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -33,8 +25,9 @@ import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.edex.plugin.taf.common.ChangeGroup; -import com.raytheon.edex.plugin.taf.common.TafPeriod; +import com.raytheon.uf.common.dataplugin.taf.ChangeGroup; +import com.raytheon.uf.common.dataplugin.taf.TafConstants; +import com.raytheon.uf.common.dataplugin.taf.TafPeriod; /** * TODO Add Description @@ -45,6 +38,7 @@ import com.raytheon.edex.plugin.taf.common.TafPeriod; * ------------ ---------- ----------- -------------------------- * Oct 20, 2008 1515 jkorman Initial implementation to * add 30 Hour tafs. + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @author jkorman @@ -110,73 +104,73 @@ class TAFSubGroup { Matcher m = PAT_PROBTEMPO.matcher(changeGroupHdr); if (m.find()) { - changeGroupHeader = CG_PROB_TEMPO; + changeGroupHeader = TafConstants.CG_PROB_TEMPO; prob = Integer.decode(changeGroupHdr.substring(4, 5)); - startDay = cvtInt(changeGroupHdr.substring(13, 15)); - startHour = cvtInt(changeGroupHdr.substring(15, 17)); - stopDay = cvtInt(changeGroupHdr.substring(18, 20)); - stopHour = cvtInt(changeGroupHdr.substring(20, 22)); + startDay = TAFParser.cvtInt(changeGroupHdr.substring(13, 15)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(15, 17)); + stopDay = TAFParser.cvtInt(changeGroupHdr.substring(18, 20)); + stopHour = TAFParser.cvtInt(changeGroupHdr.substring(20, 22)); return; } m = PAT_PROB.matcher(changeGroupHdr); if (m.find()) { - changeGroupHeader = CG_PROB; + changeGroupHeader = TafConstants.CG_PROB; prob = Integer.decode(changeGroupHdr.substring(4, 5)); - startDay = cvtInt(changeGroupHdr.substring(7, 9)); - startHour = cvtInt(changeGroupHdr.substring(9, 11)); - stopDay = cvtInt(changeGroupHdr.substring(12, 14)); - stopHour = cvtInt(changeGroupHdr.substring(14, 16)); + startDay = TAFParser.cvtInt(changeGroupHdr.substring(7, 9)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(9, 11)); + stopDay = TAFParser.cvtInt(changeGroupHdr.substring(12, 14)); + stopHour = TAFParser.cvtInt(changeGroupHdr.substring(14, 16)); return; } m = PAT_TEMPO.matcher(changeGroupHdr); if (m.find()) { - changeGroupHeader = CG_TEMPO; + changeGroupHeader = TafConstants.CG_TEMPO; - startDay = cvtInt(changeGroupHdr.substring(6, 8)); - startHour = cvtInt(changeGroupHdr.substring(8, 10)); - stopDay = cvtInt(changeGroupHdr.substring(11, 13)); - stopHour = cvtInt(changeGroupHdr.substring(13, 15)); + startDay = TAFParser.cvtInt(changeGroupHdr.substring(6, 8)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(8, 10)); + stopDay = TAFParser.cvtInt(changeGroupHdr.substring(11, 13)); + stopHour = TAFParser.cvtInt(changeGroupHdr.substring(13, 15)); return; } m = PAT_BECMG.matcher(changeGroupHdr); if (m.find()) { - changeGroupHeader = CG_BECMG; - startDay = cvtInt(changeGroupHdr.substring(6, 8)); - startHour = cvtInt(changeGroupHdr.substring(8, 10)); - stopDay = cvtInt(changeGroupHdr.substring(11, 13)); - stopHour = cvtInt(changeGroupHdr.substring(13, 15)); + changeGroupHeader = TafConstants.CG_BECMG; + startDay = TAFParser.cvtInt(changeGroupHdr.substring(6, 8)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(8, 10)); + stopDay = TAFParser.cvtInt(changeGroupHdr.substring(11, 13)); + stopHour = TAFParser.cvtInt(changeGroupHdr.substring(13, 15)); return; } m = PAT_FM.matcher(changeGroupHdr); if (m.find()) { - changeGroupHeader = CG_FM; + changeGroupHeader = TafConstants.CG_FM; - startDay = cvtInt(changeGroupHdr.substring(2, 4)); - startHour = cvtInt(changeGroupHdr.substring(4, 6)); - startMin = cvtInt(changeGroupHdr.substring(6, 8)); + startDay = TAFParser.cvtInt(changeGroupHdr.substring(2, 4)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(4, 6)); + startMin = TAFParser.cvtInt(changeGroupHdr.substring(6, 8)); return; } - changeGroupHeader = CG_INITIAL; + changeGroupHeader = TafConstants.CG_INITIAL; extension = changeGroupHdr; int pos = changeGroupHdr.length() - "DDMM/DDMM".length(); - startDay = cvtInt(changeGroupHdr.substring(pos, pos + 2)); + startDay = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2)); pos += 2; - startHour = cvtInt(changeGroupHdr.substring(pos, pos + 2)); + startHour = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2)); pos += 3; - stopDay = cvtInt(changeGroupHdr.substring(pos, pos + 2)); + stopDay = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2)); pos += 2; - stopHour = cvtInt(changeGroupHdr.substring(pos, pos + 2)); + stopHour = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2)); } /** @@ -219,23 +213,23 @@ class TAFSubGroup { ChangeGroup chgGroup = null; TafPeriod period = null; - if (CG_FM.equals(changeGroupHeader)) { + if (TafConstants.CG_FM.equals(changeGroupHeader)) { period = TafPeriod.determineChangeGroupPeriodDDhhmm(startDay .intValue(), startHour.intValue(), startMin.intValue(), issueTime); - } else if (CG_BECMG.equals(changeGroupHeader)) { + } else if (TafConstants.CG_BECMG.equals(changeGroupHeader)) { period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay .intValue(), startHour.intValue(), stopDay.intValue(), stopHour.intValue(), issueTime, true); - } else if (CG_PROB.equals(changeGroupHeader)) { + } else if (TafConstants.CG_PROB.equals(changeGroupHeader)) { period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay .intValue(), startHour.intValue(), stopDay.intValue(), stopHour.intValue(), issueTime, false); - } else if (CG_PROB_TEMPO.equals(changeGroupHeader)) { + } else if (TafConstants.CG_PROB_TEMPO.equals(changeGroupHeader)) { period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay .intValue(), startHour.intValue(), stopDay.intValue(), stopHour.intValue(), issueTime, false); - } else if (CG_TEMPO.equals(changeGroupHeader)) { + } else if (TafConstants.CG_TEMPO.equals(changeGroupHeader)) { period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay .intValue(), startHour.intValue(), stopDay.intValue(), stopHour.intValue(), issueTime, false); diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TafSeparator.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TafSeparator.java similarity index 83% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TafSeparator.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TafSeparator.java index 6d02236203..fa90c6caa3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/TafSeparator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/TafSeparator.java @@ -17,13 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.plugin.taf.decoder; - -import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND; -import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER; -import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER30; -import static com.raytheon.edex.plugin.taf.common.TafConstants.TAF_IND; +package com.raytheon.uf.edex.plugin.taf.decoder; import java.util.ArrayList; import java.util.List; @@ -35,9 +29,11 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.plugin.AbstractRecordSeparator; -import com.raytheon.edex.plugin.taf.TafDecoder; +import com.raytheon.uf.common.dataplugin.taf.TAFParts; +import com.raytheon.uf.common.dataplugin.taf.TafConstants; import com.raytheon.uf.common.wmo.WMOHeader; import com.raytheon.uf.edex.decodertools.core.DecoderTools; +import com.raytheon.uf.edex.plugin.taf.TafDecoder; /** * @@ -53,6 +49,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools; * and amended records * 9/4/2008 1444 grichard Move constants to TafConstants class. * May 14, 2014 2536 bclement moved WMO Header to common + * May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf. * * * @@ -65,11 +62,14 @@ public class TafSeparator extends AbstractRecordSeparator { private final Log logger = LogFactory.getLog(getClass()); - private static final String TEMPO_EXC = "EMPO (\\d{4}/\\d{4})"; + private static final Pattern TEMPO_EXC = Pattern + .compile("EMPO (\\d{4}/\\d{4})"); - private static final String BECMG_EXC = "ECMG (\\d{4}/\\d{4})"; + private static final Pattern BECMG_EXC = Pattern + .compile("ECMG (\\d{4}/\\d{4})"); - private static final String PROB_EXC = "OB[34]0 (\\d{4}/\\d{4})"; + private static final Pattern PROB_EXC = Pattern + .compile("OB[34]0 (\\d{4}/\\d{4})"); public static final int STATION_ID = 4; @@ -178,20 +178,18 @@ public class TafSeparator extends AbstractRecordSeparator { if (m.find()) { int pos = 0; if (!isAmd) { - pos = s.indexOf(AMD_IND); + pos = s.indexOf(TafConstants.AMD_IND); isAmd = ((pos >= 0) && (pos <= m.end())); } if (!isCor) { - pos = s.indexOf(COR_IND); + pos = s.indexOf(TafConstants.COR_IND); isCor = ((pos >= 0) && (pos <= m.end())); } } ArrayList partPos = new ArrayList(); - Pattern p = Pattern.compile(REPORT_HEADER); - - m = p.matcher(s); + m = TafConstants.REPORT_HEADER.matcher(s); if (m.find()) { partPos.add(m.start()); @@ -210,14 +208,9 @@ public class TafSeparator extends AbstractRecordSeparator { } partPos.add(s.length()); } else { - p = Pattern.compile(REPORT_HEADER30); - - Pattern pT = Pattern.compile(TEMPO_EXC); - Pattern pB = Pattern.compile(BECMG_EXC); - Pattern pP = Pattern.compile(PROB_EXC); Matcher m1 = null; - m = p.matcher(s); + m = TafConstants.REPORT_HEADER30.matcher(s); if (m.find()) { int start = m.start(); int stop = m.end(); @@ -233,15 +226,15 @@ public class TafSeparator extends AbstractRecordSeparator { // The TEMPO, BECMG, and PROB patterns can match the // start // of a taf so skip if there's a match. - m1 = pT.matcher(s.substring(start, stop)); + m1 = TEMPO_EXC.matcher(s.substring(start, stop)); if (m1.find()) { continue; } - m1 = pB.matcher(s.substring(start, stop)); + m1 = BECMG_EXC.matcher(s.substring(start, stop)); if (m1.find()) { continue; } - m1 = pP.matcher(s.substring(start, stop)); + m1 = PROB_EXC.matcher(s.substring(start, stop)); if (m1.find()) { continue; } @@ -264,19 +257,21 @@ public class TafSeparator extends AbstractRecordSeparator { StringBuilder tafHdr = new StringBuilder(s.substring( partPos.get(i), partPos.get(i + 1))); - if ((isCor) && (tafHdr.indexOf(COR_IND) < 0)) { + if ((isCor) + && (tafHdr.indexOf(TafConstants.COR_IND) < 0)) { tafHdr.insert(0, ' '); - tafHdr.insert(0, COR_IND); + tafHdr.insert(0, TafConstants.COR_IND); } - if ((isAmd) && (tafHdr.indexOf(AMD_IND) < 0)) { + if ((isAmd) + && (tafHdr.indexOf(TafConstants.AMD_IND) < 0)) { tafHdr.insert(0, ' '); - tafHdr.insert(0, AMD_IND); + tafHdr.insert(0, TafConstants.AMD_IND); } - if (tafHdr.indexOf(TAF_IND) < 0) { + if (tafHdr.indexOf(TafConstants.TAF_IND) < 0) { tafHdr.insert(0, ' '); - tafHdr.insert(0, TAF_IND); + tafHdr.insert(0, TafConstants.TAF_IND); } parts.setTafHeader(tafHdr.toString()); diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/package-info.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/package-info.java similarity index 94% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/package-info.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/package-info.java index b6984b26c4..261a9fbb19 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/decoder/package-info.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/decoder/package-info.java @@ -20,4 +20,4 @@ /** * Contains TAF decoder implementation detail classes. */ -package com.raytheon.edex.plugin.taf.decoder; \ No newline at end of file +package com.raytheon.uf.edex.plugin.taf.decoder; \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/package-info.java b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/package-info.java similarity index 95% rename from edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/package-info.java rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/package-info.java index 39754c67cd..947733ea04 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/package-info.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.taf/src/com/raytheon/uf/edex/plugin/taf/package-info.java @@ -24,4 +24,4 @@ * and common packages. * */ -package com.raytheon.edex.plugin.taf; \ No newline at end of file +package com.raytheon.uf.edex.plugin.taf; \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/utility/edex_static/base/distribution/taf.xml b/edexOsgi/com.raytheon.uf.edex.plugin.taf/utility/edex_static/base/distribution/taf.xml similarity index 100% rename from edexOsgi/com.raytheon.edex.plugin.taf/utility/edex_static/base/distribution/taf.xml rename to edexOsgi/com.raytheon.uf.edex.plugin.taf/utility/edex_static/base/distribution/taf.xml