();
+ Color current = null;
+ for (Color color: this.colors) {
+ if (!color.equals(current)) {
+ colors.add(color);
+ current = color;
+ }
+ }
+
+ this.colors = colors;
+ changed = true;
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java b/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java
index 12a718a8fb..2bed55d2d8 100644
--- a/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java
+++ b/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java
@@ -22,6 +22,7 @@ package com.raytheon.uf.common.comm;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -71,6 +72,7 @@ import com.raytheon.uf.common.util.ByteArrayOutputStreamPool.ByteArrayOutputStre
* 03/02/11 #8045 rferrel Add connect reestablished message.
* 07/17/12 #911 njensen Refactored significantly
* 08/09/12 15307 snaples Added putEntitiy in postStreamingEntity.
+ * 01/07/13 DR 15294 D. Friedman Added streaming requests.
*
*
*
@@ -434,6 +436,95 @@ public class HttpClient {
return executePostMethod(put);
}
+ /**
+ * Post a message to an http address, and return the result as a byte array.
+ *
+ * Implementation note: The given stream handler will be used at least
+ * twice: Once to determine the length, another to actually send the
+ * content. This is done because pypies does not accept chunked requests
+ * bodies.
+ *
+ * @param address
+ * @param handler the handler responsible for generating the message to be posted
+ * @return
+ * @throws CommunicationException
+ */
+ public byte[] postBinary(String address, OStreamHandler handler) throws CommunicationException {
+ class OStreamEntity extends AbstractHttpEntity {
+ OStreamHandler handler;
+ long contentLength = -1;
+
+ public OStreamEntity(OStreamHandler handler) {
+ this.handler = handler;
+ }
+
+ @Override
+ public InputStream getContent() throws IOException,
+ IllegalStateException {
+ throw new IllegalStateException("OStreamEntity does not support getContent().");
+ }
+
+ @Override
+ public long getContentLength() {
+ if (contentLength < 0) {
+ class CountingStream extends OutputStream {
+ long count;
+
+ @Override
+ public void write(int b) throws IOException {
+ ++count;
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ count += b.length;
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len)
+ throws IOException {
+ count += len;
+ }
+ }
+
+ CountingStream cs = new CountingStream();
+ try {
+ handler.writeToStream(cs);
+ contentLength = cs.count;
+ } catch (CommunicationException e) {
+ // ignore
+ }
+ }
+ return contentLength;
+ }
+
+ @Override
+ public boolean isRepeatable() {
+ return true;
+ }
+
+ @Override
+ public boolean isStreaming() {
+ return false;
+ }
+
+ @Override
+ public void writeTo(OutputStream stream) throws IOException {
+ try {
+ handler.writeToStream(stream);
+ } catch (CommunicationException e) {
+ throw new IOException(e.getMessage(), e.getCause());
+ }
+ }
+ }
+
+ OStreamEntity entity = new OStreamEntity(handler);
+ HttpPost put = new HttpPost(address);
+ put.setEntity(entity);
+
+ return executePostMethod(put);
+ }
+
/**
* Post a string to an endpoint and stream the result back.
*
@@ -592,6 +683,15 @@ public class HttpClient {
throws CommunicationException;
}
+ /**
+ * Responsible for writing HTTP content to a stream. May be called
+ * more than once for a given entity. See postBinary(String, OStreamHandler)
+ * for details.
+ */
+ public static interface OStreamHandler {
+ public void writeToStream(OutputStream os) throws CommunicationException;
+ }
+
/**
* Automatically reads a stream into a byte array and stores the byte array
* in byteResult. Should only be used internally in HttpClient with
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java
index 0b614003f1..faf88b060d 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java
@@ -61,6 +61,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Apr 11, 2012 #14691 Qinglu Lin For marine warnings, getFeAreaField() returns null.
* So, do not add the returned value of getFeAreaField()
* to areaFields.
+ * Jan 9, 2013 15600 Qinglu Lin Execute "timezones = myTimeZones;" even if timezones != null.
*
*
*
@@ -118,9 +119,7 @@ public class GeospatialFactory {
GeospatialData[] parentAreas = dataSet.getParentAreas();
GeospatialData[] myTimeZones = dataSet.getTimezones();
if (myTimeZones != null && myTimeZones.length > 0) {
- if (timezones == null) {
- timezones = myTimeZones;
- }
+ timezones = myTimeZones;
for (GeospatialData tz : myTimeZones) {
tz.prepGeom = PreparedGeometryFactory.prepare(tz.geometry);
diff --git a/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java b/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java
index 5f5e864c21..e1c1eca3fe 100644
--- a/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java
+++ b/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java
@@ -2,11 +2,13 @@ package com.raytheon.uf.common.pypies;
import java.io.File;
import java.io.FileNotFoundException;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import com.raytheon.uf.common.comm.CommunicationException;
import com.raytheon.uf.common.comm.HttpClient;
import com.raytheon.uf.common.datastorage.DuplicateRecordStorageException;
import com.raytheon.uf.common.datastorage.IDataStore;
@@ -31,6 +33,8 @@ import com.raytheon.uf.common.pypies.response.ErrorResponse;
import com.raytheon.uf.common.pypies.response.FileActionResponse;
import com.raytheon.uf.common.pypies.response.RetrieveResponse;
import com.raytheon.uf.common.pypies.response.StoreResponse;
+import com.raytheon.uf.common.serialization.DynamicSerializationManager;
+import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.util.FileUtil;
@@ -66,6 +70,7 @@ import com.raytheon.uf.common.util.FileUtil;
* ------------ ---------- ----------- --------------------------
* May 27, 2010 njensen Initial creation
* Oct 01, 2010 rjpeter Added logging of requests over 300ms
+ * Mon 07, 2013 DR 15294 D. Friedman Stream large requests
*
*
* @author njensen
@@ -76,6 +81,8 @@ public class PyPiesDataStore implements IDataStore {
private static final long SIMPLE_LOG_TIME = 300;
+ private static final long HUGE_REQUEST = 1024 * 1024 * 25;
+
protected static String address = null;
protected List records = new ArrayList();
@@ -276,9 +283,19 @@ public class PyPiesDataStore implements IDataStore {
req.setOp(storeOp);
req.setRecords(records);
+ boolean huge = false;
+ long totalSize = 0;
+ for (IDataRecord rec : records) {
+ totalSize += rec.getSizeInBytes();
+ if (totalSize >= HUGE_REQUEST) {
+ huge = true;
+ break;
+ }
+ }
+
StorageStatus ss = null;
try {
- StoreResponse sr = (StoreResponse) sendRequest(req);
+ StoreResponse sr = (StoreResponse) sendRequest(req, huge);
ss = sr.getStatus();
String[] exc = sr.getExceptions();
IDataRecord[] failed = sr.getFailedRecords();
@@ -327,17 +344,20 @@ public class PyPiesDataStore implements IDataStore {
return ss;
}
- protected Object sendRequest(final AbstractRequest obj)
+ protected Object sendRequest(final AbstractRequest obj) throws StorageException {
+ return sendRequest(obj, false);
+ }
+
+ protected Object sendRequest(final AbstractRequest obj, boolean huge)
throws StorageException {
obj.setFilename(filename);
- byte[] bytes = serializeRequest(obj);
initializeProperties();
byte[] result = null;
long t0 = System.currentTimeMillis();
try {
- result = HttpClient.getInstance().postBinary(address, bytes);
+ result = doSendRequest(obj, huge);
} catch (Exception e) {
throw new StorageException(
"Error communicating with pypies server", null, e);
@@ -359,6 +379,24 @@ public class PyPiesDataStore implements IDataStore {
return ret;
}
+ protected byte[] doSendRequest(final AbstractRequest obj, boolean huge) throws Exception {
+ if (huge) {
+ return HttpClient.getInstance().postBinary(address, new HttpClient.OStreamHandler() {
+ @Override
+ public void writeToStream(OutputStream os) throws CommunicationException {
+ try {
+ DynamicSerializationManager.getManager(SerializationType.Thrift).serialize(obj, os);
+ } catch (SerializationException e) {
+ throw new CommunicationException(e);
+ }
+ }
+ });
+ } else {
+ byte[] bytes = serializeRequest(obj);
+ return HttpClient.getInstance().postBinary(address, bytes);
+ }
+ }
+
/**
* By default this method simply passes the request to
* sendRequest(AbstractRequest). Method exists to be overridden for
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml
new file mode 100644
index 0000000000..8d29123e1d
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java
index 08f76976b7..370d88589d 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java
@@ -60,7 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 02/17/2009 1981 dhladky Initial Creation.
- *
+ * 01/07/2013 DR 15647 gzhang Use logger.warn for null earlyVilURI/earlyCZURI.
*
*
* @author dhladky
@@ -372,8 +372,9 @@ public class QPFConfig {
}
if (earlyVilURI == null || earlyCZURI == null) {
- throw new Exception("QPFConfig " + icao
- + ": Radar Record request failed, no previous data.");
+ qpfgen.logger.warn("QPFConfig: No previous data for QPF. Check the RADAR OP Mode.");// DR 15647
+ //throw new Exception("QPFConfig " + icao
+ //+ ": Radar Record request failed, no previous data.");
}
try {
@@ -518,8 +519,8 @@ public class QPFConfig {
return true;
} catch (Exception e) {
qpfgen.logger
- .error("QPFConfig: Couldn't create all needed RadarRecords: "
- + e.getMessage());
+ .error("QPFConfig: Some RadarRecords cannot be created: "
+ + e.getMessage());// DR 15647
return false;
}
}
diff --git a/rpms/awips2.core/Installer.ldm/component.spec b/rpms/awips2.core/Installer.ldm/component.spec
index bbedc5741b..b6481310af 100644
--- a/rpms/awips2.core/Installer.ldm/component.spec
+++ b/rpms/awips2.core/Installer.ldm/component.spec
@@ -5,7 +5,7 @@
Name: awips2-ldm
Summary: AWIPS II LDM Distribution
Version: 6.8.1
-Release: 27
+Release: 28
Group: AWIPSII
BuildRoot: /tmp
URL: N/A
diff --git a/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template b/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template
index eaef03eb8a..14233f8a6d 100755
--- a/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template
+++ b/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template
@@ -411,7 +411,7 @@ IDS|DDPLUS ^(FOUS[67].) (....) (..)(..)(..)
# FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
#
# separate out svrwx lsr and GSM misc adm messages
-IDS|DDPLUS|HDS ^(N[A-VYZ]....) (.{4}) (..)(..)(..)
+IDS|DDPLUS ^(N[A-VYZ]....) (.{4}) (..)(..)(..)
FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
IDS|DDPLUS ^(NWUS[01346-9].) (.{4}) (..)(..)(..)
FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
@@ -432,6 +432,10 @@ IDS|DDPLUS ^(R.{5}) (.{4}) (..)(..)(..)
IDS|DDPLUS ^(SM[UCM][SNX]..) (.{4}) (..)(..)(..)
FILE -overwrite -log -close -edex /data_store/synoptic/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
+# DR 15716 - Add in SHUS products for fire weather obs (and others)
+IDS|DDPLUS ^(SHUS..) (.{4}) (..)(..)(..)
+ FILE -overwrite -log -close -edex /data_store/misc_sfc_obs/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
+
# AWIPS1: TEXT ^S[AP]US[78]0.* /point/metar/Raw
# AWIPS1: TEXT ^S[AP]US4.* /point/metar/Raw
# AWIPS1: TEXT ^S[AP]U[CEMW]6.* /point/metar/Raw