Issue #2277 Remove more ScriptCreator references
Change-Id: I8524faa9914c81afb7ace709b857bca2ef7ff747 Former-commit-id:63e90f6955
[formerly17b38d9f72
[formerly 0d898da3aebc056c372c7785538b0b27e3e986ef]] Former-commit-id:17b38d9f72
Former-commit-id:487775918d
This commit is contained in:
parent
8192738d0d
commit
84377d3e8c
27 changed files with 430 additions and 783 deletions
|
@ -78,7 +78,7 @@ public class CatalogQuery {
|
|||
for (int i = 0; i < fieldResults.length; ++i) {
|
||||
fieldResults[i] = String.valueOf(results[i]);
|
||||
}
|
||||
return fieldResults.length == 0 ? null : fieldResults;
|
||||
return fieldResults;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,8 +32,6 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
|||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
|
@ -65,18 +63,12 @@ public class Loader {
|
|||
|
||||
public static final String SELECT_MODE = "select";
|
||||
|
||||
private static final String PLUGINNAME_COLUMN = "pluginName";
|
||||
|
||||
private static final String DATAURI_COLUMN = "dataURI";
|
||||
|
||||
public static final String ROW_NAME = "rowname";
|
||||
|
||||
public static final String CLASS_NAME = "classname";
|
||||
|
||||
public static final String DATABASE_NAME = "databasename";
|
||||
|
||||
public static final String PLUGIN_NAME = PLUGINNAME_COLUMN;
|
||||
|
||||
/**
|
||||
* Private constructor
|
||||
*/
|
||||
|
@ -84,28 +76,6 @@ public class Loader {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a list of objects from a LayerProperty
|
||||
*
|
||||
* @param property
|
||||
* the layerproperty
|
||||
* @param mode
|
||||
* the mode (e.g. "select")
|
||||
* @param timeOut
|
||||
* the timeout in milliseconds
|
||||
* @return the list of objects
|
||||
* @throws VizException
|
||||
*/
|
||||
public static List<Object> loadData(LayerProperty property, String mode,
|
||||
int timeOut) throws VizException {
|
||||
Validate.notNull(property, "LayerProperty can not be null");
|
||||
Validate.notNull(property, "Mode must not be null");
|
||||
|
||||
String script = ScriptCreator.createScript(property, mode);
|
||||
List<Object> responses = loadScripts(new String[] { script }, timeOut);
|
||||
return responses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an array of scripts and returns a list of responses returned from
|
||||
* the scripts
|
||||
|
@ -143,33 +113,23 @@ public class Loader {
|
|||
}
|
||||
|
||||
/**
|
||||
* Load a plugin data object from a request map
|
||||
* Load a plugin data object from a data uri
|
||||
*
|
||||
* @param obj
|
||||
* the request map
|
||||
* @return the fully filled out plugindataobject
|
||||
* @throws VizException
|
||||
*/
|
||||
public static PluginDataObject loadData(Map<String, Object> obj)
|
||||
throws VizException {
|
||||
public static PluginDataObject loadData(String dataURI) throws VizException {
|
||||
Map<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
|
||||
if (!obj.containsKey(DATAURI_COLUMN)
|
||||
|| !obj.containsKey(PLUGINNAME_COLUMN)) {
|
||||
throw new IllegalArgumentException(
|
||||
"Map must contain a datauri and plugin name");
|
||||
}
|
||||
|
||||
try {
|
||||
vals.putAll(RequestConstraint.toConstraintMapping(DataURIUtil
|
||||
.createDataURIMap(obj.get(DATAURI_COLUMN).toString())));
|
||||
.createDataURIMap(dataURI)));
|
||||
} catch (PluginException e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
|
||||
vals.put(PLUGINNAME_COLUMN,
|
||||
new RequestConstraint(obj.get(PLUGINNAME_COLUMN).toString()));
|
||||
|
||||
DbQueryRequest request = new DbQueryRequest(vals);
|
||||
request.setLimit(1);
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
|
||||
package com.raytheon.uf.viz.datadelivery.comm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
*
|
||||
* An interface to the registry.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 11/20/12 #218 dhladky Initial creation
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
public class RegistryQuery {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(RegistryQuery.class);
|
||||
|
||||
/**
|
||||
* Sets a query to return only distinct values from the index.
|
||||
*/
|
||||
public static final int DISTINCTVALUES = 0;
|
||||
|
||||
/**
|
||||
* Sets a query to return all values from the index.
|
||||
*/
|
||||
public static final int ALLVALUES = 1;
|
||||
|
||||
private static final int REQUESTTIMEOUT = 60000;
|
||||
|
||||
public static enum Mode {
|
||||
DISTINCT, MAX
|
||||
};
|
||||
|
||||
/**
|
||||
* Find data entries in the Data Delivery Registry
|
||||
*
|
||||
* @param fieldName
|
||||
* The fieldname to search for
|
||||
* @param queryTerms
|
||||
* A hashmap containing the parameter name/value to search for
|
||||
* @return A string array containing the found values or null if nothing is
|
||||
* found
|
||||
* @throws VizException
|
||||
*/
|
||||
public static Object[] performQuery(
|
||||
Map<String, RequestConstraint> queryTerms) throws VizException {
|
||||
String query = assembleQuery(queryTerms, Mode.DISTINCT);
|
||||
System.out.println("Query: " + query);
|
||||
DatadeliveryConnector connection = DatadeliveryConnector.getInstance();
|
||||
|
||||
Object[] registryObjects = connection.connect(query, null,
|
||||
REQUESTTIMEOUT);
|
||||
|
||||
// TODO: Figure out what magic is required for specific queries.
|
||||
// Eventually I'd like to make this several methods
|
||||
|
||||
return registryObjects;
|
||||
}
|
||||
|
||||
private static String assembleQuery(
|
||||
Map<String, RequestConstraint> queryTerms, Mode mode)
|
||||
throws VizException {
|
||||
HashMap<String, RequestConstraint> map = new HashMap<String, RequestConstraint>(
|
||||
queryTerms);
|
||||
if (mode == Mode.DISTINCT) {
|
||||
map.put("searchField1", new RequestConstraint());
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported mode: " + mode);
|
||||
}
|
||||
|
||||
return ScriptCreator.createScript(map, 1, "catalog");
|
||||
}
|
||||
|
||||
}
|
|
@ -45,7 +45,6 @@ import com.raytheon.uf.viz.monitor.fog.FogMonitor;
|
|||
import com.raytheon.uf.viz.monitor.fog.threshold.FogAlgorithmMgr;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay;
|
||||
|
||||
|
||||
/**
|
||||
* FogResourceData
|
||||
*
|
||||
|
@ -70,40 +69,43 @@ import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay;
|
|||
public class FogResourceData extends AbstractRequestableResourceData {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(FogResourceData.class);
|
||||
|
||||
public FogRecord[] records;
|
||||
|
||||
|
||||
public Map<Date, FogRecord> dataObjectMap;
|
||||
|
||||
|
||||
public Map<Date, GriddedImageDisplay> gridImageMap;
|
||||
|
||||
|
||||
protected FogMonitor monitor;
|
||||
|
||||
|
||||
protected FogAlgorithmMgr fogAlgMgr;
|
||||
|
||||
|
||||
protected FogThreat fogThreat;
|
||||
|
||||
|
||||
@Override
|
||||
protected AbstractVizResource<?, ?> constructResource(
|
||||
LoadProperties loadProperties, PluginDataObject[] objects) {
|
||||
|
||||
|
||||
records = new FogRecord[objects.length];
|
||||
dataObjectMap = new HashMap<Date, FogRecord>();
|
||||
gridImageMap = new HashMap<Date, GriddedImageDisplay>();
|
||||
|
||||
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
records[i] = (FogRecord) objects[i];
|
||||
try {
|
||||
records[i] = populateRecord(records[i]);
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||
e);
|
||||
}
|
||||
if ( dataObjectMap.containsKey(records[i].getRefHour().getTime()) ) {
|
||||
if ( dataObjectMap.get(records[i].getRefHour().getTime()).getDataTime().greaterThan(records[i].getDataTime()) ) {
|
||||
continue;
|
||||
} else {
|
||||
dataObjectMap.remove(records[i].getRefHour().getTime());
|
||||
gridImageMap.remove(records[i].getRefHour().getTime());
|
||||
}
|
||||
if (dataObjectMap.containsKey(records[i].getRefHour().getTime())) {
|
||||
if (dataObjectMap.get(records[i].getRefHour().getTime())
|
||||
.getDataTime().greaterThan(records[i].getDataTime())) {
|
||||
continue;
|
||||
} else {
|
||||
dataObjectMap.remove(records[i].getRefHour().getTime());
|
||||
gridImageMap.remove(records[i].getRefHour().getTime());
|
||||
}
|
||||
}
|
||||
dataObjectMap.put(records[i].getRefHour().getTime(), records[i]);
|
||||
gridImageMap.put(records[i].getRefHour().getTime(), null);
|
||||
|
@ -111,7 +113,7 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
|
||||
FogResource fogRes = new FogResource(this, loadProperties);
|
||||
getFogMonitor().addFogResourceListener(fogRes);
|
||||
|
||||
|
||||
return fogRes;
|
||||
}
|
||||
|
||||
|
@ -121,7 +123,7 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
public FogRecord[] getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param records
|
||||
* the records to set
|
||||
|
@ -129,19 +131,18 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
public void setRecords(FogRecord[] records) {
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* populate Fog Record
|
||||
*
|
||||
* @param record
|
||||
*/
|
||||
public FogRecord populateRecord(FogRecord record)
|
||||
throws VizException {
|
||||
public FogRecord populateRecord(FogRecord record) throws VizException {
|
||||
IDataStore dataStore = getDataStore(record);
|
||||
record.retrieveFromDataStore(dataStore);
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the data store
|
||||
*
|
||||
|
@ -149,35 +150,21 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
* @return
|
||||
*/
|
||||
private IDataStore getDataStore(FogRecord record) {
|
||||
IDataStore dataStore = null;
|
||||
try {
|
||||
Map<String, Object> vals = new HashMap<String, Object>();
|
||||
vals.put("dataURI", record.getDataURI());
|
||||
vals.put("pluginName", record.getPluginName());
|
||||
|
||||
record = (FogRecord) Loader.loadData(vals);
|
||||
|
||||
File loc = HDF5Util.findHDF5Location(record);
|
||||
dataStore = DataStoreFactory.getDataStore(loc);
|
||||
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return dataStore;
|
||||
return DataStoreFactory.getDataStore(HDF5Util.findHDF5Location(record));
|
||||
}
|
||||
|
||||
|
||||
/** Get the Fog Algorithm manager **/
|
||||
protected FogAlgorithmMgr getAlgorithmManager() {
|
||||
|
||||
|
||||
if (fogAlgMgr == null) {
|
||||
fogAlgMgr = FogAlgorithmMgr.getInstance();
|
||||
}
|
||||
return fogAlgMgr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the fog Threat generator
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected FogThreat getFogThreat() {
|
||||
|
@ -186,7 +173,7 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
}
|
||||
return fogThreat;
|
||||
}
|
||||
|
||||
|
||||
/** Get the Fog monitor **/
|
||||
protected FogMonitor getFogMonitor() {
|
||||
if (monitor == null) {
|
||||
|
@ -194,12 +181,11 @@ public class FogResourceData extends AbstractRequestableResourceData {
|
|||
}
|
||||
return monitor;
|
||||
}
|
||||
|
||||
|
||||
public void resetGridImgMap() {
|
||||
for(Date key: dataObjectMap.keySet()){
|
||||
for (Date key : dataObjectMap.keySet()) {
|
||||
gridImageMap.put(key, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
package com.raytheon.uf.viz.monitor.safeseas.resources;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -36,7 +35,6 @@ 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.core.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
@ -55,8 +53,8 @@ import com.raytheon.uf.viz.monitor.safeseas.SafeSeasMonitor;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* July 21, 2010 4891 skorolev Initial Creation.
|
||||
*
|
||||
* Jul 21, 2010 4891 skorolev Initial Creation.
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
* </pre>
|
||||
*
|
||||
* @author skorolev
|
||||
|
@ -71,21 +69,20 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SafeSeasResourceData.class);
|
||||
|
||||
@XmlAttribute
|
||||
protected String plotSource = "SAFESEAS Table";
|
||||
@XmlAttribute
|
||||
protected String plotSource = "SAFESEAS Table";
|
||||
|
||||
public FogRecord[] records;
|
||||
public FogRecord[] records;
|
||||
|
||||
public Map<Date, FogRecord> dataObjectMap;
|
||||
|
||||
protected SafeSeasMonitor monitor;
|
||||
protected SafeSeasMonitor monitor;
|
||||
|
||||
public HashMap<Date, Boolean> plotted;
|
||||
|
||||
protected FogAlgorithmMgr fogAlgMgr;
|
||||
|
||||
protected SSFogThreat fogThreatSS;
|
||||
protected FogAlgorithmMgr fogAlgMgr;
|
||||
|
||||
protected SSFogThreat fogThreatSS;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -96,15 +93,15 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
* com.raytheon.uf.viz.core.drawables.IDescriptor)
|
||||
*/
|
||||
@Override
|
||||
protected AbstractVizResource<?, ?> constructResource(
|
||||
LoadProperties loadProperties, PluginDataObject[] objects) {
|
||||
protected AbstractVizResource<?, ?> constructResource(
|
||||
LoadProperties loadProperties, PluginDataObject[] objects) {
|
||||
|
||||
records = new FogRecord[objects.length];
|
||||
records = new FogRecord[objects.length];
|
||||
dataObjectMap = new HashMap<Date, FogRecord>();
|
||||
plotted = new HashMap<Date, Boolean>();
|
||||
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
records[i] = (FogRecord) objects[i];
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
records[i] = (FogRecord) objects[i];
|
||||
try {
|
||||
records[i] = populateRecord(records[i]);
|
||||
} catch (VizException e) {
|
||||
|
@ -115,12 +112,11 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
}
|
||||
dataObjectMap.put(records[i].getRefHour().getTime(), records[i]);
|
||||
plotted.put(records[i].getRefHour().getTime(), new Boolean(false));
|
||||
}
|
||||
}
|
||||
|
||||
SafeSeasResource ssRes = new SafeSeasResource(this,
|
||||
loadProperties);
|
||||
getSafeSeasMonitor().addSSResourceListener(ssRes);
|
||||
return ssRes;
|
||||
SafeSeasResource ssRes = new SafeSeasResource(this, loadProperties);
|
||||
getSafeSeasMonitor().addSSResourceListener(ssRes);
|
||||
return ssRes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,7 +129,6 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
return monitor;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -147,87 +142,72 @@ public class SafeSeasResourceData extends AbstractRequestableResourceData {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the records
|
||||
*/
|
||||
public FogRecord[] getRecords() {
|
||||
return records;
|
||||
}
|
||||
/**
|
||||
* @return the records
|
||||
*/
|
||||
public FogRecord[] getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param records
|
||||
* the records to set
|
||||
*/
|
||||
public void setRecords(FogRecord[] records) {
|
||||
this.records = records;
|
||||
}
|
||||
/**
|
||||
* @param records
|
||||
* the records to set
|
||||
*/
|
||||
public void setRecords(FogRecord[] records) {
|
||||
this.records = records;
|
||||
}
|
||||
|
||||
/**
|
||||
* populate Fog Record
|
||||
*
|
||||
* @param record
|
||||
*/
|
||||
public FogRecord populateRecord(FogRecord record) throws VizException {
|
||||
IDataStore dataStore = getDataStore(record);
|
||||
record.retrieveFromDataStore(dataStore);
|
||||
return record;
|
||||
}
|
||||
/**
|
||||
* populate Fog Record
|
||||
*
|
||||
* @param record
|
||||
*/
|
||||
public FogRecord populateRecord(FogRecord record) throws VizException {
|
||||
IDataStore dataStore = getDataStore(record);
|
||||
record.retrieveFromDataStore(dataStore);
|
||||
return record;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data store
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
private IDataStore getDataStore(FogRecord record) {
|
||||
IDataStore dataStore = null;
|
||||
try {
|
||||
Map<String, Object> vals = new HashMap<String, Object>();
|
||||
vals.put("dataURI", record.getDataURI());
|
||||
vals.put("pluginName", record.getPluginName());
|
||||
/**
|
||||
* Get the data store
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
private IDataStore getDataStore(FogRecord record) {
|
||||
return DataStoreFactory.getDataStore(HDF5Util.findHDF5Location(record));
|
||||
}
|
||||
|
||||
record = (FogRecord) Loader.loadData(vals);
|
||||
/** Get the Fog Algorithm manager **/
|
||||
protected FogAlgorithmMgr getAlgorithmManager() {
|
||||
|
||||
File loc = HDF5Util.findHDF5Location(record);
|
||||
dataStore = DataStoreFactory.getDataStore(loc);
|
||||
if (fogAlgMgr == null) {
|
||||
fogAlgMgr = FogAlgorithmMgr.getInstance();
|
||||
}
|
||||
return fogAlgMgr;
|
||||
}
|
||||
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* Gets the fog Threat generator
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected SSFogThreat getSSFogThreat() {
|
||||
if (fogThreatSS == null) {
|
||||
fogThreatSS = new SSFogThreat(getAlgorithmManager()
|
||||
.getAlgorithmXML());
|
||||
}
|
||||
return fogThreatSS;
|
||||
}
|
||||
|
||||
return dataStore;
|
||||
}
|
||||
/** Get the SafeSeasMonitor monitor **/
|
||||
protected SafeSeasMonitor getFogMonitor() {
|
||||
if (monitor == null) {
|
||||
monitor = SafeSeasMonitor.getInstance();
|
||||
}
|
||||
return monitor;
|
||||
}
|
||||
|
||||
/** Get the Fog Algorithm manager **/
|
||||
protected FogAlgorithmMgr getAlgorithmManager() {
|
||||
|
||||
if (fogAlgMgr == null) {
|
||||
fogAlgMgr = FogAlgorithmMgr.getInstance();
|
||||
}
|
||||
return fogAlgMgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the fog Threat generator
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected SSFogThreat getSSFogThreat() {
|
||||
if (fogThreatSS == null) {
|
||||
fogThreatSS = new SSFogThreat(getAlgorithmManager()
|
||||
.getAlgorithmXML());
|
||||
}
|
||||
return fogThreatSS;
|
||||
}
|
||||
|
||||
/** Get the SafeSeasMonitor monitor **/
|
||||
protected SafeSeasMonitor getFogMonitor() {
|
||||
if (monitor == null) {
|
||||
monitor = SafeSeasMonitor.getInstance();
|
||||
}
|
||||
return monitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return plotSource
|
||||
*/
|
||||
|
|
|
@ -48,7 +48,11 @@ import com.raytheon.uf.common.dataplugin.scan.data.DMDTableDataRow;
|
|||
import com.raytheon.uf.common.dataplugin.scan.data.ScanTableData;
|
||||
import com.raytheon.uf.common.dataplugin.scan.data.ScanTableDataRow;
|
||||
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
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.geospatial.ISpatialQuery;
|
||||
|
@ -71,12 +75,9 @@ import com.raytheon.uf.viz.core.HDF5Util;
|
|||
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.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Connector;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
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;
|
||||
|
@ -93,6 +94,7 @@ import com.raytheon.uf.viz.monitor.scan.tables.SCANDmdTableDlg;
|
|||
import com.raytheon.uf.viz.monitor.scan.tables.SCANMesoTableDlg;
|
||||
import com.raytheon.uf.viz.monitor.scan.tables.SCANTableData;
|
||||
import com.raytheon.uf.viz.monitor.scan.tables.SCANTvsTableDlg;
|
||||
import com.raytheon.viz.core.mode.CAVEMode;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
|
@ -115,6 +117,7 @@ import com.vividsolutions.jts.io.WKBReader;
|
|||
* Jul 24, 2013 2218 mpduff Improved error handling, optimizations
|
||||
* Jul 30, 2013 2143 skorolev Changes for non-blocking dialogs.
|
||||
* Aug 15, 2013 2143 mpduff Fixed bug in nullifyMonitor()
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -478,11 +481,8 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
|
|||
double tilt) throws VizException {
|
||||
String uri = getAvailableUri(tilt, date, type, icao);
|
||||
ScanRecord scanRec = null;
|
||||
Map<String, Object> vals = new HashMap<String, Object>();
|
||||
vals.put("pluginName", "scan");
|
||||
vals.put("dataURI", uri);
|
||||
if (uri != null) {
|
||||
scanRec = (ScanRecord) Loader.loadData(vals);
|
||||
scanRec = (ScanRecord) Loader.loadData(uri);
|
||||
File loc = HDF5Util.findHDF5Location(scanRec);
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
|
||||
if (scanRec != null) {
|
||||
|
@ -694,7 +694,7 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
|
|||
try {
|
||||
ScanRecord rec = getScanRecord(type, icao, date, tilt);
|
||||
if (rec != null) {
|
||||
data = getScanRecord(type, icao, date, tilt).getTableData();
|
||||
data = rec.getTableData();
|
||||
}
|
||||
} catch (VizException ve) {
|
||||
statusHandler.warn("Couldn't load new ScanRecord: " + type.name());
|
||||
|
@ -1548,47 +1548,42 @@ public class ScanMonitor extends ResourceMonitor implements IScanDialogListener
|
|||
public Map<String, UnwarnedCell> retrieveWarnings(String icao, Date time,
|
||||
boolean severe, boolean tvs) {
|
||||
|
||||
Object[] resp;
|
||||
List<String> removeList = new ArrayList<String>();
|
||||
HashMap<String, UnwarnedCell> cells = new HashMap<String, UnwarnedCell>();
|
||||
List<AbstractWarningRecord> tvswarnings = new ArrayList<AbstractWarningRecord>();
|
||||
List<AbstractWarningRecord> severewarnings = new ArrayList<AbstractWarningRecord>();
|
||||
HashMap<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
LayerProperty lp = new LayerProperty();
|
||||
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
// TODO: There should be a smarter way to cap data requested using time
|
||||
// passed in possibly. Should investigate into it
|
||||
request.setLimit(NUMBER_OF_IMAGES);
|
||||
request.setEntityClass(CAVEMode.getMode() == CAVEMode.PRACTICE ? PracticeWarningRecord.class
|
||||
: WarningRecord.class);
|
||||
if (icao != null) {
|
||||
request.addConstraint("officeid",
|
||||
new RequestConstraint(icao.toUpperCase()));
|
||||
}
|
||||
|
||||
GeometryFactory factory = new GeometryFactory();
|
||||
|
||||
try {
|
||||
ScanTableData<?> cellTable = getTableData(ScanTables.CELL, icao,
|
||||
time);
|
||||
|
||||
vals.put("pluginName", new RequestConstraint("warning"));
|
||||
if (icao != null) {
|
||||
vals.put("officeid", new RequestConstraint(icao.toUpperCase()));
|
||||
}
|
||||
lp.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
lp.setEntryQueryParameters(vals, false);
|
||||
|
||||
lp.setNumberOfImages(NUMBER_OF_IMAGES);
|
||||
|
||||
String script = ScriptCreator.createScript(lp);
|
||||
if (script != null) {
|
||||
resp = Connector.getInstance().connect(script, null, 60000);
|
||||
|
||||
for (int i = 0; i < resp.length; i++) {
|
||||
|
||||
AbstractWarningRecord rec = (AbstractWarningRecord) resp[i];
|
||||
|
||||
if (rec.getPhensig() != null) {
|
||||
if (tvs
|
||||
&& rec.getPhensig().equals(
|
||||
ScanUtils.TORNADO_WARNING_PHENSIG)) {
|
||||
tvswarnings.add(rec);
|
||||
}
|
||||
if (severe
|
||||
&& rec.getPhensig().equals(
|
||||
ScanUtils.SEVERE_THUNDERSTORM_PHENSIG)) {
|
||||
severewarnings.add(rec);
|
||||
}
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
for (AbstractWarningRecord rec : response
|
||||
.getEntityObjects(AbstractWarningRecord.class)) {
|
||||
if (rec.getPhensig() != null) {
|
||||
if (tvs
|
||||
&& rec.getPhensig().equals(
|
||||
ScanUtils.TORNADO_WARNING_PHENSIG)) {
|
||||
tvswarnings.add(rec);
|
||||
}
|
||||
if (severe
|
||||
&& rec.getPhensig().equals(
|
||||
ScanUtils.SEVERE_THUNDERSTORM_PHENSIG)) {
|
||||
severewarnings.add(rec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,22 +22,23 @@ package com.raytheon.uf.viz.monitor;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
||||
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
|
||||
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecordTransform;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Connector;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceType;
|
||||
import com.raytheon.uf.viz.monitor.data.ObReport;
|
||||
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
|
||||
import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
|
||||
|
@ -52,6 +53,7 @@ import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 25, 2010 4759 dhladky Initial creation.
|
||||
* Mar 15, 2012 14510 zhao modified processProductAtStartup()
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -66,17 +68,17 @@ public abstract class ObsMonitor extends Monitor {
|
|||
|
||||
@Override
|
||||
protected abstract void nullifyMonitor();
|
||||
|
||||
|
||||
/**
|
||||
* these are the over-arching "First line" checked patterns by plugin, first
|
||||
* letter of icao
|
||||
**/
|
||||
protected ArrayList<Pattern> pluginPatterns = new ArrayList<Pattern>();
|
||||
|
||||
|
||||
/** these are the patterns for the stations **/
|
||||
protected ArrayList<Pattern> stationPatterns = new ArrayList<Pattern>();
|
||||
|
||||
/** Current CWA **/
|
||||
/** Current CWA **/
|
||||
public static String cwa = LocalizationManager.getInstance().getSite();
|
||||
|
||||
/**
|
||||
|
@ -86,7 +88,7 @@ public abstract class ObsMonitor extends Monitor {
|
|||
*/
|
||||
protected abstract void process(ObReport result)
|
||||
throws Exception;
|
||||
|
||||
|
||||
protected abstract void processAtStartup(ObReport report);
|
||||
|
||||
@Override
|
||||
|
@ -100,7 +102,7 @@ public abstract class ObsMonitor extends Monitor {
|
|||
|
||||
@Override
|
||||
public abstract void configUpdate(IMonitorConfigurationEvent me);
|
||||
|
||||
|
||||
/**
|
||||
* use this to do the initial filtering
|
||||
*/
|
||||
|
@ -120,7 +122,7 @@ public abstract class ObsMonitor extends Monitor {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process the incoming dataURI
|
||||
*
|
||||
|
@ -128,151 +130,103 @@ public abstract class ObsMonitor extends Monitor {
|
|||
* @param filtered
|
||||
*/
|
||||
public void processURI(String dataURI, AlertMessage filtered) {
|
||||
|
||||
// Map<String, Object> attribs = filtered.decodedAlert;
|
||||
HashMap<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
LayerProperty lp = new LayerProperty();
|
||||
try {
|
||||
// vals.put("cwa", new RequestConstraint(cwa));
|
||||
vals.put("dataURI", new RequestConstraint(dataURI));
|
||||
vals.put("pluginName", new RequestConstraint("fssobs"));
|
||||
// vals.put("monitorUse",
|
||||
// new RequestConstraint(attribs.get("monitorUse").toString()));
|
||||
|
||||
lp.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
lp.setEntryQueryParameters(vals);
|
||||
|
||||
String script = null;
|
||||
try {
|
||||
script = ScriptCreator.createScript(lp);
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.out.println("Unsupported plugin name: " + pluginName
|
||||
+ " encountered");
|
||||
}
|
||||
if (script != null) {
|
||||
Object[] resp = Connector.getInstance().connect(script, null,
|
||||
60000);
|
||||
if ((resp != null) && (resp.length > 0)) {
|
||||
final PluginDataObject objectToSend = (PluginDataObject) resp[0];
|
||||
try {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
// ObReport obReport = new ObReport();
|
||||
// obReport.init();
|
||||
if (objectToSend instanceof FSSObsRecord
|
||||
&& ((FSSObsRecord) objectToSend)
|
||||
.getTimeObs() != null) {
|
||||
ObReport result = GenerateFSSObReport.generateObReport(objectToSend);
|
||||
System.out
|
||||
.println("New FSSrecord ===> "
|
||||
+ objectToSend
|
||||
.getDataURI());
|
||||
process(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<String, RequestConstraint> constraints = RequestConstraint
|
||||
.toConstraintMapping(DataURIUtil.createDataURIMap(dataURI));
|
||||
FSSObsRecord[] pdos = requestFSSObs(constraints, null);
|
||||
if (pdos.length > 0 && pdos[0].getTimeObs() != null) {
|
||||
final FSSObsRecord objectToSend = pdos[0];
|
||||
try {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
ObReport result = GenerateFSSObReport
|
||||
.generateObReport(objectToSend);
|
||||
System.out.println("New FSSrecord ===> "
|
||||
+ objectToSend.getDataURI());
|
||||
process(result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else if (resp == null) {
|
||||
|
||||
} else if (resp.length == 0) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (final VizException e) {
|
||||
} catch (final Exception e) {
|
||||
System.err.println("ObsMonitor: URI: " + dataURI
|
||||
+ " failed to process. "+e.getMessage());
|
||||
+ " failed to process. " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process products at startup
|
||||
*
|
||||
* @param monitorUse
|
||||
*
|
||||
*/
|
||||
public void processProductAtStartup(String monitorUse) {
|
||||
/**
|
||||
* Process products at startup
|
||||
*
|
||||
* @param monitorUse
|
||||
*
|
||||
*/
|
||||
public void processProductAtStartup(String monitorUse) {
|
||||
|
||||
/**
|
||||
* Assume this number for MaxNumObsTimes is larger enough to cover data
|
||||
* of all observations (at least 24 hours' worth of data) in database
|
||||
* [changed from 10 to 240 on May, 18, 2010 for DR #6015, zhao]
|
||||
*/
|
||||
int MaxNumObsTimes = 240;
|
||||
HashMap<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
LayerProperty lp = new LayerProperty();
|
||||
try {
|
||||
vals.put("cwa", new RequestConstraint(cwa));
|
||||
vals.put("pluginName", new RequestConstraint("fssobs"));
|
||||
vals.put("monitorUse", new RequestConstraint(monitorUse));
|
||||
/**
|
||||
* Assume this number for MaxNumObsTimes is larger enough to cover data
|
||||
* of all observations (at least 24 hours' worth of data) in database
|
||||
* [changed from 10 to 240 on May, 18, 2010 for DR #6015, zhao]
|
||||
*/
|
||||
int MaxNumObsTimes = 240;
|
||||
Map<String, RequestConstraint> vals = new HashMap<String, RequestConstraint>();
|
||||
try {
|
||||
vals.put("cwa", new RequestConstraint(cwa));
|
||||
vals.put(FSSObsRecord.PLUGIN_NAME_ID, new RequestConstraint(
|
||||
FSSObsRecord.PLUGIN_NAME));
|
||||
vals.put("monitorUse", new RequestConstraint(monitorUse));
|
||||
|
||||
lp.setDesiredProduct(ResourceType.PLAN_VIEW);
|
||||
lp.setEntryQueryParameters(vals);
|
||||
DataTime[] dataTimesAvailable = DataCubeContainer.performTimeQuery(
|
||||
vals, false);
|
||||
DataTime[] selectedTimes = dataTimesAvailable;
|
||||
|
||||
// Ensure that the latest product is retrieved.
|
||||
// [Modified: retrieve at most MaxNumObsTimes data
|
||||
// points, Feb
|
||||
// 19, 2010, zhao]
|
||||
DataTime[] dataTimesAvailable = lp.getEntryTimes();
|
||||
Arrays.sort(dataTimesAvailable);
|
||||
if (dataTimesAvailable.length != 0) {
|
||||
// at most, MaxNumObsTimes observation times are
|
||||
// considered
|
||||
if (dataTimesAvailable.length > MaxNumObsTimes) {
|
||||
DataTime[] obsDataTime = new DataTime[MaxNumObsTimes];
|
||||
System.arraycopy(dataTimesAvailable,
|
||||
dataTimesAvailable.length - MaxNumObsTimes,
|
||||
obsDataTime, 0, MaxNumObsTimes);
|
||||
lp.setSelectedEntryTimes(obsDataTime);
|
||||
} else {
|
||||
lp.setSelectedEntryTimes(dataTimesAvailable);
|
||||
}
|
||||
}
|
||||
String script = null;
|
||||
try {
|
||||
script = ScriptCreator.createScript(lp);
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.out.println("Unsupported plugin name encountered");
|
||||
}
|
||||
if (script != null) {
|
||||
final Object[] resp = Connector.getInstance().connect(script,
|
||||
null,
|
||||
60000);
|
||||
System.out.println("ObsMonitor: Retriving data for monitor: " + monitorUse);
|
||||
if ((resp != null) && (resp.length > 0)) {
|
||||
// Ensure that the latest product is retrieved.
|
||||
// [Modified: retrieve at most MaxNumObsTimes data
|
||||
// points, Feb
|
||||
// 19, 2010, zhao]
|
||||
if (dataTimesAvailable.length > 0) {
|
||||
Arrays.sort(dataTimesAvailable);
|
||||
// at most, MaxNumObsTimes observation times are
|
||||
// considered
|
||||
if (dataTimesAvailable.length > MaxNumObsTimes) {
|
||||
selectedTimes = new DataTime[MaxNumObsTimes];
|
||||
System.arraycopy(dataTimesAvailable,
|
||||
dataTimesAvailable.length - MaxNumObsTimes,
|
||||
selectedTimes, 0, MaxNumObsTimes);
|
||||
}
|
||||
|
||||
//Display.getDefault().syncExec(new Runnable() {
|
||||
//public void run() {
|
||||
for (int j = 0; j < resp.length; j++) {
|
||||
PluginDataObject objectToSend = (PluginDataObject) resp[j];
|
||||
ObReport result = GenerateFSSObReport.generateObReport(objectToSend);
|
||||
processAtStartup(result);
|
||||
}
|
||||
//}
|
||||
FSSObsRecord[] obsRecords = requestFSSObs(vals, selectedTimes);
|
||||
for (PluginDataObject objectToSend : obsRecords) {
|
||||
ObReport result = GenerateFSSObReport
|
||||
.generateObReport(objectToSend);
|
||||
processAtStartup(result);
|
||||
}
|
||||
}
|
||||
} catch (final VizException e) {
|
||||
System.err
|
||||
.println("No data in database at startup. " + monitorUse);
|
||||
}
|
||||
}
|
||||
|
||||
//});
|
||||
|
||||
} else if (resp == null) {
|
||||
System.out
|
||||
.println("Null Response From Script Created For: "
|
||||
+ monitorUse);
|
||||
} else if (resp.length == 0) {
|
||||
System.out
|
||||
.println("Zero Length Response From Script Created For: "
|
||||
+ monitorUse);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Null script return For: " + monitorUse);
|
||||
}
|
||||
} catch (final VizException e) {
|
||||
System.err
|
||||
.println("No data in database at startup. " + monitorUse);
|
||||
}
|
||||
}
|
||||
private FSSObsRecord[] requestFSSObs(
|
||||
Map<String, RequestConstraint> constraints, DataTime[] times)
|
||||
throws VizException {
|
||||
if (times != null) {
|
||||
String[] timeStrs = new String[times.length];
|
||||
for (int i = 0; i < times.length; ++i) {
|
||||
timeStrs[i] = times[i].toString();
|
||||
}
|
||||
constraints.put(PluginDataObject.DATATIME_ID,
|
||||
new RequestConstraint(timeStrs));
|
||||
}
|
||||
PointDataContainer pdc = DataCubeContainer.getPointData(
|
||||
FSSObsRecord.PLUGIN_NAME, FSSObsRecordTransform.FSSOBS_PARAMS,
|
||||
constraints);
|
||||
return FSSObsRecordTransform.toFSSObsRecords(pdc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,4 +2,5 @@ source.. = src/
|
|||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
localization/
|
||||
localization/,\
|
||||
plugin.xml
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.vil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -33,7 +32,6 @@ import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
|||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
@ -114,21 +112,6 @@ public class VILResourceData extends AbstractRequestableResourceData {
|
|||
* @return
|
||||
*/
|
||||
private IDataStore getDataStore(VILRecord record) {
|
||||
IDataStore dataStore = null;
|
||||
try {
|
||||
Map<String, Object> vals = new HashMap<String, Object>();
|
||||
vals.put("dataURI", record.getDataURI());
|
||||
vals.put("pluginName", record.getPluginName());
|
||||
|
||||
record = (VILRecord) Loader.loadData(vals);
|
||||
|
||||
File loc = HDF5Util.findHDF5Location(record);
|
||||
dataStore = DataStoreFactory.getDataStore(loc);
|
||||
|
||||
} catch (VizException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return dataStore;
|
||||
return DataStoreFactory.getDataStore(HDF5Util.findHDF5Location(record));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,19 +19,10 @@
|
|||
**/
|
||||
package com.raytheon.viz.aviation.guidance;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.point.GFEPointDataContainers;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.request.GetPointDataRequest;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
|
||||
import com.raytheon.uf.common.dataplugin.obs.metar.MetarRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
|
@ -45,6 +36,7 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 29, 2009 njensen Initial creation
|
||||
* Mar 11, 2013 1735 rferrel Get a list of GFE Point Data Containers
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -54,37 +46,6 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
|
|||
|
||||
public class GuidanceUtil {
|
||||
|
||||
/**
|
||||
* Temporary workaround for metars, should be removed ASAP
|
||||
*
|
||||
* @param siteID
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
// TODO Remove this method no longer used in java, python of xml
|
||||
// configuration.
|
||||
public static MetarRecord getLatestMetar(String siteID) {
|
||||
try {
|
||||
Map<String, RequestConstraint> map = new HashMap<String, RequestConstraint>();
|
||||
map.put("pluginName", new RequestConstraint("obs"));
|
||||
map.put("location.stationId", new RequestConstraint(siteID));
|
||||
LayerProperty lp = new LayerProperty();
|
||||
lp.setEntryQueryParameters(map);
|
||||
DataTime[] dt = lp.getEntryTimes();
|
||||
if (dt.length == 0) {
|
||||
return null;
|
||||
}
|
||||
lp.setSelectedEntryTimes(new DataTime[] { dt[dt.length - 1] });
|
||||
List<Object> objs = Loader.loadData(lp, "select", 10000);
|
||||
MetarRecord metar = (MetarRecord) objs.get(0);
|
||||
return metar;
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of GFE Point Data information for the task request.
|
||||
*
|
||||
|
|
|
@ -20,14 +20,9 @@
|
|||
package com.raytheon.viz.aviation.monitor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.aviation.observer.TafMonitorDlg;
|
||||
|
@ -42,6 +37,7 @@ import com.raytheon.viz.aviation.observer.TafMonitorDlg;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 10, 2009 njensen Initial creation
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -77,21 +73,12 @@ public class LtgMonitorObserver extends MonitorObserver {
|
|||
|
||||
private static BinLightningRecord getRecord(String dataUri) {
|
||||
BinLightningRecord rec = null;
|
||||
Map<String, RequestConstraint> map = new HashMap<String, RequestConstraint>();
|
||||
map.put("pluginName", new RequestConstraint("binlightning"));
|
||||
map.put("dataURI", new RequestConstraint(dataUri));
|
||||
LayerProperty lp = new LayerProperty();
|
||||
try {
|
||||
lp.setEntryQueryParameters(map);
|
||||
List<Object> objs = Loader.loadData(lp, "select", 10000);
|
||||
if (objs.size() > 0) {
|
||||
rec = (BinLightningRecord) objs.get(0);
|
||||
}
|
||||
rec = (BinLightningRecord) Loader.loadData(dataUri);
|
||||
} catch (VizException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,22 +19,22 @@
|
|||
**/
|
||||
package com.raytheon.viz.aviation.monitor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.raytheon.edex.plugin.taf.common.TafRecord;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
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.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Jul 6, 2010 5792 rferrel getLatestTafs now returns tafs
|
||||
* sorted by issue date newest at
|
||||
* the start of the array.
|
||||
* 08AUG2012 15613 zhao Modified safeFormatTaf()
|
||||
* 08AUG2012 15613 zhao Modified safeFormatTaf()
|
||||
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -92,15 +93,11 @@ public class TafUtil {
|
|||
public static TafRecord[] getLatestTafs(String siteID, int numberOfTafs) {
|
||||
try {
|
||||
Map<String, RequestConstraint> map = new HashMap<String, RequestConstraint>();
|
||||
map.put("pluginName", new RequestConstraint("taf"));
|
||||
map.put(TafRecord.PLUGIN_NAME_ID, new RequestConstraint(
|
||||
TafRecord.PLUGIN_NAME));
|
||||
map.put("stationId", new RequestConstraint(siteID));
|
||||
LayerProperty lp = new LayerProperty();
|
||||
lp.setEntryQueryParameters(map);
|
||||
lp.setNumberOfImages(numberOfTafs);
|
||||
|
||||
// Assume entry times are the same as issue time and are
|
||||
// returned sorted with oldest to newest timestamp.
|
||||
DataTime[] dt = lp.getEntryTimes();
|
||||
DataTime[] dt = DataCubeContainer.performTimeQuery(map, false);
|
||||
if (dt.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
@ -117,35 +114,23 @@ public class TafUtil {
|
|||
break;
|
||||
}
|
||||
}
|
||||
lp.setSelectedEntryTimes(requestedTimes);
|
||||
List<Object> objs = Loader.loadData(lp, "select", 10000);
|
||||
TafRecord[] tafs = new TafRecord[objs.size()];
|
||||
|
||||
// No need to sort single record
|
||||
if (objs.size() == 1) {
|
||||
tafs[0] = (TafRecord) objs.get(0);
|
||||
PluginDataObject[] pdos = DataCubeContainer.getData(map,
|
||||
requestedTimes);
|
||||
TafRecord[] tafs = new TafRecord[pdos.length];
|
||||
for (int i = 0; i < pdos.length; ++i) {
|
||||
tafs[i] = (TafRecord) pdos[i];
|
||||
}
|
||||
// sort so newest issued taf record is first.
|
||||
else {
|
||||
ArrayList<TafRecord> tafList = new ArrayList<TafRecord>(
|
||||
objs.size());
|
||||
tafList.add((TafRecord) objs.get(0));
|
||||
|
||||
for (int i = 1; i < objs.size(); i++) {
|
||||
TafRecord tafI = (TafRecord) objs.get(i);
|
||||
Date timeI = tafI.getIssue_time();
|
||||
|
||||
for (k = 0; k < i; ++k) {
|
||||
if (timeI.compareTo(tafList.get(k).getIssue_time()) > 0) {
|
||||
break;
|
||||
// Sort newest first based on issue time
|
||||
Arrays.sort(tafs,
|
||||
Collections.reverseOrder(new Comparator<TafRecord>() {
|
||||
@Override
|
||||
public int compare(TafRecord o1, TafRecord o2) {
|
||||
return o1.getIssue_time().compareTo(
|
||||
o2.getIssue_time());
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
tafList.add(k, tafI);
|
||||
}
|
||||
|
||||
tafList.toArray(tafs);
|
||||
}
|
||||
return tafs;
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error retrieving TAFs", e);
|
||||
|
@ -167,7 +152,8 @@ public class TafUtil {
|
|||
if (includeHeader) {
|
||||
sb.append(t.getWmoHeader());
|
||||
sb.append(LINE_BREAK);
|
||||
sb.append("TAF").append(t.getStationId().substring(1,4)).append(LINE_BREAK);
|
||||
sb.append("TAF").append(t.getStationId().substring(1, 4))
|
||||
.append(LINE_BREAK);
|
||||
}
|
||||
String firstLine = text[0];
|
||||
if (firstLine.startsWith("TAF AMD")
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.configuration.ConfigurationException;
|
||||
|
@ -50,16 +49,15 @@ import org.eclipse.swt.widgets.Text;
|
|||
import com.raytheon.uf.common.dataplugin.text.AfosWmoIdDataContainer;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.AfosToAwips;
|
||||
import com.raytheon.uf.common.dataplugin.text.request.GetPartialAfosIdRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
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.core.catalog.LayerProperty;
|
||||
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
|
@ -84,6 +82,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* and made non-blocking.
|
||||
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||
* 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||
* 11 Sep 2013 2277 mschenke Got rid of ScriptCreator references
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -487,8 +486,7 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
|||
String description = "AvnFPS - Site Info Editor Help";
|
||||
|
||||
String helpText = "This dialog is used to define TAF site information.\n\nTo add a new site, enter site id and press \"Update\". Edit\ndisplayed entries and press \"Save\". Create default template\nfiles.\n\nTo change an existing TAF site attribute, enter site id and\npress the \"Load\" button.\n\nTo create template files, press \"Make\" in the \"Templates\"\narea.\n\nTo edit template file, select issue hour, then press \"Edit\"\nin the \"Templates\" area.\n\nYou can use \"Update\" button to extract information from\nAWIPS configuration files. Only non-empty fields will be\noverwritten.";
|
||||
usageDlg = new HelpUsageDlg(shell, description,
|
||||
helpText);
|
||||
usageDlg = new HelpUsageDlg(shell, description, helpText);
|
||||
usageDlg.open();
|
||||
} else {
|
||||
usageDlg.bringToTop();
|
||||
|
@ -1003,34 +1001,21 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
|||
private ObStation getObStation(String icao) throws VizException {
|
||||
// New up request constraint for table request and
|
||||
// also of the classname of the table for the request
|
||||
String tablePluginName = "table";
|
||||
String tableDatabaseName = "metadata";
|
||||
String tableClassName = ObStation.class.getName();
|
||||
RequestConstraint rcTable = new RequestConstraint(tablePluginName);
|
||||
RequestConstraint rcDatabase = new RequestConstraint(tableDatabaseName);
|
||||
RequestConstraint rcClass = new RequestConstraint(tableClassName);
|
||||
RequestConstraint rcGid = new RequestConstraint(ObStation.createGID(
|
||||
ObStation.CAT_TYPE_ICAO, icao));
|
||||
DbQueryRequest request = new DbQueryRequest();
|
||||
request.setEntityClass(ObStation.class);
|
||||
request.addConstraint(
|
||||
"gid",
|
||||
new RequestConstraint(ObStation.createGID(
|
||||
ObStation.CAT_TYPE_ICAO, icao)));
|
||||
request.setLimit(1);
|
||||
|
||||
// New up hash map and populate with entry query
|
||||
// parameters before new'ng up layer property
|
||||
HashMap<String, RequestConstraint> query = new HashMap<String, RequestConstraint>();
|
||||
query.put("pluginName", rcTable);
|
||||
query.put("databasename", rcDatabase);
|
||||
query.put("classname", rcClass);
|
||||
query.put("gid", rcGid);
|
||||
|
||||
// New up layer property and set the entry parameters
|
||||
LayerProperty lpParm = new LayerProperty();
|
||||
lpParm.setEntryQueryParameters(query, false);
|
||||
// Create Image <Any> Script for table request
|
||||
String tableScript = ScriptCreator.createScript(lpParm);
|
||||
List<Object> list = Loader.loadData(tableScript, 10000);
|
||||
|
||||
if (list.size() == 0) {
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
ObStation[] stations = response.getEntityObjects(ObStation.class);
|
||||
if (stations.length == 0) {
|
||||
throw new VizException("Station not found: " + icao);
|
||||
}
|
||||
return (ObStation) list.get(0);
|
||||
return stations[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.viz.texteditor.msgs;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The IAviationObserver interface specifies a method that allows the Aviation
|
||||
* Plug-in to save a working TAF bulletin.
|
||||
|
@ -30,6 +28,7 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 15, 2008 1119 grichard Initial creation
|
||||
* Sep 11, 2013 2277 mschenke Removed unused function
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -38,7 +37,7 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
public interface IAviationObserver {
|
||||
|
||||
void saveTafBulletin(String wrkTaf);
|
||||
|
||||
List<Object> recoverTafBulletin();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ package com.raytheon.viz.texteditor.util;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
@ -40,9 +39,7 @@ import com.raytheon.uf.viz.core.catalog.ScriptCreator;
|
|||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.viz.core.mode.CAVEMode;
|
||||
import com.raytheon.viz.texteditor.Activator;
|
||||
import com.raytheon.viz.texteditor.StdTextProductFactory;
|
||||
import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
||||
|
||||
|
@ -59,6 +56,7 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
|||
* dependency
|
||||
* 05/10/2010 2187 cjeanbap Added StdTextProductFactory
|
||||
* functionality.
|
||||
* 09/11/2013 2277 mschenke Removed unused function
|
||||
* </pre>
|
||||
*
|
||||
* @author grichard
|
||||
|
@ -66,7 +64,8 @@ import com.raytheon.viz.texteditor.msgs.IAviationObserver;
|
|||
*/
|
||||
|
||||
public class AviationTextUtility implements IAviationObserver {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(AviationTextUtility.class);
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AviationTextUtility.class);
|
||||
|
||||
/**
|
||||
* Method to save a temporary working version of a TAF bulletin to the text
|
||||
|
@ -126,8 +125,7 @@ public class AviationTextUtility implements IAviationObserver {
|
|||
rcRow = new RequestConstraint(
|
||||
SerializationUtil.marshalToXml(tmpProd));
|
||||
} catch (JAXBException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error serializing data", e);
|
||||
statusHandler.handle(Priority.PROBLEM, "Error serializing data", e);
|
||||
return;
|
||||
}
|
||||
// New up hash map and populate with entry query
|
||||
|
@ -154,72 +152,11 @@ public class AviationTextUtility implements IAviationObserver {
|
|||
// textEditor.insert(((StdTextProduct) (list.get(0)))
|
||||
// .getProduct());
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving metadata", e1);
|
||||
statusHandler.handle(Priority.PROBLEM, "Error retrieving metadata",
|
||||
e1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to recover a temporary working version of a TAF bulletin from the
|
||||
* text database.
|
||||
*
|
||||
* @return String -- recovered temporary working version of a TAF bulletin
|
||||
*/
|
||||
@Override
|
||||
public List<Object> recoverTafBulletin() {
|
||||
// Set the node based on localization.
|
||||
String siteNode = LocalizationManager.getInstance().getCurrentSite();
|
||||
|
||||
// Set the Site ID based on localization.
|
||||
String siteName = LocalizationManager.getInstance().getCurrentSite()
|
||||
.toUpperCase();
|
||||
if (siteName.length() == 3) {
|
||||
siteName = SiteMap.getInstance().getSite4LetterId(siteName);
|
||||
}
|
||||
if ((siteName == null) || (siteName.equals(""))) {
|
||||
siteName = "CCCC";
|
||||
}
|
||||
|
||||
// New up request constraint for table request and
|
||||
// also of the class name of the table for the request
|
||||
RequestConstraint rcTable = new RequestConstraint("table");
|
||||
String tableDatabaseName = "fxa";
|
||||
String tableClassName = StdTextProduct.class.getName();
|
||||
|
||||
RequestConstraint rcDatabase = new RequestConstraint(tableDatabaseName);
|
||||
RequestConstraint rcClass = new RequestConstraint(tableClassName);
|
||||
|
||||
RequestConstraint rcNode = new RequestConstraint(siteNode);
|
||||
RequestConstraint rcCategory = new RequestConstraint("WRK");
|
||||
RequestConstraint rcDesignator = new RequestConstraint("TAF");
|
||||
|
||||
// New up hash map and populate with entry query
|
||||
// parameters before newing up layer property
|
||||
HashMap<String, RequestConstraint> query = new HashMap<String, RequestConstraint>();
|
||||
query.put("pluginName", rcTable);
|
||||
query.put("databasename", rcDatabase);
|
||||
query.put("classname", rcClass);
|
||||
query.put("prodId.cccid", rcNode);
|
||||
query.put("prodId.nnnid", rcCategory);
|
||||
query.put("prodId.xxxid", rcDesignator);
|
||||
|
||||
// New up layer property and set then entry parameters
|
||||
LayerProperty lpParm = new LayerProperty();
|
||||
try {
|
||||
lpParm.setEntryQueryParameters(query, false);
|
||||
// Create Image <Any> Script for table request
|
||||
String tableScript = ScriptCreator.createScript(lpParm);
|
||||
// Capture the script to the console for now...
|
||||
// System.out.printf("The query script is: %n%s%n",
|
||||
// tableScript);
|
||||
return Loader.loadData(tableScript, 10000);
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error retrieving metadata", e1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getCurrentDate() {
|
||||
Date now = SimulatedTime.getSystemTime().getTime();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("ddHHmm");
|
||||
|
|
|
@ -77,12 +77,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "tafseq")
|
||||
@Table(name = "taf", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = TafRecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "taf", indexes = { @Index(name = "taf_refTimeIndex", columnNames = {
|
||||
@org.hibernate.annotations.Table(appliesTo = TafRecord.PLUGIN_NAME, indexes = { @Index(name = "taf_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
|
@ -91,6 +91,8 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String PLUGIN_NAME = "taf";
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
@Column
|
||||
|
@ -429,6 +431,6 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled {
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "taf";
|
||||
return PLUGIN_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,12 +91,12 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "binlightningseq")
|
||||
@Table(name = "binlightning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = BinLightningRecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "binlightning", indexes = { @Index(name = "binlightning_refTimeIndex", columnNames = {
|
||||
@org.hibernate.annotations.Table(appliesTo = BinLightningRecord.PLUGIN_NAME, indexes = { @Index(name = "binlightning_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@DynamicSerialize
|
||||
|
@ -107,6 +107,8 @@ public class BinLightningRecord extends PersistablePluginDataObject implements
|
|||
/** Serializable id * */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String PLUGIN_NAME = "binlightning";
|
||||
|
||||
@Transient
|
||||
private long[] obsTimes = null;
|
||||
|
||||
|
@ -509,6 +511,6 @@ public class BinLightningRecord extends PersistablePluginDataObject implements
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "binlightning";
|
||||
return PLUGIN_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,12 +44,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "fssobsseq")
|
||||
@Table(name = "fssobs", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = FSSObsRecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "fssobs", indexes = { @Index(name = "fssobs_refTimeIndex", columnNames = {
|
||||
@org.hibernate.annotations.Table(appliesTo = FSSObsRecord.PLUGIN_NAME, indexes = { @Index(name = "fssobs_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
|
@ -1240,6 +1240,6 @@ public class FSSObsRecord extends PersistablePluginDataObject implements
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "fssobs";
|
||||
return PLUGIN_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,78 +31,118 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* Provides a transform from PointDataContainer to FSSObsRecord.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 8, 2011 skorolev Initial creation
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author skorolev
|
||||
* @version 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class FSSObsRecordTransform {
|
||||
private static final String DATA_URI = "dataURI";
|
||||
private static final String LONGITUDE = "longitude";
|
||||
private static final String LATITUDE = "latitude";
|
||||
private static final String ELEVATION = "elevation";
|
||||
private static final String DATA_URI = "dataURI";
|
||||
|
||||
private static final String LONGITUDE = "longitude";
|
||||
|
||||
private static final String LATITUDE = "latitude";
|
||||
|
||||
private static final String ELEVATION = "elevation";
|
||||
|
||||
private static final String CEILING = "ceiling";
|
||||
|
||||
private static final String DEWPOINT = "dewpoint";
|
||||
|
||||
private static final String DEWPOINT_DEPR = "dewpointDepr";
|
||||
|
||||
private static final String FROSTBITE_TIME = "frostbiteTime";
|
||||
|
||||
private static final String HORIZONTAL_VIS = "horzVisibility";
|
||||
|
||||
private static final String HOURLY_PRECIP = "hourlyPrecip";
|
||||
|
||||
private static final String MAX_WIND_SPEED = "maxWindSpeed";
|
||||
|
||||
private static final String PLATFORM_ID = "platformId";
|
||||
|
||||
private static final String PRES_WEATHER = "presWeather";
|
||||
|
||||
private static final String PRESS_CHANGE3_HOUR = "pressChange3Hour";
|
||||
|
||||
private static final String PRESS_CHANGE_CHAR = "pressChangeChar";
|
||||
|
||||
private static final String PRESS_ALTIMETER = "pressureAltimeter";
|
||||
|
||||
private static final String PRI_SWELL_WV_DIR = "primarySwellWaveDir";
|
||||
|
||||
private static final String PRI_SWELL_WV_HGT = "primarySwellWaveHeight";
|
||||
|
||||
private static final String PRI_SWELL_WV_PD = "primarySwellWavePeriod";
|
||||
|
||||
private static final String RAW_MESSAGE = "rawMessage";
|
||||
|
||||
private static final String REL_HUMIDITY = "relativeHumidity";
|
||||
|
||||
private static final String SEA_LEVEL_PRESS = "seaLevelPress";
|
||||
|
||||
private static final String SEA_SFC_TEMP = "seaSurfaceTemp";
|
||||
|
||||
private static final String SEC_SWELL_WV_DIR = "secondarySwellWaveDir";
|
||||
|
||||
private static final String SEC_SWELL_WV_HGT = "secondarySwellWaveHeight";
|
||||
|
||||
private static final String SEC_SWELL_WV_PD = "secondarySwellWavePeriod";
|
||||
|
||||
private static final String SKY_COVER = "skyCover";
|
||||
|
||||
private static final String SNOW_INC_HOURLY = "snincrHourly";
|
||||
|
||||
private static final String SNOW_INC_TOTAL = "snincrTotal";
|
||||
|
||||
private static final String SNOW_DEPTH = "snowDepth";
|
||||
|
||||
private static final String STATION_NAME = "stnName";
|
||||
|
||||
private static final String TEMPERATURE = "temperature";
|
||||
|
||||
private static final String TIME_OBS = "timeObs";
|
||||
|
||||
private static final String REF_HOUR = "refHour";
|
||||
|
||||
private static final String CLOUD_AMOUNT_TOT = "totCloudAmount";
|
||||
|
||||
private static final String VISIBILITY = "visibility";
|
||||
private static final String WAVE_HEIGHT = "highResWaveHeight";
|
||||
|
||||
private static final String WAVE_HEIGHT = "highResWaveHeight";
|
||||
|
||||
private static final String WV_HGT = "waveHeight";
|
||||
|
||||
private static final String WV_PD = "wavePeriod";
|
||||
|
||||
private static final String WV_STEEPNESS = "waveSteepness";
|
||||
|
||||
private static final String WIND_DIR = "windDir";
|
||||
|
||||
private static final String WIND_GUST = "windGust";
|
||||
|
||||
private static final String WIND_SPEED = "windSpeed";
|
||||
|
||||
private static final String[] FSSOBS_PARAMS = { DATA_URI, LONGITUDE,
|
||||
LATITUDE, ELEVATION, CEILING, DEWPOINT, DEWPOINT_DEPR,
|
||||
FROSTBITE_TIME, HORIZONTAL_VIS, HOURLY_PRECIP, MAX_WIND_SPEED,
|
||||
PLATFORM_ID, PRES_WEATHER, PRESS_CHANGE3_HOUR, PRESS_CHANGE_CHAR,
|
||||
PRESS_ALTIMETER, PRI_SWELL_WV_DIR, PRI_SWELL_WV_HGT,
|
||||
PRI_SWELL_WV_PD, RAW_MESSAGE, REL_HUMIDITY, SEA_LEVEL_PRESS,
|
||||
SEA_SFC_TEMP, SEC_SWELL_WV_DIR, SEC_SWELL_WV_HGT, SEC_SWELL_WV_PD,
|
||||
SKY_COVER, SNOW_INC_HOURLY, SNOW_INC_TOTAL, SNOW_DEPTH,
|
||||
|
||||
public static final String[] FSSOBS_PARAMS = { DATA_URI, LONGITUDE,
|
||||
LATITUDE, ELEVATION, CEILING, DEWPOINT, DEWPOINT_DEPR,
|
||||
FROSTBITE_TIME, HORIZONTAL_VIS, HOURLY_PRECIP, MAX_WIND_SPEED,
|
||||
PLATFORM_ID, PRES_WEATHER, PRESS_CHANGE3_HOUR, PRESS_CHANGE_CHAR,
|
||||
PRESS_ALTIMETER, PRI_SWELL_WV_DIR, PRI_SWELL_WV_HGT,
|
||||
PRI_SWELL_WV_PD, RAW_MESSAGE, REL_HUMIDITY, SEA_LEVEL_PRESS,
|
||||
SEA_SFC_TEMP, SEC_SWELL_WV_DIR, SEC_SWELL_WV_HGT, SEC_SWELL_WV_PD,
|
||||
SKY_COVER, SNOW_INC_HOURLY, SNOW_INC_TOTAL, SNOW_DEPTH,
|
||||
STATION_NAME, TEMPERATURE, TIME_OBS, REF_HOUR, CLOUD_AMOUNT_TOT,
|
||||
VISIBILITY,
|
||||
WAVE_HEIGHT, WV_HGT, WV_PD, WV_STEEPNESS, WIND_DIR, WIND_GUST,
|
||||
WIND_SPEED };
|
||||
|
||||
VISIBILITY, WAVE_HEIGHT, WV_HGT, WV_PD, WV_STEEPNESS, WIND_DIR,
|
||||
WIND_GUST, WIND_SPEED };
|
||||
|
||||
public static final String FSSOBS_PARAMS_LIST;
|
||||
|
||||
static {
|
||||
|
@ -119,7 +159,6 @@ public class FSSObsRecordTransform {
|
|||
FSSOBS_PARAMS_LIST = sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param container
|
||||
|
@ -139,20 +178,20 @@ public class FSSObsRecordTransform {
|
|||
}
|
||||
return records.toArray(new FSSObsRecord[records.size()]);
|
||||
}
|
||||
|
||||
|
||||
private static FSSObsRecord toFSSObsRecord(PointDataView pdv) {
|
||||
FSSObsRecord obs = null;
|
||||
if (pdv != null) {
|
||||
// String uri = pdv.getString(DATA_URI);
|
||||
obs = new FSSObsRecord();
|
||||
obs.setDataURI(pdv.getString(DATA_URI));
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
pdv.getString(PLATFORM_ID));
|
||||
Double lat = pdv.getNumber(LATITUDE).doubleValue();
|
||||
Double lon = pdv.getNumber(LONGITUDE).doubleValue();
|
||||
loc.assignLocation(lat, lon);
|
||||
loc.setElevation(pdv.getNumber(ELEVATION).intValue());
|
||||
obs.setLocation(loc);
|
||||
// String uri = pdv.getString(DATA_URI);
|
||||
obs = new FSSObsRecord();
|
||||
obs.setDataURI(pdv.getString(DATA_URI));
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
pdv.getString(PLATFORM_ID));
|
||||
Double lat = pdv.getNumber(LATITUDE).doubleValue();
|
||||
Double lon = pdv.getNumber(LONGITUDE).doubleValue();
|
||||
loc.assignLocation(lat, lon);
|
||||
loc.setElevation(pdv.getNumber(ELEVATION).intValue());
|
||||
obs.setLocation(loc);
|
||||
obs.setCeiling(pdv.getFloat(CEILING));
|
||||
obs.setDewpoint(pdv.getNumber(DEWPOINT).floatValue());
|
||||
obs.setDewpointDepr(pdv.getFloat(DEWPOINT_DEPR));
|
||||
|
@ -162,19 +201,26 @@ public class FSSObsRecordTransform {
|
|||
obs.setMaxWindSpeed(pdv.getFloat(MAX_WIND_SPEED));
|
||||
obs.setPlatformId(pdv.getString(PLATFORM_ID));
|
||||
obs.setPresWeather(pdv.getStringAllLevels(PRES_WEATHER));
|
||||
obs.setPressChange3Hour(pdv.getNumber(PRESS_CHANGE3_HOUR).floatValue());
|
||||
obs.setPressChange3Hour(pdv.getNumber(PRESS_CHANGE3_HOUR)
|
||||
.floatValue());
|
||||
obs.setPressChangeChar(pdv.getString(PRESS_CHANGE_CHAR));
|
||||
obs.setPressureAltimeter(pdv.getFloat(PRESS_ALTIMETER));
|
||||
obs.setPrimarySwellWaveDir(pdv.getNumber(PRI_SWELL_WV_DIR).doubleValue());
|
||||
obs.setPrimarySwellWaveHeight(pdv.getNumber(PRI_SWELL_WV_HGT).doubleValue());
|
||||
obs.setPrimarySwellWavePeriod(pdv.getNumber(PRI_SWELL_WV_PD).intValue());
|
||||
obs.setPrimarySwellWaveDir(pdv.getNumber(PRI_SWELL_WV_DIR)
|
||||
.doubleValue());
|
||||
obs.setPrimarySwellWaveHeight(pdv.getNumber(PRI_SWELL_WV_HGT)
|
||||
.doubleValue());
|
||||
obs.setPrimarySwellWavePeriod(pdv.getNumber(PRI_SWELL_WV_PD)
|
||||
.intValue());
|
||||
obs.setRawMessage(pdv.getString(RAW_MESSAGE));
|
||||
obs.setRelativeHumidity(pdv.getFloat(REL_HUMIDITY));
|
||||
obs.setSeaLevelPress(pdv.getFloat(SEA_LEVEL_PRESS));
|
||||
obs.setSeaSurfaceTemp(pdv.getFloat(SEA_SFC_TEMP));
|
||||
obs.setSecondarySwellWaveDir(pdv.getNumber(SEC_SWELL_WV_DIR).doubleValue());
|
||||
obs.setSecondarySwellWaveHeight(pdv.getNumber(SEC_SWELL_WV_HGT).doubleValue());
|
||||
obs.setSecondarySwellWavePeriod(pdv.getNumber(SEC_SWELL_WV_PD).intValue());
|
||||
obs.setSecondarySwellWaveDir(pdv.getNumber(SEC_SWELL_WV_DIR)
|
||||
.doubleValue());
|
||||
obs.setSecondarySwellWaveHeight(pdv.getNumber(SEC_SWELL_WV_HGT)
|
||||
.doubleValue());
|
||||
obs.setSecondarySwellWavePeriod(pdv.getNumber(SEC_SWELL_WV_PD)
|
||||
.intValue());
|
||||
obs.setSkyCover(pdv.getStringAllLevels(SKY_COVER));
|
||||
obs.setSnincrHourly(pdv.getFloat(SNOW_INC_HOURLY));
|
||||
obs.setSnincrTotal(pdv.getFloat(SNOW_INC_TOTAL));
|
||||
|
@ -187,7 +233,7 @@ public class FSSObsRecordTransform {
|
|||
obs.setRefHour(TimeTools.newCalendar(rh));
|
||||
obs.setTotCloudAmount(pdv.getNumber(CLOUD_AMOUNT_TOT).intValue());
|
||||
obs.setVisibility(pdv.getNumber(VISIBILITY).floatValue());
|
||||
obs.setHighResWaveHeight(pdv.getFloat(WAVE_HEIGHT));
|
||||
obs.setHighResWaveHeight(pdv.getFloat(WAVE_HEIGHT));
|
||||
obs.setWaveHeight(pdv.getNumber(WV_HGT).doubleValue());
|
||||
obs.setWavePeriod(pdv.getNumber(WV_PD).intValue());
|
||||
obs.setWindDir(pdv.getNumber(WIND_DIR).floatValue());
|
||||
|
|
|
@ -86,7 +86,7 @@ import com.raytheon.uf.common.time.TimeRange;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "gfeseq")
|
||||
@Table(name = "gfe", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
@Table(name = GFERecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
"parmId_id", "rangestart", "rangeend", "refTime", "forecasttime" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
|
|
|
@ -89,7 +89,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "profilerseq")
|
||||
@Table(name = "profiler", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = ProfilerObs.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
|
|
@ -142,7 +142,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "radarseq")
|
||||
@Table(name = "radar", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = RadarRecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
|
|
@ -60,12 +60,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq")
|
||||
@Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = WarningRecord.PLUGIN_NAME, uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "warning", indexes = {
|
||||
@org.hibernate.annotations.Table(appliesTo = WarningRecord.PLUGIN_NAME, indexes = {
|
||||
@Index(name = "warning_refTimeIndex", columnNames = { "refTime",
|
||||
"forecastTime" }),
|
||||
@Index(name = "warning_office_phensig_index", columnNames = {
|
||||
|
@ -133,6 +133,8 @@ public class WarningRecord extends AbstractWarningRecord {
|
|||
|
||||
}
|
||||
|
||||
public static final String PLUGIN_NAME = "warning";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
@ -173,6 +175,6 @@ public class WarningRecord extends AbstractWarningRecord {
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "warning";
|
||||
return PLUGIN_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,6 +122,8 @@ public abstract class PluginDataObject extends PersistableDataObject implements
|
|||
|
||||
public static final String DATATIME_ID = "dataTime";
|
||||
|
||||
public static final String DATAURI_ID = "dataURI";
|
||||
|
||||
public static final String ID_GEN = "idgen";
|
||||
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = ID_GEN)
|
||||
|
|
|
@ -114,7 +114,7 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
@DynamicSerializeElement
|
||||
protected String constraintValue;
|
||||
|
||||
protected transient Map<Class<?>, Object> asMap;
|
||||
protected transient Map<Class<?>, Object> asMap = new HashMap<Class<?>, Object>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -124,8 +124,7 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
}
|
||||
|
||||
public RequestConstraint(ConstraintType constraintType) {
|
||||
this.constraintType = constraintType;
|
||||
this.asMap = new HashMap<Class<?>, Object>();
|
||||
this(null, constraintType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,8 +134,7 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
* the value to constrain on
|
||||
*/
|
||||
public RequestConstraint(String value) {
|
||||
this();
|
||||
this.constraintValue = value;
|
||||
this(value, ConstraintType.EQUALS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,30 +144,36 @@ public class RequestConstraint implements ISerializableObject, Cloneable {
|
|||
* @param type
|
||||
*/
|
||||
public RequestConstraint(String value, ConstraintType type) {
|
||||
this(value);
|
||||
this.constraintValue = value;
|
||||
this.constraintType = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link RequestConstraint} with {@link ConstraintType#IN} with
|
||||
* inConstraints set as the {@link #setConstraintValueList(Collection)}
|
||||
* Converts inConstraints into String[] and calls
|
||||
* {@link RequestConstraint#RequestConstraint(String[])}
|
||||
*
|
||||
* @param inConstraints
|
||||
*/
|
||||
public RequestConstraint(Collection<String> inConstraints) {
|
||||
this(ConstraintType.IN);
|
||||
setConstraintValueList(inConstraints);
|
||||
this(inConstraints.toArray(new String[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link RequestConstraint} with {@link ConstraintType#IN} with
|
||||
* inConstraints set as the {@link #setConstraintValueList(String[])}
|
||||
* inConstraints set as the {@link #setConstraintValueList(String[])} if
|
||||
* inConstraints size == 1 then {@link ConstraintType#EQUALS} will be used
|
||||
* instead
|
||||
*
|
||||
* @param inConstraints
|
||||
*/
|
||||
public RequestConstraint(String[] inConstraints) {
|
||||
this(ConstraintType.IN);
|
||||
setConstraintValueList(inConstraints);
|
||||
this.constraintType = ConstraintType.IN;
|
||||
if (inConstraints.length == 1) {
|
||||
this.constraintType = ConstraintType.EQUALS;
|
||||
this.constraintValue = inConstraints[0];
|
||||
} else {
|
||||
setConstraintValueList(inConstraints);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package gov.noaa.nws.ncep.viz.rsc.lightning.rsc;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.viz.core.RecordFactory;
|
||||
import com.raytheon.uf.viz.core.alerts.AbstractAlertMessageParser;
|
||||
import com.raytheon.uf.viz.core.alerts.AlertMessage;
|
||||
import com.raytheon.uf.viz.core.comm.Loader;
|
||||
|
@ -18,14 +13,6 @@ public class NcLtngAlertParser extends AbstractAlertMessageParser {
|
|||
@Override
|
||||
public Object parseAlertMessage(AlertMessage message,
|
||||
AbstractRequestableResourceData reqResourceData) throws VizException {
|
||||
|
||||
Object objectToSend = null;
|
||||
Map<String, Object> attribs = new HashMap<String, Object>(
|
||||
message.decodedAlert);
|
||||
String dataURI = message.dataURI;
|
||||
attribs.put("dataURI", message.dataURI);
|
||||
objectToSend = Loader.loadData(attribs);
|
||||
|
||||
return objectToSend;
|
||||
return Loader.loadData(message.dataURI);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,6 @@ public class NcAutoUpdater implements IAlertObserver {
|
|||
AbstractRequestableResourceData reqResourceData)
|
||||
throws VizException {
|
||||
Object objectToSend = null;
|
||||
Map<String, Object> attribs = new HashMap<String, Object>(
|
||||
message.decodedAlert);
|
||||
String dataURI = message.dataURI;
|
||||
if (reqResourceData.isUpdatingOnMetadataOnly()) {
|
||||
PluginDataObject record = RecordFactory.getInstance()
|
||||
|
@ -90,8 +88,7 @@ public class NcAutoUpdater implements IAlertObserver {
|
|||
objectToSend = record;
|
||||
|
||||
} else {
|
||||
attribs.put("dataURI", message.dataURI);
|
||||
objectToSend = Loader.loadData(attribs);
|
||||
objectToSend = Loader.loadData(dataURI);
|
||||
}
|
||||
return objectToSend;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue