Merge branch 'tcv_14.3.2' of ssh://collaborate3.nws.noaa.gov:29418/AWIPS2_Dev_Baseline into master_14.3.2

Former-commit-id: 29561d5324 [formerly 29561d5324 [formerly 28c3dbd91c1e89ffffd19afa811a08e228a995dd]]
Former-commit-id: 45b80432d6
Former-commit-id: de4ab82df7
This commit is contained in:
Fay.Liang 2014-11-19 22:07:54 -05:00
commit e61707aefc
32 changed files with 587 additions and 770 deletions

View file

@ -4,13 +4,15 @@
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# MFLFloodingRainThreat
# XXXFloodingRainThreat
#
# Author: M. Volkmer/P. Santos
# ----------------------------------------------------------------------------
from gfeConfig import *
HideConfigFile = 1
#------------------------------------------------------------------------
# GIF/PNG Graphic Product Generation (ifpIMAGE program)
#------------------------------------------------------------------------
@ -47,19 +49,19 @@ FloodingRainThreat_defaultColorTable='GFE/gHLS_new'
# FloodThreat_minColorTableValue = 0.0
ImageLegend_color = 'black'
bgColor = 'white'
Counties_MFL_graphicColor = 'black'
Zones_MFL_graphicColor = 'black'
Marine_Zones_MFL_graphicColor = 'black'
Counties_XXX_graphicColor = 'black'
Zones_XXX_graphicColor = 'black'
Marine_Zones_XXX_graphicColor = 'black'
Interstates_graphicColor = 'blue'
States_graphicColor = 'gray'
Lakes_graphicColor = 'blue'
# MAP BACKGROUNDS
#MapBackgrounds_default = ['Counties','Marine_Zones_MFL','Interstates']
MapBackgrounds_default = ['Zones_MFL','Marine_Zones_MFL','Interstates','States','Lakes']
MFL_mask = "MFL_NO_LAKE"
#MapBackgrounds_default = ['Counties','Marine_Zones_XXX','Interstates']
MapBackgrounds_default = ['Zones_XXX','Marine_Zones_XXX','Interstates','States','Lakes']
XXX_mask = "XXX"
DefaultSamples = ['MFLFloodingRainThreat']
DefaultSamples = ['XXXFloodingRainThreat']
# Customize FONT SIZES here.
#TextFont0 = "Bitstream Vera Sans Mono-bold-10"
#TextFont1 = "Bitstream Vera Sans Mono-bold-10"
@ -72,7 +74,7 @@ SELegend_font = 2
SEColorBar_fgTextColor = "black"
#CONFIGURATION FILE SETTINGS
Png_filenamePrefix = 'MFLFloodingRainThreat'
Png_filenamePrefix = 'XXXFloodingRainThreat'
Png_baseTimeFormat = ''
#LEGENDS

View file

@ -3,13 +3,15 @@
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# MFLStormSurgeThreat
# XXXStormSurgeThreat
#
# Author: M. Volkmer/P. Santos
# ----------------------------------------------------------------------------
from gfeConfig import *
#HideConfigFile = 1
HideConfigFile = 1
#------------------------------------------------------------------------
# GIF/PNG Graphic Product Generation (ifpIMAGE program)
#------------------------------------------------------------------------
@ -42,20 +44,20 @@ StormSurgeThreat_defaultColorTable='GFE/gHLS_new'
ImageLegend_color = 'black'
bgColor = 'white'
# Counties_graphicColor = 'grey'
Counties_MFL_graphicColor = 'black'
Zones_MFL_graphicColor = 'black'
Marine_Zones_MFL_graphicColor = 'black'
Counties_XXX_graphicColor = 'black'
Zones_XXX_graphicColor = 'black'
Marine_Zones_XXX_graphicColor = 'black'
Interstates_graphicColor = 'blue'
States_graphicColor = 'gray'
Lakes_graphicColor = 'blue'
# MAP BACKGROUNDS
# MapBackgrounds_default = ['Counties','Marine_Zones_MFL','Interstates']
MapBackgrounds_default = ['Zones_MFL','Marine_Zones_MFL','Interstates','States','Lakes']
MFL_mask = "StormSurgeWW_EditArea"
# MapBackgrounds_default = ['Counties','Marine_Zones_XXX','Interstates']
MapBackgrounds_default = ['Zones_XXX','Marine_Zones_XXX','Interstates','States','Lakes']
XXX_mask = "StormSurgeWW_EditArea"
DefaultSamples = ['MFLStormSurgeThreat']
DefaultSamples = ['XXXStormSurgeThreat']
# Customize FONT SIZES here
#TextFont0 = "Bitstream Vera Sans Mono-bold-10"
#TextFont1 = "Bitstream Vera Sans Mono-bold-10"
@ -68,7 +70,7 @@ SELegend_font = 2
SEColorBar_fgTextColor = "black"
#CONFIGURATION FILE SETTINGS
Png_filenamePrefix = 'MFLStormSurgeThreat'
Png_filenamePrefix = 'XXXStormSurgeThreat'
Png_baseTimeFormat = ''
#LEGENDS

View file

@ -4,13 +4,15 @@
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# gHLSMFLTornadoThreat
# XXXTornadoThreat
#
# Author: M. Volkmer/P. Santos
# ----------------------------------------------------------------------------
from gfeConfig import *
HideConfigFile = 1
#------------------------------------------------------------------------
# GIF/PNG Graphic Product Generation (ifpIMAGE program)
#------------------------------------------------------------------------
@ -37,23 +39,23 @@ Png_omitColorBar = 0
# COLOR TABLES
TornadoThreat_defaultColorTable='GFE/gHLS_new'
#MFLTornadoThreat_maxColorTableValue = 6.0
#MFLTornadoThreat_minColorTableValue = 0.0
#XXXTornadoThreat_maxColorTableValue = 6.0
#XXXTornadoThreat_minColorTableValue = 0.0
ImageLegend_color = 'black'
bgColor = 'white'
Counties_MFL_graphicColor = 'black'
Zones_MFL_graphicColor = 'black'
Marine_Zones_MFL_graphicColor = 'black'
Counties_XXX_graphicColor = 'black'
Zones_XXX_graphicColor = 'black'
Marine_Zones_XXX_graphicColor = 'black'
Interstates_graphicColor = 'blue'
States_graphicColor = 'gray'
Lakes_graphicColor = 'blue'
# MAP BACKGROUNDS
#MapBackgrounds_default = ['Counties','Marine_Zones_MFL','Interstates']
MapBackgrounds_default = ['Zones_MFL','Marine_Zones_MFL','Interstates','States','Lakes']
MFL_mask = "MFL_CWA"
#MapBackgrounds_default = ['Counties','Marine_Zones_XXX','Interstates']
MapBackgrounds_default = ['Zones_XXX','Marine_Zones_XXX','Interstates','States','Lakes']
XXX_mask = "XXX_CWA"
DefaultSamples = ['MFLTornadoThreat']
DefaultSamples = ['XXXTornadoThreat']
# Customize FONT SIZES here
#TextFont0 = "Bitstream Vera Sans Mono-bold-10"
#TextFont1 = "Bitstream Vera Sans Mono-bold-10"
@ -66,7 +68,7 @@ SELegend_font = 2
SEColorBar_fgTextColor = "black"
#CONFIGURATION FILE SETTINGS
Png_filenamePrefix = 'MFLTornadoThreat'
Png_filenamePrefix = 'XXXTornadoThreat'
Png_baseTimeFormat = ''
#LEGENDS

View file

@ -4,13 +4,15 @@
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# MFLWindThreat
# XXXWindThreat
#
# Author: M. Volkmer/P. Santos
# ----------------------------------------------------------------------------
from gfeConfig import *
HideConfigFile = 1
#------------------------------------------------------------------------
# GIF/PNG Graphic Product Generation (ifpIMAGE program)
#------------------------------------------------------------------------
@ -47,19 +49,19 @@ WindThreat_defaultColorTable='GFE/gHLS_new'
# FloodThreat_minColorTableValue = 0.0
ImageLegend_color = 'black'
bgColor = 'white'
Counties_MFL_graphicColor = 'black'
Zones_MFL_graphicColor = 'black'
Marine_Zones_MFL_graphicColor = 'black'
Counties_XXX_graphicColor = 'black'
Zones_XXX_graphicColor = 'black'
Marine_Zones_XXX_graphicColor = 'black'
Interstates_graphicColor = 'blue'
States_graphicColor = 'gray'
Lakes_graphicColor = 'blue'
# MAP BACKGROUNDS
#MapBackgrounds_default = ['Counties','Marine_Zones_MFL','Interstates']
MapBackgrounds_default = ['Zones_MFL','Marine_Zones_MFL','Interstates','States','Lakes']
MFL_mask = "MFL"
#MapBackgrounds_default = ['Counties','Marine_Zones_XXX','Interstates']
MapBackgrounds_default = ['Zones_XXX','Marine_Zones_XXX','Interstates','States','Lakes']
XXX_mask = "XXX"
DefaultSamples = ['MFLWindThreat']
DefaultSamples = ['XXXWindThreat']
# Customize FONT SIZES here
#TextFont0 = "Bitstream Vera Sans Mono-bold-10"
#TextFont1 = "Bitstream Vera Sans Mono-bold-10"
@ -73,7 +75,7 @@ SEColorBar_fgTextColor = "black"
#CONFIGURATION FILE SETTINGS
Png_filenamePrefix = 'MFLWindThreat'
Png_filenamePrefix = 'XXXWindThreat'
Png_baseTimeFormat = ''
#LEGENDS

View file

@ -133,7 +133,7 @@ class Procedure (SmartScript.SmartScript):
return 1
elif diff < 72:
return 2
else
else:
return 3
return 0

View file

@ -1,7 +1,7 @@
import GenericHazards
import JsonSupport
import string, time, os, re, types, copy, LogStream, collections
import ModuleAccessor, SampleAnalysis, EditAreaUtils
import string, time, os, errno, re, types, copy, collections
import LogStream, ModuleAccessor, SampleAnalysis, EditAreaUtils
import math
@ -734,8 +734,14 @@ FORECASTER STEWART"""
def _getLocalAdvisoryDirectoryPath(self):
file = self._synchronizeAdvisories()
path = file.getPath()
try:
os.makedirs(path)
except OSError as exception:
if exception.errno != errno.EEXIST:
raise
return path
def _loadLastTwoAdvisories(self):
@ -758,13 +764,14 @@ FORECASTER STEWART"""
def _loadAdvisory(self, advisoryName):
self._synchronizeAdvisories()
fileName = self._getAdvisoryFilename(advisoryName)
try:
pythonDict = JsonSupport.loadFromJson(LocalizationType.CAVE_STATIC,
self._site,
self._getAdvisoryFilename(advisoryName))
fileName)
print "SARAH: File contents for", self._getAdvisoryFilename(advisoryName), ":"
print "SARAH: File contents for", fileName, ":"
print pythonDict
# Only use transmitted advisories
@ -773,23 +780,20 @@ FORECASTER STEWART"""
else:
return pythonDict
except Exception, e:
print "SARAH Load Exception for %s : %s" % (self._getAdvisoryFilename(advisoryName), e)
print "SARAH Load Exception for %s : %s" % (fileName, e)
return None
def _getAdvisoryPath(self):
return "gfe/tcvAdvisories/"
def _getLocalizationFile(self, loctype, siteID, filename):
pathManager = PathManagerFactory.getPathManager()
context = pathManager.getContextForSite(loctype, siteID)
localizationFile = pathManager.getLocalizationFile(context, filename)
return localizationFile
dataMgr = self._argDict["dataMgr"]
gfeMode = dataMgr.getOpMode().name()
if gfeMode == "PRACTICE":
return os.path.join("gfe", "tcvAdvisories", "practice")
else:
return os.path.join("gfe", "tcvAdvisories")
def _getAdvisoryFilename(self, advisoryName):
advisoryFilename = self._getAdvisoryPath() + \
advisoryName + \
".json"
advisoryFilename = os.path.join(self._getAdvisoryPath(),
advisoryName+".json")
return advisoryFilename
###############################################################

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

@ -66,6 +66,7 @@ import com.raytheon.uf.edex.core.props.PropertiesFactory;
* Nov 03, 2013 2511 mnash Fix issue where if name occurs in path
* file won't be returned correctly
* Feb 13, 2014 mnash Add region level to localization
* Nov 13, 2014 4953 randerso Changed delete() to also remove .md5 file
* </pre>
*
* @author jelkins
@ -335,11 +336,19 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
@Override
public boolean delete(ModifiableLocalizationFile file)
throws LocalizationOpFailedException {
boolean status = true;
File localFile = file.getLocalFile();
if (localFile.exists()) {
return localFile.delete();
status = localFile.delete();
}
return true;
File md5File = new File(localFile.getAbsolutePath() + ".md5");
if (md5File.exists()) {
if (!md5File.delete()) {
handler.error("Unable to delete: " + md5File.getAbsolutePath());
}
}
return status;
}
@Override
@ -349,8 +358,8 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
String contextName = null;
if (level == LocalizationLevel.BASE) {
// nothing to add
} else if (level == LocalizationLevel.SITE
|| level == LocalizationLevel.CONFIGURED) {
} else if ((level == LocalizationLevel.SITE)
|| (level == LocalizationLevel.CONFIGURED)) {
// fill in site name
contextName = getSiteName();
} else if (level == LocalizationLevel.REGION) {

View file

@ -33,6 +33,7 @@ import jep.JepException;
import com.raytheon.uf.common.activetable.VTECPartners;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -42,7 +43,9 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.file.FilenameFilters;
/**
* Watches ingested warnings for WOU products from the SPC (Storm Prediction
@ -60,6 +63,8 @@ import com.raytheon.uf.common.util.FileUtil;
* subclasses to handle all watches if desired.
* Added hooks for TCVAdvisory creation
* Changed to use Python to store TCVAdvisory files
* Added code to keep practice and operational
* advisory files separated
*
* </pre>
*
@ -68,6 +73,11 @@ import com.raytheon.uf.common.util.FileUtil;
*/
public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
private static final String TCV_ADVISORY_PATH = FileUtil.join("gfe",
"tcvAdvisories");
private static final String PRACTICE_PATH = FileUtil.join(
TCV_ADVISORY_PATH, "practice");
private static final String TPC_WATCH_TYPE = "TPC";
@ -149,29 +159,31 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
public void handleWatch(List<AbstractWarningRecord> warningRecs) {
super.handleWatch(warningRecs);
// FIXME: This marks the pending.json file as Transmitted when ANY TCV
// is decoded not the one just sent by this office. You need to look and
// the warningRecs for a match to the issuing site and ETN or something
// like that.
/*
* Since all records originate from a single TCV product the issuing
* office and record type will be the same we only need to look at the
* first record.
*/
AbstractWarningRecord record = warningRecs.get(0);
boolean practiceMode = (record instanceof PracticeWarningRecord);
String issuingOffice = record.getOfficeid();
// FIXME: The python created dicts are storing CreationTime and EndTime
// (but not StartTime for some reason)
// as python floats. These values are converted to Java floats which are
// single precision 32-bit floats causing a possible loss of precision.
// These should be stored a integer values or datetime objects to ensure
// no precision loss. I have fixed a couple of places where endTime may
// have been set to a float but we need to ensure we've got them all.
for (String siteId : getActiveSites()) {
this.saveTCVAdvisories(siteId);
String site4 = SiteMap.getInstance().getSite4LetterId(siteId);
if (issuingOffice.equals(site4)) {
this.saveTCVAdvisories(siteId, practiceMode);
break; // found matching officeId so we're done
}
}
}
private void saveTCVAdvisories(String siteId) {
File advisoriesDirectory = this.synchronizeTCVAdvisories(siteId);
private void saveTCVAdvisories(String siteId, boolean practiceMode) {
File advisoriesDirectory = this.synchronizeTCVAdvisories(siteId,
practiceMode);
String pendingFilename = "pending.json";
LocalizationFile pendingFile = this.getLocalizationFile(siteId,
pendingFilename);
pendingFilename, practiceMode);
Map<String, Object> pendingDict = this.loadJSONDictionary(pendingFile);
if (pendingDict == null) {
@ -185,7 +197,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
String transmittedFilename = stormName + advisoryNumber + ".json";
LocalizationFile transmittedFile = this.getLocalizationFile(siteId,
transmittedFilename);
transmittedFilename, practiceMode);
this.saveJSONDictionary(transmittedFile, pendingDict);
boolean transmittedFileSaved = false;
@ -200,11 +212,13 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
if (transmittedFileSaved) {
boolean allCAN = (Boolean) pendingDict.get("AllCAN");
if (allCAN) {
for (File advisory : advisoriesDirectory.listFiles()) {
for (File advisory : advisoriesDirectory
.listFiles(FilenameFilters.byFileExtension(".json"))) {
String advisoryName = advisory.getName();
if (advisoryName.startsWith(stormName)) {
LocalizationFile advisoryFile = this
.getLocalizationFile(siteId, advisoryName);
.getLocalizationFile(siteId, advisoryName,
practiceMode);
try {
advisoryFile.delete();
} catch (LocalizationOpFailedException e) {
@ -220,34 +234,35 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
} catch (LocalizationOpFailedException e) {
}
}
this.synchronizeTCVAdvisories(siteId);
}
private File synchronizeTCVAdvisories(String siteId) {
private File synchronizeTCVAdvisories(String siteId, boolean practiceMode) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext context = pathMgr.getContextForSite(
LocalizationType.CAVE_STATIC, siteId);
// Retrieving a directory causes synching to occur
File file = pathMgr.getLocalizationFile(context,
this.getTCVAdvisoryPath()).getFile();
getTCVAdvisoryPath(practiceMode)).getFile();
return file;
}
private LocalizationFile getLocalizationFile(String siteId, String filename) {
private LocalizationFile getLocalizationFile(String siteId,
String filename, boolean practiceMode) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext context = pathMgr.getContextForSite(
LocalizationType.CAVE_STATIC, siteId);
LocalizationFile localizationFile = pathMgr.getLocalizationFile(
context, this.getTCVAdvisoryPath() + filename);
context,
FileUtil.join(getTCVAdvisoryPath(practiceMode), filename));
return localizationFile;
}
private String getTCVAdvisoryPath() {
return "gfe/tcvAdvisories/";
private String getTCVAdvisoryPath(boolean practiceMode) {
return practiceMode ? PRACTICE_PATH : TCV_ADVISORY_PATH;
}
private Map<String, Object> loadJSONDictionary(LocalizationFile lf) {

View file

@ -18,7 +18,7 @@
<endpointType>VM</endpointType>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="warning" constraintType="EQUALS"/>
<constraint constraintValue="warning,practicewarning" constraintType="IN"/>
</mapping>
<mapping key="pil">
<constraint constraintValue="TCV" constraintType="EQUALS"/>

View file

@ -32,6 +32,7 @@
# ProjectionType enumeration
# 07/09/2014 #3146 randerso Added check for duplicate smartInit
# rferrel Corrected log to alertviz.
# 11/18/2014 #4953 randerso Added check for empty unit string
#
########################################################################
import types
@ -209,7 +210,10 @@ def createParm(parminfo, domain, tc):
#don't add parms with your own office type in the name.
if name.find(officeType) != -1:
return None #skip this one
return None #skip this one
if len(units) == 0:
raise Exception, 'Unit string must not be empty. For unitless quantities enter "1"'
updateProjections(projection)
start, repeat, duration = tc

View file

@ -311,7 +311,7 @@ FloodingRainThreat = ("FloodingRainThreat", DISCRETE, "Cat", "Flooding Rain Thre
StormSurgeThreat = ("StormSurgeThreat", DISCRETE, "Cat", "Storm Surge Threat", NO, Threat4Keys,2)
WindThreat = ("WindThreat", DISCRETE, "Cat", "Wind Threat", NO, Threat4Keys,2)
TornadoThreat = ("TornadoThreat", DISCRETE, "Cat", "Tornado Threat", NO, Threat4Keys,2)
QPFtoFFGRatio = ("QPFtoFFGRatio", SCALAR, "", "QPF to FFG Ratio", 8.0, 0.0, 0, NO)
QPFtoFFGRatio = ("QPFtoFFGRatio", SCALAR, "1", "QPF to FFG Ratio", 8.0, 0.0, 0, NO)
# Hazards
HazardKeys = []
@ -478,7 +478,7 @@ BLWGDUST = ('BD', 'Blowing Dust',
[INTEN_NONE],
[PRIMARY, MENTION])
FROST = ('FR','Frost',
[PATCHY, AREAS, DEFN],
[PATCHY, AREAS, WIDE],
[INTEN_NONE],
[PRIMARY, MENTION, OUTLYNG])
FRZSPRAY = ('ZY','Freezing Spray',

View file

@ -33,8 +33,7 @@
# Jul 24, 2012 #944 dgilling Refactored to support separate
# generation of products and utilities.
# Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
# Oct 20, 2014 #4953 randerso Changed how SiteInfo is loaded.
# Fixed logging to log to a file
# Oct 20, 2014 #4953 randerso Fixed logging to log to a file
# Cleaned up how protected file updates are returned
#
# @author: jelkins
@ -68,6 +67,7 @@ from sys import path
path.append(join(LIBRARY_DIR,"../"))
path.append(join(PREFERENCE_DIR,"../"))
from library.SiteInfo import SiteInfo as SITE_INFO
from preferences.configureTextProducts import NWSProducts as NWS_PRODUCTS
from os.path import basename
@ -108,17 +108,6 @@ ProcessDirectories = [
},
]
# This will "load" SiteInfo in a more complicated way
# than 'from SiteCFG import SiteInfo'.
from LockingFile import File
pathManager = PathManagerFactory.getPathManager()
lf = pathManager.getStaticLocalizationFile(LocalizationType.COMMON_STATIC, "python/gfe/SiteCFG.py")
with File(lf.getFile(), lf.getName(), 'r') as file:
fileContents = file.read()
exec fileContents
class Generator():
"""Generates site specific text products from base template files.
@ -141,7 +130,7 @@ class Generator():
@raise LookupError: when the site ID is invalid
"""
if siteId in SiteInfo.keys():
if siteId in SITE_INFO.keys():
self.__siteId = siteId
else:
raise LookupError, ' unknown WFO: ' + siteId
@ -241,11 +230,11 @@ class Generator():
LOG.debug("PIL Information for all sites Begin.......")
for site in SiteInfo.keys():
for site in SITE_INFO.keys():
LOG.info("--------------------------------------------")
LOG.info("%s %s %s" % (site,
SiteInfo[site]['fullStationID'],
SiteInfo[site]['wfoCityState']))
SITE_INFO[site]['fullStationID'],
SITE_INFO[site]['wfoCityState']))
pils = self.__createPilDictionary(site)
self.__printPilDictionary(pils)
found += len(pils)
@ -328,11 +317,11 @@ class Generator():
subDict = {}
subDict['<site>'] = siteid.strip()
subDict['<region>'] = SiteInfo[siteid]['region'].strip()
subDict['<wfoCityState>'] = SiteInfo[siteid]['wfoCityState'].strip()
subDict['<wfoCity>'] = SiteInfo[siteid]['wfoCity'].strip()
subDict['<fullStationID>'] = SiteInfo[siteid]['fullStationID'].strip()
subDict['<state>'] = SiteInfo[siteid]['state'].strip()
subDict['<region>'] = SITE_INFO[siteid]['region'].strip()
subDict['<wfoCityState>'] = SITE_INFO[siteid]['wfoCityState'].strip()
subDict['<wfoCity>'] = SITE_INFO[siteid]['wfoCity'].strip()
subDict['<fullStationID>'] = SITE_INFO[siteid]['fullStationID'].strip()
subDict['<state>'] = SITE_INFO[siteid]['state'].strip()
if product is not None:
subDict['<product>'] = product.strip()
if ProductToStandardMapping.has_key(product):
@ -367,7 +356,7 @@ class Generator():
subDict = {}
subDict['Site'] = siteid.strip()
subDict['Region'] = SiteInfo[siteid]['region'].strip()
subDict['Region'] = SITE_INFO[siteid]['region'].strip()
if product is not None:
subDict['Product'] = product.strip()
if pilInfo is not None and pilInfo.has_key("pil") and multiPilFlag:
@ -403,10 +392,10 @@ class Generator():
LOG.info("%s %s" % (p,pillist[p]))
def __createPilDictionary(self, siteid):
"""Update the SiteInfo with a PIL dictionary
"""Update the SITE_INFO with a PIL dictionary
Read the a2a data from the database, create PIL information, and add the information
to the SiteInfo dictionary.
to the SITE_INFO dictionary.
@param site: the site for which PIL information is created
@type site: string
@ -415,7 +404,7 @@ class Generator():
@rtype: dictionary
"""
siteD = SiteInfo[siteid]
siteD = SITE_INFO[siteid]
stationID4 = siteD['fullStationID']
from com.raytheon.edex.plugin.text.dao import AfosToAwipsDao
@ -460,7 +449,7 @@ class Generator():
e['textdbPil'] = pil
e['awipsWANPil'] = site4 + pil[3:]
d.append(e)
siteD[nnn] = d #store the pil dictionary back into the SiteInfo
siteD[nnn] = d #store the pil dictionary back into the SITE_INFO
return pillist
@ -597,8 +586,8 @@ class Generator():
continue
# extract out the pil information from the dictionary
if SiteInfo[siteid].has_key(pilNames[0]):
pils = SiteInfo[siteid][pilNames[0]]
if SITE_INFO[siteid].has_key(pilNames[0]):
pils = SITE_INFO[siteid][pilNames[0]]
else:
#set pils to empty list if none defined
pils = [{'awipsWANPil': 'kssscccnnn',

View file

@ -843,18 +843,19 @@ class TextProduct(HLSTCV_Common.TextProduct):
def _saveAdvisory(self, advisoryName, advisoryDict):
self._synchronizeAdvisories()
fileName = self._getAdvisoryFilename(advisoryName)
try:
JsonSupport.saveToJson(LocalizationType.CAVE_STATIC,
self._site,
self._getAdvisoryFilename(advisoryName),
fileName,
advisoryDict)
print "SARAH: Wrote file contents for", self._getAdvisoryFilename(advisoryName)
print "SARAH: Wrote file contents for", fileName
self._synchronizeAdvisories()
except Exception, e:
print "SARAH Save Exception for", self._getAdvisoryFilename(advisoryName), ":", e
print "SARAH Save Exception for", fileName, ":", e
def _getHazardsForHLS(self):
hazardTable = self._argDict["hazards"]

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,66 +1,49 @@
<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>
<bean id="vtecFilter" class="com.raytheon.edex.plugin.warning.util.WarningHasVTECFilter"/>
<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" />
<bean id="warningDistRegistry" factory-bean="distributionSrv" factory-method="register">
<constructor-arg value="warning"/>
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
</bean>
<route id="warningFileConsumerRoute">
<from ref="warningEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>warning</constant>
</setHeader>
<to uri="jms-durable:queue:Ingest.Warning" />
</route>
-->
<bean id="warningHandleoupDistRegistry" factory-bean="handleoupDistributionSrv" factory-method="register">
<constructor-arg value="warning"/>
<constructor-arg value="jms-durable:queue:Ingest.Warning"/>
</bean>
<!--
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>
<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> -->
<!-- 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

@ -242,7 +242,7 @@ public class GridParmInfo implements Cloneable {
this.rateParm = rateParm;
if (!validCheck()) {
statusHandler.warn(this.errorMessage);
statusHandler.error(this.errorMessage);
setDefaultValues();
}
}

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

@ -33,7 +33,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;
@ -55,9 +54,9 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.database.DataAccessLayerException;
@ -91,6 +90,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>
*
@ -220,9 +221,9 @@ public class ActiveTable {
ActiveTableMode mode, String phensigList, String act, String etn,
String[] wfos) {
if (wfos == null || !Arrays.asList(wfos).contains("all")) {
if ((wfos == null) || !Arrays.asList(wfos).contains("all")) {
if (wfos == null || wfos.length == 0) {
if ((wfos == null) || (wfos.length == 0)) {
// default to WFOs from VTECPartners
Set<String> wfoSet = getDecoderSites(siteId);
@ -352,14 +353,14 @@ public class ActiveTable {
PythonScript python = threadLocalPythonScript.get();
try {
result = (MergeResult) python.execute("mergeFromJava", args);
} catch (JepException e) {
statusHandler.handle(Priority.PROBLEM,
"Error updating active table", e);
}
} catch (Exception e) {
} catch (JepException e) {
statusHandler.handle(Priority.PROBLEM,
"Error initializing active table python", e);
"Error updating active table", e);
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Error initializing active table python", e);
}
return result;
}
@ -419,11 +420,11 @@ public class ActiveTable {
query.addQueryParam("etn", etn, "in");
}
if (requestValidTimes && currentTime != null) {
if (requestValidTimes && (currentTime != null)) {
// Current Time
query.addQueryParam("endTime", currentTime, "greater_than");
}
if (latestEtn && currentTime != null) {
if (latestEtn && (currentTime != null)) {
Calendar yearStart = Calendar.getInstance();
yearStart.set(currentTime.get(Calendar.YEAR), Calendar.JANUARY,
0, 0, 0);
@ -623,19 +624,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)

View file

@ -19,7 +19,24 @@
**/
package com.raytheon.uf.edex.core;
import com.raytheon.uf.common.serialization.SerializationException;
/**
* Message Producer Interface
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 10/08/14 #3684 randerso Added sendAsyncThriftUri
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public interface IMessageProducer {
/**
@ -57,4 +74,15 @@ public interface IMessageProducer {
*/
public void sendAsyncUri(String uri, Object message) throws EdexException;
/**
* Sends a message asynchronously using Thrift serialization.
*
* @param uri
* the uri to send the message to
* @param message
* the message to send
*/
public void sendAsyncThriftUri(String uri, Object message)
throws EdexException, SerializationException;
}

View file

@ -41,6 +41,8 @@ import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.spi.InterceptStrategy;
import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.util.Pair;
@ -63,6 +65,7 @@ import com.raytheon.uf.edex.esb.camel.context.ContextManager;
* Nov 14, 2008 njensen Initial creation.
* Mar 27, 2014 2726 rjpeter Modified for graceful shutdown changes,
* added tracking of endpoints by context.
* Oct 08, 2014 #3684 randerso Added sendAsyncThriftUri
* </pre>
*
* @author njensen
@ -173,6 +176,33 @@ public class MessageProducer implements IMessageProducer, InterceptStrategy {
}
}
@Override
public void sendAsyncThriftUri(String uri, Object message)
throws EdexException, SerializationException {
if (!started
&& queueWaitingMessage(WaitingType.THRIFT_URI, uri, message)) {
return;
}
try {
Pair<ProducerTemplate, Endpoint> ctxAndTemplate = getProducerTemplateAndEndpointForUri(uri);
Map<String, Object> headers = getHeaders(message);
ProducerTemplate template = ctxAndTemplate.getFirst();
Endpoint ep = ctxAndTemplate.getSecond();
if (headers != null) {
template.sendBodyAndHeaders(ep, ExchangePattern.InOnly,
SerializationUtil.transformToThrift(message), headers);
} else {
template.sendBody(ep, ExchangePattern.InOnly,
SerializationUtil.transformToThrift(message));
}
} catch (Exception e) {
throw new EdexException("Error sending asynchronous message: "
+ message + " to uri: " + uri, e);
}
}
/*
* (non-Javadoc)
*
@ -350,6 +380,9 @@ public class MessageProducer implements IMessageProducer, InterceptStrategy {
case URI:
sendAsyncUri(wm.dest, wm.msg);
break;
case THRIFT_URI:
sendAsyncThriftUri(wm.dest, wm.msg);
break;
}
} catch (Exception e) {
statusHandler
@ -419,7 +452,7 @@ public class MessageProducer implements IMessageProducer, InterceptStrategy {
* Enum for handling whether the waiting type was uri or msg.
*/
private enum WaitingType {
ID, URI
ID, URI, THRIFT_URI
};
/**

View file

@ -112,7 +112,7 @@ for PARM in $PARMS
do
# NOTE: cannot run ifpIMAGE on dx3/dx4 - must ssh to a px
echo "Creating ${PARM} image..." >> $LOG_FILE
ssh px1 "unset DISPLAY; ${GFEBINdir}/ifpIMAGE -site ${SITE} -c ${SITE}${PARM} -o ${PRODUCTdir}"
ssh px1 "unset DISPLAY; ${GFEBINdir}/ifpIMAGE -site ${SITE} -c ${PARM} -o ${PRODUCTdir}"
convert ${PRODUCTdir}/${SITE}${PARM}.png -resize 104x148 ${PRODUCTdir}/${SITE}${PARM}_sm.png
done

View file

@ -98,6 +98,11 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(755,awips,fxalpha,755)
%dir /awips2/GFESuite/bin
/awips2/GFESuite/bin/*
%dir /awips2/GFESuite/hti/bin
/awips2/GFESuite/hti/bin/*
%defattr(755,awips,fxalpha,777)
%dir /awips2/GFESuite/hti/etc
/awips2/GFESuite/hti/etc/*
%defattr(644,awips,fxalpha,755)
%dir /awips2/GFESuite/bin/src
/awips2/GFESuite/bin/src/*

View file

@ -1 +1 @@
20120517
20141027