Merge branch 'asm_14.4.1' of ssh://10.201.30.8:29418/AWIPS2_baseline into master_14.4.1
Former-commit-id:209b1f9e7c
[formerly84dff9abc0
] [formerly32c91172b4
] [formerlyeefa05ada3
[formerly32c91172b4
[formerly 480b6597331ebd2ce7d7835de6e21050abf18722]]] Former-commit-id:eefa05ada3
Former-commit-id: fd8f5f456a4b12eae3d16683880d413105e09ff4 [formerly2b261f9ef2
] Former-commit-id:f4106951e2
This commit is contained in:
commit
1d04cbde57
6 changed files with 76 additions and 11 deletions
|
@ -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.
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@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;
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* ...
|
||||
* 2015-02-11 DR 17092 D. Friedman Handle NDM cronOTRs.xml updates.
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
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.
|
||||
|
|
|
@ -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.
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
|
@ -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 {
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
<constructor-arg value="wmoSiteInfo.txt" />
|
||||
<constructor-arg ref="radarServerNdmListener" />
|
||||
</bean>
|
||||
<bean factory-bean="ndmProc" factory-method="registerListener">
|
||||
<constructor-arg value="cronOTRs.xml" />
|
||||
<constructor-arg ref="radarServerNdmListener" />
|
||||
</bean>
|
||||
|
||||
<camelContext id="rpgenvdata-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
<property name="gfe.suite.home" value="${install.dir}" />
|
||||
<property name="gfe.suite.bin" value="${install.dir}/bin" />
|
||||
<property name="gfe.suite.hti" value="${install.dir}/hti" />
|
||||
<property name="gfe.suite.nwps" value="${install.dir}/nwps" />
|
||||
|
||||
<!-- Create the copy filter -->
|
||||
<!-- filter set -->
|
||||
|
@ -68,8 +69,10 @@
|
|||
<echo message="deploy.client=${deploy.client}" />
|
||||
<mkdir dir="${gfe.suite.bin}"/>
|
||||
<mkdir dir="${gfe.suite.hti}"/>
|
||||
<mkdir dir="${gfe.suite.nwps}"/>
|
||||
<antcall target="-deploy.cli.common"/>
|
||||
<antcall target="-deploy.hti"/>
|
||||
<antcall target="-deploy.nwps"/>
|
||||
<antcall target="-deploy.svcBackup"/>
|
||||
<!-- <antcall target="-deploy.cli.client"/> -->
|
||||
<antcall target="-set.permissions"/>
|
||||
|
@ -101,6 +104,16 @@
|
|||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="-deploy.nwps"
|
||||
description="Deploys NWPS software to a specific directory">
|
||||
<!-- copy the CLI tools to the deploy directory -->
|
||||
<echo message="Copying in NWPS files" />
|
||||
<copy todir="${gfe.suite.nwps}" overwrite="true">
|
||||
<fileset dir="${basedir}/nwps"/>
|
||||
<filterset refid="installer.filter.set"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="-deploy.svcBackup" if="deploy.svcBackup"
|
||||
description="Deploys service backup scripts to a specific directory">
|
||||
<echo message="Copying in service backup scripts" />
|
||||
|
|
|
@ -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/*
|
||||
|
|
Loading…
Add table
Reference in a new issue