13.4.1-4 baseline

Former-commit-id: 4477bad886dc7ae0418409e3bc5ebce7965b6146
This commit is contained in:
Steve Harris 2013-05-02 10:00:38 -05:00
parent 54afedf617
commit d33e5861aa
535 changed files with 9646 additions and 38203 deletions

View file

@ -1,49 +0,0 @@
#!/bin/sh
exe=$0
while test -L "$exe"; do
exe=`readlink "$exe"`
done
bin_dir=`dirname "$exe"`
bin_dir=`cd "$bin_dir";pwd`
rs_home_dir=`cd "$bin_dir/..";pwd`
props=com.raytheon.rcm
lib_dir="$rs_home_dir/lib"
cfg_dir="$rs_home_dir/data/config"
cp=
for jar in "$lib_dir"/*.jar; do
cp=$cp:$jar
done
java=/awips2/java/bin/java
decompress_products=yes
config_file="$cfg_dir/start-config"
. "$config_file" || { echo "could not read $config_file"; exit 1 ;}
if test -n "$edex_endpoint_arg"; then
edex_endpoint_arg_2="-D$props.edexRadarEndpoint=$edex_endpoint_arg"
fi
if test -z "$log_file"; then
log_file=/dev/null
fi
if test -n "$configuration_provider"; then
cfg_provider_arg_2="-D$props.server.RadarServer.configurationProviderClass=$configuration_provider"
fi
if test -n "$awips1_root"; then
awips1_root_arg_2="-D$props.awips1.resourceRoot=$awips1_root"
fi
if test -n "$awips1_site"; then
awips1_site_arg_2="-D$props.awips1.FXA_LOCAL_SITE=$awips1_site"
fi
exec $java -cp "$cp" \
"-D$props.configDir=$cfg_dir" \
"-D$props.awips1.decompressRadarProducts=$decompress_products" \
$edex_endpoint_arg_2 \
$cfg_provider_arg_2 \
$awips1_root_arg_2 \
$awips1_site_arg_2 \
com.raytheon.rcm.config.importer.Importer

View file

@ -1,76 +0,0 @@
#!/bin/sh
exe=$0
while test -L "$exe"; do
exe=`readlink "$exe"`
done
bin_dir=`dirname "$exe"`
bin_dir=`cd "$bin_dir";pwd`
rs_home_dir=`cd "$bin_dir/..";pwd`
props=com.raytheon.rcm
lib_dir="$rs_home_dir/lib"
cfg_dir="$rs_home_dir/data/config"
cp=
for jar in "$lib_dir"/*.jar; do
cp=$cp:$jar
done
cp="$cfg_dir/res:$cp"
JAVA_INSTALL="/awips2/java"
java=${JAVA_INSTALL}/bin/java
decompress_products=yes
config_file="$cfg_dir/start-config"
. "$config_file" || { echo "could not read $config_file"; exit 1 ;}
if test -n "$edex_endpoint_arg"; then
edex_endpoint_arg_2="-D$props.edexRadarEndpoint=$edex_endpoint_arg"
fi
if test -z "$log_dir"; then
log_dir=$rs_home_dir/data/logs
echo "Writing logs at $log_dir"
fi
if test -n "$configuration_provider"; then
cfg_provider_arg_2="-D$props.server.RadarServer.configurationProviderClass=$configuration_provider"
fi
if test -n "$awips1_root"; then
awips1_root_arg_2="-D$props.awips1.resourceRoot=$awips1_root"
fi
if test -n "$awips1_site"; then
awips1_site_arg_2="-D$props.awips1.FXA_LOCAL_SITE=$awips1_site"
fi
if [ ! -f "$java" ]; then
echo "Java is not correct : $java"
exit
fi
if [ -f "$rs_home_dir/data/radarserver-pid" ]; then
pid=`cat $rs_home_dir/data/radarserver-pid`
echo "Radar Server already started at process $pid. Run stop before restarting."
exit 0
fi
# giving rw permissions to all users
umask 000
$java -cp "$cp" \
"-D$props.configDir=$cfg_dir" \
"-D$props.awips1.decompressRadarProducts=$decompress_products" \
"-D$props.logDir=$log_dir" \
"-Dlog4j.configuration=log4j.properties" \
"-Dqpid.dest_syntax=BURL" \
"-Dawips2_fxa=$awips2_fxa" \
$edex_endpoint_arg_2 \
$cfg_provider_arg_2 \
$awips1_root_arg_2 \
$awips1_site_arg_2 \
com.raytheon.rcm.mqsrvr.MQServer > /dev/null 2>&1 &
pid=$!
echo "RadarServer started at process $pid"
echo "$pid" > "$rs_home_dir/data/radarserver-pid"

View file

@ -1,26 +0,0 @@
#!/bin/sh
exe=$0
while test -L "$exe"; do
exe=`readlink "$exe"`
done
bin_dir=`dirname "$exe"`
bin_dir=`cd "$bin_dir";pwd`
rs_home_dir=`cd "$bin_dir/..";pwd`
pid_file=$rs_home_dir/data/radarserver-pid
if [ -f $pid_file ]
then
pid=`cat "$pid_file"`
if test -n "$pid"; then
rm -f "$pid_file"
if kill "$pid"; then
echo "Killing radar server at process $pid, also removing pid file."
exit 0
fi
else
echo "Cannot find pid of radar server, please kill it manually."
fi
else
echo "File does not exist to find pid. It may not be running or it might need to be killed manually."
fi
exit 1

View file

@ -228,6 +228,8 @@
<var name="cave.arch" value="arch.x86" />
<extractCAVEini
zip.file="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip" />
<!-- add the Xss jvm parameter to the 32-bit CAVE -->
<echo file="/tmp/cave/cave.ini" append="true" message="-Xss512k" />
<antcall target="generateDynamicCAVE" />
<!-- Update the 32-bit CAVE zip file -->
<zip destfile="${buildDirectory}/${buildLabel}/${buildId}-linux.gtk.x86.zip"

View file

@ -22,8 +22,7 @@
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<resourceType>PLAN_VIEW</resourceType>
<resource>
<loadProperties loadWithoutData="false">
<capabilities>
<capability xsi:type="colorMapCapability">
@ -31,6 +30,7 @@
</capability>
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">

View file

@ -22,10 +22,10 @@
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<resourceType>PLAN_VIEW</resourceType>
<resource>
<loadProperties xsi:type="gridLoadProperties"
displayType="CONTOUR" >
<resourceType>PLAN_VIEW</resourceType>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true">

View file

@ -22,8 +22,7 @@
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<resourceType>PLAN_VIEW</resourceType>
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="colorMapCapability">
@ -31,6 +30,7 @@
</capability>
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">

View file

@ -22,8 +22,7 @@
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<resourceType>PLAN_VIEW</resourceType>
<resource>
<loadProperties loadWithoutData="true">
<capabilities>
<capability xsi:type="colorMapCapability">
@ -31,6 +30,7 @@
</capability>
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
</capabilities>
<resourceType>PLAN_VIEW</resourceType>
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">

View file

@ -1,17 +0,0 @@
#!/bin/sh
# Need to make sure we determine what TMCP_HOME should
# be if it is not set.
dir=${0%/*}
if [ "$dir" = "$0" ]; then
dir="."
fi
cd "$dir/.."
if [ ! -n "${TMCP_HOME}" ]
then
export TMCP_HOME=.
fi
DISPLAY=$1:0.0; export DISPLAY
$TMCP_HOME/bin/MonitorTestMode &

View file

@ -1,55 +0,0 @@
#!/bin/sh
# determine where the script is being ran from.
path_to_script=`readlink -f $0`
RUN_FROM_DIR=`dirname ${path_to_script}`
BASE_ENV_DIR=`dirname ${RUN_FROM_DIR}`
if [ ! -n "${TMCP_HOME}" ]
then
echo -e "\e[1;31mTMCP_HOME is not set.\e[m"
echo -e "\e[0;32mSetting TMCP_HOME to '${BASE_ENV_DIR}'.\e[m"
export TMCP_HOME=${BASE_ENV_DIR}
else
echo "TMCP_HOME is '${TMCP_HOME}'"
fi
if [ ! -n "${FXA_HOME}" ]
then
echo -e "\e[1;31mFXA_HOME is not set.\e[m"
echo -e "\e[0;32mSetting FXA_HOME to '${BASE_ENV_DIR}'.\e[m"
export FXA_HOME=${BASE_ENV_DIR}
else
echo "FXA_HOME is '${FXA_HOME}'"
fi
# determine if 'FXA_WARNGEN_PRODUCT_ID' needs to be set
HOST=`uname -n`
TMP_HOST_NUMBER=`uname -n | awk '{print substr($1, 3, 1);}'`
ALT_HOST_PART=`uname -n | awk '{print substr($1, 3, length($1) - 1);}'`
ALT_HOST="xt"${ALT_HOST_PART}
ping -c 1 -w 1 ${ALT_HOST} >/dev/null 2>/dev/null
RC=`echo $?`
if [ "${RC}" = "0" ]
then
if [ ! -n "${FXA_WARNGEN_PRODUCT_ID}" ]
then
echo -e "\e[1;31mFXA_WARNGEN_PRODUCT_ID is not set.\e[m"
echo -e "\e[0;32mSetting FXA_WARNGEN_PRODUCT_ID to '${TMP_HOST_NUMBER}'.\e[m"
export FXA_WARNGEN_PRODUCT_ID=${TMP_HOST_NUMBER}
else
echo "FXA_WARNGEN_PRODUCT_ID is '${FXA_WARNGEN_PRODUCT_ID}'."
fi
fi
export LD_LIBRARY_PATH=$TMCP_HOME/lib:$LD_LIBRARY_PATH
# for TMCP logs
if [ ! -d $HOME/tmcpLogs ]; then
mkdir $HOME/tmcpLogs
fi
export LOG_DIR=$HOME/tmcpLogs
$TMCP_HOME/bin/tmcp

View file

@ -1,22 +0,0 @@
#!/bin/sh
# Need to make sure we determine what TMCP_HOME should
# be if it is not set because this script may be ran
# remotely under certain conditions.
dir=${0%/*}
if [ "$dir" = "$0" ]; then
dir="."
fi
cd "$dir/.."
if [ ! -n "${TMCP_HOME}" ]
then
export TMCP_HOME=.
fi
if [ $6 = "kde" ]
then
kstart --alldesktops $TMCP_HOME/bin/showBanner $2 $3 $4 $5 &
else
$TMCP_HOME/bin/showBanner $2 $3 $4 $5 &
fi

View file

@ -1 +1 @@
com.raytheon.uf.viz.core.status.VizStatusHandlerFactory
com.raytheon.uf.common.status.DefaultStatusHandlerFactory

View file

@ -78,16 +78,17 @@ public class VizStatusHandler implements IUFStatusHandler {
*/
@Override
public void handle(UFStatus status) {
handle(status, this.category);
}
handle(status, this.category);
}
@Override
public void handle(UFStatus status, String category) {
@Override
public void handle(UFStatus status, String category) {
if (this.source == null) {
if (factory != null) {
this.source = factory.getSource(source, pluginId);
}
}
VizStatusInternal vizStatus = new VizStatusInternal(status, category,
source, pluginId);
StatusManager.getManager().handle(vizStatus);
@ -98,10 +99,10 @@ public class VizStatusHandler implements IUFStatusHandler {
handle(new UFStatus(p, msg));
}
@Override
public void handle(Priority priority, String category, String message) {
handle(priority, category, message, (Throwable) null);
}
@Override
public void handle(Priority priority, String category, String message) {
handle(priority, category, message, (Throwable) null);
}
@Override
public void handle(Priority p, String msg, Throwable t) {
@ -109,19 +110,19 @@ public class VizStatusHandler implements IUFStatusHandler {
}
@Override
public void handle(Priority p, String category, String msg, Throwable t) {
handle(new UFStatus(p, msg, t), category);
}
public void handle(Priority p, String category, String msg, Throwable t) {
handle(new UFStatus(p, msg, t), category);
}
@Override
@Override
public void debug(String message) {
handle(Priority.DEBUG, message);
}
@Override
public void debug(String category, String message) {
handle(Priority.DEBUG, category, message);
}
@Override
public void debug(String category, String message) {
handle(Priority.DEBUG, category, message);
}
@Override
public void info(String message) {
@ -129,48 +130,48 @@ public class VizStatusHandler implements IUFStatusHandler {
}
@Override
public void info(String category, String message) {
handle(Priority.INFO, category, message);
}
public void info(String category, String message) {
handle(Priority.INFO, category, message);
}
@Override
@Override
public void warn(String message) {
handle(Priority.WARN, message);
}
@Override
public void warn(String category, String message) {
handle(Priority.WARN, category, message);
}
public void warn(String category, String message) {
handle(Priority.WARN, category, message);
}
@Override
@Override
public void error(String message) {
handle(Priority.ERROR, message);
}
@Override
public void error(String category, String message) {
handle(Priority.ERROR, category, message);
}
public void error(String category, String message) {
handle(Priority.ERROR, category, message);
}
@Override
@Override
public void error(String message, Throwable throwable) {
handle(Priority.ERROR, message, throwable);
}
@Override
public void error(String message, String category, Throwable throwable) {
handle(Priority.ERROR, category, message, throwable);
}
public void error(String message, String category, Throwable throwable) {
handle(Priority.ERROR, category, message, throwable);
}
@Override
@Override
public void fatal(String message, Throwable throwable) {
handle(Priority.FATAL, message, throwable);
}
@Override
public void fatal(String message, String category, Throwable throwable) {
handle(Priority.FATAL, category, message, throwable);
}
@Override
public void fatal(String message, String category, Throwable throwable) {
handle(Priority.FATAL, category, message, throwable);
}
}

View file

@ -37,7 +37,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus.Priority;
/**
* TODO Add Description
* Viz Status Handler Factory
*
* <pre>
*

View file

@ -21,7 +21,9 @@ package com.raytheon.uf.viz.cwat;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@ -68,6 +70,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 16JUN2009 2037 dhladky Initial Creation.
* Apr 17, 2013 1916 njensen Overrode getDataTimes()
*
*
* </pre>
*
@ -78,39 +82,33 @@ import com.vividsolutions.jts.geom.Coordinate;
public class CWATResource extends
AbstractVizResource<CWATResourceData, MapDescriptor> implements
IResourceDataChanged {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CWATResource.class);
public String icao;
protected CWATRecord record;
public String fieldName;
private Map<DataTime, GriddedImageDisplay2> griddedDisplayMap;
public String fieldUnitString;
protected DataTime displayedDataTime;
public CWATRecord record;
private HashMap<DataTime, GriddedImageDisplay2> griddedDisplayMap;
public DataTime displayedDataTime;
public DataTime previousDataTime;
protected DataTime previousDataTime;
private String colormapfile = null;
/* The font used */
public IFont font = null;
protected IFont font = null;
private float cwatmax = 0.0f;
private float cwatmin = 0.0f;
boolean init = true;
private boolean init = true;
public CWATResource(CWATResourceData data, LoadProperties props) {
super(data, props);
data.addChangeListener(this);
this.dataTimes = new ArrayList<DataTime>();
griddedDisplayMap = new HashMap<DataTime, GriddedImageDisplay2>();
}
@ -146,7 +144,10 @@ public class CWATResource extends
for (PluginDataObject pdo : pdos) {
try {
CWATRecord cwat = (CWATRecord) pdo;
resourceData.dataObjectMap.put(cwat.getDataTime(), cwat);
synchronized (resourceData.dataObjectMap) {
resourceData.dataObjectMap
.put(cwat.getDataTime(), cwat);
}
record = cwat;
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
@ -303,7 +304,9 @@ public class CWATResource extends
@Override
public void remove(DataTime dataTime) {
this.dataTimes.remove(dataTime);
synchronized (resourceData.dataObjectMap) {
resourceData.dataObjectMap.remove(dataTime);
}
GriddedImageDisplay2 display = this.griddedDisplayMap.remove(dataTime);
if (display != null) {
display.dispose();
@ -322,4 +325,14 @@ public class CWATResource extends
match.setParameterName(paramList);
return match;
}
@Override
public DataTime[] getDataTimes() {
DataTime[] times = new DataTime[0];
synchronized (resourceData.dataObjectMap) {
times = this.resourceData.dataObjectMap.keySet().toArray(times);
}
Arrays.sort(times);
return times;
}
}

View file

@ -1,16 +1,17 @@
package com.raytheon.uf.viz.monitor.ffmp;
import java.io.File;
import java.io.FileNotFoundException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NavigableMap;
import java.util.Set;
@ -34,9 +35,13 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasin;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest.OrderMode;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.monitor.config.FFFGDataMgr;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
@ -57,6 +62,7 @@ import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.ResourceMonitor;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
@ -94,6 +100,7 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
* 02/20/13 1635 D. Hladky Fixed multi guidance sources
* Mar 6, 2013 1769 dhladky Changed threading to use count down latch.
* Apr 9, 2013 1890 dhladky Fixed the broken cache file load
* Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp
*
* </pre>
*
@ -118,7 +125,16 @@ public class FFMPMonitor extends ResourceMonitor {
private String wfo = null;
/** Pattern for dates in radar */
public static String datePattern = "yyyy-MM-dd HH:mm:ss";
public static ThreadLocal<SimpleDateFormat> datePattern = new ThreadLocal<SimpleDateFormat>() {
@Override
protected SimpleDateFormat initialValue() {
SimpleDateFormat datef = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
datef.setTimeZone(TimeZone.getTimeZone("Zulu"));
return datef;
}
};
private FFMPSiteDataContainer siteDataMap = new FFMPSiteDataContainer();
@ -376,6 +392,11 @@ public class FFMPMonitor extends ResourceMonitor {
"FFMP Can't retrieve FFMP URI, " + uri, e);
}
SourceXML sourceXml = fscm.getSource(source);
if (sourceXml.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
source = sourceXml.getDisplayName();
}
return siteDataMap.get(siteKey).getSourceData(source).getRecord();
}
@ -391,7 +412,8 @@ public class FFMPMonitor extends ResourceMonitor {
NavigableMap<Date, List<String>> uris, String siteKey, String source) {
// get record from cache
FFMPSourceData sourceData = siteDataMap.get(siteKey).getSourceData(source);
FFMPSourceData sourceData = siteDataMap.get(siteKey).getSourceData(
source);
FFMPRecord curRecord = sourceData.getRecord();
if (curRecord == null) {
@ -399,14 +421,14 @@ public class FFMPMonitor extends ResourceMonitor {
for (String huc : data.getBasinsMap().keySet()) {
// add all of the uris
for (Entry<Date, List<String>> duris : uris.entrySet()) {
for (String uri : duris.getValue()) {
if (curRecord == null) {
curRecord = new FFMPRecord(uri);
sourceData.setRecord(curRecord);
if (data.getTimes().contains(duris.getKey().getTime())) {
for (String uri : duris.getValue()) {
if (curRecord == null) {
curRecord = new FFMPRecord(uri);
sourceData.setRecord(curRecord);
}
sourceData.addLoadedUri(huc, uri);
}
sourceData.addLoadedUri(huc, uri);
}
}
}
@ -467,7 +489,7 @@ public class FFMPMonitor extends ResourceMonitor {
if (sourceXML.getSourceType().equals(
SOURCE_TYPE.GAGE.getSourceType())
&& phuc.equals(FFMPRecord.ALL)) {
ffmpRec.retrieveVirtualBasinFromDataStore(dataStore,
ffmpRec.retrieveVirtualBasinFromDataStore(loc,
dataUri, getTemplates(siteKey), ffmpRec
.getDataTime().getRefTime(), basin);
} else {
@ -484,36 +506,6 @@ public class FFMPMonitor extends ResourceMonitor {
}
}
/**
* Getting a specific URI
*
* @param date
* @return
*/
public String getAvailableUri(String siteKey, String dataKey,
String sourceName, Date ptime) {
String uri = null;
SimpleDateFormat datef = new SimpleDateFormat(datePattern);
datef.setTimeZone(TimeZone.getTimeZone("Zulu"));
String sql = "select datauri from ffmp where wfo = '" + getWfo()
+ "' and reftime = '" + datef.format(ptime)
+ "' and sourcename = '" + sourceName + "' and sitekey = '"
+ siteKey + "' and datakey = '" + dataKey
+ "' order by reftime";
try {
List<Object[]> results = DirectDbQuery.executeQuery(sql,
"metadata", QueryLanguage.SQL);
if (results.size() > 0) {
uri = (String) results.get(0)[0];
}
} catch (VizException e) {
e.printStackTrace();
}
return uri;
}
/**
* Get me the available URIS for this source
*
@ -537,6 +529,112 @@ public class FFMPMonitor extends ResourceMonitor {
return uris;
}
/**
* Perform a single database request to populate the availableUris for
* multiple sources. After preloading the uris the uris for each source can
* be retrieved with getAvailableUris
*
*/
public void preloadAvailableUris(String siteKey, String dataKey,
Set<String> sourceNames, Date time) {
DbQueryRequest request = new DbQueryRequest();
request.setEntityClass(FFMPRecord.class);
request.addRequestField("dataURI");
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
request.addConstraint("wfo", new RequestConstraint(getWfo()));
request.addConstraint("siteKey", new RequestConstraint(siteKey));
request.addConstraint("dataTime.refTime", new RequestConstraint(
datePattern.get().format(time),
ConstraintType.GREATER_THAN_EQUALS));
RequestConstraint sourceRC = new RequestConstraint(null,
ConstraintType.IN);
sourceRC.setConstraintValueList(sourceNames);
request.addConstraint("sourceName", sourceRC);
try {
handleURIRequest(request, siteKey, dataKey, time);
FFMPSiteData siteData = siteDataMap.get(siteKey);
for (String sourceName : sourceNames) {
// This is done to ensure that the previous query time is
// updated, even for sources with no data.
FFMPSourceData sourceData = siteData.getSourceData(sourceName);
Date oldPrevTime = sourceData.getPreviousUriQueryDate();
if (oldPrevTime == null || time.before(oldPrevTime)) {
sourceData.setPreviousUriQueryDate(time);
}
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't find availble URI list for, " + sourceNames, e);
}
}
/**
* handle a pre assembled database query for uris. The request is sent to
* edex and the response is parsed to populated the uris in the siteDataMap.
*
*/
private void handleURIRequest(DbQueryRequest request, String siteKey,
String dataKey, Date time) throws VizException {
FFMPSiteData siteData = siteDataMap.get(siteKey);
DbQueryResponse dbResponse = (DbQueryResponse) ThriftClient
.sendRequest(request);
Map<String, List<FFMPRecord>> recordsBySource = new HashMap<String, List<FFMPRecord>>();
for (String datauri : dbResponse.getFieldObjects("dataURI",
String.class)) {
FFMPRecord record = new FFMPRecord(datauri);
List<FFMPRecord> records = recordsBySource.get(record
.getSourceName());
if (records == null) {
records = new ArrayList<FFMPRecord>();
recordsBySource.put(record.getSourceName(), records);
}
records.add(record);
}
for (Entry<String, List<FFMPRecord>> entry : recordsBySource.entrySet()) {
String sourceName = entry.getKey();
SourceXML sourceXml = getSourceConfig().getSource(sourceName);
boolean isMosiac = sourceXml.isMosaic();
FFMPSourceData sourceData = siteData.getSourceData(sourceName);
Map<Date, List<String>> sortedUris = sourceData.getAvailableUris();
List<String> list = new LinkedList<String>();
Date prevRefTime = null;
for (FFMPRecord rec : entry.getValue()) {
if (!isMosiac && !rec.getDataKey().equals(dataKey)) {
continue;
}
Date curRefTime = rec.getDataTime().getRefTime();
if ((prevRefTime != null) && !prevRefTime.equals(curRefTime)) {
sortedUris.put(prevRefTime, list);
list = new LinkedList<String>();
}
prevRefTime = curRefTime;
list.add(rec.getDataURI());
}
if (prevRefTime != null) {
sortedUris.put(prevRefTime, list);
}
Date prevTime = time;
if (sourceXml.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
long timeOffset = sourceXml.getExpirationMinutes(siteKey)
* TimeUtil.MILLIS_PER_MINUTE;
prevTime = new Date(time.getTime() - timeOffset);
}
Date oldPrevTime = sourceData.getPreviousUriQueryDate();
if (oldPrevTime == null || prevTime.before(oldPrevTime)) {
sourceData.setPreviousUriQueryDate(prevTime);
}
}
}
/**
* Gets the available uris back to a given time
@ -551,94 +649,55 @@ public class FFMPMonitor extends ResourceMonitor {
.get(siteKey).getSourceData(sourceName).getAvailableUris();
Date previousQueryTime = siteDataMap.get(siteKey)
.getSourceData(sourceName).getPreviousUriQueryDate();
Date earliestTime = time;
SourceXML source = getSourceConfig().getSource(sourceName);
if (source.getSourceType().equals(SOURCE_TYPE.GUIDANCE.getSourceType())) {
// Always look back for guidance types because of long expiration
// times,
// prevents mosaic brittleness from occurring.
// times, prevents mosaic brittleness from occurring.
retrieveNew = true;
long timeOffset = source.getExpirationMinutes(siteKey)
* TimeUtil.MILLIS_PER_MINUTE;
earliestTime = new Date(time.getTime() - timeOffset);
}
if (retrieveNew
|| ((time != null) && ((previousQueryTime == null) || (time
.getTime() < previousQueryTime.getTime())))) {
SimpleDateFormat datef = new SimpleDateFormat(datePattern);
datef.setTimeZone(TimeZone.getTimeZone("Zulu"));
Date earliestTime = time;
StringBuilder query = new StringBuilder(200);
query.append("select datauri from ffmp where wfo = '");
query.append(getWfo());
query.append("' and sourcename = '");
query.append(sourceName);
|| (time != null && (previousQueryTime == null || time
.before(previousQueryTime)))) {
DbQueryRequest request = new DbQueryRequest();
request.setEntityClass(FFMPRecord.class);
request.addRequestField("dataURI");
request.setOrderByField("dataTime.refTime", OrderMode.DESC);
// GUIDANCE we save by displayName, *type*
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
long timeOffset = source.getExpirationMinutes(siteKey)
* TimeUtil.MILLIS_PER_MINUTE;
earliestTime = new Date(time.getTime() - timeOffset);
}
query.append("' and sitekey = '");
query.append(siteKey);
request.addConstraint("wfo", new RequestConstraint(getWfo()));
request.addConstraint("sourceName", new RequestConstraint(
sourceName));
request.addConstraint("siteKey", new RequestConstraint(siteKey));
if (!source.isMosaic()) {
query.append("' and datakey = '");
query.append(dataKey);
request.addConstraint("dataKey", new RequestConstraint(dataKey));
}
query.append("' and reftime >= '");
query.append(datef.format(earliestTime));
String earliestTimeString = datePattern.get().format(earliestTime);
if (!retrieveNew && (previousQueryTime != null)) {
query.append("' and reftime < '");
query.append(datef.format(previousQueryTime));
String latestTimeString = datePattern.get().format(
previousQueryTime);
RequestConstraint timeRC = new RequestConstraint(null,
ConstraintType.BETWEEN);
timeRC.setBetweenValueList(new String[] { earliestTimeString,
latestTimeString });
request.addConstraint("dataTime.refTime", timeRC);
} else {
request.addConstraint("dataTime.refTime",
new RequestConstraint(earliestTimeString,
ConstraintType.GREATER_THAN_EQUALS));
}
query.append("' order by reftime desc");
try {
List<Object[]> results = DirectDbQuery.executeQuery(
query.toString(), "metadata", QueryLanguage.SQL);
List<String> list = new LinkedList<String>();
Date prevRefTime = null;
for (int j = 0; j < results.size(); j++) {
if (results.size() > 0) {
Object[] results2 = results.get(j);
// System.out.println("Querrying for URIs: "
// + query.toString() + " # " + results2.length);
for (int i = 0; i < results2.length; i++) {
String uri = (String) results2[0];
FFMPRecord rec = new FFMPRecord(uri);
Date curRefTime = rec.getDataTime().getRefTime();
if ((prevRefTime != null)
&& !prevRefTime.equals(curRefTime)) {
sortedUris.put(prevRefTime, list);
list = new LinkedList<String>();
}
prevRefTime = curRefTime;
list.add(uri);
}
}
}
if (list != null) {
if ((prevRefTime == null) || (list == null)) {
statusHandler.handle(Priority.WARN,
"Source prevTime or list = null: " + sourceName
+ " Date: " + time);
} else {
sortedUris.put(prevRefTime, list);
}
}
siteDataMap.get(siteKey).getSourceData(sourceName)
.setPreviousUriQueryDate(time);
handleURIRequest(request, siteKey, dataKey, time);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't find availble URI list for, " + sourceName,
@ -1673,16 +1732,18 @@ public class FFMPMonitor extends ResourceMonitor {
*/
public void processUri(boolean isProductLoad, String uri, String siteKey,
String sourceName, Date barrierTime, String phuc) {
SourceXML source = getSourceConfig().getSource(sourceName);
if (uri != null) {
try {
FFMPRecord record = populateFFMPRecord(isProductLoad, uri,
siteKey, sourceName, phuc);
if ((record != null) && (source != null)) {
record.setExpiration(source.getExpirationMinutes(siteKey));
record.setRate(source.isRate());
if (record != null) {
record.getBasinData(phuc).loadNow();
SourceXML source = getSourceConfig().getSource(sourceName);
if (source != null) {
record.setExpiration(source
.getExpirationMinutes(siteKey));
record.setRate(source.isRate());
}
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
@ -2189,16 +2250,20 @@ public class FFMPMonitor extends ResourceMonitor {
List<String> uris = getLoadedUris(fsiteKey, fsource, fhuc);
String dataUri = fffmpRec.getDataURI();
if (!uris.contains(dataUri)) {
Date refTime = fffmpRec.getDataTime().getRefTime();
File loc = HDF5Util.findHDF5Location(fffmpRec);
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
FFMPSiteData siteData = siteDataMap.get(fsiteKey);
String mySource = fsource;
boolean isGageSource = false;
SourceXML source = fscm.getSource(fsource);
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
mySource = source.getDisplayName();
} else if (source.getSourceType().equals(
SOURCE_TYPE.GAGE.getSourceType())) {
isGageSource = true;
}
FFMPSourceData sourceData = siteData
@ -2207,55 +2272,36 @@ public class FFMPMonitor extends ResourceMonitor {
if (curRecord == null) {
// ensure the record can only be set once
synchronized (siteDataMap) {
curRecord = siteDataMap.get(fsiteKey)
.getSourceData(mySource).getRecord();
siteData = siteDataMap.get(fsiteKey);
sourceData = siteData.getSourceData(mySource);
curRecord = sourceData.getRecord();
if (curRecord == null) {
curRecord = new FFMPRecord(dataUri);
siteDataMap.get(fsiteKey)
.getSourceData(mySource)
.setRecord(curRecord);
sourceData.setRecord(curRecord);
}
}
}
SourceXML sourceXML = fscm.getSource(mySource);
try {
if ((sourceXML != null)
&& sourceXML.getSourceType().equals(
SOURCE_TYPE.GAGE.getSourceType())
&& fhuc.equals(FFMPRecord.ALL)) {
try {
curRecord.retrieveVirtualMapFromDataStore(
dataStore, dataUri, getTemplates(fsiteKey),
fffmpRec.getDataTime().getRefTime(),
if (isGageSource && fhuc.equals(FFMPRecord.ALL)) {
curRecord.retrieveVirtualMapFromDataStore(loc,
dataUri, getTemplates(fsiteKey), refTime,
fffmpRec.getSourceName());
} catch (FileNotFoundException e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't find FFMP URI, " + dataUri, e);
} catch (StorageException e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve (Storage problem) FFMP URI, "
+ dataUri, e);
}
} else {
try {
} else {
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
statusHandler.handle(Priority.DEBUG,
"Retrieving and Populating URI: , "
+ dataUri);
}
curRecord.retrieveMapFromDataStore(dataStore,
dataUri,
curRecord.retrieveMapFromDataStore(loc, dataUri,
getTemplates(fffmpRec.getSiteKey()), fhuc,
fffmpRec.getDataTime().getRefTime(),
fffmpRec.getSourceName());
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve FFMP URI, " + dataUri,
e);
refTime, fffmpRec.getSourceName());
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve FFMP URI, " + dataUri, e);
}
sourceData.addLoadedUri(fhuc, dataUri);
}
}
@ -2296,46 +2342,48 @@ public class FFMPMonitor extends ResourceMonitor {
}
public void run() {
SourceXML source = getSourceConfig().getSource(fsourceName);
if (furiMap != null) {
SourceXML source = getSourceConfig().getSource(fsourceName);
boolean isGuidance = false;
if (source != null
&& source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
isGuidance = true;
}
List<String> loadedUris = getLoadedUris(fsiteKey, fsourceName,
fhuc);
Set<FFMPRecord> populatedRecords = new HashSet<FFMPRecord>();
for (List<String> uris : furiMap.descendingMap().values()) {
for (String uri : uris) {
if (uri != null) {
FFMPRecord record = new FFMPRecord(uri);
if (record.getDataTime().getRefTime()
.after(fbarrierTime)
|| source
.getSourceType()
.equals(FFMPSourceConfigurationManager.SOURCE_TYPE.GUIDANCE
.getSourceType())) {
try {
if (!getLoadedUris(fsiteKey, fsourceName,
fhuc).contains(uri)) {
record = populateFFMPRecord(
fisProductLoad, uri, fsiteKey,
fsourceName, fhuc);
if ((record != null)
&& (source != null)) {
record.setExpiration(source
.getExpirationMinutes(fsiteKey));
record.setRate(source.isRate());
}
if (uri == null || loadedUris.contains(uri)) {
continue;
}
FFMPRecord record = new FFMPRecord(uri);
if (record.getDataTime().getRefTime()
.after(fbarrierTime)
|| isGuidance) {
try {
record = populateFFMPRecord(fisProductLoad,
uri, fsiteKey, fsourceName, fhuc);
if (record != null) {
populatedRecords.add(record);
if (source != null) {
record.setExpiration(source
.getExpirationMinutes(fsiteKey));
record.setRate(source.isRate());
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve FFMP URI, "
+ uri, e);
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"FFMP Can't retrieve FFMP URI, " + uri,
e);
}
}
}
}
for (FFMPRecord record : populatedRecords) {
record.getBasinData(fhuc).loadNow();
}
}
}
}

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.ffmp.ui.dialogs;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.JAXB;
@ -31,8 +30,6 @@ import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
@ -40,6 +37,9 @@ import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
import com.raytheon.uf.common.monitor.xml.ProductXML;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData.COLUMN_NAME;
import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML;
@ -55,6 +55,7 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
* ------------ ---------- ----------- --------------------------
* Aug 01, 2012 14168 mpduff Add convenience methods for
* getting ColorCell and ReverseFilter
* Apr 12, 2013 1902 mpduff Speed up cell coloring.
* Apr 15. 2013 1890 dhladky Added Mikes fix for singleton.
*
* </pre>
@ -63,6 +64,10 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML;
* @version 1.0
*/
public class FFMPConfig {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPConfig.class);
private static FFMPConfig classInstance = new FFMPConfig();
public static enum TableCellColor {
@ -200,20 +205,17 @@ public class FFMPConfig {
try {
IPathManager pm = PathManagerFactory.getPathManager();
Map<LocalizationLevel, LocalizationFile> fileMap = pm
.getTieredLocalizationFile(LocalizationType.CAVE_STATIC,
"ffmp" + fs + "guiConfig" + fs + xmlFileName);
String path = null;
if (fileMap.get(LocalizationLevel.USER) != null) {
path = fileMap.get(LocalizationLevel.USER).getFile(true)
.getAbsolutePath();
} else if (fileMap.get(LocalizationLevel.SITE) != null) {
path = fileMap.get(LocalizationLevel.SITE).getFile(true)
.getAbsolutePath();
File file = pm.getStaticFile("ffmp" + fs + "guiConfig" + fs
+ xmlFileName);
if (file != null) {
path = file.getAbsolutePath();
} else {
path = fileMap.get(LocalizationLevel.BASE).getFile(true)
.getAbsolutePath();
// Should never get here since there is a baseline version of
// the file.
statusHandler.handle(Priority.ERROR,
"Default FFMP Configuration File Not Found.");
return;
}
System.out.println("Path Config FFMP: " + path);
@ -305,20 +307,15 @@ public class FFMPConfig {
* color based on threshold
*/
public Color getThresholdColor(String colName, double val) {
if (thresholdLookup.containsKey(colName) == true) {
ArrayList<FFMPTableColumnXML> ffmpTableCols = ffmpCfgBasin
.getTableColumnData();
ThreshColNames colNames = thresholdLookup.get(colName);
if (colNames != null) {
FFMPTableColumnXML tableColData = ffmpCfgBasin
.getTableColumnData(colName);
if (tableColData.getColorCell()) {
TableCellColor cellColor = threshMgrMap.get(colNames)
.getThresholdColor(val);
for (FFMPTableColumnXML tableColData : ffmpTableCols) {
if (tableColData.getColumnName().compareTo(colName) == 0) {
if (tableColData.getColorCell()) {
return getCellColor(threshMgrMap.get(
thresholdLookup.get(colName))
.getThresholdColor(val));
} else {
return defaultColor;
}
}
return getCellColor(cellColor);
}
}

View file

@ -38,6 +38,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig.ThreshColNames;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 6, 2009 lvenable Initial creation
* Apr 12, 2013 1902 mpduff Optimized the color assignments.
*
* </pre>
*
@ -69,7 +70,7 @@ public class FFMPTableCellData {
private FIELDS columnName;
private FFMPConfig ffmpCfg = FFMPConfig.getInstance();
private static final FFMPConfig ffmpCfg = FFMPConfig.getInstance();
private boolean vgbFlag = false;
@ -77,6 +78,8 @@ public class FFMPTableCellData {
private String displayStr = null;
private double colorValue;
/**
* Constructor.
*
@ -86,13 +89,7 @@ public class FFMPTableCellData {
* The column value
*/
public FFMPTableCellData(FIELDS columnName, float value) {
if (columnName == FIELDS.RATIO) {
displayAsInt = true;
}
this.columnName = columnName;
this.value = value;
this.setColor();
this(columnName, value, false);
}
/**
@ -113,7 +110,18 @@ public class FFMPTableCellData {
this.columnName = columnName;
this.value = value;
this.guidForcedFlag = forced;
this.setColor();
if (displayAsInt == true) {
colorValue = Math.rint(value);
} else {
if (!this.value.isNaN()) {
colorValue = ((Math.round(value * 100.0)) / 100.0);
} else {
colorValue = Float.NaN;
}
}
this.generateCellColor();
}
/**
@ -171,16 +179,7 @@ public class FFMPTableCellData {
/**
* Set the RGB which is the cell background color.
*/
public void setColor() {
double tmpVal = value;
if (displayAsInt == true) {
tmpVal = Math.rint(value);
} else {
if (!value.isNaN()) {
tmpVal = (double) ((Math.round(value * 100.0))/100.0);
}
}
public void generateCellColor() {
if ((columnName == FIELDS.GUIDANCE) && this.guidForcedFlag) {
if (this.value.isNaN()) {
backgroundColor = ffmpCfg.getCellColor(TableCellColor.Default);
@ -189,11 +188,11 @@ public class FFMPTableCellData {
.getCellColor(TableCellColor.ForcedFFG);
}
} else if (columnName == FIELDS.GUIDANCE) {
backgroundColor = ffmpCfg.getThresholdColor(ThreshColNames.GUID.name(),
tmpVal);
backgroundColor = ffmpCfg.getThresholdColor(
ThreshColNames.GUID.name(), colorValue);
} else {
backgroundColor = ffmpCfg.getThresholdColor(columnName.name(),
tmpVal);
colorValue);
}
}

View file

@ -148,7 +148,7 @@ public class FFMPTableComp extends FFMPTable {
ArrayList<FFMPTableRowData> rowData = tableData.getTableRows();
for (int i = 0; i < rowData.size(); i++) {
rowData.get(i).getTableCellData(threshColumn.getColIndex())
.setColor();
.generateCellColor();
}
sortTableUsingConfig();

View file

@ -70,16 +70,18 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
* Feb 1, 2013 DR 1569 dhladky Switched to using pypies records instead of files
* Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord
* feb 20, 2013 1635 dhladky Fixed multi guidance displays
* Feb 28, 2013 1729 dhladky General enhancements for speed.
* Feb 28, 2013 1729 dhladky General enhancements for speed.
* Apr 12, 2013 1902 mpduff Code Cleanup.
* Apr 15, 2013 1890 dhladky Added another constant fix.
* Apr 15, 2013 1911 dhladky Fixed forced FFG for centered aggregates.
* </pre>
*
* @author dhladky
* @version 1.0
*/
public class FFMPDataGenerator {
private FfmpTableConfig tableConfig;
private final FfmpTableConfig tableConfig;
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(FFMPDataGenerator.class);
@ -88,23 +90,23 @@ public class FFMPDataGenerator {
private final String NA = "NA";
private String siteKey;
private final String siteKey;
private String dataKey;
private final String dataKey;
private ProductXML product;
private final ProductXML product;
private Date paintRefTime;
private final Date paintRefTime;
private Date tableTime;
private final Date tableTime;
private Object centeredAggregationKey;
private final Object centeredAggregationKey;
private String huc;
private final String huc;
private ArrayList<DomainXML> domains;
private final List<DomainXML> domains;
private double sliderTime;
private final double sliderTime;
private boolean isWorstCase = false;
@ -178,14 +180,14 @@ public class FFMPDataGenerator {
public FFMPTableData generateFFMPData() throws Exception {
// You should always have at least a QPE data source
FFMPTableData tData = null;
// update the FFFGDataManager
FFFGDataMgr.getUpdatedInstance();
tData = new FFMPTableData();
try {
FIELDS field = getBaseField();
if (field != null) {
if (baseRec != null) {
FFMPBasinData fbd = null;
@ -211,8 +213,7 @@ public class FFMPDataGenerator {
continue;
}
if ((cwa.equals(fmdb
.getCwa()))
if ((cwa.equals(fmdb.getCwa()))
|| (domain.isPrimary() && fmdb
.isPrimaryCwa())) {
try {
@ -255,9 +256,8 @@ public class FFMPDataGenerator {
* is in the CWA
*/
ArrayList<Long> pfafs = ft
.getAggregatePfafs(key, siteKey,
huc);
List<Long> pfafs = ft.getAggregatePfafs(
key, siteKey, huc);
boolean isVGB = false;
if (ft.checkVGBsInAggregate(key, siteKey,
@ -302,11 +302,11 @@ public class FFMPDataGenerator {
|| (domain.isPrimary() && fmdb
.isPrimaryCwa())) {
setFFMPRow(fbd.get(key), tData,
false, null);
// virtual basin
if (virtualBasin != null) {
for (Long id : ft
setFFMPRow(fbd.get(key), tData,
false, null);
if (virtualBasin != null) {
for (Long id : ft
.getVirtualGageBasinLookupIds(
siteKey,
key,
@ -329,7 +329,7 @@ public class FFMPDataGenerator {
}
}
}
}
}
}
}
tData.sortData();
@ -337,7 +337,8 @@ public class FFMPDataGenerator {
}
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, "Failed to load FFMP table data!", e);
statusHandler.handle(Priority.PROBLEM,
"Failed to load FFMP table data!", e);
}
return tData;
@ -348,11 +349,11 @@ public class FFMPDataGenerator {
try {
if (cBasin instanceof FFMPVirtualGageBasin) {
if (tData.containsPfaf(((FFMPVirtualGageBasin) cBasin).getLid()
.toString()) == true) {
.toString())) {
return;
}
} else {
if (tData.containsPfaf(cBasin.getPfaf().toString()) == true) {
if (tData.containsPfaf(cBasin.getPfaf().toString())) {
return;
}
}
@ -380,7 +381,6 @@ public class FFMPDataGenerator {
rowField = FIELDS.VIRTUAL;
String lid = ((FFMPVirtualGageBasin) cBasin).getLid();
if (lid != null) {
@ -396,7 +396,7 @@ public class FFMPDataGenerator {
Long parentBasinPfaf = fvgmbd.getParentPfaf();
if (fvgmbd != null) {
mouseOverText = metabasin.getBasinId() + "\n"
+ fvgmbd.getLid() + "-" + fvgmbd.getName();
@ -405,8 +405,9 @@ public class FFMPDataGenerator {
}
}
trd.setTableCellData(0, new FFMPTableCellData(rowField,
sb.toString(), mouseOverText));
trd.setTableCellData(0,
new FFMPTableCellData(rowField, sb.toString(),
mouseOverText));
if (!isWorstCase || huc.equals(ALL)
|| (centeredAggregationKey != null)) {
@ -414,14 +415,11 @@ public class FFMPDataGenerator {
if (!cBasin.getValues().isEmpty()) {
rate = ((FFMPVirtualGageBasin) cBasin)
.getValue(paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, rate));
} else {
trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, Float.NaN));
}
if (!cBasin.getValues().isEmpty()) {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
rate));
if (!cBasin.getValues().isEmpty()) {
if (sliderTime > 0.00) {
qpe = cBasin.getAccumValue(monitor.getQpeWindow()
.getAfterTime(), monitor.getQpeWindow()
@ -429,38 +427,34 @@ public class FFMPDataGenerator {
} else {
qpe = 0.0f;
}
trd.setTableCellData(2, new FFMPTableCellData(
FIELDS.QPE, qpe));
} else {
trd.setTableCellData(2, new FFMPTableCellData(
FIELDS.QPE, Float.NaN));
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
if ((qpfBasin != null)
&& (qpfBasin.get(parentBasinPfaf) != null)) {
qpf = qpfBasin.get(parentBasinPfaf).getAverageValue(
monitor.getQpfWindow().getAfterTime(),
monitor.getQpfWindow().getBeforeTime());
trd.setTableCellData(3, new FFMPTableCellData(
FIELDS.QPF, qpf));
} else {
trd.setTableCellData(3, new FFMPTableCellData(
FIELDS.QPF, Float.NaN));
}
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
qpf));
// run over each guidance type
int i = 0;
for (String guidType : guidBasins.keySet()) {
List<Long> pfafList = new ArrayList<Long>();
List<Long> forcedPfafs = new ArrayList<Long>();
guidance = Float.NaN;
boolean forced = false;
Float diffValue = Float.NaN;
Float ratioValue = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType);
FFMPBasinData guidBasin = guidBasins.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType);
if ((guidBasin != null)
&& ((FFMPGuidanceBasin) guidBasin
.get(parentBasinPfaf) != null)) {
@ -551,23 +545,15 @@ public class FFMPDataGenerator {
FIELDS.GUIDANCE, Float.NaN));
}
// If guidance is NaN then it cannot be > 0
if (!qpe.isNaN() && (guidance > 0.0f)) {
trd.setTableCellData(
i + 5,
new FFMPTableCellData(FIELDS.RATIO,
FFMPUtils.getRatioValue(qpe,
guidance)));
trd.setTableCellData(
i + 6,
new FFMPTableCellData(FIELDS.DIFF,
FFMPUtils.getDiffValue(qpe,
guidance)));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, Float.NaN));
ratioValue = FFMPUtils.getRatioValue(qpe, guidance);
diffValue = FFMPUtils.getDiffValue(qpe, guidance);
}
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, ratioValue));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, diffValue));
i += 3;
}
@ -595,25 +581,20 @@ public class FFMPDataGenerator {
&& (rateBasin.get(cBasin.getPfaf()) != null)) {
rate = rateBasin.get(cBasin.getPfaf()).getValue(
paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, rate));
// System.out.println("rate: "+rate);
} else {
trd.setTableCellData(1, new FFMPTableCellData(
FIELDS.RATE, Float.NaN));
}
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
rate));
if ((qpeBasin != null)
&& (qpeBasin.get(cBasin.getPfaf()) != null)) {
qpe = qpeBasin.get(cBasin.getPfaf()).getAccumValue(
monitor.getQpeWindow().getAfterTime(),
monitor.getQpeWindow().getBeforeTime(),
expirationTime, isRate);
trd.setTableCellData(2, new FFMPTableCellData(
FIELDS.QPE, qpe));
} else {
trd.setTableCellData(2, new FFMPTableCellData(
FIELDS.QPE, Float.NaN));
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
if ((qpfBasin != null)
&& (qpfBasin.get(cBasin.getPfaf()) != null)) {
@ -622,25 +603,27 @@ public class FFMPDataGenerator {
monitor.getQpfWindow().getBeforeTime());
// qpf = getQPFValue(false, cBasin.getPfaf(),
// new ArrayList<Long>());/* DR13839 */
trd.setTableCellData(3, new FFMPTableCellData(
FIELDS.QPF, qpf));
// System.out.println("qpf: "+qpf);
} else {
trd.setTableCellData(3, new FFMPTableCellData(
FIELDS.QPF, Float.NaN));
}
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
qpf));
// run over each guidance type
int i = 0;
Float ratioValue;
Float diffValue;
for (String guidType : guidBasins.keySet()) {
List<Long> pfafList = new ArrayList<Long>();
List<Long> forcedPfafs = new ArrayList<Long>();
guidance = Float.NaN;
boolean forced = false;
ratioValue = Float.NaN;
diffValue = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType);
FFMPBasinData guidBasin = guidBasins.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType);
if ((guidBasin != null)
&& ((FFMPGuidanceBasin) guidBasin.get(cBasin
.getPfaf()) != null)) {
@ -731,7 +714,7 @@ public class FFMPDataGenerator {
// check for forcing even if no data are available
guidance = getForcedAvg(forceUtil, domain, cBasin,
guidType);
if (guidance.isNaN() == false) {
if (!guidance.isNaN()) {
forced = true;
} else {
forced = false;
@ -741,23 +724,15 @@ public class FFMPDataGenerator {
FIELDS.GUIDANCE, guidance, forced));
}
// If guidance is NaN then it cannot be > 0
if (!qpe.isNaN() && (guidance > 0.0f)) {
trd.setTableCellData(
i + 5,
new FFMPTableCellData(FIELDS.RATIO,
FFMPUtils.getRatioValue(qpe,
guidance)));
trd.setTableCellData(
i + 6,
new FFMPTableCellData(FIELDS.DIFF,
FFMPUtils.getDiffValue(qpe,
guidance)));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, Float.NaN));
ratioValue = FFMPUtils.getRatioValue(qpe, guidance);
diffValue = FFMPUtils.getDiffValue(qpe, guidance);
}
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, ratioValue));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, diffValue));
i += 3;
}
@ -782,7 +757,7 @@ public class FFMPDataGenerator {
forceUtil.calculateForcings(domain, ft, cBasin);
forcedPfafs = forceUtil.getForcedPfafList();
forced = forceUtil.isForced();
if (forced == false) {
if (!forced) {
return Float.NaN;
}
} else {
@ -885,20 +860,15 @@ public class FFMPDataGenerator {
Float guidance = Float.NaN;
Float rate = Float.NaN;
Float qpf = Float.NaN;
Float ratioValue = Float.NaN;
Float diffValue = Float.NaN;
if (cBasin instanceof FFMPVirtualGageBasin) {
if (!pfafs.isEmpty()) {
if (virtualBasin != null) {
trd.setTableCellData(
1,
new FFMPTableCellData(FIELDS.RATE, virtualBasin
.get(cBasin.getPfaf()).getValue(
paintRefTime)));
} else {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
Float.NaN));
}
if (virtualBasin != null) {
rate = virtualBasin.get(cBasin.getPfaf()).getValue(
paintRefTime);
if (sliderTime > 0.00) {
qpe = virtualBasin.get(cBasin.getPfaf()).getAccumValue(
monitor.getQpeWindow().getAfterTime(),
@ -907,104 +877,40 @@ public class FFMPDataGenerator {
} else {
qpe = 0.0f;
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
} else {
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
Float.NaN));
}
trd.setTableCellData(1,
new FFMPTableCellData(FIELDS.RATE, rate));
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe));
if (qpfBasin != null) {
trd.setTableCellData(
3,
new FFMPTableCellData(FIELDS.QPF, new Float(
qpfBasin.get(cBasin.getPfaf()).getMaxValue(
monitor.getQpfWindow()
.getAfterTime(),
monitor.getQpfWindow()
.getBeforeTime()))
.floatValue()));
} else {
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
Float.NaN));
qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue(
monitor.getQpfWindow().getAfterTime(),
monitor.getQpfWindow().getBeforeTime()))
.floatValue();
}
// run over each guidance type
int i = 0;
for (String guidType : guidBasins.keySet()) {
FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf));
FFMPBasinData guidBasin = guidBasins.get(guidType);
if (guidBasin != null) {
FFMPGuidanceBasin basin = ((FFMPGuidanceBasin) guidBasin
.get(cBasin.getPfaf()));
guidance = resource.getGuidanceValue(basin, monitor
.getQpeWindow().getBeforeTime(), guidType);
forceUtil.calculateForcings(pfafs, ft, cBasin);
List<Long> forcedPfafs = forceUtil.getForcedPfafList();
boolean forced = forceUtil.isForced();
if (!forced) {
if ((forcedPfafs != null)
&& (!forcedPfafs.isEmpty())) {
forced = true;
}
}
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, guidance, forced));
} else {
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, Float.NaN));
}
if (!qpe.isNaN() && (guidance > 0.0f)) {
trd.setTableCellData(
i + 5,
new FFMPTableCellData(FIELDS.RATIO, FFMPUtils
.getRatioValue(qpe, guidance)));
trd.setTableCellData(
i + 6,
new FFMPTableCellData(FIELDS.DIFF, FFMPUtils
.getDiffValue(qpe, guidance)));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, Float.NaN));
}
i += 3;
}
processGuidance(trd, cBasin, pfafs, qpe);
}
} else {
// Not Virtual
if (!pfafs.isEmpty()) {
if (rateBasin != null) {
rate = rateBasin.getMaxValue(pfafs, paintRefTime);
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
rate));
} else {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
Float.NaN));
}
trd.setTableCellData(1,
new FFMPTableCellData(FIELDS.RATE, rate));
if (qpeBasin != null) {
qpe = qpeBasin.getAccumMaxValue(pfafs, monitor
.getQpeWindow().getBeforeTime(), monitor
.getQpeWindow().getAfterTime(), expirationTime,
isRate);
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
} else {
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
Float.NaN));
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe));
if (qpfBasin != null) {
qpf = qpfBasin.getAverageMaxValue(pfafs, monitor
.getQpfWindow().getAfterTime(), monitor
@ -1012,16 +918,17 @@ public class FFMPDataGenerator {
// qpf = getQPFValue(true, new Long(0l), pfafs);/* DR13839
// */
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
qpf.floatValue()));
} else {
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
Float.NaN));
}
trd.setTableCellData(3,
new FFMPTableCellData(FIELDS.QPF, qpf.floatValue()));
// run over each guidance type
int i = 0;
for (String guidType : guidBasins.keySet()) {
guidance = Float.NaN;
diffValue = Float.NaN;
ratioValue = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
@ -1078,6 +985,8 @@ public class FFMPDataGenerator {
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, Float.NaN));
}
// If guidance is NaN then it cannot be > 0
if (!qpe.isNaN() && (guidance > 0.0f)) {
List<Float> qpes = qpeBasin.getAccumValues(pfafs,
@ -1093,23 +1002,14 @@ public class FFMPDataGenerator {
if ((!qpes.isEmpty())
&& ((guids != null) && (!guids.isEmpty()))) {
trd.setTableCellData(
i + 5,
new FFMPTableCellData(FIELDS.RATIO,
FFMPUtils.getMaxRatioValue(qpes,
guids)));
trd.setTableCellData(
i + 6,
new FFMPTableCellData(FIELDS.DIFF,
FFMPUtils.getMaxDiffValue(qpes,
guids)));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, Float.NaN));
ratioValue = FFMPUtils
.getMaxRatioValue(qpes, guids);
diffValue = FFMPUtils.getMaxDiffValue(qpes, guids);
}
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, ratioValue));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, diffValue));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
@ -1123,98 +1023,31 @@ public class FFMPDataGenerator {
} else {
if ((rateBasin != null)
&& (rateBasin.get(cBasin.getPfaf()) != null)) {
trd.setTableCellData(
1,
new FFMPTableCellData(FIELDS.RATE, rateBasin.get(
cBasin.getPfaf()).getValue(paintRefTime)));
} else {
trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE,
Float.NaN));
rate = rateBasin.get(cBasin.getPfaf()).getValue(
paintRefTime);
}
trd.setTableCellData(1,
new FFMPTableCellData(FIELDS.RATE, rate));
if ((qpeBasin != null)
&& (qpeBasin.get(cBasin.getPfaf()) != null)) {
qpe = qpeBasin.get(cBasin.getPfaf()).getAccumValue(
monitor.getQpeWindow().getAfterTime(),
monitor.getQpeWindow().getBeforeTime(),
expirationTime, isRate);
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
} else {
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
Float.NaN));
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe));
if ((qpfBasin != null)
&& (qpfBasin.get(cBasin.getPfaf()) != null)) {
trd.setTableCellData(
3,
new FFMPTableCellData(FIELDS.QPF, new Float(
qpfBasin.get(cBasin.getPfaf()).getMaxValue(
monitor.getQpfWindow()
.getAfterTime(),
monitor.getQpfWindow()
.getBeforeTime()))
.floatValue()));
} else {
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
Float.NaN));
qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue(
monitor.getQpfWindow().getAfterTime(),
monitor.getQpfWindow().getBeforeTime()))
.floatValue();
}
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf));
// run over each guidance type
int i = 0;
for (String guidType : guidBasins.keySet()) {
FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType);
if (guidBasin != null) {
FFMPGuidanceBasin basin = ((FFMPGuidanceBasin) guidBasin
.get(cBasin.getPfaf()));
guidance = resource.getGuidanceValue(basin, monitor
.getQpeWindow().getBeforeTime(), guidType);
if (guidance < 0.0f) {
guidance = Float.NaN;
}
forceUtil.calculateForcings(pfafs, ft, cBasin);
List<Long> forcedPfafs = forceUtil.getForcedPfafList();
boolean forced = forceUtil.isForced();
if (!forced) {
if ((forcedPfafs != null)
&& (!forcedPfafs.isEmpty())) {
forced = true;
}
}
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, guidance, forced));
} else {
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, Float.NaN));
}
if (!qpe.isNaN() && (guidance > 0.0f)) {
trd.setTableCellData(
i + 5,
new FFMPTableCellData(FIELDS.RATIO, FFMPUtils
.getRatioValue(qpe, guidance)));
trd.setTableCellData(
i + 6,
new FFMPTableCellData(FIELDS.DIFF, FFMPUtils
.getDiffValue(qpe, guidance)));
} else {
trd.setTableCellData(i + 5, new FFMPTableCellData(
FIELDS.RATIO, Float.NaN));
trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, Float.NaN));
}
i += 3;
}
processGuidance(trd, cBasin, pfafs, qpe);
}
}
@ -1222,6 +1055,71 @@ public class FFMPDataGenerator {
return trd;
}
/**
* @param trd
* @param cBasin
* @param pfafs
* @param qpe
*/
private void processGuidance(FFMPTableRowData trd, FFMPBasin cBasin,
ArrayList<Long> pfafs, Float qpe) {
Float guidance;
Float ratioValue;
Float diffValue;
int i = 0;
for (String guidType : guidBasins.keySet()) {
guidance = Float.NaN;
diffValue = Float.NaN;
ratioValue = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFMPBasinData guidBasin = guidBasins.get(guidType);
if (guidBasin != null) {
FFMPGuidanceBasin basin = ((FFMPGuidanceBasin) guidBasin
.get(cBasin.getPfaf()));
guidance = resource.getGuidanceValue(basin, monitor
.getQpeWindow().getBeforeTime(), guidType);
if (guidance < 0.0f) {
guidance = Float.NaN;
}
forceUtil.calculateForcings(pfafs, ft, cBasin);
List<Long> forcedPfafs = forceUtil.getForcedPfafList();
boolean forced = forceUtil.isForced();
if (!forced) {
if ((forcedPfafs != null) && (!forcedPfafs.isEmpty())) {
forced = true;
}
}
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, guidance, forced));
} else {
trd.setTableCellData(i + 4, new FFMPTableCellData(
FIELDS.GUIDANCE, Float.NaN));
}
// If guidance is NaN then it cannot be > 0
if (!qpe.isNaN() && (guidance > 0.0f)) {
ratioValue = FFMPUtils.getRatioValue(qpe, guidance);
diffValue = FFMPUtils.getDiffValue(qpe, guidance);
}
trd.setTableCellData(i + 5, new FFMPTableCellData(FIELDS.RATIO,
ratioValue));
trd.setTableCellData(i + 6, new FFMPTableCellData(FIELDS.DIFF,
diffValue));
i += 3;
}
}
/**
* Gets the base field
*

View file

@ -23,9 +23,12 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPAggregateRecord;
@ -67,6 +70,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent;
* Feb 28, 2013 1729 dhladky Changed the way status messages are sent to the FFMP Dialog.
* Mar 6, 2013 1769 dhladky Changed threading to use count down latch.
* Apr 9, 2013 1890 dhladky removed loading of phantom Virtual template and cache file processing.
* Apr 18, 2013 1912 bsteffen Increase bulk requests to pypies.
*
* </pre>
*
* @author dhladky
@ -167,15 +172,36 @@ public class FFMPDataLoader extends Thread {
.getSourceConfig();
ProductRunXML productRun = runner.getProduct(siteKey);
ArrayList<String> qpfSources = new ArrayList<String>();
ArrayList<SourceXML> qpfSources = new ArrayList<SourceXML>();
String layer = config.getFFMPConfigData().getLayer();
boolean isProductLoad = true;
String rateURI = null;
if ((loadType == LOADER_TYPE.INITIAL)
|| (loadType == LOADER_TYPE.GENERAL)) {
rateURI = monitor.getAvailableUri(siteKey, dataKey,
product.getRate(), mostRecentTime);
if (loadType != LOADER_TYPE.GENERAL) {
// preload all the uris except guidance. Guidance loads data
// much further back and it is not efficient to group with the
// rest.
Set<String> sources = new HashSet<String>();
sources.add(product.getRate());
sources.add(product.getQpe());
sources.add(product.getVirtual());
for (String qpfType : productRun.getQpfTypes(product)) {
for (SourceXML qpfSource : productRun.getQpfSources(
product, qpfType)) {
sources.add(qpfSource.getSourceName());
}
}
monitor.preloadAvailableUris(siteKey, dataKey, sources,
timeBack);
}
if ((loadType == LOADER_TYPE.INITIAL || loadType == LOADER_TYPE.GENERAL)
&& !product.getRate().equals(product.getQpe())) {
Map<Date, List<String>> rateURIs = monitor
.getAvailableUris(siteKey, dataKey, product.getRate(),
mostRecentTime);
if (rateURIs.containsKey(mostRecentTime)) {
rateURI = rateURIs.get(mostRecentTime).get(0);
}
}
NavigableMap<Date, List<String>> qpeURIs = monitor
@ -201,7 +227,7 @@ public class FFMPDataLoader extends Thread {
if (qpfURIs != null && !qpfURIs.isEmpty()) {
qpfs.add(qpfURIs);
qpfSources.add(qpfSource.getSourceName());
qpfSources.add(qpfSource);
}
}
}
@ -267,7 +293,7 @@ public class FFMPDataLoader extends Thread {
SourceXML source = sourceConfig.getSource(product.getQpe());
qpeCache = readAggregateRecord(source, dataKey, wfo);
qpeCache = readAggregateRecord(source, dataKey, wfo);
if (qpeCache != null) {
monitor.insertFFMPData(qpeCache, qpeURIs, siteKey, product.getQpe());
@ -276,7 +302,7 @@ public class FFMPDataLoader extends Thread {
// Use this method of QPE data retrieval if you don't have cache
// files
if (!qpeURIs.isEmpty() && qpeCache == null) {
if (!qpeURIs.isEmpty()) {
for (String phuc : hucsToLoad) {
if (phuc.equals(layer) || phuc.equals(FFMPRecord.ALL)) {
monitor.processUris(qpeURIs, isProductLoad, siteKey,
@ -296,45 +322,22 @@ public class FFMPDataLoader extends Thread {
if (loadType == LOADER_TYPE.INITIAL) {
SourceXML source = sourceConfig
.getSource(qpfSources.get(i));
SourceXML source = qpfSources.get(i);
String pdataKey = findQPFHomeDataKey(source);
qpfCache = readAggregateRecord(source, pdataKey, wfo);
if (qpfCache != null) {
for (String phuc : hucsToLoad) {
if ((phuc.equals(layer) || phuc
.equals(FFMPRecord.ALL))
&& loadType == LOADER_TYPE.INITIAL
&& source.getSourceName().equals(
config.getFFMPConfigData()
.getIncludedQPF())) {
if (!qpfURIs.isEmpty()) {
monitor.processUris(qpfURIs, isProductLoad,
siteKey, source.getSourceName(),
timeBack, phuc);
}
}
}
monitor.insertFFMPData(qpfCache, qpfURIs, siteKey,
source.getSourceName());
}
}
// if (isUrisProcessNeeded(qpfData,qpfURIs))
// {/*DR13839*/
// Use this method of QPF data retrieval if you don't have cache
// files
if ((qpfCache == null) && !qpfURIs.isEmpty()) {
if (!qpfURIs.isEmpty()) {
for (String phuc : hucsToLoad) {
if (phuc.equals(layer) || phuc.equals(FFMPRecord.ALL)) { // old
// code:
// keep
// for
// reference*/
// if (isHucProcessNeeded(phuc)) {/*DR13839*/
monitor.processUris(qpfURIs, isProductLoad,
siteKey, product.getQpf(i), timeBack, phuc);
}

View file

@ -20,6 +20,8 @@
package com.raytheon.uf.viz.monitor.ffmp.xml;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@ -29,6 +31,22 @@ import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* Config Basin xml object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Initial creation
* Apr 12, 2013 1902 mpduff Return a FFMPTableColumnXML object.
*
* </pre>
*
*/
@XmlRootElement(name = "FfmpConfigBasin")
@XmlAccessorType(XmlAccessType.NONE)
public class FFMPConfigBasinXML implements ISerializableObject {
@ -91,6 +109,11 @@ public class FFMPConfigBasinXML implements ISerializableObject {
@XmlElements({ @XmlElement(name = "TableColumn", type = FFMPTableColumnXML.class) })
private ArrayList<FFMPTableColumnXML> tableColumnData;
/**
* Temp data structure.
*/
private transient Map<String, FFMPTableColumnXML> tableColumnMap = new HashMap<String, FFMPTableColumnXML>();
public FFMPConfigBasinXML() {
}
@ -230,4 +253,24 @@ public class FFMPConfigBasinXML implements ISerializableObject {
public void setTableColumnData(ArrayList<FFMPTableColumnXML> tableColumnData) {
this.tableColumnData = tableColumnData;
}
/**
* Get the FFMPTableColumn object for the provided column name
*
* @param colName
* the column name
* @return the FFMPTableColumnXML object
*/
public FFMPTableColumnXML getTableColumnData(String colName) {
if (!tableColumnMap.containsKey(colName)) {
for (FFMPTableColumnXML tc : tableColumnData) {
if (tc.getColumnName().equals(colName)) {
tableColumnMap.put(colName, tc);
break;
}
}
}
return tableColumnMap.get(colName);
}
}

View file

@ -22,40 +22,36 @@ package com.raytheon.uf.viz.monitor.scan;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
/**
*
* Action for launching the Scan Resource with Cell data
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 01/01/09 Initial Creation.
* 04/23/13 1926 njensen Use ScanStarterJob
*
*
* </pre>
*
* @version 1.0
*/
public class CellAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
String icao = arg0.getParameter("icao");
System.out.println("Activating/Action for Cell table...");
final String ficao = icao;
Display.getDefault().asyncExec(new Runnable() {
ScanStarterJob job = new ScanStarterJob(icao, ScanTables.CELL);
job.setSystem(false);
job.schedule();
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
ScanMonitor scan = ScanMonitor.getInstance();
// first time initialization, or re-init
if (scan.icaos.size() == 0
|| !scan.icaos.contains(ficao)) {
scan.launchSplash(shell);
scan.setup(ficao);
}
scan.launchDialog(shell, ficao, ScanTables.CELL);
}
});
return null;
}
}

View file

@ -22,41 +22,35 @@ package com.raytheon.uf.viz.monitor.scan;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
/**
*
* Action for launching the Scan Resource with DMD data
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 01/01/09 Initial Creation.
* 04/23/13 1926 njensen Use ScanStarterJob
*
* </pre>
*
* @version 1.0
*/
public class DmdAction extends AbstractHandler {
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
String icao = arg0.getParameter("icao");
System.out.println("Activating/Action for DMD table...");
final String ficao = icao;
Display.getDefault().asyncExec(new Runnable() {
ScanStarterJob job = new ScanStarterJob(icao, ScanTables.DMD);
job.setSystem(false);
job.schedule();
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
ScanMonitor scan = ScanMonitor.getInstance();
// first time initialization, or re-init
if (scan.icaos.size() == 0
|| !scan.icaos.contains(ficao)) {
scan.launchSplash(shell);
scan.setup(ficao);
}
scan.launchDialog(shell, ficao, ScanTables.DMD);
}
});
return null;
}
}

View file

@ -35,6 +35,7 @@ import java.util.Set;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
import org.eclipse.swt.graphics.Color;
@ -108,6 +109,8 @@ import com.vividsolutions.jts.io.WKBReader;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 29, 2009 dhladky Initial creation
* Apr 18, 2013 1926 njensen Changed inner data maps to have Long key
* to avoid !TimeStamp.equals(Date) issue
* </pre>
*
* @author dhladky
@ -142,19 +145,19 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
* DMD table data, indexed by time and volume scan (with a record for each
* azimith and elevation)
**/
public HashMap<String, ConcurrentHashMap<Date, DMDScanData>> dmdData = null;
public Map<String, ConcurrentMap<Long, DMDScanData>> dmdData = null;
/** tvs table data, indexed by time **/
@SuppressWarnings("rawtypes")
public HashMap<String, ConcurrentHashMap<Date, ScanTableData>> tvsData = null;
public Map<String, ConcurrentMap<Long, ScanTableData>> tvsData = null;
/** MESO table data, indexed by time **/
@SuppressWarnings("rawtypes")
public HashMap<String, ConcurrentHashMap<Date, ScanTableData>> mdData = null;
public Map<String, ConcurrentMap<Long, ScanTableData>> mdData = null;
/** cell table data, indexed by time **/
@SuppressWarnings("rawtypes")
public HashMap<String, ConcurrentHashMap<Date, ScanTableData>> cellData = null;
public Map<String, ConcurrentMap<Long, ScanTableData>> cellData = null;
/** Array of scan listeners **/
private final ArrayList<IScanRadarListener> scanListeners = new ArrayList<IScanRadarListener>();
@ -245,10 +248,10 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
*/
@SuppressWarnings("rawtypes")
private void createDataStructures() {
dmdData = new HashMap<String, ConcurrentHashMap<Date, DMDScanData>>();
tvsData = new HashMap<String, ConcurrentHashMap<Date, ScanTableData>>();
mdData = new HashMap<String, ConcurrentHashMap<Date, ScanTableData>>();
cellData = new HashMap<String, ConcurrentHashMap<Date, ScanTableData>>();
dmdData = new HashMap<String, ConcurrentMap<Long, DMDScanData>>();
tvsData = new HashMap<String, ConcurrentMap<Long, ScanTableData>>();
mdData = new HashMap<String, ConcurrentMap<Long, ScanTableData>>();
cellData = new HashMap<String, ConcurrentMap<Long, ScanTableData>>();
}
/**
@ -314,10 +317,10 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
setStationCoordinate(icao);
setCwa(icao);
dmdData.put(icao, new ConcurrentHashMap<Date, DMDScanData>());
cellData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
tvsData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
mdData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
dmdData.put(icao, new ConcurrentHashMap<Long, DMDScanData>());
cellData.put(icao, new ConcurrentHashMap<Long, ScanTableData>());
tvsData.put(icao, new ConcurrentHashMap<Long, ScanTableData>());
mdData.put(icao, new ConcurrentHashMap<Long, ScanTableData>());
// kill splash
if (scanSplashDlg != null) {
@ -505,11 +508,11 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
if ((scanType == ScanTables.MESO) || (scanType == ScanTables.TVS)) {
scanType = ScanTables.CELL;
}
Set<Date> ds = getData(scanType, icao).keySet();
Set<Long> ds = getData(scanType, icao).keySet();
DataTime[] times = new DataTime[ds.size()];
int i = 0;
for (Date d : ds) {
times[i] = new DataTime(d);
for (Long d : ds) {
times[i] = new DataTime(new Date(d));
i++;
}
java.util.Arrays.sort(times);
@ -545,30 +548,39 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
/**
* Sends a String from the TABLE enum for which table data to grab
*/
public ConcurrentHashMap<Date, ?> getData(ScanTables table, String icao) {
@SuppressWarnings({ "rawtypes", "unchecked" })
public ConcurrentMap<Long, ?> getData(ScanTables table, String icao) {
ConcurrentMap<Long, ?> data = null;
ConcurrentHashMap<Date, ?> data = null;
if (table.equals(ScanTables.CELL)) {
if (cellData.get(icao) == null) {
cellData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
}
switch (table) {
case CELL:
data = cellData.get(icao);
} else if (table.equals(ScanTables.DMD)) {
if (dmdData.get(icao) == null) {
dmdData.put(icao, new ConcurrentHashMap<Date, DMDScanData>());
if (data == null) {
data = new ConcurrentHashMap<Long, ScanTableData>();
cellData.put(icao, (ConcurrentMap<Long, ScanTableData>) data);
}
break;
case DMD:
data = dmdData.get(icao);
} else if (table.equals(ScanTables.MESO)) {
if (mdData.get(icao) == null) {
mdData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
if (data == null) {
data = new ConcurrentHashMap<Long, DMDScanData>();
dmdData.put(icao, (ConcurrentHashMap<Long, DMDScanData>) data);
}
break;
case MESO:
data = mdData.get(icao);
} else if (table.equals(ScanTables.TVS)) {
if (tvsData.get(icao) == null) {
tvsData.put(icao, new ConcurrentHashMap<Date, ScanTableData>());
if (data == null) {
data = new ConcurrentHashMap<Long, ScanTableData>();
mdData.put(icao, (ConcurrentMap<Long, ScanTableData>) data);
}
break;
case TVS:
data = tvsData.get(icao);
if (data == null) {
data = new ConcurrentHashMap<Long, ScanTableData>();
tvsData.put(icao, (ConcurrentMap<Long, ScanTableData>) data);
}
break;
}
return data;
@ -581,25 +593,29 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
public ScanTableData<?> getTableData(ScanTables table, String icao,
Date time) {
ScanTableData<?> tableData = null;
if (table == ScanTables.CELL) {
tableData = (ScanTableData<?>) getData(table, icao).get(time);
} else if (table == ScanTables.DMD) {
if (getData(table, icao).containsKey(time)) {
tableData = ((DMDScanData) getData(table, icao).get(time))
.getTableData(time.getTime());
}
} else if ((table == ScanTables.TVS) || (table == ScanTables.MESO)) {
if (getData(table, icao).containsKey(time)) {
tableData = (ScanTableData<?>) getData(table, icao).get(time);
} else {
ConcurrentMap<Long, ?> data = getData(table, icao);
long longtime = time.getTime();
switch (table) {
case CELL:
case TVS:
case MESO:
tableData = (ScanTableData<?>) data.get(longtime);
if (tableData == null
&& (table == ScanTables.TVS || table == ScanTables.MESO)) {
tableData = getNewTableData(table, icao, time,
getTiltAngle(table, icao));
if (tableData != null) {
((ConcurrentHashMap<Date, ScanTableData>) getData(table,
icao)).put(time, tableData);
((ConcurrentHashMap<Long, ScanTableData>) data).put(
longtime, tableData);
}
}
break;
case DMD:
DMDScanData dmdsd = (DMDScanData) data.get(longtime);
if (dmdsd != null) {
tableData = dmdsd.getTableData(longtime);
}
break;
}
return tableData;
@ -612,9 +628,10 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
double tiltAngle) {
ScanTables dmd = ScanTables.DMD;
ScanTableData<?> tableData = null;
if (getData(dmd, icao).containsKey(time)) {
tableData = ((DMDScanData) getData(dmd, icao).get(time))
.getTableData(time.getTime());
ConcurrentMap<Long, ?> data = getData(dmd, icao);
DMDScanData dmdsd = (DMDScanData) data.get(time.getTime());
if (dmdsd != null) {
tableData = dmdsd.getTableData(time.getTime());
}
return tableData;
@ -650,24 +667,25 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
@SuppressWarnings({ "unchecked" })
public void setTableData(String icao, ScanTableData<?> data, Date date,
double angle, Date scanTime, String type) {
long longScanTime = scanTime.getTime();
if (type.equals(ScanTables.DMD.name())) {
if (getData(ScanTables.DMD, icao).containsKey(scanTime)) {
if (((DMDScanData) getData(ScanTables.DMD, icao).get(scanTime))
.containsKey(angle) == false) {
((DMDScanData) getData(ScanTables.DMD, icao).get(scanTime))
.addData(angle, date.getTime(), data);
ConcurrentMap<Long, DMDScanData> dataMap = (ConcurrentMap<Long, DMDScanData>) getData(
ScanTables.DMD, icao);
if (dataMap.containsKey(longScanTime)) {
DMDScanData dmdsd = dataMap.get(longScanTime);
if (!dmdsd.containsKey(angle)) {
dmdsd.addData(angle, date.getTime(), data);
}
} else { // new volume scan
DMDScanData sdata = new DMDScanData(scanTime.getTime());
((ConcurrentHashMap<Date, DMDScanData>) getData(ScanTables.DMD,
icao)).put(scanTime, sdata);
((DMDScanData) getData(ScanTables.DMD, icao).get(scanTime))
.addData(angle, date.getTime(), data);
DMDScanData sdata = new DMDScanData(longScanTime);
sdata.addData(angle, date.getTime(), data);
dataMap.put(longScanTime, sdata);
}
} else if (type.equals(ScanTables.CELL.name())) {
if (!getData(ScanTables.CELL, icao).containsKey(scanTime)) {
((ConcurrentHashMap<Date, ScanTableData<?>>) getData(
ScanTables.CELL, icao)).put(scanTime, data);
ConcurrentMap<Long, ScanTableData<?>> dataMap = (ConcurrentMap<Long, ScanTableData<?>>) getData(
ScanTables.CELL, icao);
if (!dataMap.containsKey(longScanTime)) {
dataMap.put(longScanTime, data);
}
}
}
@ -1318,7 +1336,7 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
// minutes
// dmdScanData = new DMDScanData();
dmdScanData = (DMDScanData) getData(ScanTables.DMD, icao).get(
date);
date.getTime());
TreeMap<Long, DMDTableDataRow> tmp = dmdScanData
.getTimeHeightData(tableCol, dmdIdent);
@ -1358,11 +1376,11 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
* @param set
* @return
*/
public ArrayList<Date> getTimeOrderedKeys(IMonitor monitor, String type,
public List<Date> getTimeOrderedKeys(IMonitor monitor, String type,
String icao) {
ArrayList<Date> dates = new ArrayList<Date>();
for (Date date : getData(ScanTables.valueOf(type), icao).keySet()) {
dates.add(date);
List<Date> dates = new ArrayList<Date>();
for (Long date : getData(ScanTables.valueOf(type), icao).keySet()) {
dates.add(new Date(date));
}
Collections.sort(dates, new SortByDate());
return dates;
@ -1818,11 +1836,12 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
}
public void purge() {
long dateTime = date.getTime();
ConcurrentHashMap<Date, ?> data = getData(table, icao);
ConcurrentMap<Long, ?> data = getData(table, icao);
for (Date idate : data.keySet()) {
if (idate.before(date)) {
for (Long idate : data.keySet()) {
if (idate < dateTime) {
data.remove(idate);
}
}
@ -1830,20 +1849,18 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
// also check MESO and TVS
if (table == ScanTables.CELL) {
ConcurrentHashMap<Date, ?> mesodata = getData(ScanTables.MESO,
icao);
ConcurrentMap<Long, ?> mesodata = getData(ScanTables.MESO, icao);
for (Date idate : mesodata.keySet()) {
if (idate.before(date)) {
for (Long idate : mesodata.keySet()) {
if (idate < dateTime) {
mesodata.remove(idate);
}
}
ConcurrentHashMap<Date, ?> tvsdata = getData(ScanTables.TVS,
icao);
ConcurrentMap<Long, ?> tvsdata = getData(ScanTables.TVS, icao);
for (Date idate : tvsdata.keySet()) {
if (idate.before(date)) {
for (Long idate : tvsdata.keySet()) {
if (idate < dateTime) {
tvsdata.remove(idate);
}
}

View file

@ -0,0 +1,92 @@
/**
* 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.viz.monitor.scan;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.core.VizApp;
/**
* A job that sets up the ScanMonitor then asks the UI thread to open the
* associated dialog. By running the monitor's setup() on this job, the requests
* to the server will not be blocking the UI thread.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 23, 2013 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public class ScanStarterJob extends Job {
private String icao;
private ScanTables table;
public ScanStarterJob(String icao, ScanTables table) {
super("Starting SCAN " + table.name());
this.icao = icao;
this.table = table;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
* IProgressMonitor)
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
final ScanMonitor scan = ScanMonitor.getInstance();
// first time initialization, or re-init
if (scan.icaos.size() == 0 || !scan.icaos.contains(icao)) {
// scan.launchSplash(shell);
scan.setup(icao);
}
VizApp.runAsync(new Runnable() {
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
scan.launchDialog(shell, icao, table);
}
});
return Status.OK_STATUS;
}
}

View file

@ -19,7 +19,11 @@
**/
package com.raytheon.uf.viz.monitor.scan.resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.FactoryException;
@ -28,9 +32,11 @@ import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.dataplugin.cwat.CWATRecord;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.monitor.scan.ThreatLocation;
import com.raytheon.uf.common.monitor.scan.ThreatReport;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.PixelCoverage;
@ -39,7 +45,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.cwat.CWATResource;
import com.vividsolutions.jts.geom.Coordinate;
@ -52,6 +57,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 2307 dhladky Initial creation
* Apr 18, 2013 1916 njensen Bulk rendering
*
*
* </pre>
*
@ -61,36 +68,27 @@ import com.vividsolutions.jts.geom.Coordinate;
public class CWATLocalThreatResource extends CWATResource {
private int lineWidth = 0;
private static final int BOX_HEIGHT = 10;
private static final int BOX_WIDTH = 10;
private RGB color;
private double previousZoom = 0.0;
private PaintProperties myPaintProps;
protected HashMap<ThreatLocation, PixelCoverage> drawables = new HashMap<ThreatLocation, PixelCoverage>();
protected Map<ThreatLocation, PixelCoverage> drawables = new HashMap<ThreatLocation, PixelCoverage>();
public CWATLocalThreatResource(CWATLocalThreatResourceData data,
LoadProperties props) {
super(data, props);
}
@Override
protected void paintInternal(IGraphicsTarget target,
PaintProperties paintProps) throws VizException {
this.displayedDataTime = paintProps.getDataTime();
this.myPaintProps = paintProps;
this.record = resourceData.dataObjectMap.get(this.displayedDataTime);
this.lineWidth = this.getCapability(OutlineCapability.class)
.getOutlineWidth();
this.color = this.getCapability(ColorableCapability.class).getColor();
if (record == null) {
@ -103,26 +101,12 @@ public class CWATLocalThreatResource extends CWATResource {
}
if (record.getThreats() != null && drawables != null) {
drawables.clear();
previousZoom = myPaintProps.getZoomLevel();
this.previousDataTime = displayedDataTime;
for (ThreatLocation loc : record.getThreats().keySet()) {
Set<ThreatLocation> keyset = record.getThreats().keySet();
for (ThreatLocation loc : keyset) {
drawables.put(loc, getPixelCoverage(loc));
}
if (record != null && drawables != null && target != null) {
for (ThreatLocation loc : record.getThreats().keySet()) {
if (drawables.containsKey(loc)) {
drawSquare(loc, drawables.get(loc), target);
} else {
PixelCoverage pc = getPixelCoverage(loc);
drawables.put(loc, pc);
drawSquare(loc, pc, target);
}
}
}
drawSquares(keyset, target);
}
}
@ -182,47 +166,48 @@ public class CWATLocalThreatResource extends CWATResource {
}
/**
* Draw the square and whatever else it needs
* Draws all the squares and selectively draws the location names if there
* is a threat
*
* @param loc
* @param pc
* @param locs
* @param target
* @param paintProps
* @throws VizException
*/
private void drawSquare(ThreatLocation loc, PixelCoverage pc,
IGraphicsTarget target) throws VizException {
font.setMagnification(getCapability(MagnificationCapability.class)
.getMagnification().floatValue());
if (record.getThreats() != null && record.getThreats().containsKey(loc)) {
private void drawSquares(Set<ThreatLocation> locs, IGraphicsTarget target)
throws VizException {
float mag = getCapability(MagnificationCapability.class)
.getMagnification().floatValue();
font.setMagnification(mag);
Map<ThreatLocation, ThreatReport> recordThreats = record.getThreats();
List<double[]> points = new ArrayList<double[]>(locs.size());
List<DrawableString> strings = new ArrayList<DrawableString>(
locs.size());
for (ThreatLocation loc : locs) {
// get the point for drawing in bulk
PixelCoverage pc = drawables.get(loc);
if (pc != null) {
if (!record.getThreats().get(loc).isThreat()) {
target.drawLine(pc.getLl().x, pc.getLl().y, 0.0,
pc.getUl().x, pc.getUl().y, 0.0, color, lineWidth,
LineStyle.SOLID);
target.drawLine(pc.getUl().x, pc.getUl().y, 0.0,
pc.getUr().x, pc.getUr().y, 0.0, color, lineWidth,
LineStyle.SOLID);
target.drawLine(pc.getUr().x, pc.getUr().y, 0.0,
pc.getLr().x, pc.getLr().y, 0.0, color, lineWidth,
LineStyle.SOLID);
target.drawLine(pc.getLr().x, pc.getLr().y, 0.0,
pc.getLl().x, pc.getLl().y, 0.0, color, lineWidth,
LineStyle.SOLID);
}
// System.out.p
if (record.getThreats().get(loc) != null) {
if (record.getThreats().get(loc).isThreat()) {
double[] center = descriptor.worldToPixel(new double[] {
loc.getLon(), loc.getLat() });
target.drawString(font, loc.getLocationName(),
center[0], center[1], 0.0, TextStyle.BOXED,
color, HorizontalAlignment.CENTER,
VerticalAlignment.MIDDLE, 0.0);
}
}
points.add(pc.getExtent().getCenter());
}
// if a threat, prepare it to draw in bulk
ThreatReport report = recordThreats.get(loc);
if (report != null && report.isThreat()) {
DrawableString ds = new DrawableString(loc.getLocationName(),
color);
ds.horizontalAlignment = HorizontalAlignment.CENTER;
ds.font = font;
ds.textStyle = TextStyle.BOXED;
ds.verticallAlignment = VerticalAlignment.MIDDLE;
double[] center = descriptor.worldToPixel(new double[] {
loc.getLon(), loc.getLat() });
ds.setCoordinates(center[0], center[1]);
strings.add(ds);
}
}
// now draw everything in bulk
target.drawPoints(points, color, PointStyle.BOX, mag);
target.drawStrings(strings);
}
/**

View file

@ -36,10 +36,12 @@ import com.raytheon.uf.common.monitor.scan.ScanUtils;
import com.raytheon.uf.common.monitor.scan.config.DmdDisplayFilterConfig;
import com.raytheon.uf.common.monitor.scan.config.StormCellConfig;
import com.raytheon.uf.viz.core.DrawableCircle;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.PixelCoverage;
@ -61,6 +63,7 @@ import com.vividsolutions.jts.geom.Point;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 2307 dhladky Initial creation
* Apr 22, 2013 1926 njensen Faster rendering
*
* </pre>
*
@ -69,24 +72,23 @@ import com.vividsolutions.jts.geom.Point;
*/
public class ScanDrawer {
public static int hexAngle = 60;
public static int tvsAngle = 45;
private static final int HEX_ANGLE = 60;
public static RGB red = new RGB(255, 0, 0);
private static final double SIN_HEX_ANGLE = Math.sin(HEX_ANGLE);
public static RGB yellow = new RGB(255, 255, 0);
public static final RGB red = new RGB(255, 0, 0);
public static RGB white = new RGB(255, 255, 255);
public static final RGB yellow = new RGB(255, 255, 0);
public static RGB green = new RGB(0, 255, 0);
public static final RGB white = new RGB(255, 255, 255);
public RGB rscColor = null;
private RGB rscColor = null;
public GeometryFactory factory = new GeometryFactory();
private GeometryFactory factory = new GeometryFactory();
// defaults
public double screenToWorldRatio = 0.0;
private double screenToWorldRatio = 0.0;
public IFont font = null;
@ -104,29 +106,21 @@ public class ScanDrawer {
private double wRightX = 0.0;
private double size = 0;
public boolean draw = false;
public boolean drawHexagon = false;
private double hexRadius = 0.0;
/** Cell's center values */
double[] center = null;
private double[] center = null;
private RGB color = null;
/** Cell's center point */
private Point centerPoint = null;
ArrayList<double[]> vertexes = null;
private List<double[]> vertexes = null;
ArrayList<double[]> innervertexes = null;
protected StormCellConfig sdc = null;
public StormCellConfig sdc = null;
public DmdDisplayFilterConfig ddfc = null;
protected DmdDisplayFilterConfig ddfc = null;
private GeodeticCalculator gc = null;
@ -140,29 +134,19 @@ public class ScanDrawer {
private static final int outerTopBottomFactor = 4;
private static final int innerSideFactor = 4;
private static final int innerTopBottomFactor = 8;
private int mesoType = 2;
private boolean isExt = false;
private final Point site;
private int count = 0;
/**
* public constructor CELL
*
* @param stormCellConfig
* @param gc
*/
public ScanDrawer(StormCellConfig stormCellConfig, GeodeticCalculator gc,
Coordinate siteCoor) {
public ScanDrawer(StormCellConfig stormCellConfig, GeodeticCalculator gc) {
this.sdc = stormCellConfig;
this.gc = gc;
this.site = factory.createPoint(siteCoor);
}
/**
@ -171,30 +155,9 @@ public class ScanDrawer {
* @param sdc
* @param gc
*/
public ScanDrawer(DmdDisplayFilterConfig ddfc, GeodeticCalculator gc,
Coordinate siteCoor) {
public ScanDrawer(DmdDisplayFilterConfig ddfc, GeodeticCalculator gc) {
this.ddfc = ddfc;
this.gc = gc;
this.site = factory.createPoint(siteCoor);
}
/**
* Draw a triangle icon for the TVS marker
*
* @param tvdr
* @param descriptor
* @param aTarget
* @throws VizException
*/
public void drawTVS(TVSTableDataRow tvdr, MapDescriptor descriptor,
IGraphicsTarget aTarget) throws VizException {
this.descriptor = descriptor;
this.aTarget = aTarget;
this.centerPoint = factory.createPoint(new Coordinate(tvdr.getLon(),
tvdr.getLat(), 0.0));
size = getSize(tvdr) * 2;
}
public boolean isHexagonEnabled() {
@ -259,35 +222,32 @@ public class ScanDrawer {
this.aTarget = aTarget;
this.centerPoint = factory.createPoint(new Coordinate(ctdr.getLon(),
ctdr.getLat(), 0.0));
this.drawHexagon = false;
size = getSize(ctdr) * 2;
double size = getSize(ctdr) * 2;
// go ahead and draw
center = descriptor.worldToPixel(new double[] {
centerPoint.getCoordinate().x, centerPoint.getCoordinate().y });
drawHexagon = this.isHexagonEnabled();
vertexes = getHexagonVertices();
if (drawHexagon) {
vertexes = getHexagonVertices(size);
if (isHexagonEnabled()) {
if (size > 0.0) {
for (int i = 0; vertexes.size() - 1 > i; i++) {
double[] point = vertexes.get(i);
double[] point2 = vertexes.get(i + 1);
aTarget.drawLine(point[0], point[1], 0, point2[0],
point2[1], 0, color, outlineWidth);
}
DrawableCircle circle = new DrawableCircle();
circle.numberOfPoints = 6;
circle.setCoordinates(center[0], center[1]);
circle.radius = size * (SIN_HEX_ANGLE);
circle.lineWidth = outlineWidth;
circle.basics.color = color;
aTarget.drawCircle(circle);
if (isNew(ctdr)) {
// new cell draw inner hexagon
innervertexes = getInnerHexagonVertices();
for (int i = 0; innervertexes.size() - 1 > i; i++) {
double[] point = innervertexes.get(i);
double[] point2 = innervertexes.get(i + 1);
aTarget.drawLine(point[0], point[1], 0, point2[0],
point2[1], 0, color, outlineWidth);
}
DrawableCircle innerCircle = new DrawableCircle();
innerCircle.numberOfPoints = 6;
innerCircle.setCoordinates(center[0], center[1]);
innerCircle.radius = size / 2 * (SIN_HEX_ANGLE);
innerCircle.lineWidth = outlineWidth;
innerCircle.basics.color = color;
aTarget.drawCircle(innerCircle);
}
}
}
@ -301,7 +261,6 @@ public class ScanDrawer {
}
drawCellTrack(ctdr);
}
/**
@ -385,7 +344,7 @@ public class ScanDrawer {
this.aTarget = aTarget;
this.centerPoint = factory.createPoint(new Coordinate(dtdr.getLon(),
dtdr.getLat(), 0.0));
size = getSize(dtdr);
double size = getSize(dtdr);
if ((size > 0) && !dtdr.getRank().equals("NONE")) {
// go ahead and draw
@ -460,20 +419,21 @@ public class ScanDrawer {
int mapWidth = this.descriptor.getMapWidth() / 1000;
double km = zoomLevel * mapWidth;
DrawableString ds = new DrawableString(dtdr.getIdent(), getResourceColor());
DrawableString ds = new DrawableString(dtdr.getIdent(),
getResourceColor());
ds.horizontalAlignment = HorizontalAlignment.RIGHT;
ds.verticallAlignment = VerticalAlignment.BOTTOM;
ds.font = font;
ds.textStyle = TextStyle.DROP_SHADOW;
if (km < 50) {
ds.setCoordinates(center[0] - 1, center[1] - 1);
aTarget.drawStrings(ds);
} else {
ds.setCoordinates(wLeftX , center[1] - size);
ds.setCoordinates(wLeftX, center[1] - size);
aTarget.drawStrings(ds);
}
if (ddfc.isTrack()) {
// draws the center point/circle
if ((dtdr.getPastLat() != null) && (dtdr.getPastLon() != null)) {
@ -515,8 +475,8 @@ public class ScanDrawer {
end[1] });
Point endPoint = factory.createPoint(new Coordinate(endWorld[0],
endWorld[1], 0.0));
ArrayList<double[]> ears = getDogEarCoordinate(centerPoint,
endPoint, dir, totalLength / 1.25);
List<double[]> ears = getDogEarCoordinate(centerPoint, endPoint,
dir, totalLength / 1.25);
// draw it
if (sdc.getArrowMode()) {
@ -623,6 +583,7 @@ public class ScanDrawer {
*/
private double getSize(ScanTableDataRow stdr) {
double value = 0.0;
double size = 0.0;
if (stdr instanceof CellTableDataRow) {
setCellColor(((CellTableDataRow) stdr).getValue(sdc.getAttrName()));
@ -637,8 +598,6 @@ public class ScanDrawer {
if (value > 0.0) {
size = getPixelRelativeLength(centerPoint, value + 1);
} else {
size = 0.0;
}
return size;
@ -675,9 +634,9 @@ public class ScanDrawer {
* @param center
* @return
*/
private ArrayList<double[]> getHexagonVertices() {
private List<double[]> getHexagonVertices(double size) {
side = size / outerSideFactor * (Math.sin(hexAngle));
side = size / outerSideFactor * (SIN_HEX_ANGLE);
topY = center[1] - (size / outerTopBottomFactor);
bottomY = center[1] + (size / outerTopBottomFactor);
rightX = center[0] - (side);
@ -685,7 +644,7 @@ public class ScanDrawer {
wRightX = center[0] - 2 * side;
wLeftX = center[0] + 2 * side;
ArrayList<double[]> vertexes = new ArrayList<double[]>();
List<double[]> vertexes = new ArrayList<double[]>();
vertexes.add(new double[] { rightX, bottomY });
vertexes.add(new double[] { wRightX, center[1] });
vertexes.add(new double[] { rightX, topY });
@ -698,65 +657,6 @@ public class ScanDrawer {
return vertexes;
}
/**
* Gets the vertices of the hexagons
*
* @param center
* @return
*/
@SuppressWarnings("unused")
private ArrayList<double[]> getTVSVertices() {
side = size / outerSideFactor * (Math.sin(hexAngle));
topY = center[1] - (size / outerTopBottomFactor);
bottomY = center[1] + (size / outerTopBottomFactor);
rightX = center[0] - (side);
leftX = center[0] + (side);
wRightX = center[0] - 2 * side;
wLeftX = center[0] + 2 * side;
ArrayList<double[]> vertexes = new ArrayList<double[]>();
vertexes.add(new double[] { rightX, bottomY });
vertexes.add(new double[] { wRightX, center[1] });
vertexes.add(new double[] { rightX, topY });
vertexes.add(new double[] { leftX, topY });
vertexes.add(new double[] { wLeftX, center[1] });
vertexes.add(new double[] { leftX, bottomY });
// add first to the end, this way the hexagon will complete
vertexes.add(new double[] { rightX, bottomY });
return vertexes;
}
/**
* Gets the vertices of the hexagons
*
* @param center
* @return
*/
private ArrayList<double[]> getInnerHexagonVertices() {
double iside = size / innerSideFactor * (Math.sin(hexAngle));
double itopY = center[1] - (size / innerTopBottomFactor);
double ibottomY = center[1] + (size / innerTopBottomFactor);
double irightX = center[0] - (iside);
double ileftX = center[0] + (iside);
double iwRightX = center[0] - 2 * iside;
double iwLeftX = center[0] + 2 * iside;
ArrayList<double[]> vertexes = new ArrayList<double[]>();
vertexes.add(new double[] { irightX, ibottomY });
vertexes.add(new double[] { iwRightX, center[1] });
vertexes.add(new double[] { irightX, itopY });
vertexes.add(new double[] { ileftX, itopY });
vertexes.add(new double[] { iwLeftX, center[1] });
vertexes.add(new double[] { ileftX, ibottomY });
// add first to the end, this way the hexagon will complete
vertexes.add(new double[] { irightX, ibottomY });
return vertexes;
}
/**
* sets the screen to World ratio;
*
@ -927,11 +827,11 @@ public class ScanDrawer {
* @param dir
* @return
*/
private ArrayList<double[]> getDogEarCoordinate(Point refPoint,
Point endPoint, double dir, double length) {
private List<double[]> getDogEarCoordinate(Point refPoint, Point endPoint,
double dir, double length) {
double[] earAngles = new double[] { 10, -10 };
ArrayList<double[]> coords = new ArrayList<double[]>();
List<double[]> coords = new ArrayList<double[]>();
for (double earAngle : earAngles) {
@ -1011,14 +911,12 @@ public class ScanDrawer {
double[] futurePoint = null;
double[] pastPoint = null;
int count = Math.min(dtdr.getFcstLon().size(),
dtdr.getFcstLat().size());
int count = Math.min(dtdr.getFcstLon().size(), dtdr.getFcstLat()
.size());
for (int i = 0; i < count; i++) {
futurePoint = descriptor
.worldToPixel(new double[] {
dtdr.getFcstLon().get(i),
dtdr.getFcstLat().get(i) });
futurePoint = descriptor.worldToPixel(new double[] {
dtdr.getFcstLon().get(i), dtdr.getFcstLat().get(i) });
if (pastPoint == null) {
pastPoint = center;
@ -1036,14 +934,15 @@ public class ScanDrawer {
double[] futurePoint = null;
double[] pastPoint = null;
int count = Math.min(dtdr.getPastLon().size(),
dtdr.getPastLat().size());
int count = Math.min(dtdr.getPastLon().size(), dtdr.getPastLat()
.size());
for (int i = 0; i < count; i++) {
try {
futurePoint = descriptor.worldToPixel(new double[] {
dtdr.getPastLon().get(i),
dtdr.getPastLat().get(i) });
futurePoint = descriptor
.worldToPixel(new double[] {
dtdr.getPastLon().get(i),
dtdr.getPastLat().get(i) });
if (pastPoint == null) {
pastPoint = center;
@ -1061,7 +960,7 @@ public class ScanDrawer {
}
}
public void drawCellTrack(CellTableDataRow ctdr) {
public void drawCellTrack(CellTableDataRow ctdr) throws VizException {
List<double[]> futurePoints = new ArrayList<double[]>();
List<double[]> pastPoints = new ArrayList<double[]>();
List<Date> dates = new ArrayList<Date>();
@ -1116,46 +1015,47 @@ public class ScanDrawer {
}
// Draw data
double[] oldPoint = new double[3];
for (int i = pastPoints.size() - 1; i >= 0; i--) {
try {
if (pastPoints.size() > 0) {
double cirRadius = 2.0 / screenToWorldRatio;
DrawableCircle[] pastCircles = new DrawableCircle[pastPoints.size()];
for (int i = 0; i < pastPoints.size(); i++) {
DrawableCircle pc = new DrawableCircle();
double[] point = pastPoints.get(i);
if (i == pastPoints.size() - 1) { // first time
oldPoint = point;
} else {
aTarget.drawLine(oldPoint[0], oldPoint[1], 0.0, point[0],
point[1], 0.0, getResourceColor(), outlineWidth);
}
drawFilledCircle(point, getResourceColor());
oldPoint = point;
} catch (VizException e) {
e.printStackTrace();
pc.setCoordinates(point[0], point[1], 0);
pc.basics.color = getResourceColor();
pc.radius = cirRadius;
pc.filled = true;
pastCircles[i] = pc;
}
aTarget.drawCircle(pastCircles);
}
try {
if (oldPoint[0] != 0) {
aTarget.drawLine(oldPoint[0], oldPoint[1], 0.0, center[0],
center[1], 0.0, getResourceColor(), outlineWidth);
}
drawX(center);
oldPoint = center;
} catch (VizException e) {
e.printStackTrace();
if (pastPoints.size() > 1) {
DrawableLine line = new DrawableLine();
line.points = pastPoints;
line.width = outlineWidth;
line.basics.color = getResourceColor();
aTarget.drawLine(line);
}
for (int i = 0; i < futurePoints.size(); i++) {
try {
double[] point = futurePoints.get(i);
aTarget.drawLine(oldPoint[0], oldPoint[1], 0.0, point[0],
point[1], 0.0, getResourceColor(), outlineWidth);
if (pastPoints.size() > 0) {
double[] oldPoint = pastPoints.get(0);
aTarget.drawLine(oldPoint[0], oldPoint[1], 0.0, center[0],
center[1], 0.0, getResourceColor(), outlineWidth);
}
drawX(center);
drawPlus(point, getResourceColor());
oldPoint = point;
} catch (VizException e) {
e.printStackTrace();
}
if (futurePoints.size() > 0) {
aTarget.drawPoints(futurePoints, getResourceColor(),
PointStyle.CROSS, 1.3f);
}
if (futurePoints.size() > 1) {
DrawableLine line = new DrawableLine();
line.points = futurePoints;
line.width = outlineWidth;
line.basics.color = getResourceColor();
aTarget.drawLine(line);
}
}
@ -1174,10 +1074,11 @@ public class ScanDrawer {
aTarget.drawLine((point[0] - 4.0 / screenToWorldRatio), point[1], 0.0,
(point[0] + 4.0 / screenToWorldRatio), point[1], 0.0, color,
outlineWidth);
}
/**
* draws the plus sign
* draws the X sign
*
* @param point
* @throws VizException
@ -1270,14 +1171,6 @@ public class ScanDrawer {
return 10;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
/**
* Sort by Date
*

View file

@ -26,6 +26,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.geotools.referencing.GeodeticCalculator;
import org.opengis.referencing.FactoryException;
@ -83,6 +84,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Feb 28, 2013 1731 bsteffen Allow ScanResource to work better with
* D2DTimeMatcher.
* Apr 02, 2013 1731 mpduff Fix problem with DMD updates.
* Apr 22, 2013 1926 njensen Faster rendering
*
* </pre>
*
@ -118,7 +120,7 @@ public class ScanResource extends
private static final int titleXOffset = 50;
/** trends graphs **/
public boolean isTrend = false;
private boolean isTrend = false;
private GeodeticCalculator gc = null;
@ -146,7 +148,7 @@ public class ScanResource extends
private String cellId = null;
protected HashMap<String, PixelCoverage> drawables = new HashMap<String, PixelCoverage>();
protected Map<String, PixelCoverage> drawables = new HashMap<String, PixelCoverage>();
protected ScanResource(ScanResourceData srd, LoadProperties loadProps)
throws VizException {
@ -333,9 +335,6 @@ public class ScanResource extends
}
if (draw && (ctdr != null)) {
// System.out.println("Draw CELL: "+ctdr.getIdent());
getScanDrawer().setCount(1);
getScanDrawer().drawHexagon(ctdr, descriptor,
target);
drawables.put(id, getScanDrawer()
@ -566,12 +565,10 @@ public class ScanResource extends
if (drawer == null && gc != null) {
if (getTable().equals(ScanTables.CELL)) {
drawer = new ScanDrawer(SCANConfig.getInstance()
.getStormCellConfig(), gc, getScan()
.getStationCoordinate(resourceData.icao));
.getStormCellConfig(), gc);
} else if (getTable().equals(ScanTables.DMD)) {
drawer = new ScanDrawer(SCANConfig.getInstance()
.getDmdDisplayFilterConfig(), gc, getScan()
.getStationCoordinate(resourceData.icao));
.getDmdDisplayFilterConfig(), gc);
}
}
return drawer;

View file

@ -23,7 +23,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@ -39,10 +38,6 @@ import javax.xml.bind.annotation.XmlType;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.scan.ScanRecord;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
@ -52,7 +47,6 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.HDF5Util;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
@ -68,6 +62,7 @@ import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 dhladky Initial creation
* Feb 28, 2013 1731 bsteffen Optimize construction of scan resource.
* Apr 18, 2013 1926 njensen Reuse URIs in construction of resource
*
* </pre>
*
@ -113,14 +108,16 @@ public class ScanResourceData extends AbstractRequestableResourceData {
firstCal.add(Calendar.MINUTE, -90);
Date firstDate = firstCal.getTime();
int count = 0;
List<String> urisToLoad = new ArrayList<String>(uris.size());
List<ScanRecord> recordsToLoad = new ArrayList<ScanRecord>(
uris.size());
for (String uri : uris) {
ScanRecord record = new ScanRecord(uri);
if (record.getDataTime().getRefTime().after(firstDate)) {
urisToLoad.add(uri);
recordsToLoad.add(record);
}
}
ScanRecord[] records = getScanRecords(urisToLoad);
ScanRecord[] records = recordsToLoad.toArray(new ScanRecord[0]);
populateRecords(records);
for (ScanRecord record : records) {
if ((record.getTableData() != null)
@ -164,11 +161,10 @@ public class ScanResourceData extends AbstractRequestableResourceData {
}
}
}
long t4 = System.currentTimeMillis();
System.out
.println("Loaded " + count + " out of " + uris.size()
+ " objects in "
+ (System.currentTimeMillis() - t0) + "ms");
System.out.println("Loaded " + count + " out of " + uris.size()
+ " objects in " + (t4 - t0) + "ms");
// need to update the dialog here after the
// scanResourceData has been fully populated
getScan().setInstantiated(true);
@ -189,6 +185,7 @@ public class ScanResourceData extends AbstractRequestableResourceData {
}
}
} catch (Exception e) {
e.printStackTrace();
getScan().closeDialog(icao);
}
return new ScanResource(this, loadProperties);
@ -231,8 +228,7 @@ public class ScanResourceData extends AbstractRequestableResourceData {
}
try {
IDataRecord[] dataRecords = dataStore.retrieveDatasets(
datasetGroupPath,
Request.ALL);
datasetGroupPath, Request.ALL);
for (i = 0; i < dataRecords.length; i += 1) {
ByteDataRecord byteData = (ByteDataRecord) dataRecords[i];
scanRecords[i].setTableData(byteData);
@ -287,16 +283,4 @@ public class ScanResourceData extends AbstractRequestableResourceData {
}
}
private ScanRecord[] getScanRecords(Collection<String> uris)
throws VizException {
DbQueryRequest request = new DbQueryRequest();
request.setEntityClass(ScanRecord.class);
RequestConstraint rc = new RequestConstraint(null, ConstraintType.IN);
rc.setConstraintValueList(uris);
request.addConstraint("dataURI", rc);
DbQueryResponse response = (DbQueryResponse) ThriftClient
.sendRequest(request);
return response.getEntityObjects(ScanRecord.class);
}
}

View file

@ -39,7 +39,6 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
/**
* Manager class to hold between scan dialog and alarming capabilities
@ -53,6 +52,7 @@ import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
* Dec 2, 2010 mnash Initial creation
*
* 03/15/2012 13939 Mike Duff For a SCAN Alarms issue
* Apr 18, 2013 1926 njensen Update for Long keys
*
* </pre>
*
@ -102,7 +102,8 @@ public class SCANAlarmAlertManager {
public void addSite(String site) {
if (!scheduledAlarmsMap.containsKey(site)) {
Map<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = Collections.synchronizedMap(new HashMap<ScanTables, List<ScheduledAlarms>>());
Map<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = Collections
.synchronizedMap(new HashMap<ScanTables, List<ScheduledAlarms>>());
siteScheduledAlarmsMap.put(ScanTables.DMD,
new CopyOnWriteArrayList<ScheduledAlarms>());
siteScheduledAlarmsMap.put(ScanTables.CELL,
@ -111,7 +112,8 @@ public class SCANAlarmAlertManager {
}
if (!alertedAlarmsMap.containsKey(site)) {
Map<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = Collections.synchronizedMap(new HashMap<ScanTables, Set<AlertedAlarms>>());
Map<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = Collections
.synchronizedMap(new HashMap<ScanTables, Set<AlertedAlarms>>());
siteAlertedAlarmsSet.put(ScanTables.DMD,
new HashSet<AlertedAlarms>());
siteAlertedAlarmsSet.put(ScanTables.CELL,
@ -130,11 +132,13 @@ public class SCANAlarmAlertManager {
private SCANAlarmAlertManager() {
if (scheduledAlarmsMap == null) {
scheduledAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, List<ScheduledAlarms>>>());
scheduledAlarmsMap = Collections
.synchronizedMap(new HashMap<String, Map<ScanTables, List<ScheduledAlarms>>>());
}
if (alertedAlarmsMap == null) {
alertedAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, Set<AlertedAlarms>>>());
alertedAlarmsMap = Collections
.synchronizedMap(new HashMap<String, Map<ScanTables, Set<AlertedAlarms>>>());
}
if (idents == null) {
@ -197,8 +201,8 @@ public class SCANAlarmAlertManager {
if (valCompare) {
addAlertedAlarm(site, tableType, scanData
.getTableCellData(0).getCellText(),
alarm.colName, AlarmType.AbsVal, row,
index, latestTime);
alarm.colName, AlarmType.AbsVal, row, index,
latestTime);
}
row++;
}
@ -208,12 +212,15 @@ public class SCANAlarmAlertManager {
if (monitor.cellData != null) {
if (monitor.cellData.containsKey(site)) {
Set<Date> cellData = monitor.cellData.get(site)
Set<Long> cellData = monitor.cellData.get(site)
.keySet();
Date previous = null;
if (!cellData.isEmpty()) {
Date[] times = cellData.toArray(new Date[cellData
.size()]);
Date[] times = new Date[cellData.size()];
Iterator<Long> itr = cellData.iterator();
for (int i = 0; i < times.length; i++) {
times[i] = new Date(itr.next());
}
if (times.length > 1) {
Arrays.sort(times);
previous = times[times.length - 2];
@ -322,10 +329,10 @@ public class SCANAlarmAlertManager {
public void clearAlarm(String site, ScanTables tableType,
AlertedAlarms alarm) {
Set<AlertedAlarms> alarms = alertedAlarmsMap.get(site).get(tableType);
for (AlertedAlarms aa: alarms) {
if (alarm.ident.equalsIgnoreCase(aa.ident) &&
alarm.colName.equalsIgnoreCase(aa.colName) &&
(alarm.type == aa.type) && (alarm.row == aa.row)) {
for (AlertedAlarms aa : alarms) {
if (alarm.ident.equalsIgnoreCase(aa.ident)
&& alarm.colName.equalsIgnoreCase(aa.colName)
&& (alarm.type == aa.type) && (alarm.row == aa.row)) {
aa.cleared = true;
break;
}
@ -390,22 +397,24 @@ public class SCANAlarmAlertManager {
* @param col
*/
public void addAlertedAlarm(String site, ScanTables tableType,
String ident, String colName, AlarmType type, int row,
int col, Date validTime) {
String ident, String colName, AlarmType type, int row, int col,
Date validTime) {
Set<AlertedAlarms> alarms = alertedAlarmsMap.get(site).get(tableType);
if (alarms.size() == 0) {
alarms.add(new AlertedAlarms(ident, colName, type, row, col, validTime));
alarms.add(new AlertedAlarms(ident, colName, type, row, col,
validTime));
return;
}
for (AlertedAlarms alarm: alarms) {
if (alarm.ident.equalsIgnoreCase(ident) &&
alarm.colName.equalsIgnoreCase(colName) &&
(alarm.type == type) && (alarm.row == row)) {
for (AlertedAlarms alarm : alarms) {
if (alarm.ident.equalsIgnoreCase(ident)
&& alarm.colName.equalsIgnoreCase(colName)
&& (alarm.type == type) && (alarm.row == row)) {
if (alarm.cleared) {
break;
}
} else {
alarms.add(new AlertedAlarms(ident, colName, type, row, col, validTime));
alarms.add(new AlertedAlarms(ident, colName, type, row, col,
validTime));
break;
}
}
@ -426,23 +435,21 @@ public class SCANAlarmAlertManager {
*
* @return
*/
public Set<AlertedAlarms> getAlertedAlarms(String site,
ScanTables tableType) {
public Set<AlertedAlarms> getAlertedAlarms(String site, ScanTables tableType) {
return alertedAlarmsMap.get(site).get(tableType);
}
public int getAlertedAlarmCount(String site,
ScanTables tableType) {
public int getAlertedAlarmCount(String site, ScanTables tableType) {
int count = 0;
for (AlertedAlarms alarm: alertedAlarmsMap.get(site).get(tableType)) {
for (AlertedAlarms alarm : alertedAlarmsMap.get(site).get(tableType)) {
if (!alarm.cleared) {
count++;
}
}
return count;
}
public boolean containsAlarm(String site, ScanTables tableType,
AlarmType type, String colName, String ident) {
for (AlertedAlarms alarm : alertedAlarmsMap.get(site).get(tableType)) {
@ -478,17 +485,17 @@ public class SCANAlarmAlertManager {
*/
private void clearOldAlarms(String site, ScanTables type, Date latestTime) {
List<AlertedAlarms> clearList = new ArrayList<AlertedAlarms>();
for (AlertedAlarms alarm: alertedAlarmsMap.get(site).get(type)) {
for (AlertedAlarms alarm : alertedAlarmsMap.get(site).get(type)) {
if (latestTime.getTime() > alarm.validTime.getTime()) {
clearList.add(alarm);
}
}
for (AlertedAlarms alarm: clearList) {
for (AlertedAlarms alarm : clearList) {
alertedAlarmsMap.get(site).get(type).remove(alarm);
}
}
/**
* clear the alerted alarms and the indices
*/
@ -497,12 +504,12 @@ public class SCANAlarmAlertManager {
alarm.cleared = true;
}
}
public void removeAlertedAlarms(String site, ScanTables tableType) {
alertedAlarmsMap.get(site).get(tableType).clear();
setRing(false);
}
/**
* Clear the scheduled alarms
*/
@ -581,9 +588,9 @@ public class SCANAlarmAlertManager {
int row;
int col;
boolean cleared = false;
Date validTime;
public AlertedAlarms(String ident, String colName, AlarmType type,
@ -605,7 +612,8 @@ public class SCANAlarmAlertManager {
public String toString() {
return "Identifier : " + this.ident + "\nColumn : " + this.colName
+ "\nType : " + this.type.getName() + "\nRow #: "
+ this.row + "\nCol #:" + this.col + "\nCleared: " + cleared + "\n";
+ this.row + "\nCol #:" + this.col + "\nCleared: "
+ cleared + "\n";
}
}

View file

@ -60,6 +60,7 @@ import com.raytheon.uf.viz.core.localization.CAVELocalizationNotificationObserve
import com.raytheon.uf.viz.core.localization.LocalizationConstants;
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.core.status.VizStatusHandlerFactory;
import com.raytheon.viz.alerts.jobs.AutoUpdater;
import com.raytheon.viz.alerts.jobs.MenuUpdater;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
@ -88,6 +89,7 @@ import com.raytheon.viz.core.units.UnitRegistrar;
* the command line even if practice
* mode is off.
* Jan 09, 2013 #1442 rferrel Changes to notify SimultedTime listeners.
* Apr 17, 2013 1786 mpduff startComponent now sets StatusHandlerFactory
*
* </pre>
*
@ -162,6 +164,8 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent {
// dialog which would break gfeClient-based cron jobs.
return IApplication.EXIT_OK;
}
UFStatus.setHandlerFactory(new VizStatusHandlerFactory());
initializeSerialization();
initializeDataStoreFactory();
initializeObservers();

View file

@ -2,7 +2,7 @@
<classpath>
<classpathentry exported="true" kind="lib" path="hibernate-spatial-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="hibernate-spatial-postgis-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="hibernate3.5.0-Final.jar"/>
<classpathentry exported="true" kind="lib" path="hibernate3.5.6-Final.jar"/>
<classpathentry exported="true" kind="lib" path="javassist-3.9.0.GA.jar"/>
<classpathentry exported="true" kind="lib" path="jta-1.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>

View file

@ -5,7 +5,7 @@ Bundle-SymbolicName: org.hibernate
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: hibernate-spatial-1.0.jar,
hibernate-spatial-postgis-1.0.jar,
hibernate3.5.0-Final.jar,
hibernate3.5.6-Final.jar,
javassist-3.9.0.GA.jar,
jta-1.1.jar
Bundle-Vendor: Hibernate

View file

@ -1,6 +1,6 @@
bin.includes = META-INF/,\
hibernate-spatial-1.0.jar,\
hibernate-spatial-postgis-1.0.jar,\
hibernate3.5.0-Final.jar,\
hibernate3.5.6-Final.jar,\
javassist-3.9.0.GA.jar,\
jta-1.1.jar

Binary file not shown.

View file

@ -1,206 +0,0 @@
=========================================================================
== Apache License ==
=========================================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -1,8 +0,0 @@
// ------------------------------------------------------------------
// NOTICE file corresponding to the section 4d of The Apache License,
// Version 2.0, in this case for Qpid bin scripts
// ------------------------------------------------------------------
Apache Qpid
Copyright 2006-2008 Apache Software Foundation

View file

@ -1,71 +0,0 @@
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
#!/bin/sh
qpid_version=$1
repo=$2
if [ -z "$qpid_version" -o -z "$repo" ]; then
echo "Usage: mvn-deploy-qpid-java.sh <qpid-version> <mvn-repo>"
exit 1
fi
set -xe
build_dir=build/lib
deploy_artifact() {
mvn deploy:deploy-file -DuniqueVersion=false -Durl=$repo -Dfile=${build_dir}/$1-${qpid_version}.jar -DgroupId=org.apache.qpid -DartifactId=$1 -Dversion=${qpid_version} -Dpackaging=jar
}
deploy_artifact_with_classifier() {
mvn deploy:deploy-file -DuniqueVersion=false -Durl=$repo -Dfile=${build_dir}/$1-$2-${qpid_version}.jar -DgroupId=org.apache.qpid -DartifactId=$1 -Dclassifier=$2 -Dversion=${qpid_version} -Dpackaging=jar
}
deploy_artifact qpid-broker
deploy_artifact_with_classifier qpid-broker-plugins tests
deploy_artifact_with_classifier qpid-broker tests
deploy_artifact qpid-client-example
deploy_artifact_with_classifier qpid-client-example tests
deploy_artifact qpid-client
deploy_artifact_with_classifier qpid-client tests
deploy_artifact qpid-common
deploy_artifact_with_classifier qpid-common tests
deploy_artifact qpid-integrationtests
deploy_artifact_with_classifier qpid-integrationtests tests
deploy_artifact qpid-junit-toolkit
deploy_artifact_with_classifier qpid-junit-toolkit tests
deploy_artifact qpid-management-eclipse-plugin
deploy_artifact_with_classifier qpid-management-eclipse-plugin tests
deploy_artifact qpid-perftests
deploy_artifact_with_classifier qpid-perftests tests
deploy_artifact qpid-systests
deploy_artifact_with_classifier qpid-systests tests
deploy_artifact qpid-testkit
deploy_artifact_with_classifier qpid-testkit tests
deploy_artifact qpid-tools
deploy_artifact_with_classifier qpid-tools tests
build_dir=build/lib/plugins
deploy_artifact qpid-broker-plugins

View file

@ -1,251 +0,0 @@
#!/bin/sh
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
# Script to pull together an Apache Release
#
usage()
{
echo "Usage: release.sh <svn-path> <svn-revision> <version> [options]"
echo
echo "Options: Default : --prepare --svn --all --sign"
echo "--help |-h : Show this help"
echo "--prepare : Export specified tree from source control"
echo "--svn : Export from svn"
echo "--git : Export from git repository with svn metadata"
echo "--clean-all : Remove build artefacts and downloaded svn tree"
echo "--clean : Remove built artefacts"
echo "--all |-a : Generate all artefacts"
echo "--source|-e : Generate the source artefact"
echo "--cpp |-c : Generate the CPP artefacts"
echo "--dotnet|-d : Generate the dotnet artefacts"
echo "--java |-j : Generate the java artefacts"
echo "--ruby |-r : Generate the ruby artefacts"
echo "--python|-p : Generate the python artefacts"
echo "--wcf |-w : Generate the WCF artefacts"
echo "--source|-e : Generate the source artefact"
echo "--sign |-s : Sign generated artefacts"
echo "--upload|-u : Upload the artifacts directory to people.apache.org as qpid-\$VER"
echo
}
REPO="SVN"
for arg in $* ; do
case $arg in
--help|-h)
HELP="HELP"
;;
--prepare)
PREPARE="PREPARE"
;;
--svn)
REPO="SVN"
;;
--git)
REPO="GIT"
;;
--clean-all)
CLEAN="CLEAN"
CLEAN_ARTIFACTS="CLEAN_ARTIFACTS"
;;
--clean)
CLEAN_ARTIFACTS="CLEAN_ARTIFACTS"
;;
--sign|-s)
SIGN="SIGN"
;;
--all|-a)
CPP="CPP"
DOTNET="DOTNET"
JAVA="JAVA"
RUBY="RUBY"
PYTHON="PYTHON"
WCF="WCF"
SOURCE="SOURCE"
;;
--cpp|-c)
CPP="CPP"
;;
--dotnet|-d)
DOTNET="DOTNET"
;;
--java|-j)
JAVA="JAVA"
;;
--ruby|-r)
RUBY="RUBY"
;;
--python|-p)
PYTHON="PYTHON"
;;
--wcf|-w)
WCF="WCF"
;;
--source|-e)
SOURCE="SOURCE"
;;
--upload|-u)
UPLOAD="UPLOAD"
;;
*)
if [ -z "$SVN" ] ; then
SVN=$arg
continue
fi
if [ -z "$REV" ] ; then
REV=$arg
continue
fi
if [ -z "$VER" ] ; then
VER=$arg
continue
fi
;;
esac
done
if [ -n "${HELP}" ] ; then
usage
exit 0
fi
if [ -z "$SVN" -o -z "$REV" -o -z "$VER" ]; then
echo "Usage: release.sh <svn-path> <svn-revision> <version>"
exit 1
fi
echo SVN:$SVN
echo REV:$REV
echo VER:$VER
# If nothing is specified then do it all
if [ -z "${CLEAN}${PREPARE}${CPP}${DOTNET}${JAVA}${RUBY}${PYTHON}${WCF}${SOURCE}${SIGN}${UPLOAD}" ] ; then
PREPARE="PREPARE"
CPP="CPP"
DOTNET="DOTNET"
JAVA="JAVA"
RUBY="RUBY"
PYTHON="PYTHON"
WCF="WCF"
SOURCE="SOURCE"
SIGN="SIGN"
fi
set -xe
if [ "CLEAN" == "$CLEAN" ] ; then
rm -rf qpid-${VER}
fi
if [ "CLEAN_ARTIFACTS" == "$CLEAN_ARTIFACTS" ] ; then
rm -rf artifacts
fi
if [ "PREPARE" == "$PREPARE" ] ; then
mkdir artifacts
case ${REPO} in
SVN)
URL=https://svn.apache.org/repos/asf/qpid/${SVN}
svn export -r ${REV} ${URL} qpid-${VER}
echo ${URL} ${REV} > artifacts/qpid-${VER}.svnversion
;;
GIT)
URL=${SVN}
GITREV=$(GIT_DIR=${URL} git svn find-rev r${REV})
git archive --remote=${URL} ${GITREV} | tar xvf -
mv qpid qpid-${VER}
echo ${REV} > artifacts/qpid-${VER}.svnversion
;;
esac
fi
if [ "SOURCE" == "$SOURCE" ] ; then
tar -czf artifacts/qpid-${VER}.tar.gz qpid-${VER}
fi
if [ "RUBY" == "$RUBY" ] ; then
tar -czf artifacts/qpid-ruby-${VER}.tar.gz qpid-${VER}/ruby qpid-${VER}/specs
fi
if [ "PYTHON" == "$PYTHON" ] ; then
tar -czf artifacts/qpid-python-${VER}.tar.gz qpid-${VER}/python qpid-${VER}/specs
fi
if [ "WCF" == "$WCF" ] ; then
zip -rq artifacts/qpid-wcf-${VER}.zip qpid-${VER}/wcf
fi
if [ "CPP" == "$CPP" ] ; then
pushd qpid-${VER}/cpp
./bootstrap
./configure
make dist -j2
popd
cp qpid-${VER}/cpp/*.tar.gz artifacts/qpid-cpp-${VER}.tar.gz
fi
if [ "JAVA" == "$JAVA" ] ; then
pushd qpid-${VER}/java
ant build release release-bin -Dsvnversion.output=${REV}
popd
cp qpid-${VER}/java/release/*.tar.gz artifacts/qpid-java-${VER}.tar.gz
cp qpid-${VER}/java/broker/release/*.tar.gz artifacts/qpid-java-broker-${VER}.tar.gz
cp qpid-${VER}/java/client/release/*.tar.gz artifacts/qpid-java-client-${VER}.tar.gz
#cp qpid-${VER}/java/client/example/release/*.tar.gz
cp qpid-${VER}/java/management/eclipse-plugin/release/*.tar.gz qpid-${VER}/java/management/eclipse-plugin/release/*.zip artifacts/
cp qpid-${VER}/java/management/client/release/*.tar.gz artifacts/qpid-management-client-${VER}.tar.gz
fi
if [ "DOTNET" == "$DOTNET" ] ; then
pushd qpid-${VER}/dotnet
cd Qpid.Common
ant
cd ..
./build-nant-release mono-2.0
cd client-010/gentool
ant
cd ..
nant -t:mono-2.0 release-pkg
popd
cp qpid-${VER}/dotnet/bin/mono-2.0/release/*.zip artifacts/qpid-dotnet-0-8-${VER}.zip
cp qpid-${VER}/dotnet/client-010/bin/mono-2.0/debug/*.zip artifacts/qpid-dotnet-0-10-${VER}.zip
fi
if [ "SIGN" == "$SIGN" ] ; then
pushd artifacts
sha1sum *.zip *.gz *.svnversion > SHA1SUM
if [ ! -z $SIGNING_KEY ] ; then
KEYOPTION="--default-key $SIGNING_KEY"
fi
for i in `find . | egrep 'jar$|pom$|gz$|zip$|svnversion$|SHA1SUM'`; do gpg --sign --armor --detach $KEYOPTION $i; done;
popd
fi
if [ "UPLOAD" == "$UPLOAD" ] ; then
scp -r artifacts people.apache.org:qpid-${VER}
fi

View file

@ -1,133 +0,0 @@
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# This script will set the proper svn properties on all the files in the tree.
# It pretty much requires a gnu compatible xargs (for the -r flag). Running
# on Linux is probably the best option, or gnuxargs is available for OS X from
# darwinports.
find . -name "*.java" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.java" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.py" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.rb" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.txt" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.txt" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/html
find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "README*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "README*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "LICENSE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "LICENSE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "NOTICE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "NOTICE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "TODO*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "TODO*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "KEYS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "KEYS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.png" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/png
find . -name "*.gif" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/gif
find . -name "*.jpg" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/jpeg
find . -name "*.jpeg" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/jpeg
find . -name "*.scdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.scdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.fragment" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.fragment" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.componentType" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.componentType" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.wsdd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "*.wsdd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "sca.subsystem" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "sca.subsystem" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "Tuscany-model.config" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml
find . -name "Tuscany-model.config" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.cpp" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.cpp" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.c" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.c" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.h" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.h" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "*.am" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.am" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date"
find . -name "ChangeLog*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "ChangeLog*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:executable ""
find . -name "*.bat" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style CRLF
find . -name "*.bat" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:executable ""
find . -name "INSTALL*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "INSTALL*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "COPYING*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "COPYING*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain
find . -name "NEWS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native
find . -name "NEWS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain

View file

@ -1,36 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@REM Create example keystore for broker and trust store for client/management console.
@REM
@REM Use generated qpid.keystore as the brokers keystore
@REM Use generated qpid.truststore as client/consoles truststore
@REM All passwords have value: password
@REM Create Broker Keystore:
keytool -genkey -alias qpidBroker -keyalg RSA -validity 365 -keystore qpid.keystore -storepass password -keypass password -dname "CN=hostname, OU=OrgUnit, O=Org, L=City, C=US"
@REM Export Self Signed Cert:
keytool -export -alias qpidBroker -keystore qpid.keystore -file qpidBroker.cer -storepass password
@REM Import Broker Cert Into MC TrustStore:
keytool -import -alias qpidBrokerCert -file qpidBroker.cer -keystore qpid.truststore -storepass password -noprompt
@REM Delete the cert
del qpidBroker.cer

View file

@ -1,38 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Create example keystore for broker and trust store for client/management console.
#
# Use generated qpid.keystore as the brokers keystore
# Use generated qpid.truststore as client/consoles truststore
# All passwords have value: password
#Create Broker Keystore:
keytool -genkey -alias qpidBroker -keyalg RSA -validity 365 -keystore qpid.keystore \
-storepass password -keypass password -dname "CN=hostname, OU=OrgUnit, O=Org, L=City, C=US"
#Export Self Signed Cert:
keytool -export -alias qpidBroker -keystore qpid.keystore -file qpidBroker.cer -storepass password
#Import Broker Cert Into MC TrustStore:
keytool -import -alias qpidBrokerCert -file qpidBroker.cer -keystore qpid.truststore -storepass password -noprompt
#Delete the cert
rm qpidBroker.cer

View file

@ -1,60 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
die() {
if [[ $1 = -usage ]]; then
shift
usage=true
else
usage=false
fi
echo "$@"
$usage && echo
$usage && usage
exit 1
}
cygwin=false
if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
cygwin=true
fi
if [ -z "$QPID_TOOLS" ]; then
if [ -z "$QPID_HOME" ]; then
die "QPID_TOOLS must be set"
else
QPID_TOOLS=$QPID_HOME
fi
fi
if $cygwin; then
QPID_TOOLS=$(cygpath -w $QPID_TOOLS)
fi
# Set classpath to include Qpid jar with all required jars in manifest
QPID_LIBS=$QPID_TOOLS/lib/qpid-all.jar
# Set other variables used by the qpid-run script before calling
export JAVA=java \
JAVA_VM=-server \
JAVA_OPTS=-Dlog4j.configuration=file:$QPID_TOOLS/etc/mstool-log4j.xml \
QPID_CLASSPATH=$QPID_LIBS
. qpid-run org.apache.qpid.tools.messagestore.MessageStoreTool "$@"

View file

@ -1,35 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
if [ -z "$QPID_HOME" ]; then
export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
export PATH=${PATH}:${QPID_HOME}/bin
fi
# Set classpath to include Qpid jar with all required jars in manifest
QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
# Set other variables used by the qpid-run script before calling
export JAVA=java \
JAVA_VM=-server \
JAVA_MEM=-Xmx1024m \
QPID_CLASSPATH=$QPID_LIBS
. qpid-run org.apache.qpid.tools.security.Passwd "$@"

View file

@ -1,39 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
if [ -z "$QPID_HOME" ]; then
export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
export PATH=${PATH}:${QPID_HOME}/bin
fi
# Set classpath to include Qpid jar with all required jars in manifest
QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/bdbstore-launch.jar
# Set other variables used by the qpid-run script before calling
export JAVA=java \
JAVA_VM=-server \
JAVA_MEM=-Xmx1024m \
JAVA_GC="-XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \
QPID_CLASSPATH=$QPID_LIBS \
QPID_RUN_LOG=2
QPID_OPTS="$QPID_OPTS -Damqj.read_write_pool_size=32 -DQPID_LOG_APPEND=$QPID_LOG_APPEND"
. qpid-run org.apache.qpid.server.Main "$@"

View file

@ -1,22 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
set BDBSTORE_HOME=c:\qpid\trunk\java\bdbstore
set QPID_MODULE_JARS=%BDBSTORE_HOME%\target\qpid-bdbstore-1.0-incubating-M2-SNAPSHOT.jar;%BDBSTORE_HOME%\lib\bdb\je-3.1.0.jar
.\qpid-server.bat

View file

@ -1,203 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\qpid-server.bat" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\qpid-server.bat" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
REM set QPID_WORK if not set
if not "%QPID_WORK%" == "" goto okQpidWork
if "%HOME%" == "" goto noHome
set QPID_WOKR=%HOME%
goto okQpidWork
:noHome
set QPID_WORK=c:\Temp
if not exist %QPID_WORK% md %QPID_WORK%
:okQpidWork
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto end
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto end
:okJavaHome
REM set loggin level if not set
if "%AMQJ_LOGGING_LEVEL%" == "" set AMQJ_LOGGING_LEVEL=info
REM Set the default system properties that we'll use now that they have
REM all been initialised
set SYSTEM_PROPS=-Damqj.logging.level=%AMQJ_LOGGING_LEVEL% -DQPID_HOME=%QPID_HOME% -DQPID_WORK=%QPID_WORK%
if "%EXTERNAL_CLASSPATH%" == "" set EXTERNAL_CLASSPATH=%CLASSPATH%
REM Use QPID_CLASSPATH if set
if "%QPID_CLASSPATH%" == "" goto noQpidClasspath
set CLASSPATH=%QPID_CLASSPATH%
echo Using CLASSPATH: %CLASSPATH%
goto afterQpidClasspath
:noQpidClasspath
echo Warning: Qpid classpath not set. CLASSPATH set to %QPID_HOME%\lib\qpid-all.jar
set CLASSPATH=%QPID_HOME%\lib\qpid-all.jar
:afterQpidClasspath
REM start parsing -run arguments
set QPID_ARGS=
if "%1" == "" goto endRunArgs
:runLoop
set var=%1
if "%var:~0,5%" == "-run:" goto runFound
set QPID_ARGS=%QPID_ARGS% %1
:beforeRunShift
shift
if not "%1"=="" goto runLoop
goto endRunArgs
:runFound
if "%var%" == "-run:debug" goto runDebug
if "%var%" == "-run:jpda" goto runJdpa
if "%var:~0,24%" == "-run:external-classpath-" goto runExternalClasspath
if "%var%" == "-run:print-classpath" goto runPrintCP
if "%var%" == "-run:help" goto runHelp
echo "unrecognized -run option '%var%'. For using external classpaths use -run:external-classpath-option"
goto end
:runDebug
REM USAGE: print the classpath and command before running it
set debug=true
goto beforeRunShift
:runJdpa
REM USAGE: adds debugging options to the java command, use
REM USAGE: JDPA_TRANSPORT and JPDA_ADDRESS to customize the debugging
REM USAGE: behavior and use JPDA_OPTS to override it entirely
if "%JPDA_OPTS%" == "" goto beforeRunShift
if "%JPDA_TRANSPORT%" == "" set JPDA_TRANSPORT=-dt_socket
if "%JPDA_ADDRESS%" == "" set JPDA_ADDRESS=8000
set JPDA_OPTS="-Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n"
set QPID_OPTS="%QPID_OPTS% %JPDA_OPTS%"
goto beforeRunShift
:runExternalClasspath
echo Using external classpath %var%
REM USAGE: Format is -run:external-classpath-first/last/ignore/only as equals special in DOS
REM USAGE: controls how the CLASSPATH environment variable is used by
REM USAGE: this script, value can be one of ignore (the default), first,
REM USAGE: last, and only
if "%var%" == "-run:external-classpath-ignore" goto beforeRunShift
if "%var%" == "-run:external-classpath-first" goto extCPFirst
if "%var%" == "-run:external-classpath-last" goto extCPLast
if "%var%" == "-run:external-classpath-only" goto extCPOnly
echo Invalid value provided for external classpath.
goto end
:extCPFirst
set CLASSPATH=%EXTERNAL_CLASSPATH%;%CLASSPATH%
goto beforeRunShift
:extCPLast
set CLASSPATH=%CLASSPATH%;%EXTERNAL_CLASSPATH%
goto beforeRunShift
:extCPonly
set CLASSPATH=%EXTERNAL_CLASSPATH%
goto beforeRunShift
:runPrintCP
REM USAGE: print the classpath
echo %CLASSPATH%
goto beforeRunShift
:runHelp
REM USAGE: print this message
echo -------------------------------------------------------------------------------------------
echo -run:option where option can be the following.
echo debug : Prints classpath and command before running it
echo jpda : Adds remote debugging info using JPDA_OPTS. Use JPDA_TRANSPORT and JPDA_ADDRESS to
echo customize, JPDA_OPTS to override
echo external-classpath : Valid values are: ignore, first, last and only.
echo print-classpath : Prints classpath before running command
echo help : Prints this message
echo --------------------------------------------------------------------------------------------
goto end
REM end parsing -run arguments
:endRunArgs
set JAVA_VM=-server
set JAVA_MEM=-Xmx1024m
set JAVA_GC=-XX:+UseConcMarkSweepGC
rem removing the following vm arg from JAVA_GC as it is supported on ly in Java 1.6
rem -XX:+HeapDumpOnOutOfMemoryError"
REM Use QPID_JAVA_GC if set
if "%QPID_JAVA_GC%" == "" goto noQpidJavaGC
set JAVA_GC=%QPID_JAVA_GC%
echo Using QPID_JAVA_GC setting: %QPID_JAVA_GC%
goto afteQpidJavaGC
:noQPidJavaGC
echo Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC %JAVA_GC%
:afterQpidJavaGC
REM Use QPID_JAVA_MEM if set
if "%QPID_JAVA_MEM%" == "" goto noQpidJavaMem
set JAVA_MEM=%QPID_JAVA_MEM%
echo Using QPID_JAVA_MEM setting: %QPID_JAVA_MEM%
goto afterQpidJavaMem
:noQpidJavaMem
echo Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM %JAVA_MEM%
:after QpidJavaMem
rem QPID_OPTS intended to hold any -D props for use
rem user must enclose any value for QPID_OPTS in double quotes
:runCommand
set MODULE_JARS=%QPID_MODULE_JARS%
set COMMAND="%JAVA_HOME%\bin\java" %JAVA_VM% %JAVA_MEM% %JAVA_GC% %QPID_OPTS% %SYSTEM_PROPS% -cp "%CLASSPATH%;%MODULE_JARS%" org.apache.qpid.server.Main %QPID_ARGS%
if "%debug%" == "true" echo %CLASSPATH%;%LAUNCH_JAR%;%MODULE_JARS%
if "%debug%" == "true" echo %COMMAND%
%COMMAND%
:end

View file

@ -1,21 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
exec qpid-server -run:debug "$@"

View file

@ -1,178 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# qpid.stop Script
#
# Script checks for a given pid running DEFAULT_SEARCH and attempts to quit it
#
MAX_ATTEMPTS=2
SLEEP_DELAY=1
DEFAULT_SEARCH="PNAME=QPBRKR"
if [ -z "$QPID_STOP_SEARCH" ]; then
SEARCH=$DEFAULT_SEARCH;
else
SEARCH=$QPID_STOP_SEARCH;
fi
#
# Forcably Quit the specified PID($1)
#
forceQuit()
{
kill -9 $1
}
#
# Gracefully ask the PID($1) to quit
#
quit()
{
kill $1
}
#
# grep for the session ID ($1) and return 0 for successful quit and 1 for process alive
#
lookup_pid()
{
result=`ps -e | grep $1 | wc -l`
}
#
# grep ps for all instances of $SEARCH for the current user and collect PIDs
#
lookup_all_pids()
{
pids=`pgrep -f -U $USER $SEARCH`
result_all=`echo -n $pids | wc -w`
}
#
# check that the PID passed in is for a Qpid broker owned by this user and alive
#
validate_pid()
{
result=`pgrep -fl $SEARCH | grep $1 | wc -l`
}
#
# Show the PS output for given set of pids
#
showPids()
{
ps -o user,pid,args -p $pids
}
#
# Sleep and then check then lookup the PID($1) to ensure it has quit
#
check()
{
echo "Waiting $SLEEP_DELAY second for $1 to exit"
sleep $SLEEP_DELAY
lookup_pid $1
}
#
# Verify the PID($1) is available
#
verifyPid()
{
validate_pid $1
if [[ $[$result] == 1 ]] ; then
brokerspid=$1
else
echo "Unable to locate Qpid Broker Process with PID $1. Check PID and try again."
exit -1
fi
}
#
# Stops all Qpid brokers for current user
#
qpid_stopall_brokers()
{
for pid in $pids ; do
lookup_pid $pid;
brokerspid=$pid;
stop_broker $pid;
done
}
#
# Stops Qpid broker with brokerspid id
#
stop_broker()
{
# Attempt to quit the process MAX_ATTEMPTS Times
attempt=0
while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
quit $brokerspid
check $brokerspid
attempt=$[$attempt + 1]
done
# Check that it has quit
if [[ $[$result] == 0 ]] ; then
echo "Process quit"
else
attempt=0
# Now attempt to force quit the process
while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
forceQuit $brokerspid
check $brokerspid
attempt=$[$attempt + 1]
done
# Output final status
if [[ $[$result] > 0 && $[$attempt] == $[$MAX_ATTEMPTS] ]] ; then
echo "Stopped trying to kill process: $brokerspid"
echo "Attempted to stop $attempt times"
else
echo "Done "
fi
fi
}
#
# Main Run
#
# Check if we are killing all qpid pids or just one.
# Now uses local function qpid_stopall_brokers
if [[ $# == 0 ]] ; then
lookup_all_pids
if [[ $[$result_all] > 0 ]] ; then
echo "Killing All Qpid Brokers for user: '$USER'"
qpid_stopall_brokers
else
echo "No Qpid Brokers found running for user: " $USER
fi
exit $result
else
verifyPid $1
stop_broker
exit $result
fi

View file

@ -1,27 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# qpid.stopall script
#
# Script attempts to stop all PROGRAMs running under the current user
# Utilises qpid.stop to perform the actual stopping
#
qpid.stop $*

View file

@ -1,11 +0,0 @@
= Qpid Java Examples =
For more information read ../README.txt.
== The Verify All Script ==
The verify_all script will run Java examples against itself and against the C++
and Python examples. The success of the script is determined by comparing its
output against what is expected.
This script uses the verify script found in qpid/cpp/examples.

View file

@ -1,50 +0,0 @@
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM Helper script to set classpath for running Qpid example classes
@REM NB: You must add the Qpid client and common jars to your CLASSPATH
@REM before running this script
@echo off
if "%QPID_HOME%" == "" GOTO ERROR_QPID_HOME
set QPIDLIB=%QPID_HOME%\lib
if "%CLASSPATH%" == "" GOTO ERROR_CLASSPATH
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\backport-util-concurrent-2.2.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\geronimo-jms_1.1_spec-1.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-collections-3.1.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-configuration-1.2.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-cli-1.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-lang-2.1.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-api-1.0.4.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-1.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\log4j-1.2.12.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-core-1.0.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-filter-ssl-1.0.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-java5-1.0.0.jar
set CLASSPATH=%CLASSPATH%;%QPIDLIB%\slf4j-simple-1.0.jar
GOTO END
:ERROR_CLASSPATH
Echo Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ....
:ERROR_QPID_HOME
Echo Please set QPID_HOME variable. Exiting ....
:END

View file

@ -1,83 +0,0 @@
#!/bin/sh -xv
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Helper script to set classpath for running Qpid example classes
# NB: You must add the Qpid client and common jars to your CLASSPATH
# before running this script
cygwin=false
if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
cygwin=true
fi
#Should have set the QPID_HOME var after install to the working dir e.g. home/qpid/qpid-1.0-incubating-M2-SNAPSHOT
if [ "$QPID_HOME" = "" ] ; then
echo "ERROR: Please set QPID_HOME variable. Exiting ...."
exit 1
else
QPIDLIB=$QPID_HOME/lib
fi
if $cygwin; then
QPIDLIB=$(cygpath -w $QPIDLIB)
fi
if [ "$CLASSPATH" = "" ] ; then
echo "ERROR: Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ...."
exit 2
fi
#Converts paths for cygwin if req
#Some nasty concatenation to get round cygpath line limits
if $cygwin; then
SEP=";"
CLASSPATH=`cygpath -w $CLASSPATH`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/backport-util-concurrent-2.2.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/geronimo-jms_1.1_spec-1.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-collections-3.1.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-configuration-1.2.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-cli-1.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-lang-2.1.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-api-1.0.4.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-1.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/log4j-1.2.12.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-core-1.0.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-filter-ssl-1.0.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-java5-1.0.0.jar`
CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/slf4j-simple-1.0.jar`
export CLASSPATH
else
CLASSPATH=$CLASSPATH:$QPIDLIB/backport-util-concurrent-2.2.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/geronimo-jms_1.1_spec-1.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-collections-3.1.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-configuration-1.2.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-cli-1.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-lang-2.1.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-api-1.0.4.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-1.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/log4j-1.2.12.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/mina-core-1.0.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/mina-filter-ssl-1.0.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/mina-java5-1.0.0.jar
CLASSPATH=$CLASSPATH:$QPIDLIB/slf4j-simple-1.0.jar
export CLASSPATH
fi

View file

@ -1,64 +0,0 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
echo $QPID_SRC_HOME
if test "'x$QPID_SRC_HOME'" == "'x'"
then
export QPID_SRC_HOME=$(cd "$(dirname $0)/../../../.."; pwd)
fi
export CPP=$QPID_SRC_HOME/cpp/examples
export PYTHON=$QPID_SRC_HOME/python/examples
export JAVA=$QPID_SRC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample
export AMQP_SPEC=$QPID_SRC_HOME/specs/amqp.0-10-qpid-errata.xml
export PYTHONPATH=$QPID_SRC_HOME/python/
export LOG4J=file://$QPID_SRC_HOME/java/client/example/src/main/java/log4j.xml
trap cleanup EXIT
run_broker(){
$QPID_SRC_HOME/cpp/src/qpidd -d --no-data-dir --auth no
}
stop_broker(){
$QPID_SRC_HOME/cpp/src/qpidd -q
}
cleanup(){
if [ -e /tmp/qpidd.5672.pid ]; then
stop_broker
fi
find $CPP -name '*.out' | xargs rm -f
find $PYTHON -name '*.out' | xargs rm -f
find $JAVA -name '*.out' | xargs rm -f
}
QPID_LIBS=`find $QPID_SRC_HOME/java/build/lib -name '*.jar' | tr '\n' ":"`
export CLASSPATH=$QPID_LIBS:$CLASSPATH
verify=$QPID_SRC_HOME/cpp/examples/verify
for script in $(find $JAVA -name 'verify*' -not -path '*.svn' -not -name '*.*')
do
run_broker
$verify $script
stop_broker
done

View file

@ -1,69 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-JNDI-Setup.bat"
set JAVACLASS=
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist='localhost' amq.ConnectionFactory
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist='vm://:1' amq.VMConnectionFactory
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindQueue amq.Queue direct://amq.direct//IBMPerfQueue1
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic1 topic://amq.topic/IBMPerfTopic1/
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic2 topic://amq.topic/IBMPerfTopic2/
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic3 topic://amq.topic/IBMPerfTopic3/
:end
pause

View file

@ -1,27 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist=\'tcp://localhost\' amq.ConnectionFactory
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist=\'vm://:1\' amq.VMConnectionFactory
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindQueue amq.Queue direct://amq.direct//IBMPerfQueue1
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic1 topic://amq.topic/IBMPerfTopic1/
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic2 topic://amq.topic/IBMPerfTopic2/
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic3 topic://amq.topic/IBMPerfTopic3/
qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic4 topic://amq.topic/IBMPerfTopic4/

View file

@ -1,62 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-Publisher.bat"
set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 %*
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
:end
pause

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
export MSGSIZE=100
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 $*

View file

@ -1,62 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-PutGet.bat"
set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.PutGet -nt 6 %*
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
:end
pause

View file

@ -1,21 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.PutGet -nt 6 $*

View file

@ -1,19 +0,0 @@
The IBM JMS Performance Harness scripts have take the following additional parameters
-tx : Enable transactions
-pp : Enable persistent messaging
-ms 1000 : Set message size (default 1000 bytes)
-cc 1 : Number of messages to per commit (default 1) Only applies to Sender/Subscriber
The IBM JMS Performance Harness will need to be downloaded and the library added to client/test/lib.
The Library can be found here:
http://www.alphaworks.ibm.com/tech/perfharness
Before running the required test the IBM JNDI Setup script should be run.
This will create a filesystem based JNDI Context located at:
System.properties{java.io.tmpdir}/IBMPerfTestsJNDI/

View file

@ -1,62 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-Receiver.bat"
set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Receiver %*
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
:end
pause

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
export MSGSIZE=100
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Receiver $*

View file

@ -1,62 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-Sender.bat"
set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000 %*
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
:end
pause

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
export MSGSIZE=100
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000 $*

View file

@ -1,62 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@echo off
REM Script to run the Qpid Java Broker
set CMD="IBM-Subscriber.bat"
set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 %*
rem Guess QPID_HOME if not defined
set CURRENT_DIR=%cd%
if not "%QPID_HOME%" == "" goto gotHome
set QPID_HOME=%CURRENT_DIR%
echo %QPID_HOME%
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
cd ..
set QPID_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%QPID_HOME%\bin\%CMD%" goto okHome
echo The QPID_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program.
goto exit
:okJavaHome
set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
echo on
"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
:end
pause

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
export MSGSIZE=100
qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 $*

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Listener $*

View file

@ -1,25 +0,0 @@
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
for i; do
./headersListener.sh -host 10.0.0.1 -port 5672 >$i.out 2>$i.err &
echo $! > $i.pid
done;

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Publisher $*

View file

@ -1,30 +0,0 @@
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# args:
# <number of processes to start>
# <name of run>
# <command ro run>
for i in `seq 1 $1`; do
$3 >$2.$i.out 2>>$2.err &
echo $! > $2.$i.pid
done;

View file

@ -1,24 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
PROFILE=$1
shift
# XXX -Xms1024m -XX:NewSize=300m
. qpid-run org.apache.qpid.requestreply1.ServiceProvidingClient $1 guest guest /test serviceQ

View file

@ -1,27 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
PROFILE=$1
shift
thehosts=$1
shift
echo $thehosts
# XXX -Xms1024m -XX:NewSize=300m
. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.requestreply1.ServiceRequestingClient $thehosts guest guest /test serviceQ "$@"

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
. qpid-run org.apache.qpid.requestreply1.TestService 192.168.55.63 5672 foo x x

View file

@ -1,23 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# XXX -Xmx512m -Xms512m -XX:NewSize=150m
. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Listener $*

View file

@ -1,22 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# XXX -Xmx512m -Xms512m -XX:NewSize=150m
. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Publisher $*

View file

@ -1,265 +0,0 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Test if we're running on cygwin.
cygwin=false
if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
cygwin=true
fi
die() {
if [[ $1 = -usage ]]; then
shift
usage=true
else
usage=false
fi
echo "$@"
$usage && echo
$usage && usage
exit 1
}
OFF=0
WARN=1
INFO=2
if [ -z "$QPID_RUN_LOG" ]; then
QPID_RUN_LOG=$OFF
fi
log() {
if [ "$1" -le "$QPID_RUN_LOG" ]; then
shift
echo "$@"
fi
}
if [ -z $AMQJ_LOGGING_LEVEL ]; then
export AMQJ_LOGGING_LEVEL=info
fi
#Set to help us get round the manifold problems of ps/pgrep on various
#platforms which gather up to prevent qpid_stop from working .....
if [ -z "$QPID_PNAME" ]; then
export QPID_PNAME=" -DPNAME=QPBRKR"
fi
if [ -z "$QPID_HOME" ]; then
export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
export PATH=${PATH}:${QPID_HOME}/bin
fi
if [ -z "$QPID_WORK" ]; then
log $INFO Setting QPID_WORK to $HOME as default
QPID_WORK=$HOME
fi
if [ -z "$JAVA" ]; then
JAVA=java
fi
if $cygwin; then
QPID_HOME=$(cygpath -w $QPID_HOME)
QPID_WORK=$(cygpath -w $QPID_WORK)
fi
#Set the default system properties that we'll use now that they have
#all been initialised
SYSTEM_PROPS="-Damqj.logging.level=$AMQJ_LOGGING_LEVEL -DQPID_HOME=$QPID_HOME -DQPID_WORK=$QPID_WORK"
#If logprefix or logsuffix set to use PID make that happen
#Otherwise just pass the value through for these props
#Using X character to avoid probs with empty strings
if [ -n "$QPID_LOG_PREFIX" ]; then
if [ "X$QPID_LOG_PREFIX" = "XPID" ]; then
log $INFO Using pid in qpid log name prefix
LOG_PREFIX=" -Dlogprefix=$$"
else
log $INFO Using qpid logprefix property
LOG_PREFIX=" -Dlogprefix=$QPID_LOG_PREFIX"
fi
SYSTEM_PROPS="${SYSTEM_PROPS} ${LOG_PREFIX}"
fi
if [ -n "$QPID_LOG_SUFFIX" ]; then
if [ "X$QPID_LOG_SUFFIX" = "XPID" ]; then
log $INFO Using pid in qpid log name suffix
LOG_SUFFIX=" -Dlogsuffix=$$"
else
log $INFO Using qpig logsuffix property
LOG_SUFFIX=" -Dlogsuffix=$QPID_LOG_SUFFIX"
fi
SYSTEM_PROPS="${SYSTEM_PROPS} ${LOG_SUFFIX}"
fi
log $INFO System Properties set to $SYSTEM_PROPS
log $INFO QPID_OPTS set to $QPID_OPTS
program=$(basename $0)
sourced=${BASH_SOURCE[0]}
if [[ -z ${sourced:-''} ]]; then
sourced=$(which qpid-run) || ${QPID_HOME}/bin/qpid-run
fi
usage() {
echo Usage: $program ... "[-run:<option>]" ...
echo
echo Options:
egrep -B 1 "^\s*#USAGE: " ${sourced} |\
sed "s/#USAGE:/ /" |\
sed "s/-run:\(.*\))/-run:\1/" |\
sed "s/-run:\(.*\)=\*/-run:\1=<value>/" |\
sed "s/^--$//"
}
export EXTERNAL_CLASSPATH=$CLASSPATH
unset CLASSPATH
#Use QPID_CLASSPATH if set
if [ -n "$QPID_CLASSPATH" ]; then
export CLASSPATH=$QPID_CLASSPATH
log $INFO "Using QPID_CLASSPATH" $QPID_CLASSPATH
else
log $WARN "Warning: Qpid classpath not set. CLASSPATH must include qpid jars."
fi
#Use QPID_JAVA_GC if set
if [ -n "$QPID_JAVA_GC" ]; then
export JAVA_GC=$QPID_JAVA_GC
log $INFO "Using QPID_JAVA_GC setting" $QPID_JAVA_GC
else
log $INFO "Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC" $JAVA_GC
fi
#Use QPID_JAVA_MEM if set
if [ -n "$QPID_JAVA_MEM" ]; then
export JAVA_MEM=$QPID_JAVA_MEM
log $INFO "Using QPID_JAVA_MEM setting" $QPID_JAVA_MEM
else
log $INFO "Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM" $JAVA_MEM
fi
declare -a RUN_ARGS JAVA_ARGS
for arg in "$@"; do
if [[ $arg == -run:* ]]; then
RUN_ARGS[${#RUN_ARGS[@]}]="$arg"
else
JAVA_ARGS[${#JAVA_ARGS[@]}]="$arg"
fi
done
# this defines the default behavior, it may be modified during option
# processing below
DISPATCH() {
if $debug; then
echo "CLASSPATH=${CLASSPATH}"
echo "${COMMAND[@]}"
fi
exec "${COMMAND[@]}"
}
exclusive() {
if [ -z "$PREVIOUS_ARGS" ]; then
PREVIOUS_ARGS=$1
else
PREVIOUS_ARGS="${PREVIOUS_ARGS}, $1"
DISPATCH() {
die -usage "you must choose one of: $PREVIOUS_ARGS"
}
fi
}
debug=false
for arg in "${RUN_ARGS[@]}"; do
case $arg in
-run:debug)
#USAGE: print the classpath and command before running it
debug=true
;;
-run:jpda)
#USAGE: adds debugging options to the java command, use
#USAGE: JPDA_TRANSPORT and JPDA_ADDRESS to customize the debugging
#USAGE: behavior and use JPDA_OPTS to override it entirely
if [ -z "$JPDA_OPTS" ]; then
JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT:-dt_socket},address=${JPDA_ADDRESS:-8000},server=y,suspend=n"
fi
QPID_OPTS="${QPID_OPTS} ${JPDA_OPTS}"
;;
-run:external-classpath=*)
#USAGE: controls how the CLASSPATH environment variable is used by
#USAGE: this script, value can be one of ignore (the default), first,
#USAGE: last, and only
case $arg in
*=ignore)
# do nothing
;;
*=first)
CLASSPATH=$EXTERNAL_CLASSPATH:$CLASSPATH
;;
*=last)
CLASSPATH=$CLASSPATH:$EXTERNAL_CLASSPATH
;;
*=only)
CLASSPATH=$EXTERNAL_CLASSPATH
;;
*)
die -usage $(echo $arg | sed "s/=/: invalid value '/")\'
;;
esac
;;
-run:print-classpath)
#USAGE: print the classpath
DISPATCH() {
echo $CLASSPATH
}
exclusive $arg
;;
-run:print-command)
#USAGE: print the command
DISPATCH() {
echo "${COMMAND[@]}"
}
exclusive $arg
;;
-run:help)
#USAGE: print this message
DISPATCH() {
usage
}
exclusive $arg
;;
*)
die -usage "unrecognized -run option '$arg'"
;;
esac
done
if $cygwin; then
CLASSPATH=$(cygpath -w -p $CLASSPATH)
JAVA=$(cygpath -u $JAVA)
fi
COMMAND=($JAVA $JAVA_VM $QPID_PNAME $JAVA_GC $JAVA_MEM $SYSTEM_PROPS $JAVA_OPTS $QPID_OPTS "${JAVA_ARGS[@]}")
DISPATCH

View file

@ -1,180 +0,0 @@
#!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import glob, os, subprocess
from subprocess import Popen
from optparse import OptionParser
interop_cases = ["InteropTestCase1DummyRun", "InteropTestCase2BasicP2P", "InteropTestCase3BasicPubSub", "InteropTestCase4P2PMessageSize", "InteropTestCase5PubSubMessageSize"]
interop_command = "java -cp %s org.apache.qpid.test.framework.distributedtesting.Coordinator --xml -e interop -o . -n interop org.apache.qpid.interop.testcases.%s"
# TODO: read this from the ant properties file
clientlibs = ["qpid-integrationtests-M4.jar",
"qpid-junit-toolkit-M4.jar",
"junit-3.8.1.jar",
"qpid-systests-M4.jar",
"qpid-junit-toolkit-M4.jar",
"geronimo-jms_1.1_spec-1.0.jar",
"log4j-1.2.12.jar"]
def main():
parser = OptionParser()
parser.add_option("-t", "--testlib", dest="testlib", action="store",
type="string",
help="The directory containing the test classes to run")
parser.add_option("-b", "--brokers", dest="brokers", action="store",
type="string",
help="The directory containing the unpacked brokers to test")
parser.add_option("-j", "--java", dest="java", action="store",
type="string",
help="The directory containing the java client to test")
parser.add_option("-d", "--dotnet", dest="dotnet", action="store",
type="string",
help="The directory containing the .Net client to test")
parser.add_option("-c", "--cpp", dest="cpp", action="store",
type="string",
help="The directory containing the C++ client to test")
(options, args) = parser.parse_args()
# check available brokers
if (options.brokers == None or
not os.path.exists(options.brokers) or
not os.path.isdir(options.brokers)):
parser.error("Broker directory must be specified and must exist")
# check available clients
if (options.java == None or
not os.path.exists(options.java) or
not os.path.isdir(options.java)):
parser.error("Java client directory must be specified and must exist")
# check available tests
if (options.testlib == None or
not os.path.exists(options.testlib) or
not os.path.isdir(options.testlib)):
parser.error("Test directory must be specified and must exist")
# check dotnet test client
if (options.dotnet == None or
not os.path.exists(options.dotnet) or
not os.path.exists(options.dotnet+"/TestClient.exe")):
parser.error(".Net test directory must be specified and must contain TestClient.exe")
# check cpp test client
if (options.cpp == None or
not os.path.exists(options.cpp) or
not os.path.exists(options.cpp+"/src/tests/interop_runner")):
parser.error("C++ test directory must be specified and must contain test client")
# Get list of available broker and client versions
brokers = glob.glob(options.brokers+"/qpid-[0-9].[0-9].[0-9].[0-9]")
java_clients = glob.glob(options.java+"/qpid-[0-9].[0-9].[0-9].[0-9]*")
if (not len(brokers) > 0):
parser.error("Broker directory did not contain any brokers!")
if (not len(java_clients) > 0):
parser.error("Broker directory did not contain any brokers!")
for broker in brokers:
for client in java_clients:
test(options.testlib, broker, client, options.dotnet,
options.cpp)
def start_dotnet(dotnetpath):
return Popen(["%s/TestClient.exe" % os.path.abspath(dotnetpath),
"-bamqp://guest:guest@clientid/?brokerlist=\'tcp://localhost:5672\'"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
def start_java(javapath):
# Setup classpath
classpath = ""
for lib in clientlibs:
classpath = classpath + testlibdir+"/"+lib+";"
classpath = classpath + javapath+"/lib/qpid-all.jar"
# Add qpid common since the tests need that, classpath hatefulness
classpath = classpath + ";"+testlibdir+"/qpid-common-M4.jar"
return Popen(["java", "-cp","\""+classpath+"\"",
"org.apache.qpid.test.framework.distributedtesting.TestClient"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
def start_cpp(cpppath):
return Popen([cpppath+"tests/interop_runner"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
def run_tests():
for testcase in interop_cases:
cmd = " ".join(["java", "-cp","\""+classpath+"\"", "org.apache.qpid.test.framework.distributedtesting.Coordinator",
"--xml", "-e", "interop", "-o", ".", "-n", "interop", ("org.apache.qpid.interop.testcases.%s" % testcase)])
fd = os.popen(cmd, "r")
output = fd.read()
fd.close()
def test(testlibdir, brokerpath, javapath, dotnetpath, cpppath):
print ("Testing broker in %s\nclient in %s" % (brokerpath, javapath))
print ("Logging too %s" % ("/tmp/qpid-interop-tests/%s-%s" %
(os.path.basename(brokerpath), os.path.basename(javapath))))
os.environ["QPID_HOME"] = brokerpath
os.environ["QPID_WORK"] = ("/tmp/qpid-interop-tests/%s-%s" %
(os.path.basename(brokerpath), os.path.basename(javapath)))
brokerp, javacp, dotnetp, cppp, coordinatorp = (None, None, None, None, None)
try:
# Start broker
brokerp = Popen(brokerpath+"/bin/qpid-server",
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
print ("Started broker, pid %s" % brokerp.pid)
cppp = start_cpp(cpppath)
print ("Started C++ client, pid %s" % cppp.pid)
dotnetp = start_dotnet(dotnetpath)
print ("Started .Net client, pid %s" % dotnetp.pid)
javacp = start_java(javapath)
print ("Started client, pid %s" % javacp.pid)
run_tests()
finally:
# Shutdown broker and clients
if javacp != None:
os.kill(javacp.pid, 9)
if dotnetp != None:
os.kill(dotnetp.pid, 9)
if coordinatorp != None:
os.kill(coordinatorp.pid, 9)
if brokerp != None:
os.kill(brokerp.pid, 9)
# Start coordinator
if __name__ == "__main__":
main()

View file

@ -1,78 +0,0 @@
@echo off
@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements. See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership. The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied. See the License for the
@rem specific language governing permissions and limitations
@rem under the License.
@rem *************************************************************************
@rem This script is used to initialize environment to start QMan JMX Adapter.
@rem It uses several environment variables described below.
@rem You can edit this file according to your environment or (reccommended) set their
@rem values outside this script.
@rem
@rem It sets (or retrieve from the environment if defined) the following variables:
@rem
@rem QMAN_HOME - The home directory of your QMan installation.
@rem JAVA_HOME - Location of the version of Java runtime used to start QMan.
@rem QMAN_CONFIG_FILE - Location of the QMan configuration file.
@rem **************************************************************************
cls
:CHECK JVM
set JAVA=%JAVA_HOME%\bin\java
set JAVA_OPTS=-Xms128m -Xmx512m
if not "%JAVA_HOME%" == "" goto CONFIGURE AND START
set JAVA=java
echo.
echo WARNING : JAVA_HOME is not set so unexpected results may occur.
echo Please set JAVA_HOME to the directory of your local JDK / JRE to avoid this message.
:CONFIGURE AND START
if "%QMAN_HOME%" == "" SET QMAN_HOME=..
if "%QMAN_CONFIG_FILE%" == "" SET QMAN_CONFIG_FILE=%QMAN_HOME%\etc\qman-config.xml
SET QMAN_LIBS=%QMAN_HOME%\lib
SET QMAN_CLASSPATH=%QMAN_HOME%\etc
setlocal ENABLEDELAYEDEXPANSION
FOR /R %QMAN_LIBS% %%G IN (*.jar) DO set QMAN_CLASSPATH=!QMAN_CLASSPATH!;%%G
:START
echo ===============================================================================
echo.
echo QMan JMX Bridge Bootstrap Environment
echo --------------------------------------------------
echo.
echo QMan HOME : %QMAN_HOME%
echo.
echo Java executable : %JAVA%
echo.
echo Java Opts : %JAVA_OPTS%
echo.
echo Configuration file : %QMAN_CONFIG_FILE%
echo.
echo Bootstrap classpath : %QMAN_CLASSPATH%
echo.
echo ===============================================================================
echo.
"%JAVA%" %JAVA_OPTS% -Dcom.sun.management.jmxremote -Dqman-config=%QMAN_CONFIG_FILE% -classpath "%QMAN_CLASSPATH%" org.apache.qpid.management.domain.services.QMan

View file

@ -1,76 +0,0 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# *************************************************************************
# This script is used to initialize environment to start QMan JMX Adapter.
# It uses several environment variables described below.
# You can edit this file according to your environment or (reccommended) set their
# values outside this script.
#
# It sets (or retrieve from the environment if defined) the following variables:
#
# QMAN_HOME - The home directory of your QMan installation.
# JAVA_HOME - Location of the version of Java runtime used to start QMan.
# QMAN_CONFIG_FILE - Location of the QMan configuration file.
# **************************************************************************
clear
JAVA=$JAVA_HOME/bin/java
JAVA_OPTS="-Xms128m -Xmx512m"
if [ "$JAVA_HOME" = "" ] ; then
echo "JAVA_HOME is not set. Unexpected results may occur."
echo "Set JAVA_HOME to the directory of your local JDK to avoid this message."
JAVA=java
fi
if [ "$QMAN_HOME" = "" ] ; then
QMAN_HOME=..
fi
if [ "$QMAN_CONFIG_FILE" = "" ] ; then
QMAN_CONFIG_FILE=$QMAN_HOME/etc/qman-config.xml
fi
if [ "$QMAN_LIBS" = "" ] ; then
QMAN_LIBS=$QMAN_HOME/lib
fi
QMAN_CLASSPATH=`find $QMAN_LIBS | tr '\n' ":"`
QMAN_CLASSPATH=$QMAN_HOME/etc:$QMAN_CLASSPATH
echo "==============================================================================="
echo ""
echo "QMan JMX Bridge Bootstrap Environment"
echo "--------------------------------------------------"
echo ""
echo "QMan HOME : $QMAN_HOME"
echo ""
echo "Java executable : $JAVA"
echo ""
echo "Java Opts : $JAVA_OPTS"
echo ""
echo "Configuration file : $QMAN_CONFIG_FILE"
echo ""
echo "Bootstrap classpath : $QMAN_CLASSPATH"
echo ""
echo "==============================================================================="
echo ""
"$JAVA" $JAVA_OPTS -cp $QMAN_CLASSPATH -Dcom.sun.management.jmxremote -Dqman-config=$QMAN_CONFIG_FILE org.apache.qpid.management.domain.services.QMan

View file

@ -1,88 +0,0 @@
@echo off
@rem Licensed to the Apache Software Foundation (ASF) under one
@rem or more contributor license agreements. See the NOTICE file
@rem distributed with this work for additional information
@rem regarding copyright ownership. The ASF licenses this file
@rem to you under the Apache License, Version 2.0 (the
@rem "License"); you may not use this file except in compliance
@rem with the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing,
@rem software distributed under the License is distributed on an
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@rem KIND, either express or implied. See the License for the
@rem specific language governing permissions and limitations
@rem under the License.
@rem *************************************************************************
@rem This script is used to initialize environment to start QMan WS-DM Adapter.
@rem It uses several environment variables described below.
@rem You can edit this file according to your environment or (reccommended) set their
@rem values outside this script.
@rem
@rem It sets (or retrieve from the environment if defined) the following variables:
@rem
@rem QMAN_HOME - The home directory of your QMan installation.
@rem JAVA_HOME - Location of the version of Java runtime used to start QMan.
@rem QMAN_WSDM_ADAPTER_PORT - The TCP port that QMan will use to listen for incoming connections.
@rem QMAN_WSDM_ADAPTER_HOST - The IP address or DNS name QMan will use to listen for incoming connections
@rem QMAN_CONFIG_FILE - Location of the QMan configuration file.
@rem **************************************************************************
set JAVA=%JAVA_HOME%\bin\java
set JAVA_OPTS=-Xms128m -Xmx512m
SET CLASSPATH=
if not "%JAVA_HOME%" == "" goto CONFIGURE AND START
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
:CONFIGURE AND START
if "%QMAN_HOME%" == "" SET QMAN_HOME=..
if "%QMAN_WSDM_ADAPTER_PORT%" == "" SET QMAN_WSDM_ADAPTER_PORT=8080
if "%QMAN_WSDM_ADAPTER_HOST%" == "" SET QMAN_WSDM_ADAPTER_HOST=%COMPUTERNAME%
if "%QMAN_CONFIG_FILE%" == "" SET QMAN_CONFIG_FILE=%QMAN_HOME%\etc\qman-config.xml
SET ADMIN_PORT=8079
SET ADMIN_KEY=gazzax
SET QMAN_LIBS=%QMAN_HOME%\lib
SET JETTY_CONFIG_FILE=%QMAN_HOME%\etc\jetty.xml
SET CLASSPATH=%QMAN_HOME%\etc
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\start.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\jetty-6.1.14.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\jetty-util-6.1.14.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\geronimo-servlet_2.5_spec-1.2.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\slf4j-api-1.4.0.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\slf4j-log4j12-1.4.0.jar
SET CLASSPATH=%CLASSPATH%;%QMAN_LIBS%\log4j-1.2.12.jar
echo ===============================================================================
echo.
echo QMan WS-DM Bridge Bootstrap Environment
echo ------------------------------------------------------
echo.
echo QMan HOME: %QMAN_HOME%
echo.
echo Java executable : %JAVA%
echo.
echo QMan configuration file : %QMAN_CONFIG_FILE%
echo.
echo Web Server configuration file : %JETTY_CONFIG_FILE%
echo.
echo Web Server HTTP port : %QMAN_WSDM_ADAPTER_PORT%
echo.
echo Web Server Admin port : %ADMIN_PORT%
echo.
echo Bootstrap classpath : %CLASSPATH%
echo.
echo ===============================================================================
echo.
%JAVA% -cp %CLASSPATH% -DQMAN_HOME=%QMAN_HOME% -Djetty.home=%QMAN_HOME% -Dqman.host=%QMAN_WSDM_ADAPTER_HOST% -Dqman.port=%QMAN_WSDM_ADAPTER_PORT% -DSTOP.PORT=%ADMIN_PORT% -DSTOP.KEY=%ADMIN_KEY% -Dqman-config=%QMAN_CONFIG_FILE% org.mortbay.start.Main %JETTY_CONFIG_FILE%

View file

@ -1,89 +0,0 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# *************************************************************************
# This script is used to initialize environment to start QMan WS-DM Adapter.
# It uses several environment variables described below.
# You can edit this file according to your environment or (reccommended) set their
# values outside this script.
#
# It sets (or retrieve from the environment if defined) the following variables:
#
# QMAN_HOME - The home directory of your QMan installation.
# JAVA_HOME - Location of the version of Java runtime used to start QMan.
# QMAN_WSDM_ADAPTER_PORT - The TCP port that QMan will use to listen for incoming connections.
# QMAN_WSDM_ADAPTER_HOST - The IP address or DNS name QMan will use to listen for incoming connections
# QMAN_CONFIG_FILE - Location of the QMan configuration file.
# **************************************************************************
JAVA=$JAVA_HOME/bin/java
JAVA_OPTS="-Xms128m -Xmx512m"
if [ "$JAVA_HOME" = "" ] ; then
echo "JAVA_HOME is not set. Unexpected results may occur."
echo "Set JAVA_HOME to the directory of your local JDK to avoid this message."
JAVA=java
fi
if [ "$QMAN_HOME" = "" ] ; then
QMAN_HOME=..
fi
if [ "$QMAN_WSDM_ADAPTER_PORT" = "" ] ; then
QMAN_WSDM_ADAPTER_PORT=8080
fi
if [ "$QMAN_WSDM_ADAPTER_HOST" = "" ] ; then
QMAN_WSDM_ADAPTER_HOST=$HOSTNAME
fi
if [ "$QMAN_CONFIG_FILE" = "" ] ; then
QMAN_CONFIG_FILE=$QMAN_HOME/etc/qman-config.xml
fi
ADMIN_PORT=8079
ADMIN_KEY=gazzax
QMAN_LIBS=$QMAN_HOME/lib
JETTY_CONFIG_FILE=$QMAN_HOME/etc/jetty.xml
QMAN_CLASSPATH=$QMAN_HOME/etc:$QMAN_LIBS/start.jar:$QMAN_LIBS/jetty-6.1.14.jar:$QMAN_LIBS/jetty-util-6.1.14.jar:$QMAN_LIBS/geronimo-servlet_2.5_spec-1.2.jar:$QMAN_LIBS/slf4j-api-1.4.0.jar:$QMAN_LIBS/slf4j-log4j12-1.4.0.jar:$QMAN_LIBS/log4j-1.2.12.jar
echo "==============================================================================="
echo""
echo "QMan WS-DM Bridge Bootstrap Environment"
echo "------------------------------------------------------"
echo""
echo "QMan HOME: $QMAN_HOME"
echo""
echo "Java executable : $JAVA"
echo""
echo "Java Opts : $JAVA_OPTS"
echo""
echo "Configuration file : $QMAN_CONFIG_FILE"
echo""
echo "Web Server Configuration File : $JETTY_CONFIG_FILE"
echo""
echo "Web Server HTTP port : $QMAN_WSDM_ADAPTER_PORT"
echo""
echo "Web Server HTTP host : $QMAN_WSDM_ADAPTER_HOST"
echo""
echo "Web Server Admin port : $ADMIN_PORT"
echo""
echo "Bootstrap classpath : $QMAN_CLASSPATH"
echo""
echo "==============================================================================="
echo""
"$JAVA" $JAVA_OPTS -cp $QMAN_CLASSPATH -DQMAN_HOME=$QMAN_HOME -Djetty.home=$QMAN_HOME -Dqman.host=$QMAN_WSDM_ADAPTER_HOST -Dqman.port=$QMAN_WSDM_ADAPTER_PORT -DSTOP.PORT=$ADMIN_PORT -DSTOP.KEY=$ADMIN_KEY -Dqman-config=$QMAN_CONFIG_FILE org.mortbay.start.Main $JETTY_CONFIG_FILE

View file

@ -1,37 +0,0 @@
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one
rem or more contributor license agreements. See the NOTICE file
rem distributed with this work for additional information
rem regarding copyright ownership. The ASF licenses this file
rem to you under the Apache License, Version 2.0 (the
rem "License"); you may not use this file except in compliance
rem with the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing,
rem software distributed under the License is distributed on an
rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
rem KIND, either express or implied. See the License for the
rem specific language governing permissions and limitations
rem under the License.
set JAVA=%JAVA_HOME%\bin\java
if not "%JAVA_HOME%" == "" goto CONFIGURE AND START
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
:CONFIGURE AND START
if "%QMAN_HOME%" == "" SET QMAN_HOME=..
SET ADMIN_PORT=8079
SET ADMIN_KEY=gazzax
"%JAVA%" -DSTOP.PORT=%ADMIN_PORT% -DSTOP.KEY=%ADMIN_KEY% -jar %QMAN_HOME%\lib\start.jar --stop
echo QMan WS-DM Adapter shut down successfully.

View file

@ -1,38 +0,0 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
JAVA=$JAVA_HOME/bin/java
if [ "$JAVA_HOME" = "" ] ; then
echo "JAVA_HOME is not set. Unexpected results may occur."
echo "Set JAVA_HOME to the directory of your local JDK to avoid this message."
JAVA=java
fi
if [ "$QMAN_HOME" = "" ] ; then
QMAN_HOME=..
fi
ADMIN_PORT=8079
ADMIN_KEY=gazzax
"$JAVA" -DSTOP.PORT=$ADMIN_PORT -DSTOP.KEY=$ADMIN_KEY -jar $QMAN_HOME/lib/start.jar --stop
echo "QMan WS-DM Adapter shut down successfully."

View file

@ -1,35 +0,0 @@
#!/bin/bash
#
# License to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
if [ -z "$QPID_HOME" ]; then
export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
export PATH=${PATH}:${QPID_HOME}/bin
fi
# Set classpath to include Qpid jar with all required jars in manifest
QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
# Set other variables used by the qpid-run script before calling
export JAVA=java \
JAVA_VM=-server \
JAVA_MEM=-Xmx1024m \
QPID_CLASSPATH=$QPID_LIBS
. qpid-run org.apache.qpid.CommandLineInterpreter "$@"

View file

@ -1,28 +0,0 @@
@REM
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM
set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/jline-0.9.94.jar
set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/junit-4.4.jar
set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/qpid-cli-1.0.jar
set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/qpid-management-common-M4.jar
set CLASSPATH=%CLASSPATH%;%QPID_HOME%/management/tools/qpid-cli/main/classes/
java -classpath %CLASSPATH% org.apache.qpid.CommandLineInterpreter %1

View file

@ -1,221 +0,0 @@
#!/bin/bash
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
#
# This script starts a broker and then starts additional logging as required.
# *.pid files are generated in the LOG_DIR for later use by the stop-monitored-broker
# script.
#
# Currently this process starts:
# - The broker with additional QPID_OPTS for gc logging
# - Top to monitoring the CPU usage
#
# Additional processes can be started and as long as they write a PID into LOG_DIR/*.pid
# it will be shutdown with the stop script
#
#
# Output the broker log file to aid problem diagnosis
# then exit.
#
brokerFailExit()
{
echo "Broker failed to start up."
cat $BROKER_LOG
exit 1
}
showUsageExit()
{
echo "Usage $0 <Path to Test Broker> <LOG DIR> <CPU Monitor Rate (s)> [Additional options to
pass to Qpid broker startup]"
exit 1
}
#
# Perform 3 attempts to get the broker PID via ps and grep
# if unable the output broker log and exit
#
getBrokerPID()
{
attempts=3
ready=0
while [ $ready == 0 ] ; do
PID=`ps auxwww| grep java | grep Xloggc | awk '{print $2}'`
if [ ! $PID == 0 ] ; then
ready=1
else
attempts=$[ $attempts - 1 ]
if [ $attempts == 0 ] ; then
brokerFailExit
fi
sleep 1
fi
done
}
#
# Additional Check to ensure that the broker process
# has correctly written 'Ready' to the log file.
#
checkBrokerStarted()
{
attempts=3
ready=0
while [ $ready == 0 ] ; do
grep Ready $BROKER_LOG > /dev/null
if [ $? == 0 ] ; then
ready=1
else
attempts=$[ $attempts - 1 ]
if [ $attempts == 0 ] ; then
brokerFailExit
fi
echo "Broker not ready sleeping 1s"
sleep 1
fi
done
}
#
# Command Line setup
#
# Ensure we have minimum of three arguments
if [[ $# > 2 ]] ; then
BROKER_VERSION=$1
LOG_DIR=$2
CPU_MONITOR_RATE=$3
# Remove these arguments from the $@ variable
shift
shift
shift
else
# If we have no arguments then use these as the default
CPU_MONITOR_RATE=0.5
LOG_DIR=$QPID_WORK/logging
BROKER_VERSION=qpid-0.5
fi
#
# Check the specified broker is reachable
# it it is not the log and show usage
#
if [ ! -d $BROKER_VERSION ] ; then
echo "Broker not available at: $BROKER_VERSION"
showUsageExit
fi
#
# Check to see if we have an absolute path for logging
#
logStart=`echo $LOG_DIR|cut -c 1`
#
# If we don't have an absolute path then add the current
# directory path to the start.
#
if [[ $logStart != '/' ]] ; then
echo -n "$LOG_DIR is not absolute, using "
LOG_DIR=`pwd`/$LOG_DIR
echo $LOG_DIR
fi
#
# Validate that the directory does not exist
# - this is so we can guarrantee a clean run.
# If it does exit then log and show usage
#
if [ -d $LOG_DIR ] ; then
echo "Log directory already exists : $LOG_DIR"
showUsageExit
fi
#
# Create the logging directory
#
mkdir -p $LOG_DIR
#
# Variable for broker log
#
BROKER_LOG=$LOG_DIR/broker.log
# Variable to hold broker PID
PID=0
export QPID_OPTS="-Xloggc:$LOG_DIR/gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps"
#
# Start Qpid Broker
#
echo "Starting Broker : $BROKER_VERSION"
pushd $BROKER_VERSION/bin > /dev/null
./qpid-server $@ 2> $BROKER_LOG >&2 &
popd > /dev/null
# Wait and check startup was ok
echo "Waiting for broker startup"
getBrokerPID
checkBrokerStarted
echo $PID > $LOG_DIR/broker.pid
#
# Start CPU Monitoring via TOP
#
echo "Starting CPU Monitor at RATE:$CPU_MONITOR_RATE on $SERVER1"
pushd $LOG_DIR > /dev/null
echo $CPU_MONITOR_RATE > top.rate
top -d $CPU_MONITOR_RATE -S -c -p $PID -b > broker_cpu.log &
#
# Get top pid using $!
#
echo $! > $LOG_DIR/top.pid
popd > /dev/null
#
# Generate Stat files
#
echo "Generating Stat data"
stat $BROKER_LOG > $BROKER_LOG.stat
stat $LOG_DIR/broker_cpu.log > $LOG_DIR/broker_cpu.log.stat
stat $LOG_DIR/gc.log > $LOG_DIR/gc.log.stat

View file

@ -1,148 +0,0 @@
#!/bin/bash
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
#
# Run specified performance tests and
# gather details about the test run
#
runTest()
{
echo "$@"
echo "$@ --csv -o $LOG_DIR" >> $LOG_DIR/TestRun.log 2>&1
./$@ --csv -o $LOG_DIR >> $LOG_DIR/TestRun.log 2>&1
}
showUsageExit()
{
echo "Usage $0 <Path to Test Pack> <LOG DIR> <TEST LIST FILE>"
exit 1
}
# Ensure we have minimum of three arguments
if [[ $# > 2 ]] ; then
TEST_VERSION=$1
LOG_DIR=$2
TEST_LIST=$3
# Remove these arguments from the $@ variable
shift
shift
shift
else
showUsageExit
fi
#
# Check the specified broker is reachable
# it it is not the log and show usage
#
if [ ! -d $TEST_VERSION ] ; then
echo "Tests not available at: $TEST_VERSION"
showUsageExit
fi
#
# Check to see if we have an absolute path for logging
#
logStart=`echo $LOG_DIR|cut -c 1`
#
# If we don't have an absolute path then add the current
# directory path to the start.
#
if [[ $logStart != '/' ]] ; then
echo -n "$LOG_DIR is not absolute, using "
LOG_DIR=`pwd`/$LOG_DIR
echo $LOG_DIR
fi
#
# Validate that the directory does not exist
# - this is so we can guarrantee a clean run.
# If it does exit then log and show usage
#
if [ -d $LOG_DIR ] ; then
echo "Log directory already exists : $LOG_DIR"
showUsageExit
fi
#
# Check to see if we have an absolute path for test list
#
testListStart=`echo $TEST_LIST|cut -c 1`
#
# If we don't have an absolute path then add the current
# directory path to the start.
#
if [[ $testListStart != '/' ]] ; then
echo -n "$TEST_LIST is not absolute, using "
TEST_LIST=`pwd`/$TEST_LIST
echo $TEST_LIST
fi
#
# Validate that the directory does not exist
# - this is so we can guarrantee a clean run.
# If it does exit then log and show usage
#
# -r Check file exists and is readable
if [ ! -r $TEST_LIST ] ; then
echo "Test file is not readable : $TEST_LIST"
showUsageExit
fi
#
# Create the logging directory
#
mkdir -p $LOG_DIR
echo "Starting Test Run in : $TEST_VERSION"
pushd $TEST_VERSION/bin > /dev/null
#
# Run tests
#
while read testCommand
do
runTest $testCommand
done < "$TEST_LIST"
popd > /dev/null
#
# Generate Stat files
#
echo "Generating Stat data"
for file in `find $LOG_DIR -name "*.csv"` ; do
stat $file > $file.stat
done

View file

@ -1,124 +0,0 @@
#!/bin/bash
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
#
# Script to stop the running of a monitored broker
# and the associated monitoring processes.
#
# Looks in the specifed directory for pid files and
# stops those proceses
#
usage()
{
echo "Usage: $0 <LOG_DIR>"
}
#
# Attempt to gracefully kill processs
#
stopRun()
{
kill $PIDS
}
#
# Forcibly stop processes
#
forceStopRun()
{
kill -9 $PIDS
}
#
# Show usage if we are not started correctly
#
if [ $# != 1 ] ; then
usage
exit 1
fi
LOG_DIR=$1
PIDS=`cat $LOG_DIR/*.pid`
echo "Preparing to stop:"
#
# Escape the path so we can use sed to remove it.
#
path=`echo $LOG_DIR|sed -e s/\\\//\\\\\\\\\\\//g`
for i in `ls $LOG_DIR/*.pid` ; do
# Remove path from pid item then remove any final '/'
echo $i|cut -d '.' -f 1| sed -e s/$path// |tr '/' ' '
done
status=`ps $PIDS |wc -l`
if [ $status == 1 ] ; then
echo "Processes do not appear to be running."
echo "Have they already been stopped?"
exit 0
fi
attempts=3
while [ ! $status == 1 ] ; do
stopRun
sleep 1
status=`ps $PIDS |wc -l`
if [ $status == 1 ] ; then
echo "Done"
exit 0
else
attempts=$[ $attempts - 1 ]
if [ $attempts == 0 ] ; then
break
fi
echo "Sleeping as processes not stopped"
sleep 2
fi
done
# If we haven't been able to kill the processes then
# forcibly do it
if [ ! $status == 1 ] ; then
forceStopRun
sleep 1
status=`ps $PIDS |wc -l`
if [ $status == 1 ] ; then
echo "Done"
else
echo "Stop failed"
exit 1
fi
else
echo "Done"
fi

View file

@ -1,285 +0,0 @@
#!/bin/bash
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
usage()
{
echo "usage: process.sh <Qpid Version> <Test Type Queue/Topic/Latency..> <Volume of data %age> <broker details>"
echo "These parameters are used to title and name the graphs:"
echo 'Title = $<Qpid Version> $<Test Type> : $<Volume>% volume'
echo 'File = $<Qpid Version>-$<Broker Details>-$<Test Type>-$<Volume>'
exit 1
}
processCMSGCFile()
{
# Extract all the ParNew timings: Ignore any lines corrupted by concurrent CMS logging.
grep -v CMS gc.log|grep ParNew > $work/parnew.gc.log
# Calculate Full GC Data
grep failure -B 1 gc.log | sed -e :a -e '$!N;s/\n.(concurrent/ /;ta' -e 'P;D' |grep -v ^\- > $work/full.gc.log
cut -d ':' -f 1 $work/full.gc.log > $work/full.time.log
sed -e 's/failure)/\#/g' $work/full.gc.log |cut -d '#' -f 2- |awk '{print $3}' > $work/full.dur.log
# Move to the working directory to further process the gathered data.
pushd $work &> /dev/null
# Extract the Heap and timing data.
#8 is the full gc data
#5 is the paranew gc data
cat parnew.gc.log | awk '{print $8}' | cut -d '(' -f 2 | cut -d 'K' -f 1 > HEAP_MAX.log
cat parnew.gc.log | awk '{print $8}' | cut -d 'K' -f 1 > HEAP_PRE_GC.log
cat parnew.gc.log | awk '{print $8}' | cut -d 'K' -f 2 | cut -d '>' -f 2 > HEAP_POST_GC.log
cat parnew.gc.log | awk '{print $1}' | cut -d ':' -f 1 > GC_TIME.log
# Calculate ParNew GC Cumulative total
cat parnew.gc.log |awk '{sum=sum+$6; print $6, sum}' > GC_DUR.log
# Give a count of GC occurances
parNewGCCount=`wc -l GC_DUR.log| awk '{print $1}'`
# Create the Heap data file
paste GC_TIME.log HEAP_POST_GC.log HEAP_PRE_GC.log HEAP_MAX.log > GC.Heap.data
# Create ParNew GC Duration data file for graphing
paste GC_TIME.log GC_DUR.log > GC.Dur.data
# Create Full GC occurance log file for plotting
paste full.time.log full.dur.log > GC.Full.data
# Calculate All GC Timing and give a count of their occurance
awk '{print $1}' GC_DUR.log > gc_dur.log
paste GC_TIME.log gc_dur.log > gc_all.log
cat GC.Full.data >> gc_all.log
sort -n gc_all.log | awk '{sum=sum+$2;print $1 , sum}' > GC.Dur.All.data
fullGCCount=`wc -l GC.Full.data| awk '{print $1}'`
}
processG1GCFile()
{
cat gc.log | grep -e \^[0-9]*.[0-9]*\: -e \^.*[0-9]*.\-\> > $work/g1.gc.log
# Move to the working directory to further process the gathered data.
pushd $work &> /dev/null
# Calculate Full GC Data
cat g1.gc.log | sed -e :a -e '$!N;s/\n.\ *\[/ \[/;ta' -e 'P;D' > full.gc.log
grep Full full.gc.log |awk '{print $1}'| tr ':' ' ' > full.time.log
grep Full full.gc.log |awk '{print $5}' > full.dur.log
fullGCCount=`wc -l GC.Full.data| awk '{print $1}'`
# Create Full GC occurance log file for plotting
paste full.time.log full.dur.log > GC.Full.data
# Extract the Heap and timing data.
# Create G1 Young Duration data file for graphing
grep "(young)," full.gc.log |awk '{print $1}' | tr ':' ' ' > GC_TIME.log
grep "(young)," full.gc.log |awk '{print $5}' > young.gc.time.log
# Calculate G1 young Cumulative total
cat young.gc.time.log |awk '{sum=sum+$1; print $1, sum}' > GC_DUR.log
# Create G1 Young Duration data file for graphing
paste GC_TIME.log GC_DUR.log > GC.Dur.data
# Give a count of GC occurances
youngGCCount=`wc -l GC_DUR.log| awk '{print $1}'`
#
# If we have no GCs then something is wrong
if [ $youngGCCount == 0 ] ; then
echo "Error no YoungGC log entries to proceses"
return
fi
# Gather the Heap Size data
grep "(young)," full.gc.log | awk '{print $8}' | cut -d '(' -f 2 | cut -d ')' -f 1 > HEAP_MAX.Sized.log
grep "(young)," full.gc.log | awk '{print $8}' | cut -d '-' -f 1 > HEAP_PRE_GC.Sized.log
grep "(young)," full.gc.log | awk '{print $8}' | cut -d '>' -f 2| cut -d '(' -f 1 > HEAP_POST_GC.Sized.log
normaliseSizeMemFile HEAP_MAX.Sized.log HEAP_MAX.log
normaliseSizeMemFile HEAP_PRE_GC.Sized.log HEAP_PRE_GC.log
normaliseSizeMemFile HEAP_POST_GC.Sized.log HEAP_POST_GC.log
# Create the Heap data file
paste GC_TIME.log HEAP_POST_GC.log HEAP_PRE_GC.log HEAP_MAX.log > GC.Heap.data
# Calculate All GC Timing and give a count of their occurance
awk '{print $1}' GC_DUR.log > gc_dur.log
paste GC_TIME.log gc_dur.log > gc_all.log
cat GC.Full.data >> gc_all.log
sort -n gc_all.log | awk '{sum=sum+$2;print $1 , sum}' > GC.Dur.All.data
}
#
# Take an input file ($1) of lines
# <value><K|M>
# and output file $2 of <value> in whole M
#
normaliseSizeMemFile()
{
rm -f $2
for i in `cat $1` ; do
if [[ `echo $i | grep -c "K" ` == 1 ]] ; then
kb=`echo $i|cut -d 'K' -f 1`
echo $[ $kb / 1024 ] >> $2
else
echo $i|cut -d 'M' -f 1 >> $2
fi
done
}
# Parse command line
# TODO more advanced processing
# Check we have enough parameters
if [ $# != 4 ] ; then
# Take one arg to be a graph data file.
if [ $# == 1 ] ; then
textArray[0]="" # hold text
length=0
# read whole file in loop
while read line
do
textArray[$length]=$line # store line
length=$(expr $length + 1) # increase length by 1
done < $1
if [ $length != 2 ] ; then
usage
fi
#Get Title and file name
title=${textArray[0]}
file=${textArray[1]}
pushd `dirname $1`
else
usage
fi
else
version=$1
type=$2
volume=$3
brokerState=$4
# Configure Graph Title and image file names
title="$version $type : $volume% volume"
file="$version-$brokerState-$type-$volume"
fi
work=work
mkdir -p $work
echo -n "Processing GC Usage Data : "
ParNew=`grep -c ParNew gc.log`
if [ $ParNew != 0 ] ; then
echo "CMS log file"
processCMSGCFile
PLOT="\"GC.Dur.data\" with lines axis x1y1 ti \"ParNew GC Time ($parNewGCCount)\", "
else
echo "G1 log file"
processG1GCFile
PLOT="\"GC.Dur.data\" with lines axis x1y1 ti \"G1 Young Time ($youngGCCount)\", "
fi
# Prepare the plot command
# If a Full GC occured during this test then plot those
if [[ $fullGCCount > 0 ]] ; then
PLOT=$PLOT"\"GC.Dur.data\" using 1:3 with lines axis x1y2 ti \"Cumulative Total Time(ParNew)\", \
\"GC.Dur.All.data\" with lines axis x1y2 ti \"Cumulative Total Time(All)\", \
\"GC.Full.data\" with points ti \"Full GCs Time ($fullGCCount)\" "
else
PLOT=$PLOT"\"GC.Dur.data\" using 1:3 with lines axis x1y2 ti \"Cumulative Total Time(ParNew)\", \
\"GC.Dur.All.data\" with lines axis x1y2 ti \"Cumulative Total Time(All)\" "
fi
if [ $ParNew != 0 ] ; then
gcs=$parNewGCCount
else
gcs=$youngGCCount
fi
# Call out to gnuplot to generate graphs
# Only do this if we have data
if [ $gcs != 0 ] ; then
# Generate the Heap Graph and the GC Duration Graph
gnuplot << EOGNUPLOT
set xlabel "Run Time(s)"
set title "$title : Heap Size"
set term png
set output "$file-Heap.png"
set ylabel "MB" +0.5,0
plot "GC.Heap.data" using 1:2 with lines axis x1y1 ti "GC Size Post",\
"GC.Heap.data" using 1:4 with lines axis x1y1 ti "GC Size Max ", \
"GC.Heap.data" using 1:3 with lines axis x1y1 ti "GC Size Pre "
set y2tics nomirror
set ytics nomirror
set key top left
set title "$title GC Time"
set ylabel "Time(s)" +0.5,0
set y2label "Total Time(s)"
set output "$file-GCDuration.png"
plot $PLOT
EOGNUPLOT
else
echo "Warning: No GC Data to graph"
fi
# pop back to further process for CPU usage
popd &> /dev/null
echo "Processing CPU Usage Data"
# CPU.data is just TimeStamp + %age
cat broker_cpu.log |awk '{print $1 "T" $2 " " $3}' > $work/CPU.data
# Move to work directory to run gnuplot
pushd $work &> /dev/null
# Call out to gnuplot to generate graphs
# Generate the Heap Graph and the GC Duration Graph
gnuplot << EOGNUPLOT
set term png
set title "$title : CPU"
set output "$file-CPU.png"
unset key
set xlabel "Real Time(h:m)"
set ylabel "Usage(%)"
set xdata time
set timefmt "%Y-%m-%dT%H:%M:%S"
set format x "%H:%M"
plot "CPU.data" using 1:2 with lines
EOGNUPLOT
popd &> /dev/null

View file

@ -1,54 +0,0 @@
#!/bin/bash
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
usage()
{
echo "processResults.sh <search dir>"
exit 1
}
root=`pwd`
echo $root
graphFile=graph.data
if [ $# != 1 ] ; then
usage
fi
mkdir -p results
for file in `find $1 -name $graphFile` ; do
dir=`dirname $file`
echo Processing : $dir
pushd $dir &> /dev/null
$root/process.sh $graphFile
echo Copying Images
cp work/*png $root/results/
popd &> /dev/null
echo Done
done

Some files were not shown because too many files have changed in this diff Show more