Merge branch 'omaha_13.4.1' (13.4.1-9) into development

Conflicts:
	cave/com.raytheon.uf.viz.common.core.feature/feature.xml
	cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java
	edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java
	edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java
	rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0
	rpms/legal/FOSS_licenses/werkzeug/LICENSE.txt

Change-Id: Icc296cedd6d190d1743727c228e540036f9b6d8c

Former-commit-id: d37ba352e2 [formerly 648a1b25ae] [formerly a33ddbd1a6] [formerly a9869f07ba [formerly a33ddbd1a6 [formerly d8543a8dc09565c12c3aebc21466ed43108a9c85]]]
Former-commit-id: a9869f07ba
Former-commit-id: fc1253a3eff64276ef10f0a5d0b23f403a4cff70 [formerly c47eb36e43]
Former-commit-id: aff520d61b
This commit is contained in:
Richard Peter 2013-05-17 10:33:18 -05:00
commit f186912fe1
55 changed files with 1491 additions and 1189 deletions

View file

@ -110,8 +110,7 @@
id="com.raytheon.uf.common.dataplugin.radar" id="com.raytheon.uf.common.dataplugin.radar"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.edex.decodertools" id="com.raytheon.uf.edex.decodertools"

View file

@ -59,8 +59,7 @@
id="com.raytheon.uf.common.dataplugin.grid" id="com.raytheon.uf.common.dataplugin.grid"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.dataplugin.grib" id="com.raytheon.uf.common.dataplugin.grib"

View file

@ -51,8 +51,7 @@
id="com.raytheon.uf.common.dataplugin.ffmp" id="com.raytheon.uf.common.dataplugin.ffmp"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.viz.monitor.ffmp" id="com.raytheon.uf.viz.monitor.ffmp"

View file

@ -52,8 +52,7 @@
id="com.raytheon.uf.common.datadelivery.request" id="com.raytheon.uf.common.datadelivery.request"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.datadelivery.event" id="com.raytheon.uf.common.datadelivery.event"
@ -66,8 +65,7 @@
id="com.raytheon.uf.common.registry.ebxml" id="com.raytheon.uf.common.registry.ebxml"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.registry.event" id="com.raytheon.uf.common.registry.event"
@ -80,8 +78,7 @@
id="com.raytheon.uf.common.useradmin" id="com.raytheon.uf.common.useradmin"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.viz.useradmin" id="com.raytheon.uf.viz.useradmin"
@ -101,7 +98,6 @@
id="com.raytheon.uf.common.datadelivery.service" id="com.raytheon.uf.common.datadelivery.service"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
</feature> </feature>

View file

@ -34,8 +34,7 @@
id="com.raytheon.uf.common.dataplugin.gfe" id="com.raytheon.uf.common.dataplugin.gfe"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.viz.ghg" id="com.raytheon.viz.ghg"

View file

@ -80,7 +80,7 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
/** /**
* Implements common parm manager functionality shared between concrete and mock * Implements common parm manager functionality shared between concrete and mock
* implementations. * implementations.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
@ -103,9 +103,10 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
* 03/20/2013 #1774 randerso Code cleanup * 03/20/2013 #1774 randerso Code cleanup
* 04/11/2013 16028 ryu Fixed setParmsRemoveISCDeps() to not remove * 04/11/2013 16028 ryu Fixed setParmsRemoveISCDeps() to not remove
* modified parms. * modified parms.
* * 05/02/2013 #1969 randerso Cleaned up and optimized processing of DBInvChangedNotification
*
* </pre> * </pre>
* *
* @author chammack * @author chammack
* @version 1.0 * @version 1.0
*/ */
@ -421,7 +422,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#dispose() * @see com.raytheon.viz.gfe.core.IParmManager#dispose()
*/ */
@Override @Override
@ -493,14 +494,14 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Return the DataManager * Return the DataManager
* *
* @return the dataManager * @return the dataManager
*/ */
protected abstract DataManager getDataManager(); protected abstract DataManager getDataManager();
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see java.lang.Object#finalize() * @see java.lang.Object#finalize()
*/ */
@Override @Override
@ -511,7 +512,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Recalculate the system time range using the total time span of all * Recalculate the system time range using the total time span of all
* displayed parms and their locks * displayed parms and their locks
* *
* @return the system time range * @return the system time range
*/ */
protected TimeRange recalcSystemTimeRange() { protected TimeRange recalcSystemTimeRange() {
@ -573,7 +574,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.parm.IParmManager#getLockedParms() * @see com.raytheon.viz.gfe.core.parm.IParmManager#getLockedParms()
*/ */
@Override @Override
@ -595,7 +596,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.parm.IParmManager#getParm(com.raytheon.viz. * com.raytheon.viz.gfe.core.parm.IParmManager#getParm(com.raytheon.viz.
* gfe.core.parm.ParmID) * gfe.core.parm.ParmID)
@ -617,7 +618,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.parm.IParmManager#getUndisplayedParms() * @see com.raytheon.viz.gfe.core.parm.IParmManager#getUndisplayedParms()
*/ */
@Override @Override
@ -632,7 +633,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#getSelectedParms() * @see com.raytheon.viz.gfe.core.IParmManager#getSelectedParms()
*/ */
@Override @Override
@ -655,7 +656,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#getModifiedParms() * @see com.raytheon.viz.gfe.core.IParmManager#getModifiedParms()
*/ */
@Override @Override
@ -678,7 +679,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Returns a matching parm * (creates if necessary) for the given expression * Returns a matching parm * (creates if necessary) for the given expression
* and database id. * and database id.
* *
* @param dbid * @param dbid
* the database * the database
* @param exprName * @param exprName
@ -812,7 +813,7 @@ public abstract class AbstractParmManager implements IParmManager {
* Helper function for <code>setParms</code>. Takes the toBeLoaded and * Helper function for <code>setParms</code>. Takes the toBeLoaded and
* removeParms lists, calculates non-visible ISC dependencies, and then * removeParms lists, calculates non-visible ISC dependencies, and then
* returns the updated lists through the calling arguments. * returns the updated lists through the calling arguments.
* *
* @param toBeLoaded * @param toBeLoaded
* @param removeParms * @param removeParms
*/ */
@ -824,8 +825,10 @@ public abstract class AbstractParmManager implements IParmManager {
List<ParmID> depParms = dependentParms(removeList.get(i), true); List<ParmID> depParms = dependentParms(removeList.get(i), true);
for (ParmID pid : depParms) { for (ParmID pid : depParms) {
int index = pivdIndex(toBeLoaded, pid); int index = pivdIndex(toBeLoaded, pid);
if ((index != -1) && (!toBeLoaded.get(index).isVisible()) if ((index != -1)
&& (!getParm(toBeLoaded.get(index).getParmID()).isModified())) { && (!toBeLoaded.get(index).isVisible())
&& (!getParm(toBeLoaded.get(index).getParmID())
.isModified())) {
removeList.add(toBeLoaded.get(index).getParmID()); removeList.add(toBeLoaded.get(index).getParmID());
toBeLoaded.remove(index); toBeLoaded.remove(index);
} }
@ -843,7 +846,7 @@ public abstract class AbstractParmManager implements IParmManager {
* Helper function for <code>setParms</code>. Takes the toBeLoaded, * Helper function for <code>setParms</code>. Takes the toBeLoaded,
* addedParms, removeParms, and modParms lists, calculates dependencies, and * addedParms, removeParms, and modParms lists, calculates dependencies, and
* then returns the updated lists through the calling arguments. * then returns the updated lists through the calling arguments.
* *
* @param toBeLoaded * @param toBeLoaded
* @param addParms * @param addParms
* @param removeParms * @param removeParms
@ -938,7 +941,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Actual parm creation mechanism * Actual parm creation mechanism
* *
* @param pid * @param pid
* parm id * parm id
* @param mutableParm * @param mutableParm
@ -951,20 +954,20 @@ public abstract class AbstractParmManager implements IParmManager {
boolean mutableParm, boolean displayable) throws GFEServerException; boolean mutableParm, boolean displayable) throws GFEServerException;
/** /**
* *
* Command to create/remove parms based on ParmID. For additions, the Map * Command to create/remove parms based on ParmID. For additions, the Map
* contains the ParmID and visibility. * contains the ParmID and visibility.
* *
* implementation --------------------------------------------------------- * implementation ---------------------------------------------------------
* Note: addParms, removeParms is modified within this routine, thus they * Note: addParms, removeParms is modified within this routine, thus they
* are not passed in as const references. * are not passed in as const references.
* *
* Routine converts the ParmIDs into Parms*. Special cases for VCParms, * Routine converts the ParmIDs into Parms*. Special cases for VCParms,
* since they need to load other parms possibly. Thus the input add and * since they need to load other parms possibly. Thus the input add and
* remove may not result in the same parms being created and destroyed. * remove may not result in the same parms being created and destroyed.
* ------ * ------
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* *
* @param addParms * @param addParms
* @param removeParms * @param removeParms
*/ */
@ -1087,7 +1090,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Command to create/remove parms based on ParmID. * Command to create/remove parms based on ParmID.
* *
* @param addParms * @param addParms
* the parms to add * the parms to add
* @param removeParms * @param removeParms
@ -1101,7 +1104,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#getParmInExpr(java.lang.String, * com.raytheon.viz.gfe.core.IParmManager#getParmInExpr(java.lang.String,
* boolean, com.raytheon.viz.gfe.core.parm.Parm) * boolean, com.raytheon.viz.gfe.core.parm.Parm)
@ -1153,7 +1156,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.parm.IParmManager#getDisplayedParms() * @see com.raytheon.viz.gfe.core.parm.IParmManager#getDisplayedParms()
*/ */
@Override @Override
@ -1174,7 +1177,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#setDisplayedParms(com.raytheon * com.raytheon.viz.gfe.core.IParmManager#setDisplayedParms(com.raytheon
* .edex.plugin.gfe.db.objects.ParmID[]) * .edex.plugin.gfe.db.objects.ParmID[])
@ -1278,7 +1281,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.msgs.IParmIDChangedListener#parmIDChanged(com * com.raytheon.viz.gfe.core.msgs.IParmIDChangedListener#parmIDChanged(com
* .raytheon.viz.gfe.core.parm.Parm, * .raytheon.viz.gfe.core.parm.Parm,
@ -1294,7 +1297,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @seecom.raytheon.viz.gfe.core.msgs.IParmInventoryChangedListener# * @seecom.raytheon.viz.gfe.core.msgs.IParmInventoryChangedListener#
* parmInventoryChanged(com.raytheon.viz.gfe.core.parm.Parm, * parmInventoryChanged(com.raytheon.viz.gfe.core.parm.Parm,
* com.raytheon.uf.common.time.TimeRange) * com.raytheon.uf.common.time.TimeRange)
@ -1318,7 +1321,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.msgs.ILockTableChangedListener#lockTableChanged * com.raytheon.viz.gfe.core.msgs.ILockTableChangedListener#lockTableChanged
* (com.raytheon.viz.gfe.core.parm.Parm, * (com.raytheon.viz.gfe.core.parm.Parm,
@ -1336,7 +1339,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addDisplayedParmListChangedListener * com.raytheon.viz.gfe.core.IParmManager#addDisplayedParmListChangedListener
* (com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener) * (com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener)
@ -1349,7 +1352,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeDisplayedParmListChangedListener * com.raytheon.viz.gfe.core.IParmManager#removeDisplayedParmListChangedListener
* (com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener) * (com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener)
@ -1362,7 +1365,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addParmListChangedListener(com * com.raytheon.viz.gfe.core.IParmManager#addParmListChangedListener(com
* .raytheon.viz.gfe.core.msgs.IParmListChangedListener) * .raytheon.viz.gfe.core.msgs.IParmListChangedListener)
@ -1375,7 +1378,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeParmListChangedListener( * com.raytheon.viz.gfe.core.IParmManager#removeParmListChangedListener(
* com.raytheon.viz.gfe.core.msgs.IParmListChangedListener) * com.raytheon.viz.gfe.core.msgs.IParmListChangedListener)
@ -1387,7 +1390,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addParmIDChangedListener(com.raytheon * com.raytheon.viz.gfe.core.IParmManager#addParmIDChangedListener(com.raytheon
* .viz.gfe.core.msgs.IParmIDChangedListener) * .viz.gfe.core.msgs.IParmIDChangedListener)
@ -1399,7 +1402,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeParmIDChangedListener(com * com.raytheon.viz.gfe.core.IParmManager#removeParmIDChangedListener(com
* .raytheon.viz.gfe.core.msgs.IParmIDChangedListener) * .raytheon.viz.gfe.core.msgs.IParmIDChangedListener)
@ -1411,7 +1414,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addSystemTimeRangeChangedListener * com.raytheon.viz.gfe.core.IParmManager#addSystemTimeRangeChangedListener
* (com.raytheon.viz.gfe.core.msgs.ISystemTimeRangeChangedListener) * (com.raytheon.viz.gfe.core.msgs.ISystemTimeRangeChangedListener)
@ -1424,7 +1427,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeSystemTimeRangeChangedListener * com.raytheon.viz.gfe.core.IParmManager#removeSystemTimeRangeChangedListener
* (com.raytheon.viz.gfe.core.msgs.ISystemTimeRangeChangedListener) * (com.raytheon.viz.gfe.core.msgs.ISystemTimeRangeChangedListener)
@ -1437,7 +1440,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addAvailableSourcesChangedListener * com.raytheon.viz.gfe.core.IParmManager#addAvailableSourcesChangedListener
* (com.raytheon.viz.gfe.core.msgs.IAvailableSourcesChangedListener) * (com.raytheon.viz.gfe.core.msgs.IAvailableSourcesChangedListener)
@ -1450,7 +1453,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#addNewModelAvailableListener(com * com.raytheon.viz.gfe.core.IParmManager#addNewModelAvailableListener(com
* .raytheon.viz.gfe.core.msgs.INewModelAvailableListener) * .raytheon.viz.gfe.core.msgs.INewModelAvailableListener)
@ -1462,7 +1465,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeAvailableSourcesChangedListener * com.raytheon.viz.gfe.core.IParmManager#removeAvailableSourcesChangedListener
* (com.raytheon.viz.gfe.core.msgs.IAvailableSourcesChangedListener) * (com.raytheon.viz.gfe.core.msgs.IAvailableSourcesChangedListener)
@ -1475,7 +1478,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#removeNewModelAvailableListener * com.raytheon.viz.gfe.core.IParmManager#removeNewModelAvailableListener
* (com.raytheon.viz.gfe.core.msgs.INewModelAvailableListener) * (com.raytheon.viz.gfe.core.msgs.INewModelAvailableListener)
@ -1488,7 +1491,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the displayed parm list changed listener * Fire the displayed parm list changed listener
* *
* @param parms * @param parms
* complete list of parms * complete list of parms
* @param adds * @param adds
@ -1515,7 +1518,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the ParmID changed event. * Fire the ParmID changed event.
* *
* @param parm * @param parm
* The parm which had its ParmID change * The parm which had its ParmID change
* @param newParmId * @param newParmId
@ -1538,7 +1541,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the parm list changed listener * Fire the parm list changed listener
* *
* @param parms * @param parms
* complete list of parms * complete list of parms
* @param adds * @param adds
@ -1564,7 +1567,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the system time range changed listener * Fire the system time range changed listener
* *
* @param systemTimeRange * @param systemTimeRange
* new system time range * new system time range
*/ */
@ -1586,7 +1589,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the available sources changed event. * Fire the available sources changed event.
* *
* @param inventory * @param inventory
* The complete inventory * The complete inventory
* @param deletions * @param deletions
@ -1615,7 +1618,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Fire the new model available event. * Fire the new model available event.
* *
* @param additions * @param additions
* The DatabaseID of the newly-available model * The DatabaseID of the newly-available model
*/ */
@ -1636,7 +1639,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Return a list of ParmIDs for a list of Parms * Return a list of ParmIDs for a list of Parms
* *
* @param parms * @param parms
* @return * @return
*/ */
@ -1652,7 +1655,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#getParms(com.raytheon.uf.common * com.raytheon.viz.gfe.core.IParmManager#getParms(com.raytheon.uf.common
* .dataplugin.gfe.db.objects.ParmID[]) * .dataplugin.gfe.db.objects.ParmID[])
@ -1670,7 +1673,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Return a list of Parms for a list of ParmIDs with nulls in place of parms * Return a list of Parms for a list of ParmIDs with nulls in place of parms
* that are not loaded. * that are not loaded.
* *
* @param parmIDs * @param parmIDs
* @return * @return
*/ */
@ -1688,7 +1691,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#getAllAvailableParms() * @see com.raytheon.viz.gfe.core.IParmManager#getAllAvailableParms()
*/ */
@Override @Override
@ -1704,7 +1707,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#setParmDisplayable(com.raytheon * com.raytheon.viz.gfe.core.IParmManager#setParmDisplayable(com.raytheon
* .viz.gfe.core.parm.Parm, boolean) * .viz.gfe.core.parm.Parm, boolean)
@ -1730,7 +1733,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#deallocateUnusedGrids(int) * @see com.raytheon.viz.gfe.core.IParmManager#deallocateUnusedGrids(int)
*/ */
@Override @Override
@ -1797,7 +1800,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#getProductDB() * @see com.raytheon.viz.gfe.core.IParmManager#getProductDB()
*/ */
@Override @Override
@ -1808,7 +1811,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Filters out a complete list of databaseIDs to those only allowed by the * Filters out a complete list of databaseIDs to those only allowed by the
* dbCatagories in the gfeConfig. Sorts the final list. * dbCatagories in the gfeConfig. Sorts the final list.
* *
* @param dbIds * @param dbIds
* The list of DatabaseIDs to filter * The list of DatabaseIDs to filter
* @return A sorted list of DatabseIDs that are GRID types and match the * @return A sorted list of DatabseIDs that are GRID types and match the
@ -1835,7 +1838,7 @@ public abstract class AbstractParmManager implements IParmManager {
* mutable model, plus all other databases identified by the database * mutable model, plus all other databases identified by the database
* categories specified in the gfeConfig. The databases are filtered by * categories specified in the gfeConfig. The databases are filtered by
* projection also, since the GFE can only handle one projection. * projection also, since the GFE can only handle one projection.
* *
* @return A filtered list of available databases. * @return A filtered list of available databases.
*/ */
private List<DatabaseID> getDatabaseInventory() { private List<DatabaseID> getDatabaseInventory() {
@ -1855,7 +1858,7 @@ public abstract class AbstractParmManager implements IParmManager {
* This function is called when the list of available database has changed. * This function is called when the list of available database has changed.
* The list of available parms is updated based on the list of additions and * The list of available parms is updated based on the list of additions and
* deletions. * deletions.
* *
* @param deletions * @param deletions
* The items being removed from the inventory * The items being removed from the inventory
* @param additions * @param additions
@ -1863,33 +1866,35 @@ public abstract class AbstractParmManager implements IParmManager {
*/ */
public void updatedDatabaseList(List<DatabaseID> deletions, public void updatedDatabaseList(List<DatabaseID> deletions,
List<DatabaseID> additions) { List<DatabaseID> additions) {
// create list of additions we didn't already have
List<DatabaseID> newAdditions = new ArrayList<DatabaseID>(additions);
newAdditions.removeAll(availableDatabases);
availableDatabases.addAll(additions); availableDatabases.addAll(additions);
availableDatabases.removeAll(deletions); availableDatabases.removeAll(deletions);
List<ParmID> toDelete = new ArrayList<ParmID>(); List<ParmID> toDelete = new ArrayList<ParmID>();
for (DatabaseID dbId : deletions) { for (Parm parm : getAllParms()) {
for (Parm parm : getAllParms()) { ParmID pid = parm.getParmID();
if (parm.getParmID().getDbId().equals(dbId)) { if (deletions.contains(pid.getDbId())) {
toDelete.add(parm.getParmID()); toDelete.add(pid);
}
} }
} }
// now unload the parms, which handles the deletions and updates // now unload the parms, which handles the deletions and updates
setParms(new ArrayList<ParmIDVis>(), toDelete); setParms(new ArrayList<ParmIDVis>(0), toDelete);
if (additions.size() > 0) { for (DatabaseID model : newAdditions) {
for (DatabaseID model : additions) { updateModel(model);
updateModel(model); fireNewModelAvailable(model);
fireNewModelAvailable(model);
}
} }
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see
* com.raytheon.viz.gfe.core.IParmManager#updateModel(com.raytheon.uf.common * com.raytheon.viz.gfe.core.IParmManager#updateModel(com.raytheon.uf.common
* .dataplugin.gfe.db.objects.DatabaseID) * .dataplugin.gfe.db.objects.DatabaseID)
@ -1999,7 +2004,7 @@ public abstract class AbstractParmManager implements IParmManager {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.raytheon.viz.gfe.core.IParmManager#deleteTemporaryParms() * @see com.raytheon.viz.gfe.core.IParmManager#deleteTemporaryParms()
*/ */
@Override @Override
@ -2072,7 +2077,7 @@ public abstract class AbstractParmManager implements IParmManager {
/** /**
* Returns the Virtual Parm index into vcModules for the given ParmID. * Returns the Virtual Parm index into vcModules for the given ParmID.
* *
* @param pid * @param pid
* ParmID to search for. * ParmID to search for.
* @return The index of the ParmID if it is in vcModules. Else, -1. * @return The index of the ParmID if it is in vcModules. Else, -1.

View file

@ -42,6 +42,7 @@ import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceID;
import com.raytheon.uf.common.dataplugin.gfe.request.AbstractGfeRequest; import com.raytheon.uf.common.dataplugin.gfe.request.AbstractGfeRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.ClearPracticeVTECTableRequest; import com.raytheon.uf.common.dataplugin.gfe.request.ClearPracticeVTECTableRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.CommitGridsRequest; import com.raytheon.uf.common.dataplugin.gfe.request.CommitGridsRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.CreateNewDbRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.GetActiveTableRequest; import com.raytheon.uf.common.dataplugin.gfe.request.GetActiveTableRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.GetClientsRequest; import com.raytheon.uf.common.dataplugin.gfe.request.GetClientsRequest;
import com.raytheon.uf.common.dataplugin.gfe.request.GetDbInventoryRequest; import com.raytheon.uf.common.dataplugin.gfe.request.GetDbInventoryRequest;
@ -110,6 +111,8 @@ import com.raytheon.viz.gfe.core.parm.Parm;
* 06/11/09 #1947 rjpeter Fixed null pointers. * 06/11/09 #1947 rjpeter Fixed null pointers.
* 07/09/09 #2590 njensen Site ID from preferences and sent on all requests. * 07/09/09 #2590 njensen Site ID from preferences and sent on all requests.
* 09/22/09 #3058 rjpeter Removed GFE Edex dependency. * 09/22/09 #3058 rjpeter Removed GFE Edex dependency.
* 05/02/13 #1969 randerso Added createNewDb method
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -750,4 +753,10 @@ public class IFPClient {
return makeRequest(request); return makeRequest(request);
} }
public ServerResponse<?> createNewDb(DatabaseID dbId)
throws GFEServerException {
CreateNewDbRequest request = new CreateNewDbRequest(dbId);
return makeRequest(request);
}
} }

View file

@ -73,6 +73,9 @@ import com.raytheon.viz.gfe.types.MutableInteger;
* a Parm. * a Parm.
* 06/25/12 #766 dgilling Fix NullPointerException from VCModules * 06/25/12 #766 dgilling Fix NullPointerException from VCModules
* when running in practice mode. * when running in practice mode.
* 05/02/13 #1969 randerso Added code to explicitly create the mutable database
* if it doesn't exist. Used to just happen by accident
* when getParmList was called.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -83,8 +86,6 @@ public class ParmManager extends AbstractParmManager {
.getHandler(ParmManager.class); .getHandler(ParmManager.class);
@SuppressWarnings("unused") @SuppressWarnings("unused")
private final Set<ParmID> availableParmIDs;
private final GridLocation gloc; private final GridLocation gloc;
private List<DatabaseID> availableServerDatabases; private List<DatabaseID> availableServerDatabases;
@ -107,9 +108,6 @@ public class ParmManager extends AbstractParmManager {
// Get the composite grid location // Get the composite grid location
this.gloc = dataManager.getClient().getDBGridLocation(); this.gloc = dataManager.getClient().getDBGridLocation();
List<ParmID> ids = dataManager.getClient().getParmList(mutableDb);
this.availableParmIDs = new HashSet<ParmID>(ids);
this.systemTimeRange = recalcSystemTimeRange(); this.systemTimeRange = recalcSystemTimeRange();
this.parmIDCacheServer = new HashMap<DatabaseID, List<ParmID>>(); this.parmIDCacheServer = new HashMap<DatabaseID, List<ParmID>>();
this.parmIDCacheVParm = new HashMap<DatabaseID, List<ParmID>>(); this.parmIDCacheVParm = new HashMap<DatabaseID, List<ParmID>>();
@ -912,25 +910,39 @@ public class ParmManager extends AbstractParmManager {
} }
Collections.sort(this.availableServerDatabases); Collections.sort(this.availableServerDatabases);
boolean containsMutable = availableServerDatabases DatabaseID mutableDbId = getMutableDatabase();
.contains(getMutableDatabase()); if (mutableDbId.isValid()) {
if (getMutableDatabase().isValid() && containsMutable) { boolean containsMutable = availableServerDatabases
// order of isc databases is important, since ISCDataAccess will .contains(mutableDbId);
// look for the first match. That's why we don't use availableDbs()
// and simplify the three loops into one. if (!containsMutable) {
for (DatabaseID dbid : availableVCParmDatabases) { ServerResponse<?> sr = this.dataManager.getClient()
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) { .createNewDb(mutableDbId);
iscDbs.add(dbid); containsMutable = sr.isOkay();
}
} }
for (DatabaseID dbid : availableVParmDatabases) {
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) { if (containsMutable) {
iscDbs.add(dbid); // order of isc databases is important, since ISCDataAccess will
// look for the first match. That's why we don't use
// availableDbs()
// and simplify the three loops into one.
for (DatabaseID dbid : availableVCParmDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
} }
} for (DatabaseID dbid : availableVParmDatabases) {
for (DatabaseID dbid : availableServerDatabases) { if (dbid.getModelName().equals("ISC")
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) { && !iscDbs.contains(dbid)) {
iscDbs.add(dbid); iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
} }
} }
} }

View file

@ -69,8 +69,7 @@
id="com.raytheon.uf.common.hydro" id="com.raytheon.uf.common.hydro"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.viz.mpe" id="com.raytheon.viz.mpe"

View file

@ -34,7 +34,6 @@
id="com.raytheon.uf.common.dataplugin.satellite" id="com.raytheon.uf.common.dataplugin.satellite"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
</feature> </feature>

View file

@ -2,7 +2,6 @@ package com.raytheon.viz.warngen.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -11,8 +10,6 @@ import java.util.Set;
import javax.measure.converter.UnitConverter; import javax.measure.converter.UnitConverter;
import org.geotools.referencing.GeodeticCalculator;
import com.raytheon.uf.common.dataplugin.warning.config.PathcastConfiguration; import com.raytheon.uf.common.dataplugin.warning.config.PathcastConfiguration;
import com.raytheon.uf.common.dataplugin.warning.config.PointSourceConfiguration; import com.raytheon.uf.common.dataplugin.warning.config.PointSourceConfiguration;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
@ -23,7 +20,6 @@ import com.raytheon.viz.warngen.gis.ClosestPoint;
import com.raytheon.viz.warngen.gis.GisUtil; import com.raytheon.viz.warngen.gis.GisUtil;
import com.raytheon.viz.warngen.gis.GisUtil.Direction; import com.raytheon.viz.warngen.gis.GisUtil.Direction;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.prep.PreparedGeometry; import com.vividsolutions.jts.geom.prep.PreparedGeometry;
import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
@ -42,6 +38,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Mar 25, 2013 1810 jsanchez Allowed other values to be accepted as a true value for useDirs. * Mar 25, 2013 1810 jsanchez Allowed other values to be accepted as a true value for useDirs.
* Mar 25, 2013 1605 jsanchez Set ClosestPoint's prepGeom. * Mar 25, 2013 1605 jsanchez Set ClosestPoint's prepGeom.
* Apr 24, 2013 1944 jsanchez Updated calculateLocationPortion visibility to public. * Apr 24, 2013 1944 jsanchez Updated calculateLocationPortion visibility to public.
* May 2, 2013 1963 jsanchez Referenced calculatePortion from GisUtil.
* *
* </pre> * </pre>
* *
@ -180,8 +177,8 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom); PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom);
if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) { if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) {
Geometry intersection = searchArea.intersection(geom); Geometry intersection = searchArea.intersection(geom);
partOfArea = GisUtil.asStringList(calculateLocationPortion( partOfArea = GisUtil.asStringList(GisUtil.calculatePortion(
geom, null, intersection, gc)); geom, intersection, false, false));
if (attributes.get(suppressedDirectionsField) != null) { if (attributes.get(suppressedDirectionsField) != null) {
String suppressedDirections = String.valueOf( String suppressedDirections = String.valueOf(
@ -216,91 +213,6 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
return null; return null;
} }
/**
* Helper class to store cardinal ranges
*
* @author jsanchez
*
*/
private static class CardinalRange {
public EnumSet<Direction> directions;
public double lowRange;
public double highRange;
public CardinalRange(EnumSet<Direction> directions, double lowRange,
double highRange) {
this.directions = directions;
this.lowRange = lowRange;
this.highRange = highRange;
}
}
private static CardinalRange[] ranges = new CardinalRange[] {
new CardinalRange(EnumSet.of(Direction.NORTH), 0, 22.5),
new CardinalRange(EnumSet.of(Direction.NORTH, Direction.EAST),
22.5, 67.5),
new CardinalRange(EnumSet.of(Direction.EAST), 67.5, 112.5),
new CardinalRange(EnumSet.of(Direction.SOUTH, Direction.EAST),
112.5, 157.5),
new CardinalRange(EnumSet.of(Direction.SOUTH), 157.5, 202.5),
new CardinalRange(EnumSet.of(Direction.SOUTH, Direction.WEST),
202.5, 247.5),
new CardinalRange(EnumSet.of(Direction.WEST), 247.5, 292.5),
new CardinalRange(EnumSet.of(Direction.NORTH, Direction.WEST),
292.5, 337.5),
new CardinalRange(EnumSet.of(Direction.NORTH), 337.5, 360) };
/**
* Calculates the cardinal directions of a location.
*
* @param geom
* @param point
* @param intersection
* @param gc
* @return
*/
public static EnumSet<Direction> calculateLocationPortion(Geometry geom,
Coordinate point, Geometry intersection, GeodeticCalculator gc) {
EnumSet<Direction> directions = EnumSet.noneOf(Direction.class);
Coordinate geomCentroid = null;
if (point != null) {
geomCentroid = point;
} else {
geomCentroid = geom.convexHull().getCentroid().getCoordinate();
}
Coordinate intersectCentroid = intersection.convexHull().getCentroid()
.getCoordinate();
gc.setStartingGeographicPoint(geomCentroid.x, geomCentroid.y);
gc.setDestinationGeographicPoint(intersectCentroid.x,
intersectCentroid.y);
Envelope envelope = geom.getEnvelopeInternal();
double centerThresholdX = envelope.getWidth() * 0.10;
double centerThresholdY = envelope.getHeight() * 0.10;
double distanceX = Math.abs(intersectCentroid.x - geomCentroid.x);
double distanceY = Math.abs(intersectCentroid.y - geomCentroid.y);
if (distanceX > centerThresholdX || distanceY > centerThresholdY) {
// Convert azimuth from -180/180 to 0/360
double degrees = gc.getAzimuth();
if (degrees < 0) {
degrees += 360;
}
for (CardinalRange range : ranges) {
if (degrees > range.lowRange && degrees <= range.highRange) {
directions = range.directions;
break;
}
}
}
return directions;
}
/** /**
* Returns a Coordinate based on the lat,lon values in the attributes. * Returns a Coordinate based on the lat,lon values in the attributes.
* *

View file

@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.geotools.referencing.GeodeticCalculator;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration; import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType; import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType;
@ -73,7 +72,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry;
* May 4, 2012 #14887 Qinglu lin Changed 0.25 to 0.60 for DEFAULT_PORTION_TOLERANCE; * May 4, 2012 #14887 Qinglu lin Changed 0.25 to 0.60 for DEFAULT_PORTION_TOLERANCE;
* added code to pass a Envelope calculatePortion(). * added code to pass a Envelope calculatePortion().
* Nov 9, 2012 DR 15430 D. Friedman Extracted method converFeAreaToPartList. * Nov 9, 2012 DR 15430 D. Friedman Extracted method converFeAreaToPartList.
* * Apr 29, 2013 1955 jsanchez Ignored comparing the geometry's user data when finding intersected areas.
* May 2, 2013 1963 jsanchez Updated method to determine partOfArea.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -174,7 +174,6 @@ public class Area {
List<String> uniqueFips = new ArrayList<String>(); List<String> uniqueFips = new ArrayList<String>();
List<AffectedAreas> areas = new ArrayList<AffectedAreas>(); List<AffectedAreas> areas = new ArrayList<AffectedAreas>();
GeodeticCalculator gc = new GeodeticCalculator();
for (GeospatialData regionFeature : countyMap.values()) { for (GeospatialData regionFeature : countyMap.values()) {
Geometry regionGeom = regionFeature.geometry; Geometry regionGeom = regionFeature.geometry;
PreparedGeometry preparedRegionGeom = regionFeature.prepGeom; PreparedGeometry preparedRegionGeom = regionFeature.prepGeom;
@ -220,9 +219,9 @@ public class Area {
double tolerCheck = regionGeom.getArea() double tolerCheck = regionGeom.getArea()
* DEFAULT_PORTION_TOLERANCE; * DEFAULT_PORTION_TOLERANCE;
if (areaIntersection < tolerCheck) { if (areaIntersection < tolerCheck) {
area.partOfArea = GisUtil.asStringList(GisUtil area.partOfArea = GisUtil
.calculatePortion(regionGeom, intersection, gc, .asStringList(GisUtil.calculatePortion(regionGeom,
area.suppress)); intersection, true, true));
} }
// Search the parent region // Search the parent region
@ -284,13 +283,17 @@ public class Area {
throws VizException { throws VizException {
Map<String, Object> areasMap = new HashMap<String, Object>(); Map<String, Object> areasMap = new HashMap<String, Object>();
String hatchedAreaSource = config.getHatchedAreaSource()
.getAreaSource();
for (AreaSourceConfiguration asc : config.getAreaSources()) { for (AreaSourceConfiguration asc : config.getAreaSources()) {
if (asc.getType() == AreaType.INTERSECT) { if (asc.getType() == AreaType.INTERSECT) {
List<Geometry> geoms = new ArrayList<Geometry>(); List<Geometry> geoms = new ArrayList<Geometry>();
for (GeospatialData f : warngenLayer.getGeodataFeatures( for (GeospatialData f : warngenLayer.getGeodataFeatures(
asc.getAreaSource(), localizedSite)) { asc.getAreaSource(), localizedSite)) {
boolean ignoreUserData = asc.getAreaSource().equals(
hatchedAreaSource) == false;
Geometry intersect = GeometryUtil.intersection(warnArea, Geometry intersect = GeometryUtil.intersection(warnArea,
f.prepGeom); f.prepGeom, ignoreUserData);
if (intersect.isEmpty() == false) { if (intersect.isEmpty() == false) {
geoms.add(intersect); geoms.add(intersect);
} }

View file

@ -29,16 +29,8 @@ import java.util.List;
import org.geotools.referencing.GeodeticCalculator; import org.geotools.referencing.GeodeticCalculator;
import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil;
import com.raytheon.viz.warngen.suppress.SuppressMap;
import com.vividsolutions.jts.algorithm.CGAlgorithms;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.Polygon;
/** /**
* *
@ -58,6 +50,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Feb 29, 2012 #13596 Qinglu Lin Added restoreAlaskaLon(). * Feb 29, 2012 #13596 Qinglu Lin Added restoreAlaskaLon().
* May 9, 2012 #14887 Qinglu Lin Change 0.1 to 0.16875f for PORTION_OF_CENTER; * May 9, 2012 #14887 Qinglu Lin Change 0.1 to 0.16875f for PORTION_OF_CENTER;
* 0.10 to 0.0625 for EXTREME_DELTA; Added/modified code. * 0.10 to 0.0625 for EXTREME_DELTA; Added/modified code.
* May 1, 2013 1963 jsanchez Refactored calculatePortion to match A1.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -65,216 +58,198 @@ import com.vividsolutions.jts.geom.Polygon;
*/ */
public class GisUtil { public class GisUtil {
private static final float PORTION_OF_CENTER = 0.16875f;
private static final float DIRECTION_DELTA = 15; private static final float DIRECTION_DELTA = 15;
private static final float EXTREME_DELTA = 0.0625f; public static final ThreadLocal<GeodeticCalculator> gc = new ThreadLocal<GeodeticCalculator>() {
@Override
private static final double CONTAINS_PERCENTAGE = 0.1; protected GeodeticCalculator initialValue() {
GeodeticCalculator gc = new GeodeticCalculator();
// When both xDirection and yDirection are Direction.CENTRAL, for a return gc;
// rectangle }
// polygon, MIN1 is the maximum value of either distanceX or distanceY };
// for EnumSet.of(xDirection,yDirection) to be returned.
private static final float MIN1 = 0.01f;
// When both xDirection and yDirection are Direction.CENTRAL, for a right
// triangle
// polygon, MIN2 is the maximum value of both distanceX and distanceY
// for EnumSet.of(xDirection,yDirection) to be returned.
private static final float MIN2 = 0.045f;
// When yDirection is NORTH or SOUTH, in order to add CENTRAL to retval,
// required
// minimum ratio of width of intersection envelope to that of county
// envelope;
// when xDirection is EAST or WEST, in order to add CENTRAL to retval,
// required
// minimum ratio of height of intersection envelope to that of county
// envelope;
private static final float RATIO = 0.5f;
public static enum Direction { public static enum Direction {
CENTRAL, NORTH, SOUTH, EAST, WEST, EXTREME CENTRAL, NORTH, SOUTH, EAST, WEST, EXTREME
}; };
public static boolean contains(Geometry filter, Geometry geom) { /**
if (filter != null) { * Ported getAreaDesc from A1 code method GeoEntityLookupTable.getAreaDesc
if (filter.contains(geom)) { *
return true; * @param parentGeom
} * - the parent geometry such as the impacted county/zone
* @param warnedArea
* - the intersection geometry of the hatched warned geometry and
* the parent geometry
* @param useCentral
* - boolean flag to allow CENTRAL portion to be included.
* @param useExtreme
* - boolean flag to allow EXTREME portion to be included.
* @return
*/
public static EnumSet<Direction> calculatePortion(Geometry parentGeom,
Geometry warnedArea, boolean useCentral, boolean useExtreme) {
EnumSet<Direction> portions = EnumSet.noneOf(Direction.class);
ImpactedQuadrants iQuad = ImpactedQuadrants.findImpactedQuadrants(
parentGeom, warnedArea, useCentral);
double containsPercent = geom.buffer(0.00001).difference(filter) // Test for case where we cannot do portions or if the warnedArea covers
.getArea() // the parentGeom
/ geom.getArea(); if (parentGeom == null || warnedArea == null
if (containsPercent < CONTAINS_PERCENTAGE) { || parentGeom.equals(warnedArea)) {
return true; return EnumSet.noneOf(Direction.class);
}
// Test for central by not being near adjacent borders.
if (iQuad.centralGeom != null && iQuad.centralGeom.contains(warnedArea)) {
portions.add(Direction.CENTRAL);
return portions;
}
// Possible case of a stripe across the middle
if (iQuad.q == 0) {
// Only one direction encoded
; // <-- Ported A1 code
} else if ((iQuad.q == 2 && iQuad.nw == iQuad.se)
|| (iQuad.q == 2 && iQuad.ne == iQuad.sw)
|| (iQuad.qq == 2 && iQuad.nn == iQuad.ss)
|| (iQuad.qq == 2 && iQuad.ee == iQuad.ww)) {
if (iQuad.nnx == iQuad.ssx && iQuad.wwx == iQuad.eex) {
portions.add(Direction.CENTRAL);
return portions;
}
return getPointDesc(iQuad, useExtreme);
}
// Another possible case of a stripe across the middle.
if (iQuad.q == 4 && iQuad.centralGeom != null
&& iQuad.centralGeom.intersects(warnedArea)) {
portions.add(Direction.CENTRAL);
return portions;
}
// All quadrants in use.
if (iQuad.q == 4 && iQuad.qq == 4) {
return EnumSet.noneOf(Direction.class);
}
// Only one typical quadrant in use.
if (iQuad.q == 1) {
return getPointDesc(iQuad, useExtreme);
}
// No more than two quadrants of any kind in us, or all quadrants.
if (iQuad.q < 3 && iQuad.qq < 3) {
if (iQuad.nnx != iQuad.ssx
&& iQuad.wwx != iQuad.eex
|| (iQuad.centralGeom != null && iQuad.centralGeom
.intersects(warnedArea))) {
return getPointDesc(iQuad, useExtreme);
} }
} }
return false; // Three typical quadrants in use.
if (iQuad.q == 3 && iQuad.q != 3) {
if (iQuad.ne != 1 && (iQuad.ssw || iQuad.wsw)) {
portions.add(Direction.SOUTH);
portions.add(Direction.WEST);
} else if (iQuad.se != 1 && (iQuad.nnw || iQuad.wnw)) {
portions.add(Direction.NORTH);
portions.add(Direction.WEST);
} else if (iQuad.nw != 1 && (iQuad.sse || iQuad.ese)) {
portions.add(Direction.SOUTH);
portions.add(Direction.EAST);
} else if (iQuad.sw != 1 && (iQuad.nne || iQuad.ene)) {
portions.add(Direction.NORTH);
portions.add(Direction.EAST);
}
}
// Three diagonal quadrants in use.
if (iQuad.qq == 3 && portions.isEmpty()) {
if (iQuad.nn == 0) {
portions.add(Direction.SOUTH);
} else if (iQuad.ss == 0) {
portions.add(Direction.NORTH);
} else if (iQuad.ww == 0) {
portions.add(Direction.EAST);
} else if (iQuad.ee == 0) {
portions.add(Direction.WEST);
}
}
// add extreme for three quadrant case.
if (!portions.isEmpty()) {
if (useExtreme && iQuad.xxx > 0) {
portions.add(Direction.EXTREME);
return portions;
}
}
// All of either type of quadrant in use.
if (iQuad.q == 4 && iQuad.qq == 4) {
return EnumSet.noneOf(Direction.class);
}
// Case of a pure simple direction.
if (iQuad.ss == 1 && iQuad.nn == 1 || iQuad.q == 0) {
if (iQuad.nn == 0 && iQuad.ww == 1) {
portions.add(Direction.WEST);
}
if (iQuad.ww == 0 && iQuad.ee == 1) {
portions.add(Direction.EAST);
}
} else if (iQuad.ee == 1 && iQuad.ww == 1 || iQuad.q == 0) {
if (iQuad.nn == 0 && iQuad.ss == 1) {
portions.add(Direction.SOUTH);
}
if (iQuad.ss == 0 && iQuad.nn == 1) {
portions.add(Direction.NORTH);
}
}
// add extreme for simple direction case.
if (portions.isEmpty() == false) {
if (useExtreme && iQuad.xxx > 0) {
portions.add(Direction.EXTREME);
}
return portions;
}
// Catch with the point descriptor one last time
return getPointDesc(iQuad, useExtreme);
} }
public static Geometry intersect(Geometry shadedArea, Geometry filter) { /**
GeometryFactory gf = new GeometryFactory(); * Determines the portion of an area based on the ImpactedQuadrants object
Geometry rval = shadedArea; *
if (filter instanceof GeometryCollection) { * @param iQuad
GeometryCollection gc = (GeometryCollection) filter; * - ImpactedQuadrants object
List<Geometry> unionGeometries = new ArrayList<Geometry>(); * @param useExtrme
for (int k = 0; k < gc.getNumGeometries(); k++) { * - boolean flag to allow EXTREME portion to be included.
Geometry g = gc.getGeometryN(k); * @return
if (g.intersects(rval)) { */
Geometry subIntersection = GisUtil.intersect(g, rval); private static EnumSet<Direction> getPointDesc(ImpactedQuadrants iQuad,
unionGeometries.add(subIntersection); boolean useExtrme) {
} EnumSet<Direction> portions = EnumSet.noneOf(Direction.class);
}
rval = gf.createGeometryCollection(unionGeometries if (iQuad.nnw || iQuad.nne) {
.toArray(new Geometry[unionGeometries.size()])); portions.add(Direction.NORTH);
rval = rval.buffer(0); } else if (iQuad.ssw || iQuad.sse) {
portions.add(Direction.SOUTH);
} else {
rval = rval.intersection(filter).buffer(0);
}
return rval;
}
public static EnumSet<Direction> calculatePortion(Geometry geom,
Geometry geom2, GeodeticCalculator gc) {
return calculatePortion(geom, geom2, gc, SuppressMap.NONE);
}
public static EnumSet<Direction> calculatePortion(Geometry geom,
Geometry intersection, GeodeticCalculator gc, String suppressType) {
Direction xDirection = null;
Direction yDirection = null;
Coordinate point = intersection.getCentroid().getCoordinate();
Envelope env = intersection.getEnvelopeInternal();
Coordinate centroid = geom.getCentroid().getCoordinate();
Envelope envelope = geom.getEnvelopeInternal();
double approximateWidth = envelope.getWidth();
double approximateHeight = envelope.getHeight();
double distanceX = Math.abs(centroid.x - point.x);
double distanceY = Math.abs(centroid.y - point.y);
double centerThresholdX = approximateWidth * PORTION_OF_CENTER;
double centerThresholdY = approximateHeight * PORTION_OF_CENTER;
double extremaThresholdX = approximateWidth * EXTREME_DELTA;
double extremaThresholdY = approximateHeight * EXTREME_DELTA;
if (distanceX < centerThresholdX) {
xDirection = Direction.CENTRAL;
if (distanceY < centerThresholdY)
yDirection = Direction.CENTRAL;
} }
if (xDirection != null && yDirection != null) { if (iQuad.ene || iQuad.ese) {
// Both xDirection equals Direction.CENTRAL and yDirection equals portions.add(Direction.EAST);
// Direction.CENTRAL } else if (iQuad.wnw || iQuad.wsw) {
// calculated above is not always correct for returning portions.add(Direction.WEST);
// EnumSet.of(xDirection,yDirection).
// The following 'if statement' filters out some cases.
if (distanceX < MIN1 || distanceY < MIN1
|| (distanceX < MIN2 && distanceY < MIN2))
return EnumSet.of(xDirection, yDirection);
} }
xDirection = null; if (iQuad.cc) {
yDirection = null; portions.add(Direction.CENTRAL);
gc.setStartingGeographicPoint(centroid.x, centroid.y);
gc.setDestinationGeographicPoint(point.x, point.y);
double azimuth = gc.getAzimuth();
if (xDirection == null) {
if (azimuth < (180 - DIRECTION_DELTA) && azimuth > DIRECTION_DELTA)
xDirection = Direction.EAST;
else if (azimuth < 0 - DIRECTION_DELTA)
xDirection = Direction.WEST;
} }
if (yDirection == null) { if (!portions.isEmpty() && useExtrme && iQuad.xxx > 0) {
if (azimuth < (90 - DIRECTION_DELTA) portions.add(Direction.EXTREME);
&& azimuth > (-90 + DIRECTION_DELTA))
yDirection = Direction.NORTH;
else if (azimuth > (90 + DIRECTION_DELTA)
|| azimuth < (-90 - DIRECTION_DELTA))
yDirection = Direction.SOUTH;
} }
return portions;
List<Geometry> geoms = new ArrayList<Geometry>(geom.getNumGeometries());
GeometryUtil.buildGeometryList(geoms, geom);
boolean isExtreme = false;
for (Geometry g : geoms) {
if (g instanceof Polygon) {
LineString lineString = ((Polygon) g).getExteriorRing();
if (isExtreme(lineString.getCoordinates(), point,
(extremaThresholdX + extremaThresholdY) / 2.0)) {
isExtreme = true;
break;
}
}
}
EnumSet<Direction> retVal = EnumSet.noneOf(Direction.class);
if (xDirection != null && !suppressType.equals(SuppressMap.EAST_WEST)
&& !suppressType.equals(SuppressMap.ALL))
retVal.add(xDirection);
if (yDirection != null && !suppressType.equals(SuppressMap.NORTH_SOUTH)
&& !suppressType.equals(SuppressMap.ALL))
retVal.add(yDirection);
if (xDirection != null
&& (xDirection.equals(Direction.WEST) || xDirection
.equals(Direction.EAST))) {
if (env.getHeight() < RATIO * approximateHeight) {
retVal.add(Direction.CENTRAL);
}
}
if (yDirection != null
&& (yDirection.equals(Direction.NORTH) || yDirection
.equals(Direction.SOUTH))) {
if (env.getWidth() < RATIO * approximateWidth) {
retVal.add(Direction.CENTRAL);
}
}
if ((retVal.contains(Direction.NORTH) && retVal
.contains(Direction.WEST))
|| (retVal.contains(Direction.NORTH) && retVal
.contains(Direction.EAST))
|| (retVal.contains(Direction.SOUTH) && retVal
.contains(Direction.WEST))
|| (retVal.contains(Direction.SOUTH) && retVal
.contains(Direction.EAST))) {
if (retVal.contains(Direction.CENTRAL))
retVal.remove(Direction.CENTRAL);
}
if (isExtreme && !suppressType.equals(SuppressMap.ALL))
retVal.add(Direction.EXTREME);
return retVal;
}
private static boolean isExtreme(Coordinate[] coords, Coordinate c,
double threshold) {
for (int i = 1; i < coords.length; i++) {
double distance = CGAlgorithms.distancePointLine(c, coords[i - 1],
coords[i]);
if (distance < threshold)
return true;
}
return false;
} }
public static List<String> asStringList(EnumSet<Direction> set) { public static List<String> asStringList(EnumSet<Direction> set) {
@ -352,4 +327,60 @@ public class GisUtil {
return coord; return coord;
} }
/**
* Calculates the cardinal directions of a location.
*
* @param locationGeom
* @param reference
* @param gc
* @return
*/
public static EnumSet<Direction> calculateLocationPortion(
Geometry locationGeom, Geometry reference, boolean useExtreme) {
for (int i = 0; i < locationGeom.getNumGeometries(); i++) {
Geometry geom = locationGeom.getGeometryN(i);
if (geom.intersects(reference)) {
Coordinate geomCentroid = geom.getEnvelope().getCentroid()
.getCoordinate();
Coordinate refCentroid = reference.getCentroid()
.getCoordinate();
EnumSet<Direction> portions = EnumSet.noneOf(Direction.class);
gc.get().setStartingGeographicPoint(geomCentroid.x,
geomCentroid.y);
gc.get().setDestinationGeographicPoint(refCentroid.x,
refCentroid.y);
double azimuth = gc.get().getAzimuth();
if (azimuth < (180 - DIRECTION_DELTA)
&& azimuth > DIRECTION_DELTA) {
portions.add(Direction.EAST);
} else if (azimuth < 0 - DIRECTION_DELTA
&& azimuth > DIRECTION_DELTA - 180) {
portions.add(Direction.WEST);
}
if (azimuth < (90 - DIRECTION_DELTA)
&& azimuth > (-90 + DIRECTION_DELTA)) {
portions.add(Direction.NORTH);
} else if (azimuth > (90 + DIRECTION_DELTA)
&& azimuth < (-90 - DIRECTION_DELTA)) {
portions.add(Direction.SOUTH);
}
boolean isExtreme = false;
if (!portions.isEmpty() && useExtreme && isExtreme) {
portions.add(Direction.EXTREME);
}
return portions;
}
}
return EnumSet.noneOf(Direction.class);
}
} }

View file

@ -0,0 +1,303 @@
/**
* 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.viz.warngen.gis;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Envelope;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
/**
* Helper class for GisUtil to determine the quadrants of an area.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 2, 2013 1963 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class ImpactedQuadrants {
protected boolean nne;
protected boolean ene;
protected boolean ese;
protected boolean sse;
protected boolean ssw;
protected boolean wsw;
protected boolean wnw;
protected boolean nnw;
protected int nn;
protected int ss;
protected int ee;
protected int ww;
protected int ne;
protected int nw;
protected int se;
protected int sw;
/**
* q is the accumulation of the quadrants, qq is the accumulation of the sub
* quadrants
*/
protected int q, qq;
/**
* Extreme portions for north, south, east, and west.
*/
protected int nnx, ssx, eex, wwx;
/**
* Accumulation of extreme portions.
*/
protected int xxx;
/**
* Indicates if warned area is in central part regardless if warned area is
* near parentGeom's centroid.
*/
protected boolean cc = false;
protected PreparedGeometry centralGeom = null;
public ImpactedQuadrants() {
nne = ene = ese = sse = ssw = wsw = wnw = nnw = false;
nn = ss = ee = ww = ne = nw = se = sw = 0;
nnx = ssx = eex = wwx = 0;
xxx = 0;
}
/**
* Divides the parentGeom into 8 quadrants. Returns an ImpactedQuadrants
* object to identify which quadrants of parentGeom were intersected by the
* warnedArea.
*
* @param parentGeom
* - the parent geometry such as the impacted county/zone
* @param warnedArea
* - the intersection geometry of the hatched warned geometry and
* the parent geometry
* @param useCentral
* - boolean flag to allow CENTRAL portions to be included.
* @return
*/
public static ImpactedQuadrants findImpactedQuadrants(Geometry parentGeom,
Geometry warnedArea, boolean useCentral) {
// Find the bounds of the parentGeom to help create the bounds of a
// quadrant.
Envelope envelopeInternal = parentGeom.getEnvelopeInternal();
double minLat = envelopeInternal.getMinY();
double maxLat = envelopeInternal.getMaxY();
double minLon = envelopeInternal.getMinX();
double maxLon = envelopeInternal.getMaxX();
// Create a PreparedGeomery for each quadrant in parentGeom
Coordinate centroid = envelopeInternal.centre();
Coordinate c1 = new Coordinate(minLon, maxLat);
Coordinate c2 = new Coordinate(centroid.x, maxLat);
Coordinate c3 = new Coordinate(maxLon, maxLat);
Coordinate c4 = new Coordinate(maxLon, centroid.y);
Coordinate c5 = new Coordinate(maxLon, minLat);
Coordinate c6 = new Coordinate(centroid.x, minLat);
Coordinate c7 = new Coordinate(minLon, minLat);
Coordinate c8 = new Coordinate(minLon, centroid.y);
PreparedGeometry nnwQuad = createQuadrant(c1, c2, centroid);
PreparedGeometry nneQuad = createQuadrant(c2, c3, centroid);
PreparedGeometry eneQuad = createQuadrant(c3, c4, centroid);
PreparedGeometry eseQuad = createQuadrant(c4, c5, centroid);
PreparedGeometry sseQuad = createQuadrant(c5, c6, centroid);
PreparedGeometry sswQuad = createQuadrant(c6, c7, centroid);
PreparedGeometry wswQuad = createQuadrant(c7, c8, centroid);
PreparedGeometry wnwQuad = createQuadrant(c8, c1, centroid);
// Determine if the warnedArea intersected the quadrant.
ImpactedQuadrants impactedQuadrants = new ImpactedQuadrants();
impactedQuadrants.nne = nneQuad.intersects(warnedArea);
impactedQuadrants.ene = eneQuad.intersects(warnedArea);
impactedQuadrants.ese = eseQuad.intersects(warnedArea);
impactedQuadrants.sse = sseQuad.intersects(warnedArea);
impactedQuadrants.ssw = sswQuad.intersects(warnedArea);
impactedQuadrants.wsw = wswQuad.intersects(warnedArea);
impactedQuadrants.wnw = wnwQuad.intersects(warnedArea);
impactedQuadrants.nnw = nnwQuad.intersects(warnedArea);
// The following is A1 ported code used
if (impactedQuadrants.nne || impactedQuadrants.ene) {
impactedQuadrants.ne = 1;
}
if (impactedQuadrants.sse || impactedQuadrants.ese) {
impactedQuadrants.se = 1;
}
if (impactedQuadrants.nnw || impactedQuadrants.wnw) {
impactedQuadrants.nw = 1;
}
if (impactedQuadrants.ssw || impactedQuadrants.wsw) {
impactedQuadrants.sw = 1;
}
if (impactedQuadrants.nne || impactedQuadrants.nnw) {
impactedQuadrants.nn = 1;
}
if (impactedQuadrants.sse || impactedQuadrants.ssw) {
impactedQuadrants.ss = 1;
}
if (impactedQuadrants.wnw || impactedQuadrants.wsw) {
impactedQuadrants.ww = 1;
}
if (impactedQuadrants.nne || impactedQuadrants.ese) {
impactedQuadrants.ee = 1;
}
// Accumulates the quadrants and subquadrants
impactedQuadrants.q = impactedQuadrants.ne + impactedQuadrants.nw
+ impactedQuadrants.se + impactedQuadrants.sw;
impactedQuadrants.qq = impactedQuadrants.nn + impactedQuadrants.ss
+ impactedQuadrants.ee + impactedQuadrants.ww;
// Identify if central.
if (useCentral) {
identifyCentral(impactedQuadrants, parentGeom, warnedArea);
}
// Identify extremes in use.
identifyExtremes(impactedQuadrants, envelopeInternal, warnedArea);
return impactedQuadrants;
}
/**
* Creates a quadrant based on 3 coordinates.
*
* @param c1
* @param c2
* @param c3
* @return
*/
private static PreparedGeometry createQuadrant(Coordinate c1,
Coordinate c2, Coordinate c3) {
Coordinate[] coords = new Coordinate[] { c1, c2, c3, c1 };
GeometryFactory gf = new GeometryFactory();
Geometry geom = gf.createPolygon(gf.createLinearRing(coords), null);
return PreparedGeometryFactory.prepare(geom);
}
/**
* Creates a geometry that is the center of the parentGeom.
*
* @param parentGeom
* @return
*/
private static PreparedGeometry createCentralGeometry(Geometry parentGeom) {
Envelope envelope = parentGeom.getEnvelopeInternal();
Coordinate c = parentGeom.getCentroid().getCoordinate();
double percentage = 0.50;
double deltaHeight = envelope.getHeight() * percentage / 2;
double deltaWidtth = envelope.getWidth() * percentage / 2;
Coordinate c1 = new Coordinate(c.x - deltaWidtth, c.y + deltaHeight);
Coordinate c2 = new Coordinate(c.x + deltaWidtth, c.y + deltaHeight);
Coordinate c3 = new Coordinate(c.x - deltaWidtth, c.y - deltaHeight);
Coordinate c4 = new Coordinate(c.x + deltaWidtth, c.y - deltaHeight);
Coordinate[] coords = new Coordinate[] { c1, c2, c3, c4, c1 };
GeometryFactory gf = new GeometryFactory();
Geometry geom = gf.createPolygon(gf.createLinearRing(coords), null);
geom.setUserData(parentGeom.getUserData());
return PreparedGeometryFactory.prepare(geom);
}
/**
* Identifies if the warnedArea intersects the central portions of the
* parentGeom.
*
* @param impactedQuadrants
* @param parentGeom
* @param warnedArea
*/
private static void identifyCentral(ImpactedQuadrants impactedQuadrants,
Geometry parentGeom, Geometry warnedArea) {
impactedQuadrants.centralGeom = createCentralGeometry(parentGeom);
Envelope centralEnvelope = impactedQuadrants.centralGeom.getGeometry()
.getEnvelopeInternal();
Envelope warnedEnvelope = warnedArea.getEnvelopeInternal();
if ((warnedEnvelope.getMaxX() < centralEnvelope.getMaxX() && warnedEnvelope
.getMinX() > centralEnvelope.getMinX())
|| (warnedEnvelope.getMaxY() < centralEnvelope.getMaxY() && warnedEnvelope
.getMinY() > centralEnvelope.getMinY())) {
impactedQuadrants.cc = true;
}
}
/**
* Identifies portions as extreme if the centroid of the warnedArea is
* within 5 % of the parentEnvelopeInternal.
*
* @param impactedQuadrants
* @param parentEnvelopeInternal
* @param warnedArea
*/
private static void identifyExtremes(ImpactedQuadrants impactedQuadrants,
Envelope parentEnvelopeInternal, Geometry warnedArea) {
Coordinate warnedAreaCentroid = warnedArea.getCentroid()
.getCoordinate();
double deltaY = parentEnvelopeInternal.getHeight() * 0.05;
double deltaX = parentEnvelopeInternal.getWidth() * 0.05;
if (warnedAreaCentroid.y > parentEnvelopeInternal.getMaxY() - deltaY) {
impactedQuadrants.nnx = 1;
}
if (warnedAreaCentroid.y < parentEnvelopeInternal.getMinY() + deltaY) {
impactedQuadrants.ssx = 1;
}
if (warnedAreaCentroid.x > parentEnvelopeInternal.getMaxX() - deltaX) {
impactedQuadrants.eex = 1;
}
if (warnedAreaCentroid.x < parentEnvelopeInternal.getMinX() + deltaX) {
impactedQuadrants.wwx = 1;
}
impactedQuadrants.xxx = impactedQuadrants.nnx + impactedQuadrants.ssx
+ impactedQuadrants.eex + impactedQuadrants.wwx;
}
}

View file

@ -73,7 +73,6 @@ import com.raytheon.viz.warngen.PreferenceUtil;
import com.raytheon.viz.warngen.WarngenException; import com.raytheon.viz.warngen.WarngenException;
import com.raytheon.viz.warngen.config.AbstractDbSourceDataAdaptor; import com.raytheon.viz.warngen.config.AbstractDbSourceDataAdaptor;
import com.raytheon.viz.warngen.config.DataAdaptorFactory; import com.raytheon.viz.warngen.config.DataAdaptorFactory;
import com.raytheon.viz.warngen.config.DbAreaSourceDataAdaptor;
import com.raytheon.viz.warngen.util.Abbreviation; import com.raytheon.viz.warngen.util.Abbreviation;
import com.raytheon.viz.warngen.util.AdjustAngle; import com.raytheon.viz.warngen.util.AdjustAngle;
import com.raytheon.viz.warnings.DateUtil; import com.raytheon.viz.warnings.DateUtil;
@ -108,6 +107,7 @@ import com.vividsolutions.jts.geom.Point;
* Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting. * Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting.
* Mar 25, 2013 1605 jsanchez Checks if a storm location is over an urban bound area. * Mar 25, 2013 1605 jsanchez Checks if a storm location is over an urban bound area.
* Apr 24, 2013 1943 jsanchez Calculated partOfArea for a storm location over an urban bound area. * Apr 24, 2013 1943 jsanchez Calculated partOfArea for a storm location over an urban bound area.
* May 2, 2013 1963 jsanchez Referenced calculateLocationPortion from GisUtil.
* *
* </pre> * </pre>
* *
@ -733,11 +733,10 @@ public class Wx {
// has already been set in DbAreaSoureDataAdapter // has already been set in DbAreaSoureDataAdapter
Point reference = gf.createPoint(coords[i]); Point reference = gf.createPoint(coords[i]);
if (cp.prepGeom.intersects(reference)) { if (cp.prepGeom.intersects(reference)) {
cp.partOfArea = GisUtil cp.partOfArea = GisUtil.asStringList(GisUtil
.asStringList(DbAreaSourceDataAdaptor .calculateLocationPortion(
.calculateLocationPortion( cp.prepGeom.getGeometry(), reference,
cp.prepGeom.getGeometry(), false));
cp.point, reference, gc));
distance = 0; distance = 0;
} }
} }

View file

@ -150,7 +150,7 @@ import com.vividsolutions.jts.io.WKTReader;
* Feb 15, 2013 1607 jsanchez Added two variables corEventTime and corCreateTime. * Feb 15, 2013 1607 jsanchez Added two variables corEventTime and corCreateTime.
* Feb 15, 2013 15820 Qinglu Lin Added createOfficeTimezoneMap() and added logic so that localtimezone * Feb 15, 2013 15820 Qinglu Lin Added createOfficeTimezoneMap() and added logic so that localtimezone
* and secondtimezone can get correct values when warning area covers two time zones. * and secondtimezone can get correct values when warning area covers two time zones.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -239,7 +239,7 @@ public class TemplateRunner {
WKTReader wkt = new WKTReader(); WKTReader wkt = new WKTReader();
DataTime[] datatimes = warngenLayer.getDescriptor().getFramesInfo() DataTime[] datatimes = warngenLayer.getDescriptor().getFramesInfo()
.getFrameTimes(); .getFrameTimes();
Date eventTime = datatimes != null && datatimes.length > 0 ? datatimes[datatimes.length - 1] Date eventTime = (datatimes != null) && (datatimes.length > 0) ? datatimes[datatimes.length - 1]
.getRefTimeAsCalendar().getTime() : startTime; .getRefTimeAsCalendar().getTime() : startTime;
Date simulatedTime = SimulatedTime.getSystemTime().getTime(); Date simulatedTime = SimulatedTime.getSystemTime().getTime();
WarngenConfiguration config = warngenLayer.getConfiguration(); WarngenConfiguration config = warngenLayer.getConfiguration();
@ -319,7 +319,7 @@ public class TemplateRunner {
Map<String, Double> intersectSize = new HashMap<String, Double>(); Map<String, Double> intersectSize = new HashMap<String, Double>();
String[] oneLetterTZ; String[] oneLetterTZ;
double minSize = 1.0E-3d; double minSize = 1.0E-3d;
if (areas != null && areas.length > 0) { if ((areas != null) && (areas.length > 0)) {
Set<String> timeZones = new HashSet<String>(); Set<String> timeZones = new HashSet<String>();
for (AffectedAreas area : areas) { for (AffectedAreas area : areas) {
if (area.getTimezone() != null) { if (area.getTimezone() != null) {
@ -347,9 +347,11 @@ public class TemplateRunner {
n2 = 0; n2 = 0;
size = 0.0d; size = 0.0d;
totalSize = 0.0d; totalSize = 0.0d;
if (timezoneGeom != null && warningArea != null) { if ((timezoneGeom != null)
if (intersectSize.get(oneLetterTZ[i]) != null) && (warningArea != null)) {
if (intersectSize.get(oneLetterTZ[i]) != null) {
continue; continue;
}
poly1 = new Polygon[warningArea poly1 = new Polygon[warningArea
.getNumGeometries()]; .getNumGeometries()];
n1 = warningArea.getNumGeometries(); n1 = warningArea.getNumGeometries();
@ -369,19 +371,22 @@ public class TemplateRunner {
for (Polygon p2 : poly2) { for (Polygon p2 : poly2) {
size = p1.intersection(p2) size = p1.intersection(p2)
.getArea(); .getArea();
if (size > 0.0) if (size > 0.0) {
totalSize += size; totalSize += size;
}
} }
if (totalSize > minSize) if (totalSize > minSize) {
break; // save time when the size of break; // save time when the size of
// poly1 or poly2 is large // poly1 or poly2 is large
}
} }
intersectSize intersectSize
.put(oneLetterTZ[i], totalSize); .put(oneLetterTZ[i], totalSize);
} else } else {
throw new VizException( throw new VizException(
"Either timezoneGeom or/and warningArea is null. " "Either timezoneGeom or/and warningArea is null. "
+ "Timezone cannot be determined."); + "Timezone cannot be determined.");
}
System.out System.out
.println("Time to do size computation = " .println("Time to do size computation = "
+ (System.currentTimeMillis() - t0)); + (System.currentTimeMillis() - t0));
@ -393,17 +398,18 @@ public class TemplateRunner {
// area is very small, // area is very small,
// use the timezone of larger intersection size. // use the timezone of larger intersection size.
if (timeZones.size() == 0) { if (timeZones.size() == 0) {
if (intersectSize.size() > 1) if (intersectSize.size() > 1) {
if (intersectSize.get(oneLetterTZ[0]) > intersectSize if (intersectSize.get(oneLetterTZ[0]) > intersectSize
.get(oneLetterTZ[1])) { .get(oneLetterTZ[1])) {
timeZones.add(oneLetterTZ[0]); timeZones.add(oneLetterTZ[0]);
} else { } else {
timeZones.add(oneLetterTZ[1]); timeZones.add(oneLetterTZ[1]);
} }
else } else {
throw new VizException( throw new VizException(
"The size of intersectSize is less than 1, " "The size of intersectSize is less than 1, "
+ "timezone cannot be determined."); + "timezone cannot be determined.");
}
} }
} }
} else { } else {
@ -414,16 +420,17 @@ public class TemplateRunner {
Map<String, String> officeCityTimezone = createOfficeTimezoneMap(); Map<String, String> officeCityTimezone = createOfficeTimezoneMap();
String cityTimezone = null; String cityTimezone = null;
if (officeCityTimezone != null) if (officeCityTimezone != null) {
cityTimezone = officeCityTimezone.get(warngenLayer cityTimezone = officeCityTimezone.get(warngenLayer
.getLocalizedSite()); .getLocalizedSite());
}
Iterator<String> iterator = timeZones.iterator(); Iterator<String> iterator = timeZones.iterator();
if (timeZones.size() > 1 && cityTimezone != null) { if ((timeZones.size() > 1) && (cityTimezone != null)) {
String timezone; String timezone;
while (iterator.hasNext()) { while (iterator.hasNext()) {
timezone = iterator.next(); timezone = iterator.next();
if (timezone.equals(cityTimezone) if (timezone.equals(cityTimezone)
&& context.get("localtimezone") == null) { && (context.get("localtimezone") == null)) {
context.put("localtimezone", timezone); context.put("localtimezone", timezone);
} else if (context.get("secondtimezone") == null) { } else if (context.get("secondtimezone") == null) {
context.put("secondtimezone", timezone); context.put("secondtimezone", timezone);
@ -441,7 +448,7 @@ public class TemplateRunner {
} }
// CAN and EXP products follow different rules as followups // CAN and EXP products follow different rules as followups
if (!(selectedAction == WarningAction.CAN || selectedAction == WarningAction.EXP)) { if (!((selectedAction == WarningAction.CAN) || (selectedAction == WarningAction.EXP))) {
wx = new Wx(config, stormTrackState, wx = new Wx(config, stormTrackState,
warngenLayer.getStormLocations(stormTrackState), warngenLayer.getStormLocations(stormTrackState),
startTime.getTime(), DateUtil.roundDateTo15(endTime) startTime.getTime(), DateUtil.roundDateTo15(endTime)
@ -463,10 +470,11 @@ public class TemplateRunner {
context.put("duration", duration); context.put("duration", duration);
context.put("event", eventTime); context.put("event", eventTime);
if (selectedAction == WarningAction.COR) if (selectedAction == WarningAction.COR) {
context.put("TMLtime", eventTime); context.put("TMLtime", eventTime);
else } else {
context.put("TMLtime", simulatedTime); context.put("TMLtime", simulatedTime);
}
context.put("ugcline", context.put("ugcline",
FipsUtil.getUgcLine(areas, wx.getEndTime(), 15)); FipsUtil.getUgcLine(areas, wx.getEndTime(), 15));
context.put("areaPoly", GisUtil.convertCoords(warngenLayer context.put("areaPoly", GisUtil.convertCoords(warngenLayer
@ -550,7 +558,7 @@ public class TemplateRunner {
canOrExpCal.add(Calendar.MILLISECOND, 1); canOrExpCal.add(Calendar.MILLISECOND, 1);
context.put( context.put(
"ugcline", "ugcline",
FipsUtil.getUgcLine(oldWarn.getUgczones(), FipsUtil.getUgcLine(oldWarn.getUgcZones(),
canOrExpCal.getTime(), 0)); canOrExpCal.getTime(), 0));
String oldGeom = oldWarn.getGeometry().toString(); String oldGeom = oldWarn.getGeometry().toString();
context.put("areaPoly", GisUtil.convertCoords(wkt.read(oldGeom) context.put("areaPoly", GisUtil.convertCoords(wkt.read(oldGeom)
@ -605,7 +613,7 @@ public class TemplateRunner {
context.put("includedWatches", config.getIncludedWatches()); context.put("includedWatches", config.getIncludedWatches());
// Additional Information for Followup Products // Additional Information for Followup Products
if (etn != null && etn.length() > 0) { if ((etn != null) && (etn.length() > 0)) {
AbstractWarningRecord oldWarn = null; AbstractWarningRecord oldWarn = null;
// COR product - What are we correcting? // COR product - What are we correcting?
@ -618,7 +626,7 @@ public class TemplateRunner {
CurrentWarnings cw = CurrentWarnings.getInstance(threeLetterSiteId); CurrentWarnings cw = CurrentWarnings.getInstance(threeLetterSiteId);
if (selectedAction == WarningAction.COR && !allowsNewProduct) { if ((selectedAction == WarningAction.COR) && !allowsNewProduct) {
oldWarn = cw.getFollowUpByTracking(etn, phenSig, oldWarn = cw.getFollowUpByTracking(etn, phenSig,
new WarningAction[] { WarningAction.CON, new WarningAction[] { WarningAction.CON,
WarningAction.COR }); WarningAction.COR });
@ -627,8 +635,8 @@ public class TemplateRunner {
} }
// Hydro product // Hydro product
if (oldWarn.getFloodSeverity() != null if ((oldWarn.getFloodSeverity() != null)
&& oldWarn.getFloodSeverity().length() >= 1) { && (oldWarn.getFloodSeverity().length() >= 1)) {
context.put("floodseverity", oldWarn.getFloodSeverity()); context.put("floodseverity", oldWarn.getFloodSeverity());
context.put("floodic", oldWarn.getImmediateCause()); context.put("floodic", oldWarn.getImmediateCause());
} }
@ -651,8 +659,9 @@ public class TemplateRunner {
context.put("now", new Date(wwaMNDTime)); context.put("now", new Date(wwaMNDTime));
// original warning's 'now' time used in MND header // original warning's 'now' time used in MND header
context.put("corCreateTime", new Date(wwaMNDTime)); context.put("corCreateTime", new Date(wwaMNDTime));
} else } else {
context.put("now", simulatedTime); context.put("now", simulatedTime);
}
context.put("event", oldWarn.getIssueTime().getTime()); context.put("event", oldWarn.getIssueTime().getTime());
// original warning's 'event' time, which should match the storm // original warning's 'event' time, which should match the storm
// track // track
@ -721,8 +730,9 @@ public class TemplateRunner {
} }
} }
} }
if (untilIndex < 0 || atIndex < 0 || elipsisIndex < 0) if ((untilIndex < 0) || (atIndex < 0) || (elipsisIndex < 0)) {
throw new VizException("Cannot find * AT line."); throw new VizException("Cannot find * AT line.");
}
} }
Calendar cal = oldWarn.getEndTime(); Calendar cal = oldWarn.getEndTime();
@ -779,18 +789,18 @@ public class TemplateRunner {
oldWarn.getGeometry(), removedAreas, oldWarn.getGeometry(), removedAreas,
threeLetterSiteId); threeLetterSiteId);
for (int i = 0; i < cancelareas.length; i++) { for (int i = 0; i < cancelareas.length; i++) {
for (int j = 0; j < areas.length; j++) { for (AffectedAreas area : areas) {
if (cancelareas[i] != null if ((cancelareas[i] != null)
&& cancelareas[i].getFips().equals( && cancelareas[i].getFips().equals(
areas[j].getFips())) { area.getFips())) {
cancelareas[i] = null; cancelareas[i] = null;
} }
} }
} }
ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>(); ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>();
for (int i = 0; i < cancelareas.length; i++) { for (AffectedAreas cancelarea : cancelareas) {
if (cancelareas[i] != null) { if (cancelarea != null) {
al.add(cancelareas[i]); al.add(cancelarea);
} }
} }
context.put("cancel" context.put("cancel"
@ -970,7 +980,7 @@ public class TemplateRunner {
WatchUtil rval = null; WatchUtil rval = null;
String[] includedWatches = config.getIncludedWatches(); String[] includedWatches = config.getIncludedWatches();
if (includedWatches != null && includedWatches.length > 0) { if ((includedWatches != null) && (includedWatches.length > 0)) {
String phensigList = null; String phensigList = null;
for (String includedWatch : includedWatches) { for (String includedWatch : includedWatches) {
if (includedWatch.equalsIgnoreCase("torWatches")) { if (includedWatch.equalsIgnoreCase("torWatches")) {
@ -1110,7 +1120,7 @@ public class TemplateRunner {
} }
GeospatialData[] geoData = warngenLayer.getGeodataFeatures( GeospatialData[] geoData = warngenLayer.getGeodataFeatures(
asc.getAreaSource(), warngenLayer.getLocalizedSite()); asc.getAreaSource(), warngenLayer.getLocalizedSite());
if (geoData == null || geoData.length == 0) { if ((geoData == null) || (geoData.length == 0)) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Cannot process watches: cannot get geospatial data"); "Cannot process watches: cannot get geospatial data");
return rval; return rval;
@ -1143,8 +1153,9 @@ public class TemplateRunner {
} }
// TODO: Building geometry just to perform this test is probably // TODO: Building geometry just to perform this test is probably
// inefficient with the post-DR-15430 logic... // inefficient with the post-DR-15430 logic...
if (!ar.getGeometry().isEmpty()) if (!ar.getGeometry().isEmpty()) {
work.valid = true; work.valid = true;
}
/* /*
* TODO: Currently adding all zones to the list even if they are not * TODO: Currently adding all zones to the list even if they are not
@ -1159,10 +1170,12 @@ public class TemplateRunner {
* If none of the areas in the watch were neer our warning polygon, * If none of the areas in the watch were neer our warning polygon,
* do not included it. * do not included it.
*/ */
if (!work.valid) if (!work.valid) {
continue; continue;
if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw)) }
if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw)) {
rval.addWaw(work.waw); rval.addWaw(work.waw);
}
} }
return rval; return rval;
@ -1190,8 +1203,8 @@ public class TemplateRunner {
Entry<String, String[]> e = null; Entry<String, String[]> e = null;
// Either zero or more than one sates/counties would be wrong // Either zero or more than one sates/counties would be wrong
if (parsed.size() != 1 if ((parsed.size() != 1)
|| (e = parsed.entrySet().iterator().next()).getValue().length != 1) { || ((e = parsed.entrySet().iterator().next()).getValue().length != 1)) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Invalid ugczone in active table entry: " + ugc); "Invalid ugczone in active table entry: " + ugc);
continue; continue;
@ -1206,16 +1219,18 @@ public class TemplateRunner {
"Error generating included watches.", exc); "Error generating included watches.", exc);
return false; return false;
} }
if (feArea == NOT_IN_CWA) if (feArea == NOT_IN_CWA) {
continue; continue;
}
Set<String> feAreas = map.get(stateAbbrev); Set<String> feAreas = map.get(stateAbbrev);
if (feAreas == null) { if (feAreas == null) {
feAreas = new HashSet<String>(); feAreas = new HashSet<String>();
map.put(stateAbbrev, feAreas); map.put(stateAbbrev, feAreas);
} }
if (feArea != null) if (feArea != null) {
feAreas.add(feArea); feAreas.add(feArea);
}
} }
ArrayList<Portion> portions = new ArrayList<Portion>(map.size()); ArrayList<Portion> portions = new ArrayList<Portion>(map.size());
@ -1265,48 +1280,55 @@ public class TemplateRunner {
if ("pa".equals(part)) { if ("pa".equals(part)) {
pa = 1; pa = 1;
continue; continue;
} else if ("nn".equals(part)) } else if ("nn".equals(part)) {
nnn = nn = 1; nnn = nn = 1;
else if ("ss".equals(part)) } else if ("ss".equals(part)) {
sss = ss = 1; sss = ss = 1;
else if ("ee".equals(part)) } else if ("ee".equals(part)) {
eee = ee = 1; eee = ee = 1;
else if ("ww".equals(part)) } else if ("ww".equals(part)) {
www = ww = 1; www = ww = 1;
else if ("nw".equals(part)) } else if ("nw".equals(part)) {
nnn = www = nw = 1; nnn = www = nw = 1;
else if ("nc".equals(part)) } else if ("nc".equals(part)) {
nnn = nc = 1; nnn = nc = 1;
else if ("ne".equals(part)) } else if ("ne".equals(part)) {
nnn = eee = ne = 1; nnn = eee = ne = 1;
else if ("wc".equals(part)) } else if ("wc".equals(part)) {
www = wc = 1; www = wc = 1;
else if ("cc".equals(part)) { } else if ("cc".equals(part)) {
cc = 1; cc = 1;
continue; continue;
} else if ("ec".equals(part)) } else if ("ec".equals(part)) {
eee = ec = 1; eee = ec = 1;
else if ("sw".equals(part)) } else if ("sw".equals(part)) {
sss = www = sw = 1; sss = www = sw = 1;
else if ("sc".equals(part)) } else if ("sc".equals(part)) {
sss = sc = 1; sss = sc = 1;
else if ("se".equals(part)) } else if ("se".equals(part)) {
sss = eee = se = 1; sss = eee = se = 1;
}
partAbrev = part; partAbrev = part;
} }
// decide how to describe these subareas. // decide how to describe these subareas.
if (ne > 0 && nw > 0) if ((ne > 0) && (nw > 0)) {
nn = 1; nn = 1;
if (se > 0 && sw > 0) }
if ((se > 0) && (sw > 0)) {
ss = 1; ss = 1;
if (se > 0 && ne > 0) }
if ((se > 0) && (ne > 0)) {
ee = 1; ee = 1;
if (sw > 0 && nw > 0) }
if ((sw > 0) && (nw > 0)) {
ww = 1; ww = 1;
if (nnn > 0 && sss > 0 && eee > 0 && www > 0) }
if ((nnn > 0) && (sss > 0) && (eee > 0) && (www > 0)) {
return abrev; return abrev;
if (nn > 0 && ss > 0 || ee > 0 && ww > 0) }
if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) {
return abrev; return abrev;
}
if (nnn + sss + eee + www == 3) { if (nnn + sss + eee + www == 3) {
if (www == 0) { if (www == 0) {
abrev = "e"; abrev = "e";
@ -1319,11 +1341,11 @@ public class TemplateRunner {
} }
return abrev; return abrev;
} }
if (nnn == sss && eee == www || cc == m) { if (((nnn == sss) && (eee == www)) || (cc == m)) {
abrev = "c"; abrev = "c";
return abrev; return abrev;
} }
if (pa != 0 && cc == 0) { if ((pa != 0) && (cc == 0)) {
abrev = "pa"; abrev = "pa";
if (--m <= 0) { if (--m <= 0) {
return abrev; return abrev;
@ -1346,8 +1368,9 @@ public class TemplateRunner {
private static String getStateName(String key, AreaSourceConfiguration asc, private static String getStateName(String key, AreaSourceConfiguration asc,
GeospatialData[] geoData) { GeospatialData[] geoData) {
for (GeospatialData g : geoData) { for (GeospatialData g : geoData) {
if (key.equals((String) g.attributes.get("STATE"))) if (key.equals(g.attributes.get("STATE"))) {
return (String) g.parent.attributes.get("NAME"); return (String) g.parent.attributes.get("NAME");
}
} }
return null; return null;
} }
@ -1367,10 +1390,11 @@ public class TemplateRunner {
private static String getFeArea(String stateAbbrev, String ugc, private static String getFeArea(String stateAbbrev, String ugc,
AreaSourceConfiguration asc, GeospatialData[] geoData) { AreaSourceConfiguration asc, GeospatialData[] geoData) {
for (GeospatialData g : geoData) { for (GeospatialData g : geoData) {
if (stateAbbrev.equals((String) g.attributes.get("STATE")) if (stateAbbrev.equals(g.attributes.get("STATE"))
&& ((String) g.attributes.get(asc.getFipsField())) && ((String) g.attributes.get(asc.getFipsField()))
.endsWith(ugc)) .endsWith(ugc)) {
return (String) g.attributes.get(asc.getFeAreaField()); return (String) g.attributes.get(asc.getFeAreaField());
}
} }
// TODO: Is this the correct way to determine if the county is in the // TODO: Is this the correct way to determine if the county is in the

View file

@ -33,7 +33,6 @@ import java.util.Set;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord; import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.util.AnnotationUtil; import com.raytheon.uf.common.dataplugin.warning.util.AnnotationUtil;
@ -70,7 +69,7 @@ import com.vividsolutions.jts.geom.Geometry;
* record when actually retrieving for use * record when actually retrieving for use
* Apr 22, 2013 jsanchez Set the issue time for follow up warnings. * Apr 22, 2013 jsanchez Set the issue time for follow up warnings.
* May 07, 2013 1973 rferrel Corrections when getting Issue time. * May 07, 2013 1973 rferrel Corrections when getting Issue time.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author mschenke * @author mschenke
@ -105,17 +104,21 @@ public class CurrentWarnings {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj) {
return true; return true;
if (obj == null) }
if (obj == null) {
return false; return false;
if (getClass() != obj.getClass()) }
if (getClass() != obj.getClass()) {
return false; return false;
}
WarningKey other = (WarningKey) obj; WarningKey other = (WarningKey) obj;
if (etn.equals(other.etn) == false) if (etn.equals(other.etn) == false) {
return false; return false;
else if (phensig.equals(other.phensig) == false) } else if (phensig.equals(other.phensig) == false) {
return false; return false;
}
return true; return true;
} }
@ -181,11 +184,11 @@ public class CurrentWarnings {
return warnings; return warnings;
} }
private String officeId; private final String officeId;
private Map<String, AbstractWarningRecord> recordsMap = new HashMap<String, AbstractWarningRecord>(); private final Map<String, AbstractWarningRecord> recordsMap = new HashMap<String, AbstractWarningRecord>();
private Map<WarningKey, List<AbstractWarningRecord>> warningMap = new HashMap<WarningKey, List<AbstractWarningRecord>>() { private final Map<WarningKey, List<AbstractWarningRecord>> warningMap = new HashMap<WarningKey, List<AbstractWarningRecord>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -232,7 +235,7 @@ public class CurrentWarnings {
for (WarningKey key : keys) { for (WarningKey key : keys) {
AbstractWarningRecord tmp = getNewestByTracking(key.etn, AbstractWarningRecord tmp = getNewestByTracking(key.etn,
key.phensig); key.phensig);
if (tmp != null && rval.contains(tmp) == false) { if ((tmp != null) && (rval.contains(tmp) == false)) {
rval.add(tmp); rval.add(tmp);
} }
} }
@ -264,11 +267,12 @@ public class CurrentWarnings {
end.add(Calendar.MINUTE, 10); end.add(Calendar.MINUTE, 10);
TimeRange t = new TimeRange(warning.getStartTime().getTime(), TimeRange t = new TimeRange(warning.getStartTime().getTime(),
end.getTime()); end.getTime());
if ((action == WarningAction.NEW || action == WarningAction.CON || action == WarningAction.EXT) if (((action == WarningAction.NEW)
|| (action == WarningAction.CON) || (action == WarningAction.EXT))
&& t.contains(current.getTime())) { && t.contains(current.getTime())) {
rval.add(warning); rval.add(warning);
} else if (action == WarningAction.CAN } else if ((action == WarningAction.CAN)
|| action == WarningAction.EXP) { || (action == WarningAction.EXP)) {
rval.clear(); rval.clear();
return rval; return rval;
} }
@ -317,7 +321,7 @@ public class CurrentWarnings {
// rval.setAct("CON"); // rval.setAct("CON");
rval.setGeometry(warning.getGeometry()); rval.setGeometry(warning.getGeometry());
rval.setCountyheader(warning.getCountyheader()); rval.setCountyheader(warning.getCountyheader());
rval.setUgczones(warning.getUgczones()); rval.setUgcZones(warning.getUgcZones());
rval.setLoc(warning.getLoc()); rval.setLoc(warning.getLoc());
rval.setRawmessage(warning.getRawmessage()); rval.setRawmessage(warning.getRawmessage());
rval.setIssueTime(warning.getIssueTime()); rval.setIssueTime(warning.getIssueTime());
@ -326,37 +330,20 @@ public class CurrentWarnings {
} }
// If warning was canceled (CAN) or has expired (EXP), check if // If warning was canceled (CAN) or has expired (EXP), check if
// county // county headers match. If so, rval = null. Otherwise check to
// headers match. If so, rval = null. Otherwise check to see if // see if rval has any UGCZones that the warning does not have.
// rval // If there
// has // are no new UGCZones, set rval to null.
// any UGCZones that the warning does. If there are matching
// UGCZones,
// set rval to null
for (AbstractWarningRecord warning : warnings) { for (AbstractWarningRecord warning : warnings) {
WarningAction action = getAction(warning.getAct()); WarningAction action = getAction(warning.getAct());
if (action == WarningAction.CAN if ((action == WarningAction.CAN)
|| action == WarningAction.EXP) { || (action == WarningAction.EXP)) {
if (rval != null if ((rval != null)
&& warning.getCountyheader().equals( && (warning.getCountyheader().equals(
rval.getCountyheader())) { rval.getCountyheader()) || !warning
.getUgcZones().containsAll(
rval.getUgcZones()))) {
rval = null; rval = null;
} else if (rval != null) {
boolean rv = true;
for (UGCZone a : rval.getUgczones()) {
boolean rv2 = false;
for (UGCZone b : warning.getUgczones()) {
if (a.toString().equals(b.toString())) {
rv2 = true;
}
}
if (rv2 == false) {
rv = false;
}
}
if (rv == true) {
rval = null;
}
} }
} }
} }
@ -430,7 +417,7 @@ public class CurrentWarnings {
for (AbstractWarningRecord warning : warnings) { for (AbstractWarningRecord warning : warnings) {
WarningAction action = getAction(warning.getAct()); WarningAction action = getAction(warning.getAct());
if (t.contains(warning.getIssueTime().getTime()) if (t.contains(warning.getIssueTime().getTime())
&& action == WarningAction.CAN) { && (action == WarningAction.CAN)) {
cancelProd = warning; cancelProd = warning;
} }
if (action == WarningAction.NEW) { if (action == WarningAction.NEW) {
@ -443,13 +430,13 @@ public class CurrentWarnings {
// //
for (AbstractWarningRecord rec : conProds) { for (AbstractWarningRecord rec : conProds) {
if (FipsUtil.containsSameCountiesOrZones(rec.getUgczones(), if (FipsUtil.containsSameCountiesOrZones(rec.getUgcZones(),
cancelProd.getUgczones())) { cancelProd.getUgcZones())) {
conMatchesCan = true; conMatchesCan = true;
} }
} }
if (cancelProd.getUgczones().size() == newProd.getUgczones() if (cancelProd.getUgcZones().size() == newProd.getUgcZones()
.size()) { .size()) {
// Change nothing // Change nothing
rval = cancelProd; rval = cancelProd;

View file

@ -32,9 +32,6 @@ import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.viz.warngen.gis.AffectedAreas; import com.raytheon.viz.warngen.gis.AffectedAreas;
import com.raytheon.viz.warngen.gis.AffectedAreasComparator; import com.raytheon.viz.warngen.gis.AffectedAreasComparator;
import com.raytheon.viz.warnings.DateUtil; import com.raytheon.viz.warnings.DateUtil;
@ -50,8 +47,8 @@ import com.raytheon.viz.warnings.DateUtil;
* May 6, 2008 bwoodle Initial creation * May 6, 2008 bwoodle Initial creation
* Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem * Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem
* with generated list of counties. * with generated list of counties.
* Apr 25,2013 1877 jsanchez Sorted the UGC line for cancellations. * Apr 25, 2013 1877 jsanchez Sorted the UGC line for cancellations.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
@ -59,9 +56,6 @@ import com.raytheon.viz.warnings.DateUtil;
*/ */
public class FipsUtil { public class FipsUtil {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FipsUtil.class);
private static final Map<String, String> fipsToState; private static final Map<String, String> fipsToState;
private static String[][] abbrlist = new String[][] { { "02", "AK" }, private static String[][] abbrlist = new String[][] { { "02", "AK" },
@ -126,7 +120,7 @@ public class FipsUtil {
for (AffectedAreas area : sortedAreas) { for (AffectedAreas area : sortedAreas) {
String ugc = getUgc(area); String ugc = getUgc(area);
if (ugc != null && countiesOrZones.contains(ugc) == false) { if ((ugc != null) && (countiesOrZones.contains(ugc) == false)) {
countiesOrZones.add(ugc); countiesOrZones.add(ugc);
} }
} }
@ -159,15 +153,14 @@ public class FipsUtil {
* @param endtime * @param endtime
* @return * @return
*/ */
public static String getUgcLine(Set<UGCZone> ugcs, Date endtime, public static String getUgcLine(Set<String> ugcs, Date endtime, int interval) {
int interval) {
StringBuffer rval = new StringBuffer(); StringBuffer rval = new StringBuffer();
ArrayList<String> countiesOrZones = new ArrayList<String>(); ArrayList<String> countiesOrZones = new ArrayList<String>();
DateUtil du = new DateUtil(); DateUtil du = new DateUtil();
for (UGCZone ugc : ugcs) { for (String ugc : ugcs) {
if (countiesOrZones.contains(ugc.toString()) == false) { if (countiesOrZones.contains(ugc) == false) {
countiesOrZones.add(ugc.toString()); countiesOrZones.add(ugc);
} }
} }
@ -425,33 +418,15 @@ public class FipsUtil {
return fipsToState.get(statefips); return fipsToState.get(statefips);
} }
public static boolean containsSameCountiesOrZones(Set<UGCZone> a, public static boolean containsSameCountiesOrZones(Set<String> a,
Set<UGCZone> b) { Set<String> b) {
boolean rval = true; boolean rval = a.size() == b.size();
if (rval) {
// Check one way... // Check one way...
for (UGCZone z1 : a) { rval = a.containsAll(b);
boolean containsThisItem = false; if (rval) {
for (UGCZone z2 : b) { // Check the other way...
if (z1.toString().equals(z2.toString())) { rval = b.containsAll(a);
containsThisItem = true;
}
}
if (!containsThisItem) {
rval = false;
}
}
// Check the other way...
for (UGCZone z2 : a) {
boolean containsThisItem = false;
for (UGCZone z1 : b) {
if (z1.toString().equals(z2.toString())) {
containsThisItem = true;
}
}
if (!containsThisItem) {
rval = false;
} }
} }

View file

@ -1,3 +1,22 @@
/**
* 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.viz.warnings.rsc; package com.raytheon.viz.warnings.rsc;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -27,7 +46,21 @@ import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKBReader; import com.vividsolutions.jts.io.WKBReader;
import com.vividsolutions.jts.io.WKTReader; import com.vividsolutions.jts.io.WKTReader;
/**
* CWASPSResource
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 10, 2013 1951 rjpeter Initial history entry, updated ugcZones references
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class CWASPSResource extends WatchesResource { public class CWASPSResource extends WatchesResource {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
@ -57,9 +90,9 @@ public class CWASPSResource extends WatchesResource {
String zoneList = ""; String zoneList = "";
List<String> queries = new ArrayList<String>(); List<String> queries = new ArrayList<String>();
for (String ugc : record.getUgcsString()) { for (String ugc : record.getUgcZones()) {
if (ugc.charAt(2) == 'Z' if ((ugc.charAt(2) == 'Z')
&& marinezones.contains(ugc.substring(0, 2))) { && marinezones.contains(ugc.substring(0, 2))) {
if (marinezoneList.length() > 0) { if (marinezoneList.length() > 0) {
marinezoneList += ","; marinezoneList += ",";
@ -97,8 +130,8 @@ public class CWASPSResource extends WatchesResource {
try { try {
List<Object[]> result = DirectDbQuery.executeQuery(sql, "maps", List<Object[]> result = DirectDbQuery.executeQuery(sql, "maps",
QueryLanguage.SQL); QueryLanguage.SQL);
if (result != null && result.size() > 0 if ((result != null) && (result.size() > 0)
&& result.get(0)[0] != null) { && (result.get(0)[0] != null)) {
for (Object[] obj : result) { for (Object[] obj : result) {
if (obj[0] != null) { if (obj[0] != null) {
WKBReader wkbReader = new WKBReader(); WKBReader wkbReader = new WKBReader();
@ -153,14 +186,15 @@ public class CWASPSResource extends WatchesResource {
// if the shape was in the shadedShape map then create a shaded // if the shape was in the shadedShape map then create a shaded
// shape // shape
isShaded = true; isShaded = true;
} else if (entry.wireframeShape == null && record.getGeometry() == null) { } else if ((entry.wireframeShape == null)
&& (record.getGeometry() == null)) {
// if it is not in the wireframeShape map and the geometry is null // if it is not in the wireframeShape map and the geometry is null
// then create a shaded shape // then create a shaded shape
isShaded = true; isShaded = true;
} }
if (isShaded) { if (isShaded) {
if (record.getUgczones().size() > 0) { if (!record.getUgcZones().isEmpty()) {
// if the geometry is null get a geometry based on the county // if the geometry is null get a geometry based on the county
// list // list
if (record.getGeometry() == null) { if (record.getGeometry() == null) {

View file

@ -15,7 +15,6 @@ import java.util.TimerTask;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
@ -47,9 +46,9 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class.
* May 06, 2013 1930 bsteffen Check for null in WatchesResource. * May 06, 2013 1930 bsteffen Check for null in WatchesResource.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author jsanchez * @author jsanchez
@ -158,9 +157,9 @@ public class WatchesResource extends AbstractWWAResource {
} }
} }
} else if (type == ChangeType.CAPABILITY) { } else if (type == ChangeType.CAPABILITY) {
if (color != null if ((color != null)
&& color.equals(getCapability((ColorableCapability.class)) && (color.equals(getCapability((ColorableCapability.class))
.getColor()) == false) { .getColor()) == false)) {
color = getCapability((ColorableCapability.class)).getColor(); color = getCapability((ColorableCapability.class)).getColor();
for (String dataUri : entryMap.keySet()) { for (String dataUri : entryMap.keySet()) {
@ -185,9 +184,9 @@ public class WatchesResource extends AbstractWWAResource {
AbstractWarningRecord record) throws VizException { AbstractWarningRecord record) throws VizException {
Geometry geo; Geometry geo;
if (record.getUgczones().size() > 0) { if (!record.getUgcZones().isEmpty()) {
setGeometry(record); setGeometry(record);
if (record.getGeometry() != null && record.getPhen() != null) { if ((record.getGeometry() != null) && (record.getPhen() != null)) {
IShadedShape ss = target.createShadedShape(false, IShadedShape ss = target.createShadedShape(false,
descriptor.getGridGeometry(), false); descriptor.getGridGeometry(), false);
geo = (Geometry) record.getGeometry().clone(); geo = (Geometry) record.getGeometry().clone();
@ -219,11 +218,11 @@ public class WatchesResource extends AbstractWWAResource {
WarningAction watchact = WarningAction.valueOf(watchrec WarningAction watchact = WarningAction.valueOf(watchrec
.getAct()); .getAct());
int watchSize = watchrec.getUgczones().size(); int watchSize = watchrec.getUgcZones().size();
if (watchact != WarningAction.NEW) { if (watchact != WarningAction.NEW) {
AbstractWarningRecord createShape = null; AbstractWarningRecord createShape = null;
if (watchact == null || watchact.toString() == null) { if ((watchact == null) || (watchact.toString() == null)) {
createShape = watchrec; createShape = watchrec;
} }
for (String entryKey : entryMap.keySet()) { for (String entryKey : entryMap.keySet()) {
@ -233,27 +232,27 @@ public class WatchesResource extends AbstractWWAResource {
// checks for any possible null pointer exceptions in // checks for any possible null pointer exceptions in
// the following block of code, since there is the // the following block of code, since there is the
// possibility of null values // possibility of null values
if (rec.getPhensig() != null if ((rec.getPhensig() != null)
&& watchrec.getPhensig() != null && (watchrec.getPhensig() != null)
&& rec.getOfficeid() != null && (rec.getOfficeid() != null)
&& watchrec.getOfficeid() != null && (watchrec.getOfficeid() != null)
&& rec.getUgczones() != null && (rec.getUgcZones() != null)
&& rec.getStartTime() != null && (rec.getStartTime() != null)
&& watchrec.getStartTime() != null) { && (watchrec.getStartTime() != null)) {
if (rec.getPhensig().equals(watchrec.getPhensig()) if (rec.getPhensig().equals(watchrec.getPhensig())
&& rec.getOfficeid().equals( && rec.getOfficeid().equals(
watchrec.getOfficeid()) watchrec.getOfficeid())
&& rec.getEtn().equals(watchrec.getEtn())) { && rec.getEtn().equals(watchrec.getEtn())) {
int recSize = rec.getUgczones().size(); int recSize = rec.getUgcZones().size();
if (!entry.partialCancel) { if (!entry.partialCancel) {
if (watchact == WarningAction.EXP if ((watchact == WarningAction.EXP)
|| watchact == WarningAction.CAN) { || (watchact == WarningAction.CAN)) {
entry.partialCancel = true; entry.partialCancel = true;
entry.record entry.record
.setEndTime((Calendar) watchrec .setEndTime((Calendar) watchrec
.getStartTime().clone()); .getStartTime().clone());
} else if (watchact == WarningAction.CON } else if ((watchact == WarningAction.CON)
&& recSize > watchSize && (recSize > watchSize)
&& watchrec.getStartTime().after( && watchrec.getStartTime().after(
rec.getStartTime())) { rec.getStartTime())) {
entry.partialCancel = true; entry.partialCancel = true;
@ -270,7 +269,7 @@ public class WatchesResource extends AbstractWWAResource {
if (createShape != null) { if (createShape != null) {
WarningEntry entry = entryMap.get(createShape WarningEntry entry = entryMap.get(createShape
.getDataURI()); .getDataURI());
if (entry != null && entry.shadedShape != null) { if ((entry != null) && (entry.shadedShape != null)) {
entry.shadedShape.dispose(); entry.shadedShape.dispose();
} }
initShape(target, createShape); initShape(target, createShape);
@ -289,7 +288,7 @@ public class WatchesResource extends AbstractWWAResource {
List<String> marinezone = new ArrayList<String>(); List<String> marinezone = new ArrayList<String>();
List<Geometry> geometries = new ArrayList<Geometry>(); List<Geometry> geometries = new ArrayList<Geometry>();
for (String ugc : record.getUgcsString()) { for (String ugc : record.getUgcZones()) {
Geometry geom = null; Geometry geom = null;
WeakReference<Geometry> geomRef = geometryMap.get(ugc); WeakReference<Geometry> geomRef = geometryMap.get(ugc);
if (geomRef != null) { if (geomRef != null) {
@ -383,10 +382,9 @@ public class WatchesResource extends AbstractWWAResource {
AbstractWarningRecord watch = watches.get(key); AbstractWarningRecord watch = watches.get(key);
if (watch == null) { if (watch == null) {
watch = watchrec; watch = watchrec;
} else if (watchrec.getUgczones() != null) { } else if (watchrec.getUgcZones() != null) {
Set<UGCZone> ugcZones = watch.getUgczones(); Set<String> ugcZones = watch.getUgcZones();
ugcZones.addAll(watchrec.getUgczones()); ugcZones.addAll(watchrec.getUgcZones());
watch.setUgczones(ugcZones);
} }
watches.put(key, watch); watches.put(key, watch);
} }
@ -410,7 +408,7 @@ public class WatchesResource extends AbstractWWAResource {
long now = SimulatedTime.getSystemTime().getTime().getTime(); long now = SimulatedTime.getSystemTime().getTime().getTime();
long endTime = rec.getEndTime().getTimeInMillis(); long endTime = rec.getEndTime().getTimeInMillis();
synchronized (expTaskSet) { synchronized (expTaskSet) {
if (endTime > now && !expTaskSet.contains(new Long(endTime))) { if ((endTime > now) && !expTaskSet.contains(new Long(endTime))) {
WarningExpirationTask task = new WarningExpirationTask(this); WarningExpirationTask task = new WarningExpirationTask(this);
timer.schedule(task, rec.getEndTime().getTime()); timer.schedule(task, rec.getEndTime().getTime());
expTaskSet.add(new Long(endTime)); expTaskSet.add(new Long(endTime));
@ -429,7 +427,7 @@ public class WatchesResource extends AbstractWWAResource {
Long time = new Long(triggerTime); Long time = new Long(triggerTime);
// remove the instance of the trigger time from the map // remove the instance of the trigger time from the map
synchronized (expTaskSet) { synchronized (expTaskSet) {
if (expTaskSet != null && expTaskSet.contains(time)) { if ((expTaskSet != null) && expTaskSet.contains(time)) {
expTaskSet.remove(time); expTaskSet.remove(time);
} }
} }

View file

@ -0,0 +1,53 @@
-- called by updateWarningTables.sh to alter the warning and practicewarning tables
-- and to create indexes and sequences for the activetable tables
DROP SEQUENCE IF EXISTS practice_activetableseq;
DROP SEQUENCE IF EXISTS activetableseq;
DROP INDEX IF EXISTS activetable_officeid_phensig_idx;
DROP INDEX IF EXISTS practice_activetable_officeid_phensig_idx
DROP INDEX IF EXISTS practicewarning_office_phensig_index
DROP INDEX IF EXISTS warning_office_phensig_index
ALTER TABLE warning DROP COLUMN IF EXISTS ugczones;
ALTER TABLE practicewarning DROP COLUMN IF EXISTS ugczones;
CREATE INDEX activetable_officeid_phensig_idx
ON activetable
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE INDEX practice_activetable_officeid_phensig_idx
ON practice_activetable
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE SEQUENCE activetableseq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE activetableseq
OWNER TO awips;
CREATE SEQUENCE practice_activetableseq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE practice_activetableseq
OWNER TO awips;
CREATE INDEX practicewarning_office_phensig_index
ON practicewarning
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE INDEX warning_office_phensig_index
ON warning
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
ALTER TABLE warning ADD COLUMN ugczones text;
ALTER TABLE practicewarning ADD COLUMN ugczones text;

View file

@ -0,0 +1,37 @@
# Called by updateWarningTables.sh to parse the ugc zones in table updates
import sys
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID
table = sys.argv[1]
fileName = sys.argv[2]
f = open(fileName, 'r')
ugcZonesUpdateFile = open(table + 'UgcZonesUpdates.sql', 'w')
prevParentId = None
parentId = None
ugcZones = None
for line in f:
# break line by columns
columns=line.split('|')
if len(columns) > 1:
parentId=columns[0].strip()
ugcZone=columns[1].strip()
if parentId == prevParentId:
ugcZones.append(ugcZone)
else:
if ugcZones is not None:
zoneStr = ", ".join(ugcZones)
ugcZonesUpdateFile.write("UPDATE " + table + " SET ugczones = '" + zoneStr + "' WHERE id = " + prevParentId + ";\n")
ugcZones = [ugcZone]
prevParentId = parentId
if ugcZones is not None:
zoneStr = ", ".join(ugcZones)
ugcZonesUpdateFile.write("UPDATE " + table + " SET ugczones = '" + zoneStr + "' WHERE id = " + prevParentId + ";\n")
f.close()
ugcZonesUpdateFile.close()

View file

@ -0,0 +1,75 @@
#!/bin/bash
# Main script for updating warning database structure
PSQL="/awips2/psql/bin/psql"
PYTHON="/awips2/python/bin/python"
SQL_SCRIPT="alterWarningTables.sql"
# ensure that the sql script is present
if [ ! -f ${SQL_SCRIPT} ]; then
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
echo "Adding ugczones column to warning tables"
${PSQL} -U awips -d metadata -f ${SQL_SCRIPT}
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
TABLES="practicewarning warning"
for table in $TABLES
do
echo
echo "Querying for $table ugc zones"
RETRIEVE_UGC_ZONES_SQL="SELECT parentwarning, zone FROM warning_ugczone where parentwarning in (select id from $table) order by parentwarning, key"
_ugc_zone_txt="${table}UgcZones.txt"
${PSQL} -U awips -d metadata -c "${RETRIEVE_UGC_ZONES_SQL}" -t -o ${_ugc_zone_txt}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to retrieve the ugc zones for $table table."
echo "FATAL: The update has failed."
exit 1
fi
echo
echo "Parsing ugc zones for insertion into $table table"
PYTHON_PARSE_SCRIPT="parseUgcZones.py"
if [ ! -f ${PYTHON_PARSE_SCRIPT} ]; then
echo "ERROR: the required python script - ${PYTHON_PARSE_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
${PYTHON} ${PYTHON_PARSE_SCRIPT} ${table} ${_ugc_zone_txt}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to parse ugc zones."
echo "FATAL: The update has failed."
exit 1
fi
echo
echo "Adding ugc zones to $table table"
# ${table}UgcZonesUpdates.sql generated from parseParmIds.py
${PSQL} -U awips -d metadata -q -f ${table}UgcZonesUpdates.sql
if [ $? -ne 0 ]; then
echo "ERROR: Failed to add ugc zones."
echo "FATAL: The update has failed."
exit 1
fi
done
#remove warning_ugczone
echo
echo "Dropping warning_ugczone table"
DROP_TABLE_SQL="DROP TABLE warning_ugczone"
${PSQL} -U awips -d metadata -c "${DROP_TABLE_SQL}"
echo
echo "Running full vacuum for warning"
${PSQL} -U awips -d metadata -c "VACUUM FULL VERBOSE ANALYZE warning"

View file

@ -1443,6 +1443,7 @@ D2DAccumulativeElements= {
#############DCS3501 #############DCS3501
"HIRESWarw": ["tp"], "HIRESWarw": ["tp"],
"HIRESWnmm": ["tp"], "HIRESWnmm": ["tp"],
"RTMA": ["tp"],
#DR20634 "SPC": ["tp"], #DR20634 "SPC": ["tp"],
#Dummy ones for the transition from Eta to NAM. These are ignored. #Dummy ones for the transition from Eta to NAM. These are ignored.

View file

@ -295,6 +295,13 @@
value="com.raytheon.uf.common.dataplugin.gfe.request.GetSelectTimeRangeRequest" /> value="com.raytheon.uf.common.dataplugin.gfe.request.GetSelectTimeRangeRequest" />
<constructor-arg ref="GetSelectTRHandler" /> <constructor-arg ref="GetSelectTRHandler" />
</bean> </bean>
<bean id="createNewDbHandler"
class="com.raytheon.edex.plugin.gfe.server.handler.CreateNewDbHandler" />
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg
value="com.raytheon.uf.common.dataplugin.gfe.request.CreateNewDbRequest" />
<constructor-arg ref="createNewDbHandler" />
</bean>
<!-- Service Backup Handlers --> <!-- Service Backup Handlers -->

View file

@ -43,6 +43,7 @@ import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase; import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabaseManager; import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase; import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager; import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager; import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecord; import com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecord;
@ -86,6 +87,7 @@ import com.raytheon.uf.edex.site.notify.SendSiteActivationNotifications;
* Feb 28, 2013 #1447 dgilling Enable active table fetching on site * Feb 28, 2013 #1447 dgilling Enable active table fetching on site
* activation. * activation.
* Mar 20, 2013 #1774 randerso Changed to use GFED2DDao * Mar 20, 2013 #1774 randerso Changed to use GFED2DDao
* May 02, 2013 #1969 randerso Moved updateDbs method into IFPGridDatabase
* *
* </pre> * </pre>
* *
@ -350,13 +352,12 @@ public class GFESiteActivation implements ISiteActivationListener {
statusHandler.handle(Priority.EVENTA, statusHandler.handle(Priority.EVENTA,
"Checking for IFPGridDatabase updates..."); "Checking for IFPGridDatabase updates...");
for (String site : ifpInventory.keySet()) { for (String site : ifpInventory.keySet()) {
for (int i = 0; i < ifpInventory.get(site).size(); i++) { for (DatabaseID dbid : ifpInventory.get(site)) {
GridDatabase db = GridParmManager.getDb(ifpInventory.get( GridDatabase db = GridParmManager.getDb(dbid);
site).get(i));
// cluster locked since IFPGridDatabase can modify the grids // cluster locked since IFPGridDatabase can modify the grids
// based on changes to grid size, etc // based on changes to grid size, etc
if (db.databaseIsValid()) { if (db instanceof IFPGridDatabase && db.databaseIsValid()) {
db.updateDbs(); ((IFPGridDatabase) db).updateDbs();
} }
} }
} }

View file

@ -51,6 +51,8 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* 04/04/13 #1787 randerso Fixed to support changes to D2D grid location * 04/04/13 #1787 randerso Fixed to support changes to D2D grid location
* Additional cleanup to move the D2D to GFE translation * Additional cleanup to move the D2D to GFE translation
* logic into D2DGridDatabase. * logic into D2DGridDatabase.
* 05/03/13 #1974 randerso Changed queryByParmId to look for parm with duration
* suffix first.
* *
* </pre> * </pre>
* *
@ -163,14 +165,18 @@ public class GFED2DDao extends GridDao {
Date refTime, String d2dParmName, Level d2dLevel, Session s) Date refTime, String d2dParmName, Level d2dLevel, Session s)
throws DataAccessLayerException { throws DataAccessLayerException {
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName()); DatabaseQuery query;
query = new DatabaseQuery(GridRecord.class.getName());
query.addReturnedField(FCST_TIME); query.addReturnedField(FCST_TIME);
query.addReturnedField("id"); query.addReturnedField("id");
query.addReturnedField(GridConstants.PARAMETER_ABBREVIATION);
query.addQueryParam(GridConstants.DATASET_ID, d2dModelName); query.addQueryParam(GridConstants.DATASET_ID, d2dModelName);
query.addQueryParam(REF_TIME, refTime); query.addQueryParam(REF_TIME, refTime);
query.addQueryParam(GridConstants.PARAMETER_ABBREVIATION, d2dParmName); query.addQueryParam(GridConstants.PARAMETER_ABBREVIATION, d2dParmName
+ "%hr", QueryOperand.LIKE);
query.addQueryParam(GridConstants.LEVEL_ID, d2dLevel.getId()); query.addQueryParam(GridConstants.LEVEL_ID, d2dLevel.getId());
query.addOrder(FCST_TIME, true); query.addOrder(FCST_TIME, true);
query.addOrder(GridConstants.PARAMETER_ABBREVIATION, true);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<Object[]> firstTry = (List<Object[]>) this.queryByCriteria(query); List<Object[]> firstTry = (List<Object[]>) this.queryByCriteria(query);
@ -180,23 +186,25 @@ public class GFED2DDao extends GridDao {
query = new DatabaseQuery(GridRecord.class.getName()); query = new DatabaseQuery(GridRecord.class.getName());
query.addReturnedField(FCST_TIME); query.addReturnedField(FCST_TIME);
query.addReturnedField("id"); query.addReturnedField("id");
query.addReturnedField(GridConstants.PARAMETER_ABBREVIATION);
query.addQueryParam(GridConstants.DATASET_ID, d2dModelName); query.addQueryParam(GridConstants.DATASET_ID, d2dModelName);
query.addQueryParam(REF_TIME, refTime); query.addQueryParam(REF_TIME, refTime);
query.addQueryParam(GridConstants.PARAMETER_ABBREVIATION, query.addQueryParam(GridConstants.PARAMETER_ABBREVIATION,
d2dParmName + "%hr", QueryOperand.LIKE); d2dParmName);
query.addQueryParam(GridConstants.LEVEL_ID, d2dLevel.getId()); query.addQueryParam(GridConstants.LEVEL_ID, d2dLevel.getId());
query.addOrder(FCST_TIME, true); query.addOrder(FCST_TIME, true);
query.addOrder(GridConstants.PARAMETER_ABBREVIATION, true);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<Object[]> secondTry = (List<Object[]>) this List<Object[]> secondTry = (List<Object[]>) this
.queryByCriteria(query); .queryByCriteria(query);
for (Object[] row : secondTry) {
dataTimes.put((Integer) row[0], (Integer) row[1]);
}
} else {
Pattern p = Pattern.compile("^" + d2dParmName + "(\\d+)hr$"); Pattern p = Pattern.compile("^" + d2dParmName + "(\\d+)hr$");
int i = 0; int i = 0;
while (i < secondTry.size()) { while (i < firstTry.size()) {
Object[] row = secondTry.get(i++); Object[] row = firstTry.get(i++);
Integer fcstHr = (Integer) row[0]; Integer fcstHr = (Integer) row[0];
Integer id = (Integer) row[1]; Integer id = (Integer) row[1];
Matcher matcher = p.matcher((String) row[2]); Matcher matcher = p.matcher((String) row[2]);
@ -205,8 +213,8 @@ public class GFED2DDao extends GridDao {
dur = Integer.parseInt(matcher.group(1)); dur = Integer.parseInt(matcher.group(1));
} }
for (int j = i; j < secondTry.size(); j++) { for (int j = i; j < firstTry.size(); j++) {
Object[] nextRow = secondTry.get(j); Object[] nextRow = firstTry.get(j);
if (fcstHr.equals(nextRow[0])) { if (fcstHr.equals(nextRow[0])) {
i = j; i = j;
String nextParam = (String) nextRow[2]; String nextParam = (String) nextRow[2];
@ -224,10 +232,6 @@ public class GFED2DDao extends GridDao {
} }
dataTimes.put(fcstHr, id); dataTimes.put(fcstHr, id);
} }
} else {
for (Object[] row : firstTry) {
dataTimes.put((Integer) row[0], (Integer) row[1]);
}
} }
return dataTimes; return dataTimes;
} }

View file

@ -95,6 +95,9 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
* 03/20/2013 #1774 randerso Removed dead method, changed to use new * 03/20/2013 #1774 randerso Removed dead method, changed to use new
* D2DGridDatabase constructor * D2DGridDatabase constructor
* 04/23/2013 #1949 rjpeter Added inventory retrieval for a given time range. * 04/23/2013 #1949 rjpeter Added inventory retrieval for a given time range.
* 05/02/13 #1969 randerso Fixed possible null pointer in getParmList
* Removed inventory from DBInvChangedNotification
* 05/03/13 #1974 randerso Fixed error logging to include stack trace
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -910,9 +913,7 @@ public class GridParmManager {
try { try {
createDB(id); createDB(id);
if (!inv.contains(id)) { if (!inv.contains(id)) {
inv.add(id); createDbNotification(id.getSiteId(),
Collections.sort(inv);
createDbNotification(id.getSiteId(), inv,
Arrays.asList(new DatabaseID[] { id }), Arrays.asList(new DatabaseID[] { id }),
new ArrayList<DatabaseID>()); new ArrayList<DatabaseID>());
} }
@ -981,7 +982,13 @@ public class GridParmManager {
public static ServerResponse<List<ParmID>> getParmList(DatabaseID id) { public static ServerResponse<List<ParmID>> getParmList(DatabaseID id) {
ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>(); ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>();
try { try {
sr = getDb(id).getParmList(); GridDatabase db = getDb(id);
if (db != null) {
sr = db.getParmList();
} else {
sr.addMessage("Database " + id
+ " does not exist for getParmList()");
}
} catch (Exception e) { } catch (Exception e) {
sr.addMessage("Error getting db: " + id); sr.addMessage("Error getting db: " + id);
logger.error("Error getting db: " + id, e); logger.error("Error getting db: " + id, e);
@ -1210,7 +1217,7 @@ public class GridParmManager {
dbId.getModelTimeAsDate()); dbId.getModelTimeAsDate());
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage()); e.getLocalizedMessage(), e);
db = null; db = null;
} }
} }
@ -1363,14 +1370,13 @@ public class GridParmManager {
List<DatabaseID> deletions = new ArrayList<DatabaseID>(prevInventory); List<DatabaseID> deletions = new ArrayList<DatabaseID>(prevInventory);
deletions.removeAll(newInventory); deletions.removeAll(newInventory);
createDbNotification(siteID, newInventory, additions, deletions); createDbNotification(siteID, additions, deletions);
} }
private static void createDbNotification(String siteID, private static void createDbNotification(String siteID,
List<DatabaseID> dbs, List<DatabaseID> additions, List<DatabaseID> additions, List<DatabaseID> deletions) {
List<DatabaseID> deletions) {
if (!additions.isEmpty() || !deletions.isEmpty()) { if (!additions.isEmpty() || !deletions.isEmpty()) {
DBInvChangeNotification notify = new DBInvChangeNotification(dbs, DBInvChangeNotification notify = new DBInvChangeNotification(
additions, deletions, siteID); additions, deletions, siteID);
SendNotifications.send(notify); SendNotifications.send(notify);
} }

View file

@ -105,6 +105,8 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* 04/04/2013 #1774 randerso Moved wind component checking to GfeIngestNotificaionFilter * 04/04/2013 #1774 randerso Moved wind component checking to GfeIngestNotificaionFilter
* 04/04/2013 #1787 randerso Move the D2D to GFE translation logic out of GFED2DDao * 04/04/2013 #1787 randerso Move the D2D to GFE translation logic out of GFED2DDao
* 04/17/2013 #1913 randerso Added GFE level mapping to replace GridTranslator * 04/17/2013 #1913 randerso Added GFE level mapping to replace GridTranslator
* 05/02/2013 #1969 randerso Removed unnecessary updateDbs method
* 05/03/2013 #1974 randerso Fixed error handling when no D2D level mapping found
* *
* </pre> * </pre>
* *
@ -202,7 +204,7 @@ public class D2DGridDatabase extends VGridDatabase {
private final IPerformanceStatusHandler perfLog = PerformanceStatus private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("GFE:"); .getHandler("GFE:");
public static class D2DParm { public class D2DParm {
private ParmID parmId; private ParmID parmId;
private GridParmInfo gpi; private GridParmInfo gpi;
@ -346,11 +348,6 @@ public class D2DGridDatabase extends VGridDatabase {
return remap; return remap;
} }
@Override
public void updateDbs() {
// no op
}
/** /**
* Attempts to load the supplied ParmAtts using the given level. * Attempts to load the supplied ParmAtts using the given level.
* *
@ -1256,25 +1253,30 @@ public class D2DGridDatabase extends VGridDatabase {
return parmName + "_" + level; return parmName + "_" + level;
} }
private static Level getD2DLevel(String gfeLevel) { private Level getD2DLevel(String gfeLevel) {
List<Level> levels; List<Level> levels = Collections.emptyList();
try { try {
levels = LevelMappingFactory.getInstance(GFE_LEVEL_MAPPING_FILE) LevelMapping lm = LevelMappingFactory.getInstance(
.getLevelMappingForKey(gfeLevel).getLevels(); GFE_LEVEL_MAPPING_FILE).getLevelMappingForKey(gfeLevel);
if (lm != null) {
levels = lm.getLevels();
}
} catch (CommunicationException e) { } catch (CommunicationException e) {
levels = Collections.emptyList(); // do nothing
} }
Level level = null; Level level = null;
if (levels.isEmpty()) { if (levels.isEmpty()) {
statusHandler.warn("No D2D level found for: " + gfeLevel); statusHandler.warn("No D2D level found for: " + gfeLevel
+ ". Check gfeLevelMapping and parameterInfo files.");
} else { } else {
level = levels.get(0); level = levels.get(0);
} }
return level; return level;
} }
private static String getGFELevel(Level d2dLevel) { private String getGFELevel(Level d2dLevel) {
LevelMapping levelMapping; LevelMapping levelMapping;
try { try {
levelMapping = LevelMappingFactory.getInstance( levelMapping = LevelMappingFactory.getInstance(
@ -1284,7 +1286,10 @@ public class D2DGridDatabase extends VGridDatabase {
} }
String gfeLevel = null; String gfeLevel = null;
if (levelMapping != null) { if (levelMapping == null) {
statusHandler.warn("No GFE level found for: " + d2dLevel
+ ". Check gfeLevelMapping and parameterInfo files.");
} else {
gfeLevel = levelMapping.getKey(); gfeLevel = levelMapping.getKey();
} }
return gfeLevel; return gfeLevel;

View file

@ -54,6 +54,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* May 16, 2011 bphillip Initial creation * May 16, 2011 bphillip Initial creation
* May 04, 2012 #574 dgilling Add unimplemented methods from GridDatabase. * May 04, 2012 #574 dgilling Add unimplemented methods from GridDatabase.
* Oct 10 2012 #1260 randerso Added code to set valid flag * Oct 10 2012 #1260 randerso Added code to set valid flag
* 05/02/13 #1969 randerso Removed unnecessary updateDbs method
* *
* </pre> * </pre>
* *
@ -191,11 +192,6 @@ public class D2DSatDatabase extends VGridDatabase {
return null; return null;
} }
@Override
public void updateDbs() {
// no op
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -76,6 +76,7 @@ import com.raytheon.uf.common.util.Pair;
* 03/15/13 #1795 njensen Added updatePublishTime() * 03/15/13 #1795 njensen Added updatePublishTime()
* 04/23/13 #1949 rjpeter Added default implementations of history by time range * 04/23/13 #1949 rjpeter Added default implementations of history by time range
* and cachedParmId * and cachedParmId
* 05/02/13 #1969 randerso Removed unnecessary updateDbs method
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -505,8 +506,6 @@ public abstract class GridDatabase {
} }
public abstract void updateDbs();
/** /**
* Return the internally cache'd parmID for this database implementation. * Return the internally cache'd parmID for this database implementation.
* *

View file

@ -118,6 +118,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 03/15/13 #1795 njensen Added updatePublishTime() * 03/15/13 #1795 njensen Added updatePublishTime()
* 03/20/13 #1774 randerso Cleanup code to use proper constructors * 03/20/13 #1774 randerso Cleanup code to use proper constructors
* 04/08/13 #1949 rjpeter Updated to work with normalized database. * 04/08/13 #1949 rjpeter Updated to work with normalized database.
* 05/02/13 #1969 randerso Removed updateDbs from parent class
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -198,7 +199,6 @@ public class IFPGridDatabase extends GridDatabase {
* Upon site activation, this method is called to calculate any changes to * Upon site activation, this method is called to calculate any changes to
* parm info or grid locations * parm info or grid locations
*/ */
@Override
public void updateDbs() { public void updateDbs() {
Map<String, GridParmInfo> parmInfoUser = new HashMap<String, GridParmInfo>(); Map<String, GridParmInfo> parmInfoUser = new HashMap<String, GridParmInfo>();
Map<String, ParmStorageInfo> parmStorageInfoUser = new HashMap<String, ParmStorageInfo>(); Map<String, ParmStorageInfo> parmStorageInfoUser = new HashMap<String, ParmStorageInfo>();

View file

@ -39,6 +39,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 26, 2011 dgilling Initial creation * Aug 26, 2011 dgilling Initial creation
* May 04, 2012 #574 dgilling Port getSiteID() method. * May 04, 2012 #574 dgilling Port getSiteID() method.
* May 2, 2013 #1969 randerso Removed unnecessary updateDbs method
* *
* </pre> * </pre>
* *
@ -69,17 +70,6 @@ public abstract class VGridDatabase extends GridDatabase {
return config.getSiteID().get(0); return config.getSiteID().get(0);
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.GridDatabase#updateDbs()
*/
@Override
public void updateDbs() {
// no-op
}
public abstract SortedSet<Date> getValidTimes() throws GfeException, public abstract SortedSet<Date> getValidTimes() throws GfeException,
DataAccessLayerException; DataAccessLayerException;
} }

View file

@ -0,0 +1,60 @@
/**
* 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.edex.plugin.gfe.server.handler;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.uf.common.dataplugin.gfe.request.CreateNewDbRequest;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
/**
* Handler for CreateNewDb request
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 2, 2013 #1969 randerso Initial creation
* May 3, 2013 #1969 randerso Code review comment incorporation
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class CreateNewDbHandler implements IRequestHandler<CreateNewDbRequest> {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.serialization.comm.IRequestHandler#handleRequest
* (com.raytheon.uf.common.serialization.comm.IServerRequest)
*/
@Override
public ServerResponse<?> handleRequest(CreateNewDbRequest request)
throws Exception {
return GridParmManager.createNewDb(request.getDbId());
}
}

View file

@ -38,6 +38,7 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 04/08/08 #875 bphillip Initial Creation * 04/08/08 #875 bphillip Initial Creation
* 09/22/09 3058 rjpeter Converted to IRequestHandler * 09/22/09 3058 rjpeter Converted to IRequestHandler
* 05/02/13 #1969 randerso Fixed null pointer if getParmList fails
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -52,8 +53,11 @@ public class GetParmListHandler implements IRequestHandler<GetParmListRequest> {
ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>(); ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>();
for (DatabaseID id : request.getDbIds()) { for (DatabaseID id : request.getDbIds()) {
ServerResponse<List<ParmID>> ssr = GridParmManager.getParmList(id); ServerResponse<List<ParmID>> ssr = GridParmManager.getParmList(id);
retVal.addAll(ssr.getPayload()); if (ssr.isOkay()) {
sr.addMessages(ssr); retVal.addAll(ssr.getPayload());
} else {
sr.addMessages(ssr);
}
} }
if (sr.isOkay()) { if (sr.isOkay()) {
sr.setPayload(retVal); sr.setPayload(retVal);

View file

@ -81,6 +81,7 @@ import com.raytheon.uf.edex.core.EDEXUtil;
* Apr 01, 2013 #1774 randerso Moved wind component checking to GfeIngestNotificaionFilter * Apr 01, 2013 #1774 randerso Moved wind component checking to GfeIngestNotificaionFilter
* Apr 04, 2013 #1787 randerso Added null check to prevent log spamming for parameters * Apr 04, 2013 #1787 randerso Added null check to prevent log spamming for parameters
* not included in the parameter info file * not included in the parameter info file
* May 2, 2013 #1969 randerso Updated for change to DBInvChangeNotification
* *
* </pre> * </pre>
* *
@ -165,8 +166,7 @@ public class GfeIngestNotificationFilter {
fullInv.add(dbId); fullInv.add(dbId);
newDbs.add(dbId); newDbs.add(dbId);
GfeNotification dbInv = new DBInvChangeNotification( GfeNotification dbInv = new DBInvChangeNotification(
fullInv, Arrays.asList(dbId), Arrays.asList(dbId), null, site);
new ArrayList<DatabaseID>(0), site);
sendNotification(dbInv); sendNotification(dbInv);
} }

View file

@ -2,6 +2,8 @@
<!-- <!--
Mar 20, 2013 #1774 randerso Added all parms from dataFieldTable.txt Mar 20, 2013 #1774 randerso Added all parms from dataFieldTable.txt
sorted lists for ease of update sorted lists for ease of update
May 07, 2013 #1974 randerso Removed unnecessary TPCSG_ entries (should only need TPCSG-)
Changed TP_XXX to tpXXX for RFC total precip
--> -->
<aliasList caseSensitive="true" namespace="gfeParamName"> <aliasList caseSensitive="true" namespace="gfeParamName">
<alias base="AV">av</alias> <alias base="AV">av</alias>
@ -265,142 +267,95 @@
<alias base="Tmean">tmean</alias> <alias base="Tmean">tmean</alias>
<alias base="TOTSN">totsn</alias> <alias base="TOTSN">totsn</alias>
<alias base="TP120hr">tp120hr</alias> <alias base="TP120hr">tp120hr</alias>
<alias base="TP12c1">tp12c1</alias> <alias base="tp12c1">tp12c1</alias>
<alias base="TP12c2">tp12c2</alias> <alias base="tp12c2">tp12c2</alias>
<alias base="TP12c3">tp12c3</alias> <alias base="tp12c3">tp12c3</alias>
<alias base="TP12c4">tp12c4</alias> <alias base="tp12c4">tp12c4</alias>
<alias base="TP12c5">tp12c5</alias> <alias base="tp12c5">tp12c5</alias>
<alias base="TP12c6">tp12c6</alias> <alias base="tp12c6">tp12c6</alias>
<alias base="TP12c7">tp12c7</alias> <alias base="tp12c7">tp12c7</alias>
<alias base="TP12c8">tp12c8</alias> <alias base="tp12c8">tp12c8</alias>
<alias base="TP12mean">tpmean12</alias> <alias base="TP12mean">tpmean12</alias>
<alias base="TP12sprd">tpsprd12</alias> <alias base="TP12sprd">tpsprd12</alias>
<alias base="TP24c1">tp24c1</alias> <alias base="tp24c1">tp24c1</alias>
<alias base="TP24c2">tp24c2</alias> <alias base="tp24c2">tp24c2</alias>
<alias base="TP24c3">tp24c3</alias> <alias base="tp24c3">tp24c3</alias>
<alias base="TP24c4">tp24c4</alias> <alias base="tp24c4">tp24c4</alias>
<alias base="TP24c5">tp24c5</alias> <alias base="tp24c5">tp24c5</alias>
<alias base="TP24c6">tp24c6</alias> <alias base="tp24c6">tp24c6</alias>
<alias base="TP24c7">tp24c7</alias> <alias base="tp24c7">tp24c7</alias>
<alias base="TP24c8">tp24c8</alias> <alias base="tp24c8">tp24c8</alias>
<alias base="TP24mean">tpmean24</alias> <alias base="TP24mean">tpmean24</alias>
<alias base="TP24sprd">tpsprd24</alias> <alias base="TP24sprd">tpsprd24</alias>
<alias base="TP3c1">tp3c1</alias> <alias base="tp3c1">tp3c1</alias>
<alias base="TP3c2">tp3c2</alias> <alias base="tp3c2">tp3c2</alias>
<alias base="TP3c3">tp3c3</alias> <alias base="tp3c3">tp3c3</alias>
<alias base="TP3c4">tp3c4</alias> <alias base="tp3c4">tp3c4</alias>
<alias base="TP3c5">tp3c5</alias> <alias base="tp3c5">tp3c5</alias>
<alias base="TP3c6">tp3c6</alias> <alias base="tp3c6">tp3c6</alias>
<alias base="TP3c7">tp3c7</alias> <alias base="tp3c7">tp3c7</alias>
<alias base="TP3c8">tp3c8</alias> <alias base="tp3c8">tp3c8</alias>
<alias base="TP3mean">tpmean3</alias> <alias base="TP3mean">tpmean3</alias>
<alias base="TP3sprd">tpsprd3</alias> <alias base="TP3sprd">tpsprd3</alias>
<alias base="TP6c1">tp6c1</alias> <alias base="tp6c1">tp6c1</alias>
<alias base="TP6c2">tp6c2</alias> <alias base="tp6c2">tp6c2</alias>
<alias base="TP6c3">tp6c3</alias> <alias base="tp6c3">tp6c3</alias>
<alias base="TP6c4">tp6c4</alias> <alias base="tp6c4">tp6c4</alias>
<alias base="TP6c5">tp6c5</alias> <alias base="tp6c5">tp6c5</alias>
<alias base="TP6c6">tp6c6</alias> <alias base="tp6c6">tp6c6</alias>
<alias base="TP6c7">tp6c7</alias> <alias base="tp6c7">tp6c7</alias>
<alias base="TP6c8">tp6c8</alias> <alias base="tp6c8">tp6c8</alias>
<alias base="TP6mean">tpmean6</alias> <alias base="TP6mean">tpmean6</alias>
<alias base="TP6sprd">tpsprd6</alias> <alias base="TP6sprd">tpsprd6</alias>
<alias base="TP_ACR">tp_ACR</alias> <alias base="tpACR">tp_ACR</alias>
<alias base="TP-ACR">tp_ACR</alias> <alias base="tpALR">tp_ALR</alias>
<alias base="TP_ALR">tp_ALR</alias>
<alias base="TP-ALR">tp_ALR</alias>
<alias base="TPCSG_122E2">PSurge4Ft</alias>
<alias base="TPCSG-122E2">PSurge4Ft</alias> <alias base="TPCSG-122E2">PSurge4Ft</alias>
<alias base="TPCSG_152E2">PSurge5Ft</alias>
<alias base="TPCSG-152E2">PSurge5Ft</alias> <alias base="TPCSG-152E2">PSurge5Ft</alias>
<alias base="TPCSG_183E2">PSurge6Ft</alias>
<alias base="TPCSG-183E2">PSurge6Ft</alias> <alias base="TPCSG-183E2">PSurge6Ft</alias>
<alias base="TPCSG_20">Surge20Pct</alias>
<alias base="TPCSG-20">Surge20Pct</alias> <alias base="TPCSG-20">Surge20Pct</alias>
<alias base="TPCSG_213E2">PSurge7Ft</alias>
<alias base="TPCSG-213E2">PSurge7Ft</alias> <alias base="TPCSG-213E2">PSurge7Ft</alias>
<alias base="TPCSG_244E2">PSurge8Ft</alias>
<alias base="TPCSG-244E2">PSurge8Ft</alias> <alias base="TPCSG-244E2">PSurge8Ft</alias>
<alias base="TPCSG_274E2">PSurge9Ft</alias>
<alias base="TPCSG-274E2">PSurge9Ft</alias> <alias base="TPCSG-274E2">PSurge9Ft</alias>
<alias base="TPCSG_305E2">PSurge10Ft</alias>
<alias base="TPCSG-305E2">PSurge10Ft</alias> <alias base="TPCSG-305E2">PSurge10Ft</alias>
<alias base="TPCSG_30">Surge30Pct</alias>
<alias base="TPCSG-30">Surge30Pct</alias> <alias base="TPCSG-30">Surge30Pct</alias>
<alias base="TPCSG_335E2">PSurge11Ft</alias>
<alias base="TPCSG-335E2">PSurge11Ft</alias> <alias base="TPCSG-335E2">PSurge11Ft</alias>
<alias base="TPCSG_366E2">PSurge12Ft</alias>
<alias base="TPCSG-366E2">PSurge12Ft</alias> <alias base="TPCSG-366E2">PSurge12Ft</alias>
<alias base="TPCSG_396E2">PSurge13Ft</alias>
<alias base="TPCSG-396E2">PSurge13Ft</alias> <alias base="TPCSG-396E2">PSurge13Ft</alias>
<alias base="TPCSG_40">Surge40Pct</alias>
<alias base="TPCSG-40">Surge40Pct</alias> <alias base="TPCSG-40">Surge40Pct</alias>
<alias base="TPCSG_427E2">PSurge14Ft</alias>
<alias base="TPCSG-427E2">PSurge14Ft</alias> <alias base="TPCSG-427E2">PSurge14Ft</alias>
<alias base="TPCSG_457E2">PSurge15Ft</alias>
<alias base="TPCSG-457E2">PSurge15Ft</alias> <alias base="TPCSG-457E2">PSurge15Ft</alias>
<alias base="TPCSG_488E2">PSurge16Ft</alias>
<alias base="TPCSG-488E2">PSurge16Ft</alias> <alias base="TPCSG-488E2">PSurge16Ft</alias>
<alias base="TPCSG_50">Surge50Pct</alias>
<alias base="TPCSG-50">Surge50Pct</alias> <alias base="TPCSG-50">Surge50Pct</alias>
<alias base="TPCSG_518E2">PSurge17Ft</alias>
<alias base="TPCSG-518E2">PSurge17Ft</alias> <alias base="TPCSG-518E2">PSurge17Ft</alias>
<alias base="TPCSG_549E2">PSurge18Ft</alias>
<alias base="TPCSG-549E2">PSurge18Ft</alias> <alias base="TPCSG-549E2">PSurge18Ft</alias>
<alias base="TPCSG_579E2">PSurge19Ft</alias>
<alias base="TPCSG-579E2">PSurge19Ft</alias> <alias base="TPCSG-579E2">PSurge19Ft</alias>
<alias base="TPCSG_60">Surge60Pct</alias>
<alias base="TPCSG-60">Surge60Pct</alias> <alias base="TPCSG-60">Surge60Pct</alias>
<alias base="TPCSG_610E2">PSurge20Ft</alias>
<alias base="TPCSG-610E2">PSurge20Ft</alias> <alias base="TPCSG-610E2">PSurge20Ft</alias>
<alias base="TPCSG_61E2">PSurge2Ft</alias>
<alias base="TPCSG-61E2">PSurge2Ft</alias> <alias base="TPCSG-61E2">PSurge2Ft</alias>
<alias base="TPCSG_640E2">PSurge21Ft</alias>
<alias base="TPCSG-640E2">PSurge21Ft</alias> <alias base="TPCSG-640E2">PSurge21Ft</alias>
<alias base="TPCSG_671E2">PSurge22Ft</alias>
<alias base="TPCSG-671E2">PSurge22Ft</alias> <alias base="TPCSG-671E2">PSurge22Ft</alias>
<alias base="TPCSG_701E2">PSurge23Ft</alias>
<alias base="TPCSG-701E2">PSurge23Ft</alias> <alias base="TPCSG-701E2">PSurge23Ft</alias>
<alias base="TPCSG_70">Surge70Pct</alias>
<alias base="TPCSG-70">Surge70Pct</alias> <alias base="TPCSG-70">Surge70Pct</alias>
<alias base="TPCSG_732E2">PSurge24Ft</alias>
<alias base="TPCSG-732E2">PSurge24Ft</alias> <alias base="TPCSG-732E2">PSurge24Ft</alias>
<alias base="TPCSG_762E2">PSurge25Ft</alias>
<alias base="TPCSG-762E2">PSurge25Ft</alias> <alias base="TPCSG-762E2">PSurge25Ft</alias>
<alias base="TPCSG_80">Surge80Pct</alias>
<alias base="TPCSG-80">Surge80Pct</alias> <alias base="TPCSG-80">Surge80Pct</alias>
<alias base="TPCSG_90">Surge90Pct</alias>
<alias base="TPCSG-90">Surge90Pct</alias> <alias base="TPCSG-90">Surge90Pct</alias>
<alias base="TPCSG_91E2">PSurge3Ft</alias>
<alias base="TPCSG-91E2">PSurge3Ft</alias> <alias base="TPCSG-91E2">PSurge3Ft</alias>
<alias base="TPCSG_SLOSH">SloshSurge</alias>
<alias base="TPCSG-SLOSH">SloshSurge</alias> <alias base="TPCSG-SLOSH">SloshSurge</alias>
<alias base="TPCSG">Surge10Pct</alias> <alias base="TPCSG">Surge10Pct</alias>
<alias base="TP_ECMWF">tp_ecmwf</alias> <alias base="TP-ECMWF">tp_ecmwf</alias>
<alias base="TP_FWR">tp_FWR</alias> <alias base="tpFWR">tp_FWR</alias>
<alias base="TP-FWR">tp_FWR</alias> <alias base="tpHPC">tp_HPC</alias>
<alias base="TP_HPC">tp_HPC</alias> <alias base="tpKRF">tp_KRF</alias>
<alias base="TP-HPC">tp_HPC</alias> <alias base="tpMSR">tp_MSR</alias>
<alias base="TP_KRF">tp_KRF</alias> <alias base="tpORN">tp_ORN</alias>
<alias base="TP-KRF">tp_KRF</alias> <alias base="tpPTR">tp_PTR</alias>
<alias base="TP_MSR">tp_MSR</alias> <alias base="tpRHA">tp_RHA</alias>
<alias base="TP-MSR">tp_MSR</alias> <alias base="tpRSA">tp_RSA</alias>
<alias base="TP_ORN">tp_ORN</alias> <alias base="tpSTR">tp_STR</alias>
<alias base="TP-ORN">tp_ORN</alias> <alias base="tpTAR">tp_TAR</alias>
<alias base="TP_PTR">tp_PTR</alias> <alias base="tpTIR">tp_TIR</alias>
<alias base="TP-PTR">tp_PTR</alias> <alias base="tpTUA">tp_TUA</alias>
<alias base="TP_RHA">tp_RHA</alias>
<alias base="TP-RHA">tp_RHA</alias>
<alias base="TP_RSA">tp_RSA</alias>
<alias base="TP-RSA">tp_RSA</alias>
<alias base="TP_STR">tp_STR</alias>
<alias base="TP-STR">tp_STR</alias>
<alias base="TP_TAR">tp_TAR</alias>
<alias base="TP-TAR">tp_TAR</alias>
<alias base="TP_TIR">tp_TIR</alias>
<alias base="TP-TIR">tp_TIR</alias>
<alias base="TP_TUA">tp_TUA</alias>
<alias base="TP-TUA">tp_TUA</alias>
<alias base="TPW">tpw</alias> <alias base="TPW">tpw</alias>
<alias base="Tsprd">tsprd</alias> <alias base="Tsprd">tsprd</alias>
<alias base="tTOT">ttot</alias> <alias base="tTOT">ttot</alias>

View file

@ -807,7 +807,7 @@ usage: VTECDecoder -f productfilename -d -a activeTableName
template['pil'] = self._remapPil(template['phen'], template['pil'] = self._remapPil(template['phen'],
template['sig'], self._productPil) template['sig'], self._productPil)
template['ugcs'] = ugcs template['ugcZoneList'] = ", ".join(ugcs)
state = ugcstring[0:2] state = ugcstring[0:2]
if REGIONS.has_key(state): if REGIONS.has_key(state):
template['region'] = REGIONS[state] template['region'] = REGIONS[state]

View file

@ -24,12 +24,12 @@ import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Inheritance; import javax.persistence.Inheritance;
import javax.persistence.InheritanceType; import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient; import javax.persistence.Transient;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
@ -51,22 +51,23 @@ import com.vividsolutions.jts.geom.Geometry;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 24, 2009 njensen Initial creation * Mar 24, 2009 njensen Initial creation
* Feb 26, 2013 1447 dgilling Implement equals(). * Feb 26, 2013 1447 dgilling Implement equals().
* * May 10, 2013 1951 rjpeter Added own id sequence tagging
* </pre> * </pre>
* *
* @author njensen * @author njensen
* @version 1.0 * @version 1.0
*/ */
@MappedSuperclass
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@DynamicSerialize @DynamicSerialize
public abstract class ActiveTableRecord extends PersistableDataObject { public abstract class ActiveTableRecord extends PersistableDataObject {
protected static final long serialVersionUID = 1L; protected static final long serialVersionUID = 1L;
@GeneratedValue(strategy = GenerationType.AUTO) protected static final String ID_GEN = "idgen";
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = ID_GEN)
@Id @Id
protected int id; protected int id;
@ -1079,7 +1080,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
atr.setWmoid(wr.getWmoid()); atr.setWmoid(wr.getWmoid());
atr.setXxxid(wr.getXxxid()); atr.setXxxid(wr.getXxxid());
for (String ugc : wr.getUgcsString()) { for (String ugc : wr.getUgcZones()) {
ActiveTableRecord ugcRecord = (ActiveTableRecord) atr.clone(); ActiveTableRecord ugcRecord = (ActiveTableRecord) atr.clone();
ugcRecord.setUgcZone(ugc); ugcRecord.setUgcZone(ugc);
list.add(ugcRecord); list.add(ugcRecord);

View file

@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable; package com.raytheon.uf.common.activetable;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
/** /**
* TODO Add Description * Operational Active Table, separated so that practice and operational data go to separate tables.
* *
* <pre> * <pre>
* *
@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation * Feb 10, 2010 njensen Initial creation
* * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "activetableseq")
@Table(name = "activetable") @Table(name = "activetable")
@DynamicSerialize @DynamicSerialize
@org.hibernate.annotations.Table(appliesTo = "activetable", indexes = { @Index(name = "activetable_officeid_phensig_idx", columnNames = {
"officeid", "phensig" }) })
public class OperationalActiveTableRecord extends ActiveTableRecord implements public class OperationalActiveTableRecord extends ActiveTableRecord implements
Cloneable { Cloneable {

View file

@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable; package com.raytheon.uf.common.activetable;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
/** /**
* TODO Add Description * Practice Active Table, separated so that practice and operational data go to separate tables.
* *
* <pre> * <pre>
* *
@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation * Feb 10, 2010 njensen Initial creation
* * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "practice_activetableseq")
@Table(name = "practice_activetable") @Table(name = "practice_activetable")
@DynamicSerialize @DynamicSerialize
@org.hibernate.annotations.Table(appliesTo = "practice_activetable", indexes = { @Index(name = "practice_activetable_officeid_phensig_idx", columnNames = {
"officeid", "phensig" }) })
public class PracticeActiveTableRecord extends ActiveTableRecord implements public class PracticeActiveTableRecord extends ActiveTableRecord implements
Cloneable { Cloneable {

View file

@ -68,8 +68,7 @@
id="com.raytheon.uf.common.dataaccess" id="com.raytheon.uf.common.dataaccess"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.dataplugin" id="com.raytheon.uf.common.dataplugin"

View file

@ -19,21 +19,16 @@
**/ **/
package com.raytheon.uf.common.dataplugin.ffmp; package com.raytheon.uf.common.dataplugin.ffmp;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.InputStream;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.zip.GZIPInputStream;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
@ -43,8 +38,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.serialization.adapters.FloatWKBReader;
import com.raytheon.uf.common.serialization.adapters.FloatWKBWriter;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
@ -135,44 +128,9 @@ public class HucLevelGeometriesFactory {
if (f.exists()) { if (f.exists()) {
try { try {
File file = f.getFile(); map = (Map<Long, Geometry>) SerializationUtil
byte[] bytes = FileUtil.file2bytes(file, false); .transformFromThrift(FileUtil.file2bytes(
if (bytes[0] == (byte) 0x1f && bytes[1] == (byte) 0x8b) { f.getFile(), true));
// GZIP magic number is present, before 13.4.1 these
// files were compressed and stored in a different
// format, to maintain backwards compatibility we check
// for compression and deserialize the old way. This
// code can be removed any time after 13.5.1.
System.out.println("Decompressing geometry files.");
InputStream is = new ByteArrayInputStream(bytes);
is = new GZIPInputStream(is, bytes.length);
ByteArrayOutputStream os = new ByteArrayOutputStream(
bytes.length * 3 / 2);
byte[] buffer = new byte[1024 * 8];
int numRead = 0;
while ((numRead = is.read(buffer)) >= 0) {
os.write(buffer, 0, numRead);
}
bytes = os.toByteArray();
map = (Map<Long, Geometry>) SerializationUtil
.transformFromThrift(Map.class, bytes);
// save them back the new way.
persistGeometryMap(dataKey, cwa, huc, map);
} else {
Map<Long, byte[]> serializableMap = (Map<Long, byte[]>) SerializationUtil
.transformFromThrift(Map.class, bytes);
FloatWKBReader reader = new FloatWKBReader(
new GeometryFactory());
map = new HashMap<Long, Geometry>(
serializableMap.size());
for (Entry<Long, byte[]> entry : serializableMap
.entrySet()) {
InputStream in = new ByteArrayInputStream(
entry.getValue());
Geometry geom = reader.readGeometry(in);
map.put(entry.getKey(), geom);
}
}
int sizeGuess = Math.max( int sizeGuess = Math.max(
Math.abs(pfafs.size() - map.size()), 10); Math.abs(pfafs.size() - map.size()), 10);
pfafsToGenerate = new ArrayList<Long>(sizeGuess); pfafsToGenerate = new ArrayList<Long>(sizeGuess);
@ -389,23 +347,13 @@ public class HucLevelGeometriesFactory {
protected synchronized void persistGeometryMap(String dataKey, String cwa, protected synchronized void persistGeometryMap(String dataKey, String cwa,
String huc, Map<Long, Geometry> map) throws Exception { String huc, Map<Long, Geometry> map) throws Exception {
LocalizationContext lc = pathManager.getContext( LocalizationContext lc = pathManager.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
LocalizationFile lf = pathManager.getLocalizationFile(lc, LocalizationFile lf = pathManager.getLocalizationFile(lc,
getGeomPath(dataKey, cwa, huc)); getGeomPath(dataKey, cwa, huc));
FloatWKBWriter writer = new FloatWKBWriter(); FileUtil.bytes2File(SerializationUtil.transformToThrift(map),
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024); lf.getFile(), true);
Map<Long, byte[]> serializableMap = new HashMap<Long, byte[]>();
for (Entry<Long, Geometry> entry : map.entrySet()) {
writer.writeGeometry(entry.getValue(), bos);
serializableMap.put(entry.getKey(), bos.toByteArray());
bos.reset();
}
byte[] bytes = SerializationUtil.transformToThrift(serializableMap);
FileUtil.bytes2File(bytes, lf.getFile(), false);
lf.save(); lf.save();
} }
protected synchronized String getGeomPath(String dataKey, String cwa, protected synchronized String getGeomPath(String dataKey, String cwa,

View file

@ -0,0 +1,63 @@
/**
* 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.dataplugin.gfe.request;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* Request to create a new GFE database
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 2, 2013 #1969 randerso Initial creation
*
* </pre>
*
* @author randerso
* @version 1.0
*/
@DynamicSerialize
public class CreateNewDbRequest extends AbstractGfeRequest {
@DynamicSerializeElement
private DatabaseID dbId;
public CreateNewDbRequest() {
}
public CreateNewDbRequest(DatabaseID dbId) {
this.dbId = dbId;
}
public DatabaseID getDbId() {
return dbId;
}
public void setDbId(DatabaseID dbId) {
this.dbId = dbId;
}
}

View file

@ -20,7 +20,7 @@
package com.raytheon.uf.common.dataplugin.gfe.server.notify; package com.raytheon.uf.common.dataplugin.gfe.server.notify;
import java.util.ArrayList; import java.util.Collections;
import java.util.List; import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
@ -36,6 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 08/17/10 #6742 bphillip Initial Creation * 08/17/10 #6742 bphillip Initial Creation
* 05/02/13 #1969 randerso Removed inventory field, general cleanup
* *
* </pre> * </pre>
* *
@ -47,20 +48,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
public class DBInvChangeNotification extends GfeNotification implements public class DBInvChangeNotification extends GfeNotification implements
ISerializableObject { ISerializableObject {
/** The current database inventory */
@DynamicSerializeElement
private List<DatabaseID> inventory = new ArrayList<DatabaseID>();
/** The additions to the database inventory */ /** The additions to the database inventory */
@DynamicSerializeElement @DynamicSerializeElement
private List<DatabaseID> additions = new ArrayList<DatabaseID>(); private List<DatabaseID> additions = Collections.emptyList();
/** The deletions to the database inventory */ /** The deletions to the database inventory */
@DynamicSerializeElement @DynamicSerializeElement
private List<DatabaseID> deletions = new ArrayList<DatabaseID>(); private List<DatabaseID> deletions = Collections.emptyList();
/** /**
* Creates a new DBInvChangeNotification * Creates a new DBInvChangeNotification
@ -72,21 +66,24 @@ public class DBInvChangeNotification extends GfeNotification implements
/** /**
* Creates a new DBInvChangeNotification * Creates a new DBInvChangeNotification
* *
* @param inventory
* The current database inventory
* @param additions * @param additions
* The DatabaseIDs that have been added to the inventory * The DatabaseIDs that have been added to the inventory. Can be
* null if none.
* @param deletions * @param deletions
* The DatabaseIDs that have been deleted from the inventory * The DatabaseIDs that have been deleted from the inventory Can
* be null if none.
*/ */
public DBInvChangeNotification(List<DatabaseID> inventory, public DBInvChangeNotification(List<DatabaseID> additions,
List<DatabaseID> additions, List<DatabaseID> deletions, List<DatabaseID> deletions, String siteId) {
String siteId) { super(siteId);
// super(siteId);
this.inventory = inventory; if (additions != null) {
this.additions = additions; this.additions = additions;
this.deletions = deletions; }
this.siteID = siteId;
if (deletions != null) {
this.deletions = deletions;
}
} }
@Override @Override
@ -96,8 +93,7 @@ public class DBInvChangeNotification extends GfeNotification implements
} }
DBInvChangeNotification rhs = (DBInvChangeNotification) obj; DBInvChangeNotification rhs = (DBInvChangeNotification) obj;
if (inventory.containsAll(rhs.getInventory()) if (additions.containsAll(rhs.getAdditions())
&& additions.containsAll(rhs.getAdditions())
&& deletions.containsAll(rhs.getDeletions()) && deletions.containsAll(rhs.getDeletions())
&& siteID.equals(rhs.getSiteID())) { && siteID.equals(rhs.getSiteID())) {
return true; return true;
@ -109,27 +105,11 @@ public class DBInvChangeNotification extends GfeNotification implements
@Override @Override
public String toString() { public String toString() {
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
str.append("Inventory: ").append(this.inventory).append("\n");
str.append("Additions: ").append(this.additions).append("\n"); str.append("Additions: ").append(this.additions).append("\n");
str.append("Deletions: ").append(this.deletions).append("\n"); str.append("Deletions: ").append(this.deletions).append("\n");
return str.toString(); return str.toString();
} }
/**
* @return the inventory
*/
public List<DatabaseID> getInventory() {
return inventory;
}
/**
* @param inventory
* the inventory to set
*/
public void setInventory(List<DatabaseID> inventory) {
this.inventory = inventory;
}
/** /**
* @return the additions * @return the additions
*/ */

View file

@ -1,4 +1,4 @@
com.raytheon.uf.common.dataplugin.warning.UGCZone com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord
com.raytheon.uf.common.dataplugin.warning.WarningRecord com.raytheon.uf.common.dataplugin.warning.WarningRecord
com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord
com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration

View file

@ -20,39 +20,29 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashSet; import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.regex.Pattern;
import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance; import javax.persistence.Inheritance;
import javax.persistence.InheritanceType; import javax.persistence.InheritanceType;
import javax.persistence.OneToMany; import javax.persistence.MappedSuperclass;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.serialization.adapters.GeometryAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
/** /**
*
* Warning Record * Warning Record
* *
* <pre> * <pre>
@ -61,202 +51,171 @@ import com.vividsolutions.jts.geom.Geometry;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 03/12/2007 1003 bwoodle initial creation * 03/12/2007 1003 bwoodle initial creation
* 04/12/2013 1857 bgonzale Added SequenceGenerator annotation. * 04/12/2013 1857 bgonzale Added SequenceGenerator annotation.
* * 05/02/2013 1949 rjpeter Moved ugcZones to be a column inside table.
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
* @version 1 * @version 1
*/ */
@Entity @MappedSuperclass
@SequenceGenerator(name = PluginDataObject.ID_GEN) @SequenceGenerator(name = PluginDataObject.ID_GEN)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public abstract class AbstractWarningRecord extends PluginDataObject { public abstract class AbstractWarningRecord extends PluginDataObject {
private static final Pattern ugcSplitter = Pattern.compile(", ");
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@DataURI(position = 1) @DataURI(position = 1)
@Column(length = 32) @Column(length = 32)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String wmoid; private String wmoid;
@DataURI(position = 2) @DataURI(position = 2)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String pil; private String pil;
@DataURI(position = 3) @DataURI(position = 3)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String xxxid; private String xxxid;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String countyheader; private String countyheader;
@XmlElement @Column(name = "ugczones", columnDefinition = "text")
@DynamicSerializeElement @DynamicSerializeElement
@OneToMany(cascade = CascadeType.ALL, mappedBy = "parentWarning", fetch = FetchType.EAGER) protected String ugcZoneList;
protected Set<UGCZone> ugczones = new HashSet<UGCZone>();
@Transient
protected Set<String> ugcZones;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String vtecstr; private String vtecstr;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String productClass; private String productClass;
@DataURI(position = 4) @DataURI(position = 4)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String act; private String act;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
@Index(name = "query_index", columnNames = { "officeid", "phensig" })
private String officeid; private String officeid;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String phen; private String phen;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String sig; private String sig;
@DataURI(position = 5) @DataURI(position = 5)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String etn; private String etn;
/** vtec start time */ /** vtec start time */
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
@Column
private Calendar startTime; private Calendar startTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar endTime; private Calendar endTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar issueTime; private Calendar issueTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar purgeTime; private Calendar purgeTime;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private boolean ufn; private boolean ufn;
@Column(name = "geometry", columnDefinition = "geometry") @Column(name = "geometry", columnDefinition = "geometry")
@Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType") @Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement @DynamicSerializeElement
private Geometry geometry; private Geometry geometry;
@Transient @Transient
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String forecaster = ""; private String forecaster = "";
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Integer motdir; private Integer motdir;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Integer motspd; private Integer motspd;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String loc; private String loc;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String rawmessage; private String rawmessage;
@DataURI(position = 6) @DataURI(position = 6)
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private int seg; private int seg;
@DataURI(position = 7) @DataURI(position = 7)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String phensig; private String phensig;
@Transient @Transient
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String region; private String region;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String overviewText; private String overviewText;
/** segment text */ /** segment text */
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String segText; private String segText;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String locationID; private String locationID;
@Column(length = 2) @Column(length = 2)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String floodSeverity; private String floodSeverity;
@XmlAttribute @Column
@DynamicSerializeElement @DynamicSerializeElement
private String immediateCause; private String immediateCause;
@Column(length = 2) @Column(length = 2)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String floodRecordStatus; private String floodRecordStatus;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodBegin; private Calendar floodBegin;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodCrest; private Calendar floodCrest;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodEnd; private Calendar floodEnd;
@ -280,7 +239,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.setForecaster(old.getForecaster()); this.setForecaster(old.getForecaster());
this.setGeometry(old.getGeometry()); this.setGeometry(old.getGeometry());
this.setGeometry(old.getGeometry()); this.setGeometry(old.getGeometry());
this.setIdentifier(old.getIdentifier());
this.setInsertTime(old.getInsertTime()); this.setInsertTime(old.getInsertTime());
this.setIssueTime(old.getIssueTime()); this.setIssueTime(old.getIssueTime());
this.setLoc(old.getLoc()); this.setLoc(old.getLoc());
@ -315,7 +273,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
*/ */
public AbstractWarningRecord(String uri) { public AbstractWarningRecord(String uri) {
super(uri); super(uri);
identifier = java.util.UUID.randomUUID().toString();
} }
@Override @Override
@ -553,21 +510,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.purgeTime = purgeTime; this.purgeTime = purgeTime;
} }
/**
* @return the ugczones
*/
public Set<UGCZone> getUgczones() {
return ugczones;
}
/**
* @param ugczones
* the ugczones to set
*/
public void setUgczones(Set<UGCZone> ugczones) {
this.ugczones = ugczones;
}
/** /**
* @return the region * @return the region
*/ */
@ -688,8 +630,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.floodEnd = floodEnd; this.floodEnd = floodEnd;
} }
public abstract void setUgcs(List<String> list);
/** /**
* @return the ufn * @return the ufn
*/ */
@ -735,13 +675,40 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.segText = segText; this.segText = segText;
} }
public String[] getUgcsString() { public void setUgcZones(Set<String> list) {
String[] s = new String[ugczones.size()]; ugcZones = new LinkedHashSet<String>(list);
UGCZone[] ugcs = ugczones.toArray(new UGCZone[ugczones.size()]); StringBuilder builder = new StringBuilder(ugcZones.size() * 8);
for (int i = 0; i < ugcs.length; i++) { boolean addComma = false;
s[i] = ugcs[i].getZone(); for (String ugc : list) {
if (addComma) {
builder.append(", ");
} else {
addComma = true;
}
builder.append(ugc);
} }
return s; ugcZoneList = builder.toString();
} }
public Set<String> getUgcZones() {
if (ugcZones == null) {
ugcZones = new LinkedHashSet<String>();
if ((ugcZoneList != null) && (ugcZoneList.length() > 0)) {
String[] zones = ugcSplitter.split(ugcZoneList);
ugcZones.addAll(Arrays.asList(zones));
}
}
return ugcZones;
}
public String getUgcZoneList() {
return ugcZoneList;
}
public void setUgcZoneList(String ugcZoneList) {
this.ugcZoneList = ugcZoneList;
this.ugcZones = null;
}
} }

View file

@ -20,8 +20,6 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.List;
import javax.persistence.Access; import javax.persistence.Access;
import javax.persistence.AccessType; import javax.persistence.AccessType;
import javax.persistence.Column; import javax.persistence.Column;
@ -29,9 +27,6 @@ import javax.persistence.Entity;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
@ -46,9 +41,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 10/04/2011 10049 bgonzale initial creation * 10/04/2011 10049 bgonzale initial creation
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 02, 2013 1949 rjpeter Removed ugcZones.
* May 07, 2013 1869 bsteffen Remove dataURI column from * May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject. * PluginDataObject.
* *
@ -64,14 +60,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
*/ */
@org.hibernate.annotations.Table( @org.hibernate.annotations.Table(appliesTo = "practicewarning", indexes = {
appliesTo = "practicewarning", @Index(name = "practicewarning_refTimeIndex", columnNames = {
indexes = { "refTime", "forecastTime" }),
@Index(name = "practicewarning_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) @Index(name = "practicewarning_office_phensig_index", columnNames = {
} "officeid", "phensig" }) })
)
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class PracticeWarningRecord extends AbstractWarningRecord { public class PracticeWarningRecord extends AbstractWarningRecord {
@ -104,17 +97,7 @@ public class PracticeWarningRecord extends AbstractWarningRecord {
*/ */
public PracticeWarningRecord(String uri) { public PracticeWarningRecord(String uri) {
super(uri); super(uri);
identifier = java.util.UUID.randomUUID().toString();
} }
@Override
public void setUgcs(List<String> list) {
ugczones.clear();
for (String s : list) {
ugczones.add(new UGCZone(s, this));
}
}
@Override @Override
@Column @Column
@Access(AccessType.PROPERTY) @Access(AccessType.PROPERTY)

View file

@ -1,137 +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.dataplugin.warning;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* UGC Zones are part of Warning Records. This class will be utilized by the
* Warning Decoder.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 12, 2008 bwoodle Initial creation
*
* </pre>
*
* @author bwoodle
* @version 1.0
*/
@Entity
@Table(name = "warning_ugczone")
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class UGCZone extends PersistableDataObject implements
ISerializableObject {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@XmlAttribute
@DynamicSerializeElement
private Integer key;
@Column(length = 8)
@XmlAttribute
@DynamicSerializeElement
private String zone;
@ManyToOne
@JoinColumn(name = "parentWarning", nullable = false)
private AbstractWarningRecord parentWarning;
public UGCZone() {
}
public UGCZone(String zone) {
this.zone = zone;
}
public UGCZone(String zone, AbstractWarningRecord warning) {
this.zone = zone;
parentWarning = warning;
}
public String toString() {
return zone;
}
/**
* @return the key
*/
public Integer getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(Integer key) {
this.key = key;
}
/**
* @return the zone
*/
public String getZone() {
return zone;
}
/**
* @param zone
* the zone to set
*/
public void setZone(String zone) {
this.zone = zone;
}
/**
* @return the parentWarning
*/
public AbstractWarningRecord getParentWarning() {
return parentWarning;
}
/**
* @param parentWarning
* the parentWarning to set
*/
public void setParentWarning(AbstractWarningRecord parentWarning) {
this.parentWarning = parentWarning;
}
}

View file

@ -21,7 +21,6 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.Access; import javax.persistence.Access;
@ -31,9 +30,6 @@ import javax.persistence.Entity;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
@ -49,32 +45,28 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 03/12/2007 1003 bwoodle initial creation * 03/12/2007 1003 bwoodle initial creation
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 02, 2013 1949 rjpeter Removed ugcZones.
* May 07, 2013 1869 bsteffen Remove dataURI column from * May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject. * PluginDataObject.
*
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
* @version 1 * @version 1
*/ */
@Entity @Entity
@XmlAccessorType(XmlAccessType.NONE)
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq") @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq")
@Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
/* /*
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
*/ */
@org.hibernate.annotations.Table( @org.hibernate.annotations.Table(appliesTo = "warning", indexes = {
appliesTo = "warning", @Index(name = "warning_refTimeIndex", columnNames = { "refTime",
indexes = { "forecastTime" }),
@Index(name = "warning_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) @Index(name = "warning_office_phensig_index", columnNames = {
} "officeid", "phensig" }) })
)
@XmlRootElement
@DynamicSerialize @DynamicSerialize
public class WarningRecord extends AbstractWarningRecord { public class WarningRecord extends AbstractWarningRecord {
@ -107,7 +99,7 @@ public class WarningRecord extends AbstractWarningRecord {
private static Map<String, WarningAction> unknownMap = new HashMap<String, WarningAction>(); private static Map<String, WarningAction> unknownMap = new HashMap<String, WarningAction>();
private String text; private final String text;
private WarningAction(String text) { private WarningAction(String text) {
this.text = text; this.text = text;
@ -168,14 +160,6 @@ public class WarningRecord extends AbstractWarningRecord {
public WarningRecord(String uri) { public WarningRecord(String uri) {
super(uri); super(uri);
} }
public void setUgcs(List<String> list) {
ugczones.clear();
for (String s : list) {
ugczones.add(new UGCZone(s, this));
}
}
@Override @Override
@Column @Column
@Access(AccessType.PROPERTY) @Access(AccessType.PROPERTY)

View file

@ -25,6 +25,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 15, 2010 mschenke Initial creation * Nov 15, 2010 mschenke Initial creation
* Apr 28, 2013 1955 jsanchez Added an ignoreUserData flag to intersection method.
* *
* </pre> * </pre>
* *
@ -93,7 +94,7 @@ public class GeometryUtil {
GeometryFactory gf = new GeometryFactory(); GeometryFactory gf = new GeometryFactory();
List<Geometry> intersection = new ArrayList<Geometry>( List<Geometry> intersection = new ArrayList<Geometry>(
g1.getNumGeometries() + g2.getNumGeometries()); g1.getNumGeometries() + g2.getNumGeometries());
intersection(g1, g2, intersection); intersection(g1, g2, intersection, false);
Geometry rval = gf.createGeometryCollection(intersection Geometry rval = gf.createGeometryCollection(intersection
.toArray(new Geometry[intersection.size()])); .toArray(new Geometry[intersection.size()]));
rval.setUserData(g2.getUserData()); rval.setUserData(g2.getUserData());
@ -101,21 +102,24 @@ public class GeometryUtil {
} }
private static void intersection(Geometry g1, Geometry g2, private static void intersection(Geometry g1, Geometry g2,
List<Geometry> intersections) { List<Geometry> intersections, boolean ignoreUserData) {
if (g1 instanceof GeometryCollection) { if (g1 instanceof GeometryCollection) {
for (int i = 0; i < g1.getNumGeometries(); ++i) { for (int i = 0; i < g1.getNumGeometries(); ++i) {
intersection(g1.getGeometryN(i), g2, intersections); intersection(g1.getGeometryN(i), g2, intersections,
ignoreUserData);
} }
} else { } else {
if (g2 instanceof GeometryCollection) { if (g2 instanceof GeometryCollection) {
for (int i = 0; i < g2.getNumGeometries(); ++i) { for (int i = 0; i < g2.getNumGeometries(); ++i) {
intersection(g1, g2.getGeometryN(i), intersections); intersection(g1, g2.getGeometryN(i), intersections,
ignoreUserData);
} }
} else { } else {
String g1Name = toString(g1.getUserData()); String g1Name = toString(g1.getUserData());
String g2Name = toString(g2.getUserData()); String g2Name = toString(g2.getUserData());
if ((g1Name == null || g2Name == null || g2Name.equals(g1Name))) { if (g1Name == null || g2Name == null || g2Name.equals(g1Name)
|| ignoreUserData) {
Geometry section = g1.intersection(g2); Geometry section = g1.intersection(g2);
if (section.isEmpty() == false) { if (section.isEmpty() == false) {
if (g2.getUserData() != null) { if (g2.getUserData() != null) {
@ -138,7 +142,8 @@ public class GeometryUtil {
/** /**
* Intersection between g1 and prepared geometry pg. Resulting Geometry will * Intersection between g1 and prepared geometry pg. Resulting Geometry will
* have user data from pg * have user data from pg. Using this method assumes that g1 and pg come
* from the same area source (i.e County, Zone)
* *
* @param g1 * @param g1
* @param g2 * @param g2
@ -146,10 +151,25 @@ public class GeometryUtil {
* @return the intersection between g1 and g2 * @return the intersection between g1 and g2
*/ */
public static Geometry intersection(Geometry g1, PreparedGeometry pg) { public static Geometry intersection(Geometry g1, PreparedGeometry pg) {
return intersection(g1, pg, false);
}
/**
* Intersection between g1 and prepared geometry pg. Resulting Geometry will
* have user data from pg. Setting ignoreUserDate to 'true' will collect
* intersecting geometries although g1 and pg are from different sources.
*
* @param g1
* @param pg
* @param ignoreUserData
* @return
*/
public static Geometry intersection(Geometry g1, PreparedGeometry pg,
boolean ignoreUserData) {
GeometryFactory gf = new GeometryFactory(); GeometryFactory gf = new GeometryFactory();
List<Geometry> intersection = new ArrayList<Geometry>( List<Geometry> intersection = new ArrayList<Geometry>(
g1.getNumGeometries() + 1); g1.getNumGeometries() + 1);
intersection(g1, pg, intersection); intersection(g1, pg, intersection, ignoreUserData);
Geometry rval = gf.createGeometryCollection(intersection Geometry rval = gf.createGeometryCollection(intersection
.toArray(new Geometry[intersection.size()])); .toArray(new Geometry[intersection.size()]));
rval.setUserData(pg.getGeometry().getUserData()); rval.setUserData(pg.getGeometry().getUserData());
@ -157,19 +177,21 @@ public class GeometryUtil {
} }
private static void intersection(Geometry g1, PreparedGeometry pg, private static void intersection(Geometry g1, PreparedGeometry pg,
List<Geometry> intersections) { List<Geometry> intersections, boolean ignoreUserData) {
if (g1 instanceof GeometryCollection) { if (g1 instanceof GeometryCollection) {
for (int i = 0; i < g1.getNumGeometries(); ++i) { for (int i = 0; i < g1.getNumGeometries(); ++i) {
intersection(g1.getGeometryN(i), pg, intersections); intersection(g1.getGeometryN(i), pg, intersections,
ignoreUserData);
} }
} else { } else {
String g1Name = toString(g1.getUserData()); String g1Name = toString(g1.getUserData());
String g2Name = toString(pg.getGeometry().getUserData()); String g2Name = toString(pg.getGeometry().getUserData());
if ((g2Name != null && g2Name.equals(g1Name)) if ((g2Name != null && g2Name.equals(g1Name))
|| ((g1Name == null || g2Name == null) && pg.intersects(g1))) { || ((g1Name == null || g2Name == null || ignoreUserData) && pg
.intersects(g1))) {
Geometry g2 = pg.getGeometry(); Geometry g2 = pg.getGeometry();
intersection(g1, g2, intersections); intersection(g1, g2, intersections, ignoreUserData);
} }
} }
} }

View file

@ -2,6 +2,6 @@
<?eclipse-pydev version="1.0"?> <?eclipse-pydev version="1.0"?>
<pydev_project> <pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property> <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
</pydev_project> </pydev_project>

View file

@ -1,19 +1,23 @@
diff -crB a/qpid-java.spec b/qpid-java.spec diff -crB a/qpid-java.spec b/qpid-java.spec
*** a/qpid-java.spec 2013-05-14 20:24:21.000000000 -0500 *** a/qpid-java.spec 2013-05-14 20:24:21.000000000 -0500
--- b/qpid-java.spec 2013-05-15 16:24:20.000000000 -0500 --- b/qpid-java.spec 2013-05-14 20:23:49.000000000 -0500
*************** ***************
*** 1,4 **** *** 1,6 ****
! Name: qpid-java ! Name: qpid-java
Version: 0.18 Version: 0.18
! Release: 2%{?dist} ! Release: 2%{?dist}
Summary: Java implementation of Apache Qpid Summary: Java implementation of Apache Qpid
--- 1,6 ---- License: Apache Software License
Group: Development/Java
--- 1,8 ----
! %define _awips2_directory "/awips2/qpid" ! %define _awips2_directory "/awips2/qpid"
! !
! Name: awips2-qpid-java ! Name: awips2-qpid-java
Version: 0.18 Version: 0.18
! Release: 3%{?dist} ! Release: 1%{?dist}
Summary: Java implementation of Apache Qpid Summary: Java implementation of Apache Qpid
License: Apache Software License
Group: Development/Java
*************** ***************
*** 12,21 **** *** 12,21 ****
--- 14,28 ---- --- 14,28 ----
@ -45,7 +49,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Requires: log4j >= 1.2.12 Requires: log4j >= 1.2.12
%description client %description client
--- 42,60 ---- --- 42,61 ----
%description common %description common
Java implementation of Apache Qpid - common files Java implementation of Apache Qpid - common files
@ -53,6 +57,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
+ Summary: Java implementation of Apache Qpid - broker files + Summary: Java implementation of Apache Qpid - broker files
+ Group: Development/Java + Group: Development/Java
+ BuildArch: noarch + BuildArch: noarch
+ Provides: awips2-base-component
+ +
+ %description broker + %description broker
+ Java implementation of Apache Qpid - broker files + Java implementation of Apache Qpid - broker files
@ -74,7 +79,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%description example %description example
Java implementation of Apache Qpid - example Java implementation of Apache Qpid - example
--- 64,70 ---- --- 65,71 ----
Summary: Java implementation of Apache Qpid - example Summary: Java implementation of Apache Qpid - example
Group: Development/Java Group: Development/Java
BuildArch: noarch BuildArch: noarch
@ -84,7 +89,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Java implementation of Apache Qpid - example Java implementation of Apache Qpid - example
*************** ***************
*** 58,67 **** *** 58,67 ****
--- 73,97 ---- --- 74,98 ----
%setup -q -n %{qpid_src_dir} %setup -q -n %{qpid_src_dir}
mkdir -p java/lib/required mkdir -p java/lib/required
tar -xvzf %SOURCE1 -C java/lib/required tar -xvzf %SOURCE1 -C java/lib/required
@ -119,7 +124,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
# blacklisted jars are either provided by the Requires: or not needed. # blacklisted jars are either provided by the Requires: or not needed.
BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests"
--- 100,114 ---- --- 101,115 ----
( (
cd %{qpid_src_dir}/java cd %{qpid_src_dir}/java
@ -184,7 +189,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%changelog %changelog
* Thu Sep 6 2012 Irina Boverman <iboverma@redhat.com> - 0.18-2 * Thu Sep 6 2012 Irina Boverman <iboverma@redhat.com> - 0.18-2
--- 122,233 ---- --- 123,234 ----
cd .. cd ..

View file

@ -1,29 +1,29 @@
Copyright (c) 2010 by the Werkzeug Team, see AUTHORS for more details. Copyright (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are
met: met:
* Redistributions of source code must retain the above copyright * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided disclaimer in the documentation and/or other materials provided
with the distribution. with the distribution.
* The names of the contributors may not be used to endorse or * The names of the contributors may not be used to endorse or
promote products derived from this software without specific promote products derived from this software without specific
prior written permission. prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.