Merge "Omaha #3885: Merge VTEC route and request changes from VLab." into omaha_14.4.1

Former-commit-id: e0b9900a50 [formerly d7e0d21d27 [formerly 401356d7917aaf84c5ea5c8f92ca32c270d5790a]]
Former-commit-id: d7e0d21d27
Former-commit-id: c4d27803cc
This commit is contained in:
Ron Anderson 2014-12-04 15:44:46 -06:00 committed by Gerrit Code Review
commit 93bce63af0
13 changed files with 354 additions and 633 deletions

View file

@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@ -38,7 +39,6 @@ import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.activetable.PracticeProductOfftimeRequest;
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
import com.raytheon.uf.common.activetable.response.GetNextEtnResponse;
import com.raytheon.uf.common.dissemination.OUPRequest;
@ -84,6 +84,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Dec 18, 2013 2641 dgilling Support changes to GFEVtecUtil.getVtecLinesThatNeedEtn().
* Jan 06, 2014 2649 dgilling Make ETN assignment process optional.
* Feb 17, 2014 2774 dgilling Merge changes from 14.1 baseline to 14.2.
* Nov 14, 2014 4953 randerso Cleaned up practice product requests
*
* </pre>
*
@ -541,26 +542,27 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
/**
* Method to transmit the product.
*
* @param practice
* true if we are transmitting a practice product
*/
private void transmitProduct(boolean decode) {
private void transmitProduct(boolean practice) {
IServerRequest req = null;
if (decode) {
if (SimulatedTime.getSystemTime().isRealTime()) {
req = new SendPracticeProductRequest();
((SendPracticeProductRequest) req).setProductText(productText);
} else {
req = new PracticeProductOfftimeRequest();
((PracticeProductOfftimeRequest) req)
.setProductText(productText);
((PracticeProductOfftimeRequest) req).setNotifyGFE(true);
if (practice) {
SendPracticeProductRequest practiceReq = new SendPracticeProductRequest();
practiceReq.setNotifyGFE(true);
practiceReq.setProductText(productText);
if (!SimulatedTime.getSystemTime().isRealTime()) {
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"yyyyMMdd_HHmm");
((PracticeProductOfftimeRequest) req)
.setDrtString(dateFormatter.format(SimulatedTime
.getSystemTime().getTime()));
dateFormatter.setTimeZone(TimeZone.getTimeZone("GMT"));
practiceReq.setDrtString(dateFormatter.format(SimulatedTime
.getSystemTime().getTime()));
}
req = practiceReq;
} else {
req = new OUPRequest();
OUPRequest oupReq = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
// make sure the awipsWanPil is exactly 10 characters space-padded
// long
@ -580,8 +582,10 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
// oup.setAddress(parentEditor.getAutoSendAddress());
oup.setNeedsWmoHeader(false);
oup.setSource("GFE");
((OUPRequest) req).setProduct(oup);
((OUPRequest) req).setUser(UserController.getUserObject());
oupReq.setProduct(oup);
oupReq.setUser(UserController.getUserObject());
req = oupReq;
}
try {

View file

@ -1,48 +1,43 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="warningProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="warning" />
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.warning" />
<property name="record"
value="com.raytheon.uf.common.dataplugin.warning.WarningRecord" />
<property name="initialRetentionTime" value="144" />
</bean>
<bean id="warningProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="warning"/>
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.warning"/>
<property name="record" value="com.raytheon.uf.common.dataplugin.warning.WarningRecord"/>
<property name="initialRetentionTime" value="144"/>
</bean>
<bean factory-bean="pluginRegistry" factory-method="register">
<constructor-arg value="warning" />
<constructor-arg ref="warningProperties" />
</bean>
<bean factory-bean="pluginRegistry" factory-method="register">
<constructor-arg value="warning"/>
<constructor-arg ref="warningProperties"/>
</bean>
<bean id="warningDecoder" class="com.raytheon.uf.edex.python.decoder.PythonDecoder">
<property name="pluginName" value="warning" />
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning" />
<property name="moduleName" value="WarningDecoder" />
<property name="cache" value="true" />
<property name="recordClassname"
value="com.raytheon.uf.common.dataplugin.warning.WarningRecord" />
</bean>
<bean id="warningDecoder" class="com.raytheon.uf.edex.python.decoder.PythonDecoder">
<property name="pluginName" value="warning"/>
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning"/>
<property name="moduleName" value="WarningDecoder"/>
<property name="cache" value="true"/>
<property name="recordClassname" value="com.raytheon.uf.common.dataplugin.warning.WarningRecord"/>
</bean>
<bean id="practiceWarningProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="practicewarning" />
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.warning" />
<property name="record"
value="com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord" />
<property name="initialRetentionTime" value="144" />
</bean>
<bean id="practiceWarningProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="practicewarning"/>
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.warning"/>
<property name="record" value="com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord"/>
<property name="initialRetentionTime" value="144"/>
</bean>
<bean factory-bean="pluginRegistry" factory-method="register">
<constructor-arg value="practicewarning" />
<constructor-arg ref="practiceWarningProperties" />
</bean>
<bean factory-bean="pluginRegistry" factory-method="register">
<constructor-arg value="practicewarning"/>
<constructor-arg ref="practiceWarningProperties"/>
</bean>
<bean id="practiceWarningDecoder" class="com.raytheon.uf.edex.python.decoder.PythonDecoder">
<property name="pluginName" value="practicewarning" />
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning" />
<property name="moduleName" value="WarningDecoder" />
<property name="cache" value="true" />
<property name="recordClassname"
value="com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord" />
</bean>
<bean id="practiceWarningDecoder" class="com.raytheon.uf.edex.python.decoder.PythonDecoder">
<property name="pluginName" value="practicewarning"/>
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning"/>
<property name="moduleName" value="WarningDecoder"/>
<property name="cache" value="true"/>
<property name="recordClassname" value="com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord"/>
</bean>
</beans>

View file

@ -1,67 +1,50 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<bean id="vtecFilter" class="com.raytheon.edex.plugin.warning.util.WarningHasVTECFilter" />
<bean id="warningDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="warning" />
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
</bean>
<bean id="warningHandleoupDistRegistry" factory-bean="handleoupDistributionSrv"
factory-method="register">
<constructor-arg value="warning" />
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
<bean id="vtecFilter" class="com.raytheon.edex.plugin.warning.util.WarningHasVTECFilter"/>
<bean id="warningDistRegistry" factory-bean="distributionSrv" factory-method="register">
<constructor-arg value="warning"/>
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
</bean>
<bean id="warningHandleoupDistRegistry" factory-bean="handleoupDistributionSrv" factory-method="register">
<constructor-arg value="warning"/>
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
<constructor-arg value="true" /><!-- require valid distribution file for startup -->
</bean>
</bean>
<camelContext id="warning-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<!--
<endpoint id="warningEndpoint"
uri="file:${edex.home}/data/sbn/warning?noop=true&amp;idempotent=false" />
<camelContext id="warning-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<!-- <endpoint id="warningEndpoint" uri="file:${edex.home}/data/sbn/warning?noop=true&amp;idempotent=false" /> <route
id="warningFileConsumerRoute"> <from ref="warningEndpoint" /> <bean ref="fileToString" /> <setHeader headerName="pluginName">
<constant>warning</constant> </setHeader> <to uri="jms-durable:queue:Ingest.Warning" /> </route> -->
<route id="warningFileConsumerRoute">
<from ref="warningEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>warning</constant>
</setHeader>
<to uri="jms-durable:queue:Ingest.Warning" />
</route>
-->
<!--
Warning routes
-->
<route id="warningIngestRoute">
<from uri="jms-durable:queue:Ingest.Warning"/>
<setHeader headerName="pluginName">
<constant>warning</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="warningDecoder" method="decode" />
<bean ref="index" method="index" />
<bean ref="processUtil" method="log" />
<multicast parallelProcessing="false">
<to uri="direct-vm:stageNotification" />
<filter>
<method bean="vtecFilter" method="hasVTEC" />
<to uri="jms-durable:queue:activeTablePending"/>
</filter>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:warning?level=ERROR&amp;showBody=true" />
</doCatch>
</doTry>
</route>
</camelContext>
<!-- Warning routes -->
<route id="warningIngestRoute">
<from uri="jms-durable:queue:Ingest.Warning"/>
<setHeader headerName="pluginName">
<constant>warning</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile"/>
<bean ref="warningDecoder" method="decode"/>
<bean ref="index" method="index"/>
<bean ref="processUtil" method="log"/>
<multicast parallelProcessing="false">
<to uri="direct-vm:stageNotification"/>
<filter>
<method bean="vtecFilter" method="hasVTEC"/>
<to uri="jms-durable:queue:activeTablePending"/>
</filter>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:warning?level=ERROR&amp;showBody=true"/>
</doCatch>
</doTry>
</route>
</camelContext>
</beans>

View file

@ -1,124 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.activetable;
import java.util.Map;
import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* A SendPracticeProductRequest with the addition of an offset time string.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 27, 2011 wldougher Initial creation
*
* </pre>
*
* @author wldougher
* @version 1.0
*/
@DynamicSerialize
public class PracticeProductOfftimeRequest extends SendPracticeProductRequest
implements IMessage {
@DynamicSerializeElement
private String drtString;
@DynamicSerializeElement
private boolean notifyGFE;
private int offsetSeconds;
private Map<String, Object> headers;
/**
* @return the drtString
*/
public String getDrtString() {
return drtString;
}
/**
* @param drtString
* the drtString to set
*/
public void setDrtString(String drtString) {
this.drtString = drtString;
}
/**
* @param offsetSeconds
* the offsetSeconds to set
*/
public void setOffsetSeconds(int offsetSeconds) {
this.offsetSeconds = offsetSeconds;
}
/**
* @return the offsetSeconds
*/
public int getOffsetSeconds() {
return offsetSeconds;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.common.message.IMessage#getHeaders()
*/
@Override
public Map<String, Object> getHeaders() {
return headers;
}
/**
* @param headers
* the headers to set
*/
public void setHeaders(Map<String, Object> headers) {
this.headers = headers;
}
/**
* Set the flag value that tells whether GFE notifications should be sent.
*
* @param notifyGFE
* the notifyGFE to set
*/
public void setNotifyGFE(boolean notifyGFE) {
this.notifyGFE = notifyGFE;
}
/**
* @return the notifyGFE
*/
public boolean isNotifyGFE() {
return notifyGFE;
}
}

View file

@ -19,38 +19,102 @@
**/
package com.raytheon.uf.common.activetable;
import java.util.HashMap;
import java.util.Map;
import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.serialization.comm.IServerRequest;
/**
* TODO Add Description
* A SendPracticeProductRequest with an optional offset time string.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation
* Jun 27, 2011 wldougher Initial creation
* Nov 14, 2014 4953 randerso Merged PracticeProductOfftimeRequest with this
*
* </pre>
*
* @author njensen
* @author wldougher
* @version 1.0
*/
@DynamicSerialize
public class SendPracticeProductRequest implements IServerRequest {
public class SendPracticeProductRequest implements IServerRequest, IMessage {
@DynamicSerializeElement
private String productText;
@DynamicSerializeElement
private String drtString;
@DynamicSerializeElement
private boolean notifyGFE;
/**
* @return the productText
*/
public String getProductText() {
return productText;
}
/**
* @param productText
* the productText to set
*/
public void setProductText(String productText) {
this.productText = productText;
}
/**
* @return the drtString
*/
public String getDrtString() {
return drtString;
}
/**
* @param drtString
* the drtString to set
*/
public void setDrtString(String drtString) {
this.drtString = drtString;
}
/**
* Set the flag value that tells whether GFE notifications should be sent.
*
* @param notifyGFE
* the notifyGFE to set
*/
public void setNotifyGFE(boolean notifyGFE) {
this.notifyGFE = notifyGFE;
}
/**
* @return the notifyGFE
*/
public boolean isNotifyGFE() {
return notifyGFE;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.common.message.IMessage#getHeaders()
*/
@Override
public Map<String, Object> getHeaders() {
Map<String, Object> headers = new HashMap<String, Object>(2, 1.0f);
headers.put("drtstring", getDrtString());
headers.put("notifygfe", isNotifyGFE());
return headers;
}
}

View file

@ -1,86 +1,25 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<bean id="vtecFilter" class="com.raytheon.edex.plugin.warning.util.WarningHasVTECFilter" />
<bean id="vtecFilter" class="com.raytheon.edex.plugin.warning.util.WarningHasVTECFilter"/>
<bean id="activeTableSrv" class="com.raytheon.uf.edex.activetable.ActiveTableSrv" />
<bean id="activeTable" class="com.raytheon.uf.edex.activetable.ActiveTable" />
<bean id="activeTableDatabaseProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
<property name="pluginFQN" value="com.raytheon.uf.common.activetable" />
<property name="database" value="metadata" />
</bean>
<bean factory-bean="dbPluginRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable"/>
<constructor-arg ref="activeTableDatabaseProperties"/>
</bean>
<bean id="timeOffsetDecoder" class="com.raytheon.uf.edex.python.decoder.TimeOffsetDecoder">
<property name="pluginName" value="warning" />
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning" />
<property name="moduleName" value="WarningDecoder" />
<property name="cache" value="false"/>
<property name="recordClassname"
value="com.raytheon.uf.common.dataplugin.warning.WarningRecord" />
</bean>
<bean id="practiceProductOfftimeHandler" class="com.raytheon.uf.edex.activetable.PracticeProductOfftimeHandler"/>
<bean id="toDataURI" class="com.raytheon.uf.edex.ingest.notification.ToDataURI" />
<camelContext id="activetable-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<bean id="activeTableSrv" class="com.raytheon.uf.edex.activetable.ActiveTableSrv"/>
<bean id="activeTable" class="com.raytheon.uf.edex.activetable.ActiveTable"/>
<bean id="activeTableDatabaseProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
<property name="pluginFQN" value="com.raytheon.uf.common.activetable"/>
<property name="database" value="metadata"/>
</bean>
<bean factory-bean="dbPluginRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable"/>
<constructor-arg ref="activeTableDatabaseProperties"/>
</bean>
<camelContext id="activetable-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<route id="vtecNotify">
<from uri="vm:edex.vtecAlert" />
<bean ref="serializationUtil" method="transformToThrift" />
<to uri="jms-generic:topic:edex.alerts.vtec?timeToLive=60000" />
<from uri="vm:edex.vtecAlert"/>
<bean ref="serializationUtil" method="transformToThrift"/>
<to uri="jms-generic:topic:edex.alerts.vtec?timeToLive=60000"/>
</route>
<route id="practiceVtecRoute">
<from uri="jms-generic:queue:practiceActiveTable" />
<doTry>
<bean ref="activeTable" method="dumpProductToTempFile" />
<bean ref="practiceWarningDecoder" method="decode" />
<bean ref="index" method="index" />
<filter>
<method bean="vtecFilter" method="hasVTEC" />
<bean ref="activeTableSrv" method="practiceVtecArrived" />
<bean ref="toDataURI" method="toPracticeNotificationMsg"/>
<bean ref="serializationUtil" method="transformToThrift" />
<to uri="jms-generic:topic:edex.alerts.practicewarning?timeToLive=60000&amp;deliveryPersistent=false"/>
</filter>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:practiceActiveTable?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="practiceVtecOffsetRoute">
<from uri="vm:edex.vtecDecoder" />
<doTry>
<pipeline>
<setHeader headerName="drtstring">
<simple>${body?.drtString}</simple>
</setHeader>
<setHeader headerName="offsetseconds">
<simple>${body?.offsetSeconds}</simple>
</setHeader>
<setHeader headerName="notifygfe">
<simple>${body?.notifyGFE}</simple>
</setHeader>
<bean ref="practiceProductOfftimeHandler" method="process"/>
<bean ref="activeTable" method="dumpProductToTempFile"/>
<bean ref="timeOffsetDecoder" method="decode"/>
<multicast parallelProcessing="false">
<bean ref="activeTableSrv" method="practiceVtecArrived"/>
<filter>
<simple>${header?.notifygfe.booleanValue}</simple>
<to uri="jms-generic:queue:practiceNotify"/>
</filter>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:practiceActiveTable?level=ERROR"/>
</doCatch>
</doTry>
</route>
</camelContext>
</camelContext>
</beans>

View file

@ -1,40 +1,66 @@
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<camelContext id="clusteredActiveTableContext"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<route id="activeTablePendingRoute">
<from uri="jms-durable:queue:activeTablePending"/>
<bean id="toDataURI" class="com.raytheon.uf.edex.ingest.notification.ToDataURI"/>
<bean id="practiceVtecDecoder" class="com.raytheon.uf.edex.activetable.decoder.PracticeVtecDecoder">
<property name="pluginName" value="practicewarning"/>
<property name="pluginFQN" value="com.raytheon.edex.plugin.warning"/>
<property name="moduleName" value="WarningDecoder"/>
<property name="cache" value="false"/>
<property name="recordClassname" value="com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord"/>
</bean>
<camelContext id="clusteredActiveTableContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<route id="activeTablePendingRoute">
<from uri="jms-durable:queue:activeTablePending"/>
<doTry>
<bean ref="activeTableSrv" method="vtecArrived" />
<bean ref="activeTableSrv" method="vtecArrived"/>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:activeTable?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="practiceNotifyRoute">
<from uri="jms-generic:queue:practiceNotify" />
</route>
</camelContext>
<camelContext id="activetable-ingest" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<route id="practiceVtecRoute">
<from uri="jms-generic:queue:practiceVtec"/>
<doTry>
<multicast parallelProcessing="false">
<to uri="jms-durable:queue:edex.spcWatch" />
<to uri="jms-durable:queue:edex.tpcWatch" />
</multicast>
<pipeline>
<bean ref="serializationUtil" method="transformFromThrift"/>
<setHeader headerName="notifygfe">
<simple>${body?.notifyGFE}</simple>
</setHeader>
<bean ref="practiceVtecDecoder" method="decode"/>
<bean ref="index" method="index"/>
<multicast parallelProcessing="false">
<filter>
<simple>${header?.notifygfe.booleanValue}</simple>
<to uri="direct-vm:stageNotification"/>
</filter>
<filter>
<method bean="vtecFilter" method="hasVTEC"/>
<bean ref="activeTableSrv" method="practiceVtecArrived"/>
<bean ref="toDataURI" method="toPracticeNotificationMsg"/>
<bean ref="serializationUtil" method="transformToThrift"/>
<to uri="jms-generic:topic:edex.alerts.practicewarning?timeToLive=60000&amp;deliveryPersistent=false"/>
</filter>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:practiceActiveTable?level=ERROR"/>
</doCatch>
</doTry>
</route>
</route>
</camelContext>
</camelContext>
<bean factory-bean="contextManager" factory-method="registerClusteredContext">
<constructor-arg ref="clusteredActiveTableContext" />
</bean>
<bean factory-bean="contextManager" factory-method="registerClusteredContext">
<constructor-arg ref="clusteredActiveTableContext"/>
</bean>
</beans>

View file

@ -1,6 +1,5 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<bean id="clearTableHandler" class="com.raytheon.uf.edex.activetable.handler.ClearPracticeVTECTableHandler"/>
@ -8,101 +7,94 @@
<constructor-arg value="com.raytheon.uf.common.activetable.request.ClearPracticeVTECTableRequest"/>
<constructor-arg ref="clearTableHandler"/>
</bean>
<bean id="getActiveTableHandler" class="com.raytheon.uf.edex.activetable.GetActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetActiveTableRequest"/>
<constructor-arg ref="getActiveTableHandler"/>
</bean>
<bean id="getActiveTableDictHandler" class="com.raytheon.uf.edex.activetable.GetActiveTableDictHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetActiveTableDictRequest"/>
<constructor-arg ref="getActiveTableDictHandler"/>
</bean>
<bean id="getFourCharSitesHandler" class="com.raytheon.uf.edex.activetable.GetFourCharSitesHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetFourCharSitesRequest"/>
<constructor-arg ref="getFourCharSitesHandler"/>
</bean>
<bean id="getVtecAttributeHandler" class="com.raytheon.uf.edex.activetable.GetVtecAttributeHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetVtecAttributeRequest"/>
<constructor-arg ref="getVtecAttributeHandler"/>
</bean>
<bean id="dumpActiveTableHandler" class="com.raytheon.uf.edex.activetable.DumpActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.DumpActiveTableRequest"/>
<constructor-arg ref="dumpActiveTableHandler"/>
</bean>
<bean id="practiceVtecHandler" class="com.raytheon.uf.edex.activetable.PracticeVtecHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.SendPracticeProductRequest"/>
<constructor-arg ref="practiceVtecHandler"/>
<bean id="getActiveTableHandler" class="com.raytheon.uf.edex.activetable.GetActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetActiveTableRequest"/>
<constructor-arg ref="getActiveTableHandler"/>
</bean>
<!-- practiceProductOfftimeHandler declared in activetable-common -->
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.PracticeProductOfftimeRequest"/>
<constructor-arg ref="practiceProductOfftimeHandler"/>
</bean>
<bean id="getNextEtnHandler" class="com.raytheon.uf.edex.activetable.GetNextEtnHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetNextEtnRequest"/>
<constructor-arg ref="getNextEtnHandler"/>
<bean id="getActiveTableDictHandler" class="com.raytheon.uf.edex.activetable.GetActiveTableDictHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetActiveTableDictRequest"/>
<constructor-arg ref="getActiveTableDictHandler"/>
</bean>
<bean id="getFourCharSitesHandler" class="com.raytheon.uf.edex.activetable.GetFourCharSitesHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetFourCharSitesRequest"/>
<constructor-arg ref="getFourCharSitesHandler"/>
</bean>
<bean id="getVtecAttributeHandler" class="com.raytheon.uf.edex.activetable.GetVtecAttributeHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetVtecAttributeRequest"/>
<constructor-arg ref="getVtecAttributeHandler"/>
</bean>
<bean id="dumpActiveTableHandler" class="com.raytheon.uf.edex.activetable.DumpActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.DumpActiveTableRequest"/>
<constructor-arg ref="dumpActiveTableHandler"/>
</bean>
<bean id="practiceVtecHandler" class="com.raytheon.uf.edex.activetable.handler.SendPracticeProductHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.SendPracticeProductRequest"/>
<constructor-arg ref="practiceVtecHandler"/>
</bean>
<bean id="getNextEtnHandler" class="com.raytheon.uf.edex.activetable.GetNextEtnHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.GetNextEtnRequest"/>
<constructor-arg ref="getNextEtnHandler"/>
</bean>
<bean id="requestATHandler" class="com.raytheon.uf.edex.activetable.handler.RetrieveRemoteActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.RetrieveRemoteActiveTableRequest"/>
<constructor-arg ref="requestATHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.RetrieveRemoteActiveTableRequest"/>
<constructor-arg ref="requestATHandler"/>
</bean>
<bean id="sendATHandler" class="com.raytheon.uf.edex.activetable.handler.SendActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.SendActiveTableRequest"/>
<constructor-arg ref="sendATHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.SendActiveTableRequest"/>
<constructor-arg ref="sendATHandler"/>
</bean>
<bean id="ingestATHandler" class="com.raytheon.uf.edex.activetable.handler.MergeActiveTableHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.MergeActiveTableRequest"/>
<constructor-arg ref="ingestATHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.MergeActiveTableRequest"/>
<constructor-arg ref="ingestATHandler"/>
</bean>
<bean id="lockAndGetEtnHandler" class="com.raytheon.uf.edex.activetable.handler.LockAndGetNextEtnHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.LockAndGetNextEtnRequest"/>
<constructor-arg ref="lockAndGetEtnHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.LockAndGetNextEtnRequest"/>
<constructor-arg ref="lockAndGetEtnHandler"/>
</bean>
<bean id="setAndUnlockEtnHandler" class="com.raytheon.uf.edex.activetable.handler.UnlockActiveTablePhenSigHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.UnlockAndSetNextEtnRequest"/>
<constructor-arg ref="setAndUnlockEtnHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.activetable.request.UnlockAndSetNextEtnRequest"/>
<constructor-arg ref="setAndUnlockEtnHandler"/>
</bean>
<bean id="fetchATSrv" class="com.raytheon.uf.edex.activetable.vtecsharing.FetchActiveTableSrv"/>
<camelContext id="activeTableSharingRoutes"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<route id="activeSiteForFetchATSrv">
<from uri="jms-generic:queue:gfeSiteActivated" />
<doTry>
<bean ref="fetchATSrv" method="addSite" />
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:fetchATSrv?level=ERROR"/>
</doCatch>
<camelContext id="activeTableSharingRoutes" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<route id="activeSiteForFetchATSrv">
<from uri="jms-generic:queue:gfeSiteActivated"/>
<doTry>
<bean ref="fetchATSrv" method="addSite"/>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:fetchATSrv?level=ERROR"/>
</doCatch>
</doTry>
</route>
</camelContext>
</route>
</camelContext>
<bean factory-bean="contextManager" factory-method="registerClusteredContext">
<constructor-arg ref="activeTableSharingRoutes" />
</bean>
<constructor-arg ref="activeTableSharingRoutes"/>
</bean>
</beans>

View file

@ -34,7 +34,6 @@ import jep.JepException;
import org.apache.log4j.Logger;
import com.raytheon.edex.site.SiteUtil;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.activetable.ActiveTableRecord;
import com.raytheon.uf.common.activetable.MergeResult;
@ -94,6 +93,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* Jun 17, 2014 3296 randerso Cached PythonScript. Moved active table
* backup and purging to a separate thread.
* Added performance logging
* Nov 14, 2014 4953 randerso Moved dumpProductToTempFile into PracticeVtecDecoder
* since it had no reason to be in this class
*
* </pre>
*
@ -626,19 +627,6 @@ public class ActiveTable {
dao.executeNativeSql(sql);
}
/**
* Dump product text to temp file
*
* @param productText
* product text
* @return the temp file
*/
public static File dumpProductToTempFile(String productText) {
File file = Util.createTempFile(productText.getBytes(), "vtec");
file.deleteOnExit();
return file;
}
/**
* Get the last assigned ETN for the specified site and phensig combination.
*

View file

@ -1,138 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.activetable;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jep.JepException;
import com.raytheon.uf.common.activetable.PracticeProductOfftimeRequest;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.edex.core.EDEXUtil;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 27, 2011 wldougher Initial creation
*
* </pre>
*
* @author wldougher
* @version 1.0
*/
public class PracticeProductOfftimeHandler implements
IRequestHandler<PracticeProductOfftimeRequest> {
private static String timeUtil;
private static String includePath;
static {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext commonCx = pathMgr.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
timeUtil = pathMgr.getFile(commonCx,
"python" + File.separator + "TimeUtil.py").getPath();
includePath = pathMgr.getFile(commonCx, "python").getPath();
}
@Override
public Object handleRequest(PracticeProductOfftimeRequest request)
throws Exception {
String drtString = request.getDrtString();
request.setOffsetSeconds(offsetSecs(drtString));
request.setHeaders(new HashMap<String, Object>());
EDEXUtil.getMessageProducer().sendAsync("practiceVtecOffsetRoute",
request);
return null;
}
/**
* @param request
* @return The product text of the request
*/
public String process(PracticeProductOfftimeRequest request) {
return request.getProductText();
}
/**
* Call determineDrtOffset() (in Python) to determine the offset in seconds
* for a particular string.
*
* @param drtString
* The string to convert
* @return the offset in seconds
* @throws Exception
* if the Python call fails
*/
protected int offsetSecs(String drtString) throws Exception {
int rtnVal = 0;
if (drtString != null) {
Map<String, Object> args = new HashMap<String, Object>();
args.put("timeStr", drtString);
PythonScript python = null;
Object obj = null;
try {
python = new PythonScript(timeUtil, includePath, getClass()
.getClassLoader());
obj = python.execute("determineDrtOffset", args);
} catch (JepException e) {
throw new Exception("Python exception:" + e.getMessage(), e);
} finally {
if (python != null) {
python.dispose();
}
}
// determineDrtOffset returns a tuple.
// In the current implementation, it comes back as a String:
// "( -12345678, ...)", but it might change in the future.
if (obj instanceof String) {
String objStr = (String) obj;
String intStr = objStr.substring(1, objStr.indexOf(","));
rtnVal = Integer.parseInt(intStr);
} else if (obj instanceof List) {
rtnVal = (Integer) ((List<?>) obj).get(0);
} else if (obj.getClass().isArray()) {
rtnVal = (Integer) ((Object[]) obj)[0];
}
}
return rtnVal;
}
}

View file

@ -17,14 +17,16 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.python.decoder;
package com.raytheon.uf.edex.activetable.decoder;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.edex.python.decoder.PythonDecoder;
/**
* A PythonDecoder, modified to allow a time offset string (as passed in -z
@ -40,6 +42,10 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
* ------------- -------- ----------- --------------------------
* Jun 27, 2011 wldougher Initial creation
* Oct 03, 2013 2402 bsteffen Make PythonDecoder more extendable.
* Nov 14, 2014 4953 randerso Renamed to PracticeVtecDecoder since it is now
* used for all practice VTEC products
* Changed to take in the SendPracticeProductRequest
* to simplify spring wiring
*
* </pre>
*
@ -47,40 +53,51 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
* @version 1.0
*/
public class TimeOffsetDecoder extends PythonDecoder {
public class PracticeVtecDecoder extends PythonDecoder {
/**
* Constructor.
*/
public TimeOffsetDecoder() {
public PracticeVtecDecoder() {
super();
}
/**
* Decode a file with an offset time.
* Dump product text to temp file
*
* @param file
* The file to decode
* @param drtString
* The time offset string as used by
* TimeUtil.py::determineDrtOffset()
* @param productText
* product text
* @return the temp file
*/
public static File dumpProductToTempFile(String productText) {
File file = Util.createTempFile(productText.getBytes(), "vtec");
file.deleteOnExit();
return file;
}
/**
* Decode a practice VTEC product with a time offset.
*
* @param req
* @return An array of decoded records, which may be zero-length, but is not
* null.
* @throws Exception
* if anything goes wrong, typically in Python or converting
* Python structures to Java
*/
public PluginDataObject[] decode(File file, Headers headers)
public PluginDataObject[] decode(SendPracticeProductRequest req)
throws Exception {
File file = dumpProductToTempFile(req.getProductText());
StringBuilder sb = new StringBuilder("cmd -f ");
sb.append(file.getPath());
Boolean notifyGFE = (Boolean) headers.get("notifygfe");
Boolean notifyGFE = req.isNotifyGFE();
if (Boolean.TRUE.equals(notifyGFE)) {
sb.append(" -g");
}
String drtString = (String) headers.get("drtstring");
if (drtString != null && !"".equals(drtString)) {
String drtString = req.getDrtString();
if ((drtString != null) && !drtString.isEmpty()) {
sb.append(" -z ").append(drtString);
}

View file

@ -17,14 +17,14 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.activetable;
package com.raytheon.uf.edex.activetable.handler;
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.edex.core.EDEXUtil;
/**
* TODO Add Description
* Send Practice VTEC Product
*
* <pre>
*
@ -32,6 +32,8 @@ import com.raytheon.uf.edex.core.EDEXUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation
* Nov 14, 2014 4953 randerso Changed to use sendAsyncThriftUri so headers
* are not lost
*
* </pre>
*
@ -39,14 +41,14 @@ import com.raytheon.uf.edex.core.EDEXUtil;
* @version 1.0
*/
public class PracticeVtecHandler implements
public class SendPracticeProductHandler implements
IRequestHandler<SendPracticeProductRequest> {
@Override
public Object handleRequest(SendPracticeProductRequest request)
throws Exception {
EDEXUtil.getMessageProducer().sendAsync("practiceVtecRoute",
request.getProductText());
EDEXUtil.getMessageProducer().sendAsyncThriftUri(
"jms-generic:queue:practiceVtec", request);
return null;
}

View file

@ -1,27 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
from ufpy import TimeUtil
def determineDrtOffset(timeStr):
return TimeUtil.determineDrtOffset(timeStr)
def makeTime(timeStr):
return TimeUtil.makeTime(timeStr)