From db8a119ca1d319cec213356f76b31eabeda28960 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Wed, 11 Feb 2015 15:10:34 +0000 Subject: [PATCH 1/2] ASM #17092 - Add cronOTRs.xml to radar NDM files Change-Id: I46bf0728607737509ad97f6d2ed1803b3b10eeff Former-commit-id: 6db744c3cceaff1c1672c1848f351ded96d94046 [formerly c6c9209f84ec864726fd6936d60d9632bd43be4f] [formerly 6db744c3cceaff1c1672c1848f351ded96d94046 [formerly c6c9209f84ec864726fd6936d60d9632bd43be4f] [formerly 562582f056418ebc473be704164f2b18c1a29566 [formerly fc9eb096ce16005be0a80eff3b4728f279f75cf5]]] Former-commit-id: 562582f056418ebc473be704164f2b18c1a29566 Former-commit-id: 298a9cd43ffd62e6852978e0e776025e188793be [formerly 02c1658af2b2c48b37437e906af6a6f45aa9c50a] Former-commit-id: aa0746f502a1710ad4d19731f120325e3b009bbd --- .../com/raytheon/rcm/event/ConfigEvent.java | 5 +- .../raytheon/rcm/coll/RequestScheduler.java | 51 +++++++++++++++---- .../config/std/StandardConfigProvider.java | 10 ++++ .../res/spring/rpgenvdata-spring.xml | 4 ++ 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/event/ConfigEvent.java b/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/event/ConfigEvent.java index 7475d52aa8..e8e3d65d54 100755 --- a/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/event/ConfigEvent.java +++ b/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/event/ConfigEvent.java @@ -37,13 +37,16 @@ import com.raytheon.rcm.config.RadarConfig; * 2009-04-22 #1693 D. Friedman Initial checkin * ... * 2014-02-03 DR 14762 D. Friedman Add Category enum + * 2015-02-11 DR 17092 D. Friedman Handle NDM cronOTRs.xml updates. * * */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ConfigEvent { - public static enum Category { GLOBAL_CONFIG, RADAR_CONFIG, PROD_DISTRIBUTION, NATIONAL_RPS_LISTS } + public static enum Category { + GLOBAL_CONFIG, RADAR_CONFIG, PROD_DISTRIBUTION, NATIONAL_RPS_LISTS, CRON_OTRS + } private String radarID; // null indicates global configuration change. private RadarConfig oldConfig; diff --git a/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/coll/RequestScheduler.java b/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/coll/RequestScheduler.java index c6623619bd..0eacd2223a 100644 --- a/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/coll/RequestScheduler.java +++ b/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/coll/RequestScheduler.java @@ -27,6 +27,7 @@ import org.quartz.impl.StdSchedulerFactory; import com.raytheon.rcm.config.Configuration; import com.raytheon.rcm.config.RadarConfig; import com.raytheon.rcm.config.Util; +import com.raytheon.rcm.event.ConfigEvent; import com.raytheon.rcm.event.OtrEvent; import com.raytheon.rcm.event.RadarEventAdapter; import com.raytheon.rcm.event.RadarEventListener; @@ -37,6 +38,19 @@ import com.raytheon.rcm.request.Request; import com.raytheon.rcm.server.Log; import com.raytheon.rcm.server.RadarServer; +/** + * Represents the standard configuration model of the AWIPS 2 RadarServer. + * + *
+ *
+ * SOFTWARE HISTORY
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * ...
+ * 2015-02-11   DR 17092   D. Friedman Handle NDM cronOTRs.xml updates.
+ * 
+ * + */ public class RequestScheduler extends RadarEventAdapter { // Quartz job detail properties @@ -46,8 +60,6 @@ public class RequestScheduler extends RadarEventAdapter { private RadarServer radarServer; private OTRManager otrManager; - private CronOTRConfiguration cronConfig; - private Scheduler scheduler; private Random random = new Random(); @@ -70,16 +82,29 @@ public class RequestScheduler extends RadarEventAdapter { OTRManager.class.getSimpleName()); return; } - + + loadConfiguration(); + } + + private synchronized void loadConfiguration() { + if (scheduler != null) { + try { + scheduler.shutdown(); + } catch (SchedulerException e) { + Log.errorf("Error stopping cron-OTR scheduler: %s", e); + } + } + try { scheduler = StdSchedulerFactory.getDefaultScheduler(); scheduler.start(); } catch (SchedulerException e) { - Log.errorf("Failed to start cron-OTR scheduler: %s", e); + Log.errorf("Failed to start cron-OTR scheduler: %s", e); scheduler = null; } - + if (scheduler != null) { + CronOTRConfiguration cronConfig = null; InputStream ins = null; try { ins = radarServer.getConfiguration().getDropInData("cronOTRs.xml"); @@ -91,7 +116,7 @@ public class RequestScheduler extends RadarEventAdapter { } catch (Exception e) { Log.errorf("Error loading cron-OTR configuration: %s", e); } - + if (cronConfig != null) { int jobIndex = 1; // Used to generate unique JobDetail names for (CronOTR cronOTR : cronConfig.cronOTRList) { @@ -104,7 +129,7 @@ public class RequestScheduler extends RadarEventAdapter { cronOTR.getCron(), e); continue; } - + JobDetail jd = new JobDetail(name, null, CronOTRJob.class); JobDataMap jdm = jd.getJobDataMap(); jdm.put(SCHEDULER, this); @@ -112,10 +137,10 @@ public class RequestScheduler extends RadarEventAdapter { try { scheduler.scheduleJob(jd, trigger); } catch (Exception e) { - Log.errorf("Error schedule cron \"%s\": %s", + Log.errorf("Error scheduling cron \"%s\": %s", cronOTR.getCron(), e); } - + jobIndex++; } } @@ -179,7 +204,13 @@ public class RequestScheduler extends RadarEventAdapter { runCron(cronOTR); } - + + public void handleConfigEvent(ConfigEvent event) { + if (event.getCategory() == ConfigEvent.Category.CRON_OTRS) { + loadConfiguration(); + } + } + /** * This class declared public only so that it can be instantiated by * Quartz. diff --git a/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/config/std/StandardConfigProvider.java b/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/config/std/StandardConfigProvider.java index 07a6ce68f1..2c5b05a584 100755 --- a/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/config/std/StandardConfigProvider.java +++ b/RadarServer/com.raytheon.rcm.server/src/com/raytheon/rcm/config/std/StandardConfigProvider.java @@ -40,6 +40,8 @@ import com.raytheon.rcm.config.LinkType; import com.raytheon.rcm.config.RadarConfig; import com.raytheon.rcm.config.StandardProductDistInfoDB; import com.raytheon.rcm.config.awips1.Awips1ConfigProvider; +import com.raytheon.rcm.event.ConfigEvent; +import com.raytheon.rcm.event.RadarEventListener; import com.raytheon.rcm.server.Log; @@ -54,6 +56,7 @@ import com.raytheon.rcm.server.Log; * ------------ ---------- ----------- -------------------------- * ... * 2014-02-03 DR 14762 D. Friedman Handle updated NDM config files. + * 2015-02-11 DR 17092 D. Friedman Handle NDM cronOTRs.xml updates. * * */ @@ -62,6 +65,7 @@ public class StandardConfigProvider implements ConfigurationProvider { private static String WSR_88D_PROD_LIST_NAME = "prodList.txt"; private static String TDWR__PROD_LIST_NAME = "tdwrProdList.txt"; private static String WMO_SITE_INFO_NAME = "wmoSiteInfo.txt"; + private static String CRON_OTRS_NAME = "cronOTRs.xml"; private static JAXBContext jaxbContext; private static Unmarshaller u; @@ -266,6 +270,12 @@ public class StandardConfigProvider implements ConfigurationProvider { loadProdListDB(); } else if (WMO_SITE_INFO_NAME.equals(name)) { updateRegionCode(); + } else if (CRON_OTRS_NAME.equals(name)) { + RadarEventListener target = config.getConfigurationEventTarget(); + if (target != null) { + ConfigEvent ev = new ConfigEvent(ConfigEvent.Category.CRON_OTRS); + target.handleConfigEvent(ev); + } } else if (Pattern.matches("^rps-.*OP.*$", name)) { config.notifyNationalRpsLists(); } else { diff --git a/edexOsgi/com.raytheon.edex.rpgenvdata/res/spring/rpgenvdata-spring.xml b/edexOsgi/com.raytheon.edex.rpgenvdata/res/spring/rpgenvdata-spring.xml index e61b917ac3..13088cf66f 100644 --- a/edexOsgi/com.raytheon.edex.rpgenvdata/res/spring/rpgenvdata-spring.xml +++ b/edexOsgi/com.raytheon.edex.rpgenvdata/res/spring/rpgenvdata-spring.xml @@ -32,6 +32,10 @@ + + + + From 19cdb600ed2bf0dfac26204c53505be2f13e43d1 Mon Sep 17 00:00:00 2001 From: "Shawn.Hooper" Date: Thu, 12 Feb 2015 17:32:05 -0500 Subject: [PATCH 2/2] ASM #15083 - Updates to allow nwps to be released in the gfesuite-server rpm Change-Id: I9ab3fca601120954ebe229d3a4f0871b7b43af28 Former-commit-id: 0d9e4dd69ebf0794d01692f53ad8438144d0724d [formerly 060a169904bb7f23132c80fffca6ce8af50ed8fb] [formerly 0d9e4dd69ebf0794d01692f53ad8438144d0724d [formerly 060a169904bb7f23132c80fffca6ce8af50ed8fb] [formerly 9c637bda0bb0cebe366f067550a336be6a2286b0 [formerly 2c62f45654b0531349fef5e7523c67c94236ce1a]]] Former-commit-id: 9c637bda0bb0cebe366f067550a336be6a2286b0 Former-commit-id: 89d1309974d57be959467fe0e1bf184cba22a563 [formerly 5ff97ae1887be0c84d6dd99a9eab450bc3a00776] Former-commit-id: b29bfba24b726aa2054dbcfabce59c0cff96d7a9 --- edexOsgi/com.raytheon.uf.tools.gfesuite/deploy.xml | 13 +++++++++++++ .../Installer.gfesuite-server/component.spec | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite/deploy.xml b/edexOsgi/com.raytheon.uf.tools.gfesuite/deploy.xml index b2facf28c0..6a2f6ea9e6 100644 --- a/edexOsgi/com.raytheon.uf.tools.gfesuite/deploy.xml +++ b/edexOsgi/com.raytheon.uf.tools.gfesuite/deploy.xml @@ -54,6 +54,7 @@ + @@ -68,8 +69,10 @@ + + @@ -101,6 +104,16 @@ + + + + + + + + + diff --git a/rpms/awips2.core/Installer.gfesuite-server/component.spec b/rpms/awips2.core/Installer.gfesuite-server/component.spec index 5d322ca3fb..bec10fc43a 100644 --- a/rpms/awips2.core/Installer.gfesuite-server/component.spec +++ b/rpms/awips2.core/Installer.gfesuite-server/component.spec @@ -101,9 +101,13 @@ rm -rf ${RPM_BUILD_ROOT} /awips2/GFESuite/bin/* %dir /awips2/GFESuite/hti/bin /awips2/GFESuite/hti/bin/* +%dir /awips2/GFESuite/nwps/bin +/awips2/GFESuite/nwps/bin/* %defattr(755,awips,fxalpha,777) %dir /awips2/GFESuite/hti/etc /awips2/GFESuite/hti/etc/* +%dir /awips2/GFESuite/nwps/domains +/awips2/GFESuite/nwps/domains/* %defattr(644,awips,fxalpha,755) %dir /awips2/GFESuite/bin/src /awips2/GFESuite/bin/src/*