ugcZones = watch.getUgcZones();
+ ugcZones.addAll(watchrec.getUgcZones());
}
watches.put(key, watch);
}
@@ -410,7 +408,7 @@ public class WatchesResource extends AbstractWWAResource {
long now = SimulatedTime.getSystemTime().getTime().getTime();
long endTime = rec.getEndTime().getTimeInMillis();
synchronized (expTaskSet) {
- if (endTime > now && !expTaskSet.contains(new Long(endTime))) {
+ if ((endTime > now) && !expTaskSet.contains(new Long(endTime))) {
WarningExpirationTask task = new WarningExpirationTask(this);
timer.schedule(task, rec.getEndTime().getTime());
expTaskSet.add(new Long(endTime));
@@ -429,7 +427,7 @@ public class WatchesResource extends AbstractWWAResource {
Long time = new Long(triggerTime);
// remove the instance of the trigger time from the map
synchronized (expTaskSet) {
- if (expTaskSet != null && expTaskSet.contains(time)) {
+ if ((expTaskSet != null) && expTaskSet.contains(time)) {
expTaskSet.remove(time);
}
}
diff --git a/deltaScripts/13.4.1/alterWarningTables.sql b/deltaScripts/13.4.1/alterWarningTables.sql
new file mode 100644
index 0000000000..f09a7f4da9
--- /dev/null
+++ b/deltaScripts/13.4.1/alterWarningTables.sql
@@ -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;
+
diff --git a/deltaScripts/13.4.1/parseUgcZones.py b/deltaScripts/13.4.1/parseUgcZones.py
new file mode 100644
index 0000000000..ff3792f0f8
--- /dev/null
+++ b/deltaScripts/13.4.1/parseUgcZones.py
@@ -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()
diff --git a/deltaScripts/13.4.1/updateWarningTables.sh b/deltaScripts/13.4.1/updateWarningTables.sh
new file mode 100644
index 0000000000..7a3a48091c
--- /dev/null
+++ b/deltaScripts/13.4.1/updateWarningTables.sh
@@ -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"
diff --git a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py
index 9703c467c8..c3a023b584 100644
--- a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py
+++ b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py
@@ -798,7 +798,7 @@ usage: VTECDecoder -f productfilename -d -a activeTableName
template['pil'] = self._remapPil(template['phen'],
template['sig'], self._productPil)
- template['ugcs'] = ugcs
+ template['ugcZoneList'] = ", ".join(ugcs)
state = ugcstring[0:2]
if REGIONS.has_key(state):
template['region'] = REGIONS[state]
diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java
index 3328c3d31c..eb68d705d3 100644
--- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/ActiveTableRecord.java
@@ -24,12 +24,12 @@ import java.util.Calendar;
import java.util.List;
import javax.persistence.Column;
-import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
+import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import org.hibernate.annotations.Type;
@@ -51,22 +51,23 @@ import com.vividsolutions.jts.geom.Geometry;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 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
*
*
* @author njensen
* @version 1.0
*/
-
-@Entity
+@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@DynamicSerialize
public abstract class ActiveTableRecord extends PersistableDataObject {
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
protected int id;
@@ -1079,7 +1080,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
atr.setWmoid(wr.getWmoid());
atr.setXxxid(wr.getXxxid());
- for (String ugc : wr.getUgcsString()) {
+ for (String ugc : wr.getUgcZones()) {
ActiveTableRecord ugcRecord = (ActiveTableRecord) atr.clone();
ugcRecord.setUgcZone(ugc);
list.add(ugcRecord);
diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.java
index b157bf8c3f..44a7efcff6 100644
--- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.java
@@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable;
import javax.persistence.Entity;
+import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
+import org.hibernate.annotations.Index;
+
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.
*
*
*
@@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation
- *
+ * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
*
*
* @author njensen
@@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/
@Entity
+@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "activetableseq")
@Table(name = "activetable")
@DynamicSerialize
+@org.hibernate.annotations.Table(appliesTo = "activetable", indexes = { @Index(name = "activetable_officeid_phensig_idx", columnNames = {
+ "officeid", "phensig" }) })
public class OperationalActiveTableRecord extends ActiveTableRecord implements
Cloneable {
diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.java
index 67a4792e22..fc419204be 100644
--- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.java
@@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable;
import javax.persistence.Entity;
+import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
+import org.hibernate.annotations.Index;
+
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.
*
*
*
@@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation
- *
+ * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
*
*
* @author njensen
@@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/
@Entity
+@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "practice_activetableseq")
@Table(name = "practice_activetable")
@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
Cloneable {
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java
index 60cf06b550..d158cd791b 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasinData.java
@@ -49,7 +49,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 06/22/09 2152 D. Hladky Initial release
* 01/27/13 1478 D. Hladky Added support for write of aggregate record cache
* 01/27/13 1569 D. Hladky Added support for write of aggregate record cache
- * Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp
+ * 04/16/13 1912 bsteffen Initial bulk hdf5 access for ffmp
+ * 05/09/13 1919 mpduff Use parent pfaf instead of lookupId.
*
*
*
@@ -58,10 +59,6 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*/
@DynamicSerialize
public class FFMPBasinData implements ISerializableObject {
-
- /**
- *
- */
private static final long serialVersionUID = 8162247989509750715L;
public static final double GUIDANCE_MISSING = -999999.0;
@@ -76,12 +73,12 @@ public class FFMPBasinData implements ISerializableObject {
/**
* Pending load tasks that need to be run to fully populate basins
*/
- private List tasks = new ArrayList();
+ private final List tasks = new ArrayList();
/**
* Cache of basins in order for easy population from Load Tasks.
*/
- private Map orderedBasinsCache = new HashMap();
+ private final Map orderedBasinsCache = new HashMap();
/**
* Public one arg constructor
@@ -690,7 +687,7 @@ public class FFMPBasinData implements ISerializableObject {
FFMPBasin basin = this.basins.get(fvgbmd.getLookupId());
if (basin == null) {
basin = new FFMPVirtualGageBasin(fvgbmd.getLid(),
- fvgbmd.getLookupId(), false);
+ fvgbmd.getParentPfaf(), false);
this.basins.put(fvgbmd.getLookupId(), basin);
}
basins[j++] = basin;
@@ -702,6 +699,9 @@ public class FFMPBasinData implements ISerializableObject {
}
}
+ /**
+ * Load now.
+ */
public void loadNow() {
synchronized (tasks) {
if (!tasks.isEmpty()) {
@@ -728,6 +728,9 @@ public class FFMPBasinData implements ISerializableObject {
this.date = date;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public void process(FloatDataRecord record) {
float[] values = record.getFloatData();
@@ -736,6 +739,9 @@ public class FFMPBasinData implements ISerializableObject {
}
}
+ /**
+ * Apply the value to the basin/
+ */
protected void applyValue(FFMPBasin basin, float value) {
if (basin.contains(date)) {
float curval = basin.getValue(date);
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
index d8b9b376f6..04a1422726 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -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.PracticeWarningRecord
com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java
index 76ec98bf6c..495421f5fd 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java
@@ -20,39 +20,29 @@
package com.raytheon.uf.common.dataplugin.warning;
+import java.util.Arrays;
import java.util.Calendar;
-import java.util.HashSet;
-import java.util.List;
+import java.util.LinkedHashSet;
import java.util.Set;
+import java.util.regex.Pattern;
-import javax.persistence.CascadeType;
import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
-import javax.persistence.OneToMany;
+import javax.persistence.MappedSuperclass;
import javax.persistence.SequenceGenerator;
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 com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
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.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry;
/**
- *
* Warning Record
*
*
@@ -61,202 +51,171 @@ import com.vividsolutions.jts.geom.Geometry;
* ------------ ---------- ----------- --------------------------
* 03/12/2007 1003 bwoodle initial creation
* 04/12/2013 1857 bgonzale Added SequenceGenerator annotation.
- *
+ * 05/02/2013 1949 rjpeter Moved ugcZones to be a column inside table.
*
*
* @author bwoodle
* @version 1
*/
-@Entity
+@MappedSuperclass
@SequenceGenerator(name = PluginDataObject.ID_GEN)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public abstract class AbstractWarningRecord extends PluginDataObject {
+ private static final Pattern ugcSplitter = Pattern.compile(", ");
private static final long serialVersionUID = 1L;
@DataURI(position = 1)
@Column(length = 32)
- @XmlAttribute
@DynamicSerializeElement
private String wmoid;
@DataURI(position = 2)
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String pil;
@DataURI(position = 3)
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String xxxid;
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String countyheader;
- @XmlElement
+ @Column(name = "ugczones", columnDefinition = "text")
@DynamicSerializeElement
- @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentWarning", fetch = FetchType.EAGER)
- protected Set ugczones = new HashSet();
+ protected String ugcZoneList;
+
+ @Transient
+ protected Set ugcZones;
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String vtecstr;
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String productClass;
@DataURI(position = 4)
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String act;
@Column(length = 8)
- @XmlAttribute
@DynamicSerializeElement
- @Index(name = "query_index", columnNames = { "officeid", "phensig" })
private String officeid;
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String phen;
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String sig;
@DataURI(position = 5)
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String etn;
/** vtec start time */
- @XmlAttribute
@DynamicSerializeElement
+ @Column
private Calendar startTime;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar endTime;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar issueTime;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar purgeTime;
@Column(length = 8)
- @XmlAttribute
@DynamicSerializeElement
private boolean ufn;
@Column(name = "geometry", columnDefinition = "geometry")
@Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType")
- @XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Geometry geometry;
@Transient
- @XmlAttribute
@DynamicSerializeElement
private String forecaster = "";
@Column
- @XmlAttribute
@DynamicSerializeElement
private Integer motdir;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Integer motspd;
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String loc;
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String rawmessage;
@DataURI(position = 6)
@Column
- @XmlAttribute
@DynamicSerializeElement
private int seg;
@DataURI(position = 7)
@Column(length = 4)
- @XmlAttribute
@DynamicSerializeElement
private String phensig;
@Transient
- @XmlAttribute
@DynamicSerializeElement
private String region;
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String overviewText;
/** segment text */
@Column(columnDefinition = "text")
- @XmlAttribute
@DynamicSerializeElement
private String segText;
@Column(length = 8)
- @XmlAttribute
@DynamicSerializeElement
private String locationID;
@Column(length = 2)
- @XmlAttribute
@DynamicSerializeElement
private String floodSeverity;
- @XmlAttribute
+ @Column
@DynamicSerializeElement
private String immediateCause;
@Column(length = 2)
- @XmlAttribute
@DynamicSerializeElement
private String floodRecordStatus;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar floodBegin;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar floodCrest;
@Column
- @XmlAttribute
@DynamicSerializeElement
private Calendar floodEnd;
@@ -280,7 +239,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.setForecaster(old.getForecaster());
this.setGeometry(old.getGeometry());
this.setGeometry(old.getGeometry());
- this.setIdentifier(old.getIdentifier());
this.setInsertTime(old.getInsertTime());
this.setIssueTime(old.getIssueTime());
this.setLoc(old.getLoc());
@@ -315,7 +273,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
*/
public AbstractWarningRecord(String uri) {
super(uri);
- identifier = java.util.UUID.randomUUID().toString();
}
@Override
@@ -553,21 +510,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.purgeTime = purgeTime;
}
- /**
- * @return the ugczones
- */
- public Set getUgczones() {
- return ugczones;
- }
-
- /**
- * @param ugczones
- * the ugczones to set
- */
- public void setUgczones(Set ugczones) {
- this.ugczones = ugczones;
- }
-
/**
* @return the region
*/
@@ -688,8 +630,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.floodEnd = floodEnd;
}
- public abstract void setUgcs(List list);
-
/**
* @return the ufn
*/
@@ -735,13 +675,40 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.segText = segText;
}
- public String[] getUgcsString() {
- String[] s = new String[ugczones.size()];
- UGCZone[] ugcs = ugczones.toArray(new UGCZone[ugczones.size()]);
- for (int i = 0; i < ugcs.length; i++) {
- s[i] = ugcs[i].getZone();
+ public void setUgcZones(Set list) {
+ ugcZones = new LinkedHashSet(list);
+ StringBuilder builder = new StringBuilder(ugcZones.size() * 8);
+ boolean addComma = false;
+ for (String ugc : list) {
+ if (addComma) {
+ builder.append(", ");
+ } else {
+ addComma = true;
+ }
+ builder.append(ugc);
}
- return s;
+ ugcZoneList = builder.toString();
}
+ public Set getUgcZones() {
+ if (ugcZones == null) {
+ ugcZones = new LinkedHashSet();
+
+ 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;
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java
index a9e1ca59d9..ffe748a7ed 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java
@@ -20,15 +20,10 @@
package com.raytheon.uf.common.dataplugin.warning;
-import java.util.List;
-
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
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;
@@ -43,9 +38,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * 10/04/2011 10049 bgonzale initial creation
- * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
- * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
+ * 10/04/2011 10049 bgonzale initial creation
+ * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
+ * May 02, 2013 1949 rjpeter Removed ugcZones.
*
*
*
@@ -59,14 +55,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
*/
-@org.hibernate.annotations.Table(
- appliesTo = "practicewarning",
- indexes = {
- @Index(name = "practicewarning_refTimeIndex", columnNames = { "refTime", "forecastTime" } )
- }
-)
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.NONE)
+@org.hibernate.annotations.Table(appliesTo = "practicewarning", indexes = {
+ @Index(name = "practicewarning_refTimeIndex", columnNames = {
+ "refTime", "forecastTime" }),
+ @Index(name = "practicewarning_office_phensig_index", columnNames = {
+ "officeid", "phensig" }) })
@DynamicSerialize
public class PracticeWarningRecord extends AbstractWarningRecord {
@@ -99,15 +92,5 @@ public class PracticeWarningRecord extends AbstractWarningRecord {
*/
public PracticeWarningRecord(String uri) {
super(uri);
- identifier = java.util.UUID.randomUUID().toString();
}
-
- @Override
- public void setUgcs(List list) {
- ugczones.clear();
- for (String s : list) {
- ugczones.add(new UGCZone(s, this));
- }
- }
-
}
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java
index 6f2acadde3..c26b9c102c 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java
@@ -21,16 +21,12 @@
package com.raytheon.uf.common.dataplugin.warning;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
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;
@@ -46,30 +42,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 03/12/2007 1003 bwoodle initial creation
- * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
- * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
- *
+ * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
+ * May 02, 2013 1949 rjpeter Removed ugcZones.
*
*
* @author bwoodle
* @version 1
*/
@Entity
-@XmlAccessorType(XmlAccessType.NONE)
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq")
@Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
*/
-@org.hibernate.annotations.Table(
- appliesTo = "warning",
- indexes = {
- @Index(name = "warning_refTimeIndex", columnNames = { "refTime", "forecastTime" } )
- }
-)
-
-@XmlRootElement
+@org.hibernate.annotations.Table(appliesTo = "warning", indexes = {
+ @Index(name = "warning_refTimeIndex", columnNames = { "refTime",
+ "forecastTime" }),
+ @Index(name = "warning_office_phensig_index", columnNames = {
+ "officeid", "phensig" }) })
@DynamicSerialize
public class WarningRecord extends AbstractWarningRecord {
@@ -102,7 +94,7 @@ public class WarningRecord extends AbstractWarningRecord {
private static Map unknownMap = new HashMap();
- private String text;
+ private final String text;
private WarningAction(String text) {
this.text = text;
@@ -163,12 +155,4 @@ public class WarningRecord extends AbstractWarningRecord {
public WarningRecord(String uri) {
super(uri);
}
-
- public void setUgcs(List list) {
- ugczones.clear();
- for (String s : list) {
- ugczones.add(new UGCZone(s, this));
- }
- }
-
}
diff --git a/rpms/awips2.core/Installer.hydroapps/component.spec b/rpms/awips2.core/Installer.hydroapps/component.spec
index 0002a05ba6..9bc2720825 100644
--- a/rpms/awips2.core/Installer.hydroapps/component.spec
+++ b/rpms/awips2.core/Installer.hydroapps/component.spec
@@ -47,6 +47,11 @@ if [ $? -ne 0 ]; then
exit 1
fi
+/usr/bin/find %{_build_root}/awips2/edex/data/share -name .gitignore -exec rm -rf {} \;
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+
%pre
%post
diff --git a/rpms/awips2.edex/Installer.edex-base/component.spec b/rpms/awips2.edex/Installer.edex-base/component.spec
index 67d35fdc3d..83461e5cbb 100644
--- a/rpms/awips2.edex/Installer.edex-base/component.spec
+++ b/rpms/awips2.edex/Installer.edex-base/component.spec
@@ -72,6 +72,13 @@ if [ $? -ne 0 ]; then
fi
popd > /dev/null
+# remove any .gitignore files
+# currently, the ebxml webapp includes a .gitignore file
+/usr/bin/find ${RPM_BUILD_ROOT}/awips2/edex -name .gitignore -exec rm -f {} \;
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+
INSTALLER_RPM="%{_baseline_workspace}/rpms"
# copy the service script.
EDEX_BASE="${INSTALLER_RPM}/awips2.edex/Installer.edex-base"
@@ -152,4 +159,4 @@ rm -rf ${RPM_BUILD_ROOT}
%dir /awips2/edex/bin
/awips2/edex/bin/*.sh
-%attr(744,root,root) /etc/init.d/*
\ No newline at end of file
+%attr(744,root,root) /etc/init.d/*
diff --git a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0
index a6a397ad95..64df514a2f 100644
--- a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0
+++ b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0
@@ -1,6 +1,6 @@
diff -crB a/qpid-java.spec b/qpid-java.spec
-*** a/qpid-java.spec 2013-04-15 16:19:49.000000000 -0500
---- b/qpid-java.spec 2013-04-24 13:31:29.000000000 -0500
+*** a/qpid-java.spec 2013-05-14 20:24:21.000000000 -0500
+--- b/qpid-java.spec 2013-05-14 20:23:49.000000000 -0500
***************
*** 1,6 ****
! Name: qpid-java
@@ -10,8 +10,8 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
License: Apache Software License
Group: Development/Java
--- 1,8 ----
-+ %define _awips2_directory "/awips2/qpid"
-+
+! %define _awips2_directory "/awips2/qpid"
+!
! Name: awips2-qpid-java
Version: 0.18
! Release: 1%{?dist}
@@ -37,8 +37,19 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
***************
-*** 35,40 ****
---- 42,55 ----
+*** 35,45 ****
+ %description common
+ Java implementation of Apache Qpid - common files
+
+ %package client
+ Summary: Java implementation of Apache Qpid - client
+ Group: Development/Java
+ BuildArch: noarch
+! Requires: qpid-java-common = %{version}-%{release}
+ Requires: log4j >= 1.2.12
+
+ %description client
+--- 42,61 ----
%description common
Java implementation of Apache Qpid - common files
@@ -46,6 +57,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
+ Summary: Java implementation of Apache Qpid - broker files
+ Group: Development/Java
+ BuildArch: noarch
++ Provides: awips2-base-component
+
+ %description broker
+ Java implementation of Apache Qpid - broker files
@@ -53,9 +65,31 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%package client
Summary: Java implementation of Apache Qpid - client
Group: Development/Java
+ BuildArch: noarch
+! Requires: awips2-qpid-java-common = %{version}-%{release}
+ Requires: log4j >= 1.2.12
+
+ %description client
+***************
+*** 49,55 ****
+ Summary: Java implementation of Apache Qpid - example
+ Group: Development/Java
+ BuildArch: noarch
+! Requires: qpid-java-client = %{version}-%{release}
+
+ %description example
+ Java implementation of Apache Qpid - example
+--- 65,71 ----
+ Summary: Java implementation of Apache Qpid - example
+ Group: Development/Java
+ BuildArch: noarch
+! Requires: awips2-qpid-java-client = %{version}-%{release}
+
+ %description example
+ Java implementation of Apache Qpid - example
***************
*** 58,67 ****
---- 73,97 ----
+--- 74,98 ----
%setup -q -n %{qpid_src_dir}
mkdir -p java/lib/required
tar -xvzf %SOURCE1 -C java/lib/required
@@ -90,7 +124,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
# blacklisted jars are either provided by the Requires: or not needed.
BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests"
---- 100,114 ----
+--- 101,115 ----
(
cd %{qpid_src_dir}/java
@@ -155,7 +189,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%changelog
* Thu Sep 6 2012 Irina Boverman - 0.18-2
---- 122,233 ----
+--- 123,234 ----
cd ..
diff --git a/rpms/build/i386/build.sh b/rpms/build/i386/build.sh
index c7469686ff..96c4930376 100644
--- a/rpms/build/i386/build.sh
+++ b/rpms/build/i386/build.sh
@@ -85,28 +85,28 @@ if [ "${2}" = "-nobinlightning" ]; then
fi
if [ "${1}" = "-python-qpid" ]; then
- buildRPM "awips2"
- buildRPM "awips2-python-qpid"
- buildRPM "awips2-python"
- buildRPM "awips2-python-cherrypy"
+# buildRPM "awips2"
+# buildRPM "awips2-python-qpid"
+# buildRPM "awips2-python"
+# buildRPM "awips2-python-cherrypy"
buildRPM "awips2-python-dynamicserialize"
- buildRPM "awips2-python-nose"
- buildRPM "awips2-python-numpy"
- buildRPM "awips2-python-h5py"
- buildRPM "awips2-python-jimporter"
- buildRPM "awips2-python-matplotlib"
- buildRPM "awips2-python-pil"
- buildRPM "awips2-python-pmw"
- buildRPM "awips2-python-pupynere"
- buildRPM "awips2-python-scientific"
- buildRPM "awips2-python-scipy"
- buildRPM "awips2-python-tables"
- buildRPM "awips2-python-thrift"
- buildRPM "awips2-python-tpg"
- buildRPM "awips2-python-ufpy"
- buildRPM "awips2-python-werkzeug"
- buildRPM "awips2-python-pygtk"
- buildRPM "awips2-python-pycairo"
+# buildRPM "awips2-python-nose"
+# buildRPM "awips2-python-numpy"
+# buildRPM "awips2-python-h5py"
+# buildRPM "awips2-python-jimporter"
+# buildRPM "awips2-python-matplotlib"
+# buildRPM "awips2-python-pil"
+# buildRPM "awips2-python-pmw"
+# buildRPM "awips2-python-pupynere"
+# buildRPM "awips2-python-scientific"
+# buildRPM "awips2-python-scipy"
+# buildRPM "awips2-python-tables"
+# buildRPM "awips2-python-thrift"
+# buildRPM "awips2-python-tpg"
+# buildRPM "awips2-python-ufpy"
+# buildRPM "awips2-python-werkzeug"
+# buildRPM "awips2-python-pygtk"
+# buildRPM "awips2-python-pycairo"
if [ $? -ne 0 ]; then
exit 1
fi
@@ -342,6 +342,7 @@ fi
if [ "${1}" = "-viz" ]; then
buildRPM "awips2"
buildRPM "awips2-rcm"
+ buildRPM "awips2-hydroapps-shared"
buildCAVE
if [ $? -ne 0 ]; then
exit 1