Issue #2142 remove more dependencies on edex.common

Change-Id: Iac9d21fc531c03920fcbb52d6a9cc833a2625a2f

Former-commit-id: cce952c0bc [formerly a919490d00] [formerly a9f5465c99 [formerly f650a26ee4c6c944164d2b5d917b5f8b6ad32bb5]]
Former-commit-id: a9f5465c99
Former-commit-id: fe3adecbc2
This commit is contained in:
Nate Jensen 2013-08-08 14:14:55 -05:00
parent 6b3788382b
commit 71a7b044ae
56 changed files with 326 additions and 301 deletions

View file

@ -17,7 +17,6 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.alertviz, com.raytheon.uf.common.alertviz,
javax.jms;bundle-version="1.0.0", javax.jms;bundle-version="1.0.0",
ch.qos.logback;bundle-version="1.0.13" ch.qos.logback;bundle-version="1.0.13"
Bundle-ClassPath: .
Export-Package: com.raytheon.uf.viz.alertviz, Export-Package: com.raytheon.uf.viz.alertviz,
com.raytheon.uf.viz.alertviz.config com.raytheon.uf.viz.alertviz.config
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -3,13 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Name: App Launcher Plug-in Bundle-Name: App Launcher Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.app.launcher;singleton:=true Bundle-SymbolicName: com.raytheon.uf.viz.app.launcher;singleton:=true
Bundle-Version: 1.12.1174.qualifier Bundle-Version: 1.12.1174.qualifier
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-Activator: com.raytheon.uf.viz.app.launcher.Activator Bundle-Activator: com.raytheon.uf.viz.app.launcher.Activator
Bundle-Vendor: RAYTHEON Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime, org.eclipse.core.runtime,
com.raytheon.uf.common.serialization,
com.raytheon.uf.common.localization;bundle-version="1.11.1", com.raytheon.uf.common.localization;bundle-version="1.11.1",
com.raytheon.edex.common;bundle-version="1.11.1",
com.raytheon.uf.viz.core;bundle-version="1.11.5" com.raytheon.uf.viz.core;bundle-version="1.11.5"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.app.launcher, Export-Package: com.raytheon.uf.viz.app.launcher,
@ -19,4 +19,5 @@ Export-Package: com.raytheon.uf.viz.app.launcher,
com.raytheon.uf.viz.app.launcher.runner, com.raytheon.uf.viz.app.launcher.runner,
com.raytheon.uf.viz.app.launcher.utilities com.raytheon.uf.viz.app.launcher.utilities
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.ohd Import-Package: com.raytheon.uf.common.ohd,
com.raytheon.uf.common.util

View file

@ -28,8 +28,8 @@ import java.util.Set;
import javax.xml.bind.JAXB; import javax.xml.bind.JAXB;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.viz.app.launcher.bundle.Entity; import com.raytheon.uf.viz.app.launcher.bundle.Entity;
import com.raytheon.uf.viz.app.launcher.bundle.Launcher; import com.raytheon.uf.viz.app.launcher.bundle.Launcher;
import com.raytheon.uf.viz.app.launcher.exception.AppLauncherException; import com.raytheon.uf.viz.app.launcher.exception.AppLauncherException;
@ -176,7 +176,7 @@ public final class AppLauncherUtilities {
} catch (Exception e) { } catch (Exception e) {
throw new AppLauncherException( throw new AppLauncherException(
"Unable to import App Launcher bundle " "Unable to import App Launcher bundle "
+ Util.printString(bundleLocation), e); + StringUtil.printString(bundleLocation), e);
} }
} }
} }

View file

@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.ui,
org.geotools;bundle-version="2.5.8", org.geotools;bundle-version="2.5.8",
com.raytheon.uf.common.geospatial;bundle-version="1.11.17", com.raytheon.uf.common.geospatial;bundle-version="1.11.17",
com.raytheon.viz.pointdata;bundle-version="1.11.17", com.raytheon.viz.pointdata;bundle-version="1.11.17",
com.raytheon.edex.common;bundle-version="1.11.17",
com.raytheon.uf.common.pointdata;bundle-version="1.11.17", com.raytheon.uf.common.pointdata;bundle-version="1.11.17",
com.raytheon.edex.meteolib;bundle-version="1.11.17", com.raytheon.edex.meteolib;bundle-version="1.11.17",
com.raytheon.viz.core;bundle-version="1.11.17", com.raytheon.viz.core;bundle-version="1.11.17",

View file

@ -33,13 +33,13 @@ import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException; import org.opengis.referencing.operation.TransformException;
import com.raytheon.edex.meteoLib.Controller; import com.raytheon.edex.meteoLib.Controller;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.pointdata.ParameterDescription; import com.raytheon.uf.common.pointdata.ParameterDescription;
import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
@ -172,7 +172,7 @@ public class OAGridTransformer {
for (int i = 0; i < grid.length; i++) { for (int i = 0; i < grid.length; i++) {
if (grid[i] > 1e36f) { if (grid[i] > 1e36f) {
grid[i] = Util.GRID_FILL_VALUE; grid[i] = GridUtil.GRID_FILL_VALUE;
} }
} }
return grid; return grid;

View file

@ -40,7 +40,6 @@ import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.datum.PixelInCell; import org.opengis.referencing.datum.PixelInCell;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.colormap.IColorMap;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
@ -52,6 +51,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.alerts.AlertMessage; import com.raytheon.uf.viz.core.alerts.AlertMessage;
@ -407,7 +407,7 @@ public class OAResource extends
.getConverterTo(prefs.getDisplayUnits()); .getConverterTo(prefs.getDisplayUnits());
for (int i = 0; i < grid.length; i++) { for (int i = 0; i < grid.length; i++) {
if (grid[i] != Util.GRID_FILL_VALUE) { if (grid[i] != GridUtil.GRID_FILL_VALUE) {
grid[i] = (float) converter.convert(grid[i]); grid[i] = (float) converter.convert(grid[i]);
} }
} }
@ -498,7 +498,7 @@ public class OAResource extends
GriddedImageDisplay image = (GriddedImageDisplay) renderable; GriddedImageDisplay image = (GriddedImageDisplay) renderable;
double value = ((FloatBuffer) image.getData()).get(index); double value = ((FloatBuffer) image.getData()).get(index);
if (value == Util.GRID_FILL_VALUE) { if (value == GridUtil.GRID_FILL_VALUE) {
return "NO DATA"; return "NO DATA";
} }
@ -527,22 +527,22 @@ public class OAResource extends
double val22 = sliceData[y2 * transformer.getNx() + x2]; double val22 = sliceData[y2 * transformer.getNx() + x2];
double val = 0.0; double val = 0.0;
boolean data = false; boolean data = false;
if (val11 != Util.GRID_FILL_VALUE) { if (val11 != GridUtil.GRID_FILL_VALUE) {
val += (x2 - x) * (y2 - y) * val11 val += (x2 - x) * (y2 - y) * val11
/ ((x2 - x1) * (y2 - y1)); / ((x2 - x1) * (y2 - y1));
data = true; data = true;
} }
if (val21 != Util.GRID_FILL_VALUE) { if (val21 != GridUtil.GRID_FILL_VALUE) {
val += (x - x1) * (y2 - y) * val21 val += (x - x1) * (y2 - y) * val21
/ ((x2 - x1) * (y2 - y1)); / ((x2 - x1) * (y2 - y1));
data = true; data = true;
} }
if (val12 != Util.GRID_FILL_VALUE) { if (val12 != GridUtil.GRID_FILL_VALUE) {
val += (x2 - x) * (y - y1) * val12 val += (x2 - x) * (y - y1) * val12
/ ((x2 - x1) * (y2 - y1)); / ((x2 - x1) * (y2 - y1));
data = true; data = true;
} }
if (val22 != Util.GRID_FILL_VALUE) { if (val22 != GridUtil.GRID_FILL_VALUE) {
val += (x - x1) * (y - y1) * val22 val += (x - x1) * (y - y1) * val22
/ ((x2 - x1) * (y2 - y1)); / ((x2 - x1) * (y2 - y1));
data = true; data = true;

View file

@ -29,11 +29,11 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.TransformException; import org.opengis.referencing.operation.TransformException;
import com.raytheon.edex.meteoLib.Controller; import com.raytheon.edex.meteoLib.Controller;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.derivparam.library.DerivedParameterGenerator; import com.raytheon.uf.viz.derivparam.library.DerivedParameterGenerator;
@ -129,7 +129,7 @@ public class OATiltGridTransformer extends OAGridTransformer {
for (int i = 0; i < grid.length; i++) { for (int i = 0; i < grid.length; i++) {
if (grid[i] > 1e36f) { if (grid[i] > 1e36f) {
grid[i] = Util.GRID_FILL_VALUE; grid[i] = GridUtil.GRID_FILL_VALUE;
} }
} }
return grid; return grid;
@ -193,8 +193,9 @@ public class OATiltGridTransformer extends OAGridTransformer {
if (grid == null) { if (grid == null) {
continue; continue;
} }
FloatDataRecord fdr = new FloatDataRecord(parmDescription FloatDataRecord fdr = new FloatDataRecord(
.getParameterName(), "", grid, 2, new long[] { nx, ny }); parmDescription.getParameterName(), "", grid, 2,
new long[] { nx, ny });
cube.add(new CubeLevel<Object, Object>((float) i, fdr)); cube.add(new CubeLevel<Object, Object>((float) i, fdr));
} }
if (cube.size() < 3) { if (cube.size() < 3) {

View file

@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui,
org.geotools, org.geotools,
com.raytheon.viz.gfe, com.raytheon.viz.gfe,
com.raytheon.viz.alerts, com.raytheon.viz.alerts,
com.raytheon.edex.common,
org.jep, org.jep,
com.raytheon.uf.common.message;bundle-version="1.11.31", com.raytheon.uf.common.message;bundle-version="1.11.31",
com.raytheon.uf.common.dataplugin.gfe, com.raytheon.uf.common.dataplugin.gfe,

View file

@ -44,7 +44,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Listener;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -58,6 +57,7 @@ import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.gfe.constants.StatusConstants; import com.raytheon.viz.gfe.constants.StatusConstants;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
@ -723,9 +723,9 @@ public final class GhgConfigData {
*/ */
public void addNamedFilter(String name, GhgDataFilter filter) public void addNamedFilter(String name, GhgDataFilter filter)
throws VizException { throws VizException {
if (Util.isEmptyString(name) || (filter == null)) { if (StringUtil.isEmptyString(name) || (filter == null)) {
throw new VizException("Invalid filter save request - name = " throw new VizException("Invalid filter save request - name = "
+ Util.printString(name)); + StringUtil.printString(name));
} }
filters.put(name, filter); filters.put(name, filter);
} }
@ -740,9 +740,9 @@ public final class GhgConfigData {
* if the named filter does not exist * if the named filter does not exist
*/ */
public void deleteNamedFilter(String name) throws VizException { public void deleteNamedFilter(String name) throws VizException {
if (Util.isEmptyString(name) || !filters.containsKey(name)) { if (StringUtil.isEmptyString(name) || !filters.containsKey(name)) {
throw new VizException("Invalid filter delete request, name " throw new VizException("Invalid filter delete request, name "
+ Util.printString(name) + " does not exist"); + StringUtil.printString(name) + " does not exist");
} }
if (filters.get(name).name.equals(currentFilter.name)) { if (filters.get(name).name.equals(currentFilter.name)) {
setDefaultAsCurrent(FeatureEnum.FILTERS); setDefaultAsCurrent(FeatureEnum.FILTERS);

View file

@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.viz.ui, com.raytheon.viz.ui,
com.raytheon.viz.core, com.raytheon.viz.core,
org.geotools, org.geotools,
com.raytheon.edex.common,
com.raytheon.viz.hydrocommon, com.raytheon.viz.hydrocommon,
com.raytheon.viz.shapefile, com.raytheon.viz.shapefile,
com.raytheon.viz.core.graphing, com.raytheon.viz.core.graphing,

View file

@ -24,9 +24,9 @@ import java.util.ArrayList;
import com.raytheon.edex.msg.Command; import com.raytheon.edex.msg.Command;
import com.raytheon.edex.msg.ProgramOutput; import com.raytheon.edex.msg.ProgramOutput;
import com.raytheon.edex.util.Util;
import com.raytheon.edex.utility.StreamHandler; import com.raytheon.edex.utility.StreamHandler;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
/** /**
@ -101,7 +101,7 @@ public class AdapterSrv {
} catch (Exception e) { } catch (Exception e) {
throw new EdexException( throw new EdexException(
"AdapterSrv: Error running external executable: " "AdapterSrv: Error running external executable: "
+ Util.printString(command), e); + StringUtil.printString(command), e);
} finally { } finally {
// #DR 10955 // #DR 10955
if (proc != null) { if (proc != null) {

View file

@ -38,7 +38,6 @@ import com.raytheon.edex.subscription.runners.SubscribeRunner;
import com.raytheon.edex.subscription.util.Tools; import com.raytheon.edex.subscription.util.Tools;
import com.raytheon.edex.uengine.runners.IMicroEngine; import com.raytheon.edex.uengine.runners.IMicroEngine;
import com.raytheon.edex.uengine.runners.MicroEngine; import com.raytheon.edex.uengine.runners.MicroEngine;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
import com.raytheon.uf.common.message.Header; import com.raytheon.uf.common.message.Header;
@ -46,6 +45,7 @@ import com.raytheon.uf.common.message.Message;
import com.raytheon.uf.common.message.Property; import com.raytheon.uf.common.message.Property;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.util.ReflectionUtil; import com.raytheon.uf.common.util.ReflectionUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
/** /**
@ -261,15 +261,15 @@ public class ScriptRunner {
} else { } else {
String path = record.getFilepath(); String path = record.getFilepath();
String args = record.getArguments(); String args = record.getArguments();
if (Util.isEmptyString(path) && Util.isEmptyString(args)) { if (StringUtil.isEmptyString(path) && StringUtil.isEmptyString(args)) {
logger.warn("Unable to execute script for " + record.toString()); logger.warn("Unable to execute script for " + record.toString());
return; return;
} }
if (!Util.isEmptyString(args)) { if (!StringUtil.isEmptyString(args)) {
args = args.replaceAll(TRIGGER_KEY, trigger); args = args.replaceAll(TRIGGER_KEY, trigger);
} }
script = (Util.isEmptyString(path) ? "" : path) + " " script = (StringUtil.isEmptyString(path) ? "" : path) + " "
+ (Util.isEmptyString(args) ? "" : args); + (StringUtil.isEmptyString(args) ? "" : args);
} }
IMicroEngine engine = null; IMicroEngine engine = null;
try { try {

View file

@ -25,8 +25,8 @@ import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Message;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
/** /**
@ -121,7 +121,7 @@ public class SubscribeRunner {
*/ */
public static ISubscribeRunner getInstance(String oper, Message message) throws EdexException { public static ISubscribeRunner getInstance(String oper, Message message) throws EdexException {
ISubscribeRunner retVal = null; ISubscribeRunner retVal = null;
if (Util.isEmptyString(oper)) { if (StringUtil.isEmptyString(oper)) {
throw new EdexException("Unable to initialize ISubscribeRunner instance; null or empty operation specified - unable to continue"); throw new EdexException("Unable to initialize ISubscribeRunner instance; null or empty operation specified - unable to continue");
} }
SubscribeAction action = SubscribeAction.translate(oper); SubscribeAction action = SubscribeAction.translate(oper);

View file

@ -23,9 +23,9 @@ package com.raytheon.edex.msg;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.message.response.AbstractResponseMessage; import com.raytheon.uf.common.message.response.AbstractResponseMessage;
import com.raytheon.uf.common.util.ConvertUtil; import com.raytheon.uf.common.util.ConvertUtil;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* Represents an ASCII product response from EDEX. * Represents an ASCII product response from EDEX.
@ -75,13 +75,13 @@ public class ResponseMessageASCII extends AbstractResponseMessage {
String time, String time,
String uri) { String uri) {
this.fileType = "ascii"; this.fileType = "ascii";
this.filename = Util.isEmptyString(filename)?"":filename; this.filename = StringUtil.isEmptyString(filename)?"":filename;
this.contents = contents; this.contents = contents;
this.type = Util.isEmptyString(type)?"":type; this.type = StringUtil.isEmptyString(type)?"":type;
this.station = Util.isEmptyString(station)?"":station; this.station = StringUtil.isEmptyString(station)?"":station;
this.time = Util.isEmptyString(time)?"":time; this.time = StringUtil.isEmptyString(time)?"":time;
this.dataURI = Util.isEmptyString(uri)?"":uri; this.dataURI = StringUtil.isEmptyString(uri)?"":uri;
try { try {
Calendar valid = (Calendar)ConvertUtil.convertObject(time, Calendar.class); Calendar valid = (Calendar)ConvertUtil.convertObject(time, Calendar.class);
this.validTime = valid.getTime(); this.validTime = valid.getTime();

View file

@ -19,8 +19,8 @@
**/ **/
package com.raytheon.edex.msg; package com.raytheon.edex.msg;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.message.response.AbstractResponseMessage; import com.raytheon.uf.common.message.response.AbstractResponseMessage;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* A response message that allows the &mu;Engine to respond when * A response message that allows the &mu;Engine to respond when
@ -57,9 +57,9 @@ public class ResponseMessageNull extends AbstractResponseMessage {
*/ */
private ResponseMessageNull(String message, String uri, String time) { private ResponseMessageNull(String message, String uri, String time) {
this.fileType="ascii"; this.fileType="ascii";
this.dataURI = Util.isEmptyString(uri)?"":uri; this.dataURI = StringUtil.isEmptyString(uri)?"":uri;
this.time = Util.isEmptyString(time)?"":time; this.time = StringUtil.isEmptyString(time)?"":time;
this.message = Util.isEmptyString(message)?"":message; this.message = StringUtil.isEmptyString(message)?"":message;
} }
/** /**
* Static method that creates an null Response Message. Uses the * Static method that creates an null Response Message. Uses the

View file

@ -22,8 +22,8 @@ package com.raytheon.edex.msg;
import java.util.Date; import java.util.Date;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.message.response.AbstractResponseMessage; import com.raytheon.uf.common.message.response.AbstractResponseMessage;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* Represent a subscription response for the server. This message * Represent a subscription response for the server. This message
@ -64,9 +64,9 @@ public class ResponseMessageSubscription extends AbstractResponseMessage {
Exception cause) { Exception cause) {
this.statusMessage = message; this.statusMessage = message;
if (cause != null) { if (cause != null) {
this.statusMessage += " Cause was " + Util.printString(cause); this.statusMessage += " Cause was " + StringUtil.printString(cause);
if(cause.getCause() != null) { if(cause.getCause() != null) {
this.statusMessage += " " + Util.printString(cause.getCause()); this.statusMessage += " " + StringUtil.printString(cause.getCause());
} }
} }

View file

@ -24,8 +24,8 @@ import java.util.Calendar;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* Contains the information that describes a single product subscription. * Contains the information that describes a single product subscription.
@ -243,7 +243,7 @@ public class Subscription extends PersistableDataObject {
*/ */
public String toString() { public String toString() {
return this.getClass().getName() + "[count=" + this.count + return this.getClass().getName() + "[count=" + this.count +
", URI=" + Util.printString((String)identifier); ", URI=" + StringUtil.printString((String)identifier);
} }
public int getId() { public int getId() {

View file

@ -35,6 +35,7 @@ import com.raytheon.edex.db.dao.SubscribeDAO;
import com.raytheon.edex.exception.SubscriptionException; import com.raytheon.edex.exception.SubscriptionException;
import com.raytheon.edex.util.Util; import com.raytheon.edex.util.Util;
import com.raytheon.edex.util.XMLUtils; import com.raytheon.edex.util.XMLUtils;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* This class manages the product subscription list. It is designed as a POJO * This class manages the product subscription list. It is designed as a POJO
@ -162,8 +163,8 @@ public final class SubscriptionManager implements ISubscriptionManager {
} }
} catch (Exception e) { } catch (Exception e) {
String msg = "Unable fulfill subscription request, dataURI=" String msg = "Unable fulfill subscription request, dataURI="
+ Util.printString(dataURI) + ", scriptID=" + StringUtil.printString(dataURI) + ", scriptID="
+ Util.printString(scriptID); + StringUtil.printString(scriptID);
e.printStackTrace(); e.printStackTrace();
throw new SubscriptionException(msg, e); throw new SubscriptionException(msg, e);
} }
@ -222,7 +223,7 @@ public final class SubscriptionManager implements ISubscriptionManager {
*/ */
public synchronized boolean isSubscribed(String dataURI) { public synchronized boolean isSubscribed(String dataURI) {
logger.debug("isSubscribed() received subscription inquery, URI is " logger.debug("isSubscribed() received subscription inquery, URI is "
+ Util.printString(dataURI)); + StringUtil.printString(dataURI));
/* check to see if the uri exactly matches a subscription */ /* check to see if the uri exactly matches a subscription */
if (subscriptions.containsKey(dataURI)) { if (subscriptions.containsKey(dataURI)) {
return true; return true;
@ -299,12 +300,12 @@ public final class SubscriptionManager implements ISubscriptionManager {
// Object obj = dataLayer.getSubscription(dataURI); // Object obj = dataLayer.getSubscription(dataURI);
if (obj == null && obj instanceof Subscription) { if (obj == null && obj instanceof Subscription) {
logger.error("No Subscription object available for " logger.error("No Subscription object available for "
+ Util.printString(dataURI)); + StringUtil.printString(dataURI));
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("Unable to get subscription information for " logger.error("Unable to get subscription information for "
+ Util.printString(dataURI), e); + StringUtil.printString(dataURI), e);
} }
return subscription; return subscription;
} }
@ -344,15 +345,15 @@ public final class SubscriptionManager implements ISubscriptionManager {
} else { } else {
// no matching script // no matching script
String msg = "no matching script, dataURI=" String msg = "no matching script, dataURI="
+ Util.printString(dataURI) + ", scriptID= " + StringUtil.printString(dataURI) + ", scriptID= "
+ Util.printString(scriptID); + StringUtil.printString(scriptID);
logger.warn("unsubscribe() " + msg); logger.warn("unsubscribe() " + msg);
throw new SubscriptionException(msg); throw new SubscriptionException(msg);
} }
} else { } else {
// no subscription for the data // no subscription for the data
String msg = "No subscription exists, dataURI=" String msg = "No subscription exists, dataURI="
+ Util.printString(dataURI); + StringUtil.printString(dataURI);
logger.warn("unsubscribe() " + msg); logger.warn("unsubscribe() " + msg);
throw new SubscriptionException(msg); throw new SubscriptionException(msg);
} }
@ -360,8 +361,8 @@ public final class SubscriptionManager implements ISubscriptionManager {
// error performing the unsubscribe // error performing the unsubscribe
if (!(e instanceof SubscriptionException)) { if (!(e instanceof SubscriptionException)) {
String msg = "Unable to unsubscribe. dataURI=" String msg = "Unable to unsubscribe. dataURI="
+ Util.printString(dataURI) + ", scriptID=" + StringUtil.printString(dataURI) + ", scriptID="
+ Util.printString(scriptID); + StringUtil.printString(scriptID);
throw new SubscriptionException(msg, e); throw new SubscriptionException(msg, e);
} else { } else {
throw (SubscriptionException) e; throw (SubscriptionException) e;

View file

@ -43,7 +43,6 @@ import org.springframework.context.ConfigurableApplicationContext;
import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.GridUtil;
/** /**
* Contains utility methods for use in common. * Contains utility methods for use in common.
@ -91,37 +90,10 @@ public final class Util {
*/ */
public static final String EOL = FileUtil.EOL; public static final String EOL = FileUtil.EOL;
public static final float GRID_FILL_VALUE = GridUtil.GRID_FILL_VALUE;
private Util() { private Util() {
// No Instantiation // No Instantiation
} }
/**
* Simple check if str is null or empty.
*
* @param str
* A string to check
* @return true if string is null or empty, false otherwise
*/
public static final boolean isEmptyString(String str) {
return (str == null) || ("".equals(str));
}
/**
* Wraps input Object.toString (if non-null) in [] for display (helps show
* empty string in output).<br>
* Example: printString("test") would display "[test]"<br>
* printString(null) would display "[null]"
*
* @param obj
* An object instance
* @return The object's {@link Object#toString()} value
*/
public static final String printString(Object obj) {
return "[" + (obj == null ? "null" : obj.toString()) + "]";
}
/** /**
* Get the filename from a fully qualified path * Get the filename from a fully qualified path
* *
@ -439,30 +411,6 @@ public final class Util {
return status; return status;
} }
/**
* Determines if the given string is all alpha-numeric characters
*
* @param str
* The string to test
* @return True if the string is alpha-numeric
*/
public static boolean isAlnum(String str) {
int count = 0;
Pattern pat = Pattern.compile("\\p{Alnum}");
Matcher mat = pat.matcher(str);
while (mat.find()) {
count++;
}
if (count == str.length()) {
return true;
} else {
return false;
}
}
/** /**
* Retrieve date as a long in the index standard format: yyyy-MM-dd * Retrieve date as a long in the index standard format: yyyy-MM-dd
* kk:mm:ss.SSS * kk:mm:ss.SSS

View file

@ -45,6 +45,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import com.raytheon.uf.common.util.StringUtil;
import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl; import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
/** /**
@ -552,13 +553,13 @@ public final class XMLUtils {
throws Exception { throws Exception {
NodeList nodes = document.getElementsByTagName(tagName); NodeList nodes = document.getElementsByTagName(tagName);
if(nodes == null) { if(nodes == null) {
throw new Exception("Unable to find tag " + Util.printString(tagName)); throw new Exception("Unable to find tag " + StringUtil.printString(tagName));
} }
Node node = nodes.item(0); Node node = nodes.item(0);
Node attribute = node.getAttributes().getNamedItem(name); Node attribute = node.getAttributes().getNamedItem(name);
if (attribute == null) { if (attribute == null) {
throw new Exception("Unable to find attribute " + Util.printString(name) + throw new Exception("Unable to find attribute " + StringUtil.printString(name) +
" for tag " + Util.printString(tagName)); " for tag " + StringUtil.printString(tagName));
} }
String retVal = attribute.getNodeValue(); String retVal = attribute.getNodeValue();
return retVal; return retVal;

View file

@ -30,7 +30,7 @@ import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL; import javax.management.remote.JMXServiceURL;
import com.raytheon.edex.services.MonitorSrv; import com.raytheon.edex.services.MonitorSrv;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* Uses JMX to obtain latency information for an end-point. Reports queue size, * Uses JMX to obtain latency information for an end-point. Reports queue size,
@ -176,7 +176,7 @@ public class EdexLatencyMonitor extends AEdexMonitor {
Integer queueSize = (Integer)connection.getAttribute(theObject, "QueueSize"); Integer queueSize = (Integer)connection.getAttribute(theObject, "QueueSize");
Long queuedEvents = (Long)connection.getAttribute(theObject, "QueuedEvents"); Long queuedEvents = (Long)connection.getAttribute(theObject, "QueuedEvents");
Long averageTime = (Long)connection.getAttribute(theObject, "AverageExecutionTime"); Long averageTime = (Long)connection.getAttribute(theObject, "AverageExecutionTime");
logger.info(String.format(REPORT_FORMAT,Util.printString(beanName), logger.info(String.format(REPORT_FORMAT,StringUtil.printString(beanName),
queueSize,queuedEvents,averageTime)); queueSize,queuedEvents,averageTime));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -10,5 +10,5 @@ Require-Bundle: com.raytheon.uf.edex.core;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174", com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
org.apache.commons.configuration;bundle-version="1.6.0" org.apache.commons.configuration;bundle-version="1.6.0"
Import-Package: com.raytheon.edex.subscription, Import-Package: com.raytheon.edex.subscription,
com.raytheon.edex.util, com.raytheon.uf.common.util,
org.apache.commons.logging org.apache.commons.logging

View file

@ -31,8 +31,8 @@ import com.raytheon.edex.subscription.ISubscriptionManager;
import com.raytheon.edex.subscription.Script; import com.raytheon.edex.subscription.Script;
import com.raytheon.edex.subscription.Subscription; import com.raytheon.edex.subscription.Subscription;
import com.raytheon.edex.subscription.SubscriptionManager; import com.raytheon.edex.subscription.SubscriptionManager;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
import com.raytheon.uf.edex.core.props.PropertiesFactory; import com.raytheon.uf.edex.core.props.PropertiesFactory;
@ -104,7 +104,7 @@ public class NotifySrv {
.getSubscriptionKey(dataURI); .getSubscriptionKey(dataURI);
// messages = new ArrayList<String>(); // messages = new ArrayList<String>();
logger.info("-subscription exists for " logger.info("-subscription exists for "
+ Util.printString(dataURI)); + StringUtil.printString(dataURI));
Configuration properties = PropertiesFactory.getInstance() Configuration properties = PropertiesFactory.getInstance()
.getConfiguration( .getConfiguration(
ISubscriptionManager.CONFIGURATION_NAME); ISubscriptionManager.CONFIGURATION_NAME);

View file

@ -32,7 +32,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -113,7 +113,7 @@ public class CcfpSeparator extends AbstractRecordSeparator {
public String next() { public String next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return ""; return "";
} else { } else {
return temp; return temp;

View file

@ -49,6 +49,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.common.util.file.FilenameFilters;
import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils; import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
@ -111,8 +112,8 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
FilenameFilters.ACCEPT_FILES, FilenameFilters.ACCEPT_FILES,
FilenameFilters.byFileExtension(".xml")); FilenameFilters.byFileExtension(".xml"));
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, filter,
filter, false); false);
for (File file : thinnedModelFiles) { for (File file : thinnedModelFiles) {
try { try {
@ -247,7 +248,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
throws GribException { throws GribException {
GridCoverage coverage = assembledRecord.getLocation(); GridCoverage coverage = assembledRecord.getLocation();
float[] data = new float[coverage.getNx() * coverage.getNy()]; float[] data = new float[coverage.getNx() * coverage.getNy()];
Arrays.fill(data, Util.GRID_FILL_VALUE); Arrays.fill(data, GridUtil.GRID_FILL_VALUE);
assembledRecord.setMessageData(data); assembledRecord.setMessageData(data);
mergeData(record, assembledRecord, thinned); mergeData(record, assembledRecord, thinned);
try { try {

View file

@ -40,8 +40,8 @@ import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.edex.colormap.ColorMapManager; import com.raytheon.edex.colormap.ColorMapManager;
import com.raytheon.edex.uengine.tasks.ScriptTask; import com.raytheon.edex.uengine.tasks.ScriptTask;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.util.GridUtil;
/** /**
* GribMap task derived from original uEngine GribMap task. Maps grid data to an * GribMap task derived from original uEngine GribMap task. Maps grid data to an
@ -163,7 +163,7 @@ public class GribMap extends ScriptTask {
int pixels = gribData.length; int pixels = gribData.length;
for (int i = 0; i < pixels; i++) { for (int i = 0; i < pixels; i++) {
if (gribData[i] != Util.GRID_FILL_VALUE) { if (gribData[i] != GridUtil.GRID_FILL_VALUE) {
if (max < gribData[i]) { if (max < gribData[i]) {
max = gribData[i]; max = gribData[i];
} }

View file

@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -111,7 +111,7 @@ public class MesowestSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -38,7 +38,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.wmo.message.WMOHeader; import com.raytheon.uf.edex.wmo.message.WMOHeader;
/** /**
@ -149,7 +149,7 @@ public class MetarSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return new byte[0]; return new byte[0];
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -27,8 +27,8 @@ import java.util.UUID;
import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.exception.MicroEngineException;
import com.raytheon.edex.uengine.tasks.ScriptTask; import com.raytheon.edex.uengine.tasks.ScriptTask;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.props.EnvProperties; import com.raytheon.uf.edex.core.props.EnvProperties;
import com.raytheon.uf.edex.core.props.PropertiesFactory; import com.raytheon.uf.edex.core.props.PropertiesFactory;
@ -88,7 +88,7 @@ public class FileOut extends ScriptTask {
/* /*
* make sure there is an output directory defined * make sure there is an output directory defined
*/ */
if (Util.isEmptyString(destDir)) { if (StringUtil.isEmptyString(destDir)) {
// default to uengineOutDir // default to uengineOutDir
destDir = uengineOutDir; destDir = uengineOutDir;
logger.debug("Defaulting destDir to: " + destDir); logger.debug("Defaulting destDir to: " + destDir);
@ -114,7 +114,7 @@ public class FileOut extends ScriptTask {
// get the URI for the image out // get the URI for the image out
String suffix = "." + format; String suffix = "." + format;
if (uri != null && !Util.isEmptyString(uri.toString())) { if (uri != null && !StringUtil.isEmptyString(uri.toString())) {
destFile = new File(uri).getName(); destFile = new File(uri).getName();
if (!destFile.endsWith(suffix)) { if (!destFile.endsWith(suffix)) {
destFile += suffix; destFile += suffix;

View file

@ -35,7 +35,7 @@ import com.raytheon.edex.msg.ResponseMessageInline;
import com.raytheon.edex.uengine.ResponseUtil; import com.raytheon.edex.uengine.ResponseUtil;
import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.exception.MicroEngineException;
import com.raytheon.edex.uengine.tasks.ScriptTask; import com.raytheon.edex.uengine.tasks.ScriptTask;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* Makes an inline response message. Derived from old uEngine * Makes an inline response message. Derived from old uEngine
@ -85,7 +85,7 @@ public class MakeResponseInline extends ScriptTask {
imageData.add(dataItem); imageData.add(dataItem);
} else { } else {
throw new MicroEngineException("unknown data type " throw new MicroEngineException("unknown data type "
+ Util.printString(dataItem.getClass().getName()) + StringUtil.printString(dataItem.getClass().getName())
+ " unable to continue."); + " unable to continue.");
} }
// create the return object - need to call the create method. // create the return object - need to call the create method.

View file

@ -33,7 +33,7 @@ import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.util.IndentPrinter; import org.apache.activemq.util.IndentPrinter;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* Taken from test.ToolSupport, should probably be cleaned up and moved to common? * Taken from test.ToolSupport, should probably be cleaned up and moved to common?
@ -120,7 +120,7 @@ public class JmsSupport {
} }
public MessageConsumer createConsumer(Session session, MessageListener msgListener, String selector) throws JMSException { public MessageConsumer createConsumer(Session session, MessageListener msgListener, String selector) throws JMSException {
MessageConsumer consumer; MessageConsumer consumer;
if(Util.isEmptyString(selector)) { if(StringUtil.isEmptyString(selector)) {
consumer = session.createConsumer(destination); consumer = session.createConsumer(destination);
} else { } else {
consumer = session.createConsumer(destination, selector); consumer = session.createConsumer(destination, selector);

View file

@ -32,7 +32,7 @@ import javax.jms.TextMessage;
import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQQueue;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* Contains utility methods that are specific to the Micro Engine. All * Contains utility methods that are specific to the Micro Engine. All
@ -160,7 +160,7 @@ public class MEUtils {
/* sending the message */ /* sending the message */
/* set the message correlation id */ /* set the message correlation id */
if (Util.isEmptyString(correlationID)) { if (StringUtil.isEmptyString(correlationID)) {
correlationID = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", correlationID = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS",
Calendar.getInstance()); Calendar.getInstance());
} }

View file

@ -51,6 +51,7 @@ import com.raytheon.edex.util.Util;
import com.raytheon.edex.util.XMLUtils; import com.raytheon.edex.util.XMLUtils;
import com.raytheon.uf.common.message.response.ResponseMessageError; import com.raytheon.uf.common.message.response.ResponseMessageError;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
/** /**
@ -93,7 +94,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String receiveTime = request.getParameter("receiveTime"); String receiveTime = request.getParameter("receiveTime");
long receive = 5000; long receive = 5000;
boolean jsEngine = false; boolean jsEngine = false;
theLogger.info("request type is " + Util.printString(requestType)); theLogger.info("request type is " + StringUtil.printString(requestType));
if (requestType != null) { if (requestType != null) {
if (requestType.equals("ascii")) { if (requestType.equals("ascii")) {
actionXML = createActionASCII(request); actionXML = createActionASCII(request);
@ -237,7 +238,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal);
String name = request.getParameter("scriptname"); String name = request.getParameter("scriptname");
if (Util.isEmptyString(name)) { if (StringUtil.isEmptyString(name)) {
name = ""; name = "";
} }
String function = request.getParameter("function"); String function = request.getParameter("function");
@ -249,7 +250,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String imageFormat = request.getParameter("imageformat"); String imageFormat = request.getParameter("imageformat");
String reproject = request.getParameter("reproject"); String reproject = request.getParameter("reproject");
String count = request.getParameter("count"); String count = request.getParameter("count");
if (Util.isEmptyString(count)) { if (StringUtil.isEmptyString(count)) {
count = "1"; count = "1";
} }
boolean subscription = function.equalsIgnoreCase("subscribe"); boolean subscription = function.equalsIgnoreCase("subscribe");
@ -267,15 +268,15 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
action.append("var dataRequest = new RadarRequest();" + eol); action.append("var dataRequest = new RadarRequest();" + eol);
action.append("dataRequest.requestImage(true);" + eol); action.append("dataRequest.requestImage(true);" + eol);
action.append("dataRequest.setCount(" + count + ");" + eol); action.append("dataRequest.setCount(" + count + ");" + eol);
if (!Util.isEmptyString(productCode)) { if (!StringUtil.isEmptyString(productCode)) {
action.append("dataRequest.addList(\"productCode\",\"" action.append("dataRequest.addList(\"productCode\",\""
+ productCode + "\");"); + productCode + "\");");
} }
if (!Util.isEmptyString(location)) { if (!StringUtil.isEmptyString(location)) {
action.append("dataRequest.addParameter(\"icao\",\"" + location action.append("dataRequest.addParameter(\"icao\",\"" + location
+ "\");"); + "\");");
} }
if (!Util.isEmptyString(elevation)) { if (!StringUtil.isEmptyString(elevation)) {
action.append("dataRequest.addParameter(\"primaryElevationAngle\",\"" action.append("dataRequest.addParameter(\"primaryElevationAngle\",\""
+ elevation + "\");"); + elevation + "\");");
} }
@ -311,7 +312,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal);
StringBuffer action = new StringBuffer(); StringBuffer action = new StringBuffer();
String name = request.getParameter("scriptname"); String name = request.getParameter("scriptname");
if (Util.isEmptyString(name)) { if (StringUtil.isEmptyString(name)) {
name = ""; name = "";
} }
String function = request.getParameter("function"); String function = request.getParameter("function");
@ -324,7 +325,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String reproject = request.getParameter("reproject"); String reproject = request.getParameter("reproject");
String count = request.getParameter("count"); String count = request.getParameter("count");
if (Util.isEmptyString(count)) { if (StringUtil.isEmptyString(count)) {
count = "1"; count = "1";
} }
boolean subscription = function.equalsIgnoreCase("subscribe"); boolean subscription = function.equalsIgnoreCase("subscribe");
@ -381,7 +382,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal); String now = String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", cal);
StringBuffer action = new StringBuffer(); StringBuffer action = new StringBuffer();
String name = request.getParameter("scriptname"); String name = request.getParameter("scriptname");
if (Util.isEmptyString(name)) { if (StringUtil.isEmptyString(name)) {
name = "GRIB Request"; name = "GRIB Request";
} }
@ -399,22 +400,22 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
/* create the value for the levelinfo query. */ /* create the value for the levelinfo query. */
StringBuffer levelInfo = new StringBuffer(); StringBuffer levelInfo = new StringBuffer();
if (!Util.isEmptyString(level2)) { if (!StringUtil.isEmptyString(level2)) {
levelInfo.append(level2); levelInfo.append(level2);
} }
if (!Util.isEmptyString(level1)) { if (!StringUtil.isEmptyString(level1)) {
if (!Util.isEmptyString(level2)) { if (!StringUtil.isEmptyString(level2)) {
levelInfo.append("-"); levelInfo.append("-");
} }
levelInfo.append(level1); levelInfo.append(level1);
} }
if (!Util.isEmptyString(units)) { if (!StringUtil.isEmptyString(units)) {
if (levelInfo.length() != 0) { if (levelInfo.length() != 0) {
levelInfo.append("_").append(units); levelInfo.append("_").append(units);
} }
} }
if (Util.isEmptyString(count)) { if (StringUtil.isEmptyString(count)) {
count = "1"; count = "1";
} }
// boolean subscription = function.equalsIgnoreCase("subscribe"); // boolean subscription = function.equalsIgnoreCase("subscribe");
@ -433,11 +434,11 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
action.append("dataRequest.setCount(" + count + ");"); action.append("dataRequest.setCount(" + count + ");");
action.append("dataRequest.addParameter(\"paramid\",\"" + parameter action.append("dataRequest.addParameter(\"paramid\",\"" + parameter
+ "\");" + eol); + "\");" + eol);
if (!Util.isEmptyString(levelInfo.toString())) { if (!StringUtil.isEmptyString(levelInfo.toString())) {
action.append("dataRequest.addParameter(\"levelinfo\",\"" action.append("dataRequest.addParameter(\"levelinfo\",\""
+ levelInfo.toString() + "\");" + eol); + levelInfo.toString() + "\");" + eol);
} }
if (!Util.isEmptyString(forecast)) { if (!StringUtil.isEmptyString(forecast)) {
action.append("dataRequest.addParameter(\"forecasttime\",\"" action.append("dataRequest.addParameter(\"forecasttime\",\""
+ forecast + "\");" + eol); + forecast + "\");" + eol);
} }
@ -516,7 +517,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String timeType = request.getParameter("refTime"); String timeType = request.getParameter("refTime");
String count = request.getParameter("count"); String count = request.getParameter("count");
if (Util.isEmptyString(count)) { if (StringUtil.isEmptyString(count)) {
count = "1"; count = "1";
} }
boolean subscription = function.equalsIgnoreCase("subscribe"); boolean subscription = function.equalsIgnoreCase("subscribe");
@ -576,7 +577,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String station = request.getParameter("station"); String station = request.getParameter("station");
String count = request.getParameter("count"); String count = request.getParameter("count");
if (Util.isEmptyString(count)) { if (StringUtil.isEmptyString(count)) {
count = "1"; count = "1";
} }
boolean subscription = function.equalsIgnoreCase("subscribe"); boolean subscription = function.equalsIgnoreCase("subscribe");
@ -977,7 +978,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
out.println("<center><h2>No Data Available</h2></center><hr>"); out.println("<center><h2>No Data Available</h2></center><hr>");
try { try {
String subresp = getSubscriptionMsg(responseStr); String subresp = getSubscriptionMsg(responseStr);
if (!Util.isEmptyString(subresp)) { if (!StringUtil.isEmptyString(subresp)) {
out.println("<table>\n"); out.println("<table>\n");
out.println("<tr><th colspan=2>Subscription results:</th></tr>\n"); out.println("<tr><th colspan=2>Subscription results:</th></tr>\n");
out.println(subresp); out.println(subresp);
@ -1033,7 +1034,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
htmlStr.append("</tr></table></center>\n"); htmlStr.append("</tr></table></center>\n");
try { try {
String subresp = getSubscriptionMsg(responseStr); String subresp = getSubscriptionMsg(responseStr);
if (!Util.isEmptyString(subresp)) { if (!StringUtil.isEmptyString(subresp)) {
htmlStr.append("<table>\n"); htmlStr.append("<table>\n");
htmlStr.append("<tr><th colspan=2>Subscription results:</th></tr>\n"); htmlStr.append("<tr><th colspan=2>Subscription results:</th></tr>\n");
htmlStr.append(subresp); htmlStr.append(subresp);
@ -1520,7 +1521,7 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
(type.equalsIgnoreCase("taf") ? "taf" : "obs")); (type.equalsIgnoreCase("taf") ? "taf" : "obs"));
dataUri.append("/.+?"); dataUri.append("/.+?");
dataUri.append("/").append(type); dataUri.append("/").append(type);
if (Util.isEmptyString(station)) { if (StringUtil.isEmptyString(station)) {
dataUri.append("/.+?"); dataUri.append("/.+?");
} else { } else {
dataUri.append("/").append(station); dataUri.append("/").append(station);
@ -1544,20 +1545,20 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
String level2 = request.getParameter("level2"); String level2 = request.getParameter("level2");
String units = request.getParameter("unit"); String units = request.getParameter("unit");
String forecast = request.getParameter("forecast"); String forecast = request.getParameter("forecast");
if (Util.isEmptyString(forecast)) { if (StringUtil.isEmptyString(forecast)) {
forecast = ".+"; forecast = ".+";
} }
StringBuffer levelInfo = new StringBuffer(); StringBuffer levelInfo = new StringBuffer();
if (!Util.isEmptyString(level2)) { if (!StringUtil.isEmptyString(level2)) {
levelInfo.append(level2); levelInfo.append(level2);
} }
if (!Util.isEmptyString(level1)) { if (!StringUtil.isEmptyString(level1)) {
if (!Util.isEmptyString(level2)) { if (!StringUtil.isEmptyString(level2)) {
levelInfo.append("-"); levelInfo.append("-");
} }
levelInfo.append(level1); levelInfo.append(level1);
} }
if (!Util.isEmptyString(units)) { if (!StringUtil.isEmptyString(units)) {
if (levelInfo.length() != 0) { if (levelInfo.length() != 0) {
levelInfo.append("_").append(units); levelInfo.append("_").append(units);
} }
@ -1585,15 +1586,15 @@ public class RunAction extends javax.servlet.http.HttpServlet implements
private String makeRadarDataURI(HttpServletRequest request) private String makeRadarDataURI(HttpServletRequest request)
throws Exception { throws Exception {
String location = request.getParameter("station"); String location = request.getParameter("station");
if (Util.isEmptyString(location)) { if (StringUtil.isEmptyString(location)) {
location = ".+?"; location = ".+?";
} }
String productCode = request.getParameter("productcode"); String productCode = request.getParameter("productcode");
if (Util.isEmptyString(productCode)) { if (StringUtil.isEmptyString(productCode)) {
productCode = ".+?"; productCode = ".+?";
} }
String elevation = request.getParameter("elevation"); String elevation = request.getParameter("elevation");
if (Util.isEmptyString(elevation)) { if (StringUtil.isEmptyString(elevation)) {
elevation = ".+?"; elevation = ".+?";
} }
StringBuffer dataUri = new StringBuffer(); StringBuffer dataUri = new StringBuffer();

View file

@ -41,11 +41,11 @@ import org.hibernate.annotations.Immutable;
import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction; import org.hibernate.annotations.OnDeleteAction;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.gfe.serialize.ParmIDAdapter; import com.raytheon.uf.common.dataplugin.gfe.serialize.ParmIDAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter;
import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -315,11 +315,11 @@ public class ParmID implements Comparable<ParmID> {
return false; return false;
} }
if (!Util.isAlnum(parmName)) { if (!StringUtil.isAlnum(parmName)) {
return false; return false;
} }
if (!Util.isAlnum(parmLevel)) { if (!StringUtil.isAlnum(parmLevel)) {
return false; return false;
} }

View file

@ -23,6 +23,8 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
@ -272,4 +274,53 @@ public final class StringUtil {
return sb.toString(); return sb.toString();
} }
/**
* Wraps input Object.toString (if non-null) in [] for display (helps show
* empty string in output).<br>
* Example: printString("test") would display "[test]"<br>
* printString(null) would display "[null]"
*
* @param obj
* An object instance
* @return The object's {@link Object#toString()} value
*/
public static final String printString(Object obj) {
return "[" + (obj == null ? "null" : obj.toString()) + "]";
}
/**
* Simple check if str is null or empty.
*
* @param str
* A string to check
* @return true if string is null or empty, false otherwise
*/
public static final boolean isEmptyString(String str) {
return (str == null) || ("".equals(str));
}
/**
* Determines if the given string is all alpha-numeric characters
*
* @param str
* The string to test
* @return True if the string is alpha-numeric
*/
public static boolean isAlnum(String str) {
int count = 0;
Pattern pat = Pattern.compile("\\p{Alnum}");
Matcher mat = pat.matcher(str);
while (mat.find()) {
count++;
}
if (count == str.length()) {
return true;
} else {
return false;
}
}
} }

View file

@ -24,7 +24,6 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage; import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage;
import com.raytheon.uf.common.datadelivery.registry.Parameter; import com.raytheon.uf.common.datadelivery.registry.Parameter;
import com.raytheon.uf.common.datadelivery.retrieval.xml.RetrievalAttribute; import com.raytheon.uf.common.datadelivery.retrieval.xml.RetrievalAttribute;
@ -32,6 +31,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.gridcoverage.GridCoverage; import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilities; import com.raytheon.uf.edex.datadelivery.retrieval.util.ResponseProcessingUtilities;
/** /**
@ -171,7 +171,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
for (int x = 0; x < nx; x++) { for (int x = 0; x < nx; x++) {
float value = origVals[(nx * y) + x]; float value = origVals[(nx * y) + x];
if (value == missingValue) { if (value == missingValue) {
value = Util.GRID_FILL_VALUE; value = GridUtil.GRID_FILL_VALUE;
} }
returnVals[(nx * revy) + x] = value; returnVals[(nx * revy) + x] = value;
} }
@ -196,7 +196,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
float[] vals = new float[(nx * ny)]; float[] vals = new float[(nx * ny)];
for (int y = 0; y < ny; y++) { for (int y = 0; y < ny; y++) {
for (int x = 0; x < nx; x++) { for (int x = 0; x < nx; x++) {
vals[(nx * y) + x] = Util.GRID_FILL_VALUE; vals[(nx * y) + x] = GridUtil.GRID_FILL_VALUE;
} }
} }
// writes in the values of the sub cut array actually received from // writes in the values of the sub cut array actually received from
@ -228,7 +228,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
// fill it up // fill it up
for (int y = 0; y < ny; y++) { for (int y = 0; y < ny; y++) {
for (int x = 0; x < nx; x++) { for (int x = 0; x < nx; x++) {
vals[(nx * y) + x] = Util.GRID_FILL_VALUE; vals[(nx * y) + x] = GridUtil.GRID_FILL_VALUE;
} }
} }
// writes in the values of the sub cut array // writes in the values of the sub cut array
@ -238,7 +238,7 @@ public class GridMetadataAdapter extends AbstractMetadataAdapter<Integer> {
vals[bin] = subValues[bin]; vals[bin] = subValues[bin];
if (x == (dnx - 1)) { if (x == (dnx - 1)) {
for (int i = 0; i < offset; i++) { for (int i = 0; i < offset; i++) {
vals[bin + i] = Util.GRID_FILL_VALUE; vals[bin + i] = GridUtil.GRID_FILL_VALUE;
} }
} }
} }

View file

@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.datadelivery.registry.Collection; import com.raytheon.uf.common.datadelivery.registry.Collection;
import com.raytheon.uf.common.datadelivery.registry.DataLevelType; import com.raytheon.uf.common.datadelivery.registry.DataLevelType;
import com.raytheon.uf.common.datadelivery.registry.DataLevelType.LevelType; import com.raytheon.uf.common.datadelivery.registry.DataLevelType.LevelType;
@ -58,6 +57,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.ImmutableDate; import com.raytheon.uf.common.time.util.ImmutableDate;
import com.raytheon.uf.common.util.CollectionUtil; import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.edex.datadelivery.retrieval.Link; import com.raytheon.uf.edex.datadelivery.retrieval.Link;
import com.raytheon.uf.edex.datadelivery.retrieval.LinkStore; import com.raytheon.uf.edex.datadelivery.retrieval.LinkStore;
import com.raytheon.uf.edex.datadelivery.retrieval.MetaDataParser; import com.raytheon.uf.edex.datadelivery.retrieval.MetaDataParser;
@ -138,7 +138,9 @@ class OpenDAPMetaDataParser extends MetaDataParser {
if (levelType.equals(LevelType.MB) if (levelType.equals(LevelType.MB)
|| levelType.equals(LevelType.SEAB)) { || levelType.equals(LevelType.SEAB)) {
List<Double> levelList = OpenDAPParseUtility.getInstance().parseLevels(gdsmd.getUrl(), serviceConfig.getConstantValue("LEV")); List<Double> levelList = OpenDAPParseUtility.getInstance()
.parseLevels(gdsmd.getUrl(),
serviceConfig.getConstantValue("LEV"));
LookupManager.getInstance().modifyLevelLookups( LookupManager.getInstance().modifyLevelLookups(
collectionName, dz, levMin, levMax, levelList); collectionName, dz, levMin, levMax, levelList);
} }
@ -185,9 +187,8 @@ class OpenDAPMetaDataParser extends MetaDataParser {
* @return * @return
*/ */
private Map<String, Parameter> getParameters(DAS das, private Map<String, Parameter> getParameters(DAS das,
GriddedDataSet dataSet, GriddedDataSet dataSet, GriddedDataSetMetaData gdsmd, Link link,
GriddedDataSetMetaData gdsmd, Link link, Collection collection, Collection collection, String dataDateFormat) {
String dataDateFormat) {
final String collectionName = dataSet.getCollectionName(); final String collectionName = dataSet.getCollectionName();
final String url = gdsmd.getUrl(); final String url = gdsmd.getUrl();
@ -229,7 +230,7 @@ class OpenDAPMetaDataParser extends MetaDataParser {
final String missing_value = serviceConfig final String missing_value = serviceConfig
.getConstantValue("MISSING_VALUE"); .getConstantValue("MISSING_VALUE");
final String fill_value = serviceConfig.getConstantValue("FILL_VALUE"); final String fill_value = serviceConfig.getConstantValue("FILL_VALUE");
final String fill = new Float(Util.GRID_FILL_VALUE).toString(); final String fill = new Float(GridUtil.GRID_FILL_VALUE).toString();
// process globals first // process globals first
// process time // process time
@ -238,19 +239,20 @@ class OpenDAPMetaDataParser extends MetaDataParser {
AttributeTable at = das.getAttributeTable(timecon); AttributeTable at = das.getAttributeTable(timecon);
Time time = new Time(); Time time = new Time();
// number of times // number of times
time.setNumTimes(new Integer(OpenDAPParseUtility.getInstance().trim(at time.setNumTimes(new Integer(OpenDAPParseUtility.getInstance()
.getAttribute(size).getValueAt(0))).intValue()); .trim(at.getAttribute(size).getValueAt(0))).intValue());
// minimum time val // minimum time val
time.setStart(OpenDAPParseUtility.getInstance().parseDate(at.getAttribute( time.setStart(OpenDAPParseUtility.getInstance().parseDate(
minimum).getValueAt(0))); at.getAttribute(minimum).getValueAt(0)));
// maximum time val // maximum time val
time.setEnd(OpenDAPParseUtility.getInstance().parseDate(at.getAttribute(maximum) time.setEnd(OpenDAPParseUtility.getInstance().parseDate(
.getValueAt(0))); at.getAttribute(maximum).getValueAt(0)));
// format of time // format of time
time.setFormat(dataDateFormat); time.setFormat(dataDateFormat);
// step // step
List<String> step = OpenDAPParseUtility.getInstance().parseTimeStep(at List<String> step = OpenDAPParseUtility
.getAttribute(time_step).getValueAt(0)); .getInstance()
.parseTimeStep(at.getAttribute(time_step).getValueAt(0));
time.setStep(new Double(step.get(0)).doubleValue()); time.setStep(new Double(step.get(0)).doubleValue());
time.setStepUnit(Time.findStepUnit(step.get(1)) time.setStepUnit(Time.findStepUnit(step.get(1))
.getDurationUnit()); .getDurationUnit());
@ -264,20 +266,26 @@ class OpenDAPMetaDataParser extends MetaDataParser {
try { try {
AttributeTable at = das.getAttributeTable(lat); AttributeTable at = das.getAttributeTable(lat);
// ny // ny
gridCoverage.setNy(new Integer(OpenDAPParseUtility.getInstance().trim(at gridCoverage.setNy(new Integer(OpenDAPParseUtility
.getAttribute(size).getValueAt(0))).intValue()); .getInstance()
.trim(at.getAttribute(size).getValueAt(0))).intValue());
// dy // dy
gridCoverage.setDy(new Float(OpenDAPParseUtility.getInstance().trim(at gridCoverage.setDy(new Float(OpenDAPParseUtility.getInstance()
.getAttribute(resolution).getValueAt(0))).floatValue()); .trim(at.getAttribute(resolution).getValueAt(0)))
.floatValue());
// first latitude point // first latitude point
gridCoverage.setLa1(new Double(OpenDAPParseUtility.getInstance().trim(at gridCoverage.setLa1(new Double(OpenDAPParseUtility
.getAttribute(minimum).getValueAt(0))).doubleValue()); .getInstance().trim(
at.getAttribute(minimum).getValueAt(0)))
.doubleValue());
upperLeft.y = new Double(OpenDAPParseUtility.getInstance().trim(at.getAttribute( upperLeft.y = new Double(OpenDAPParseUtility.getInstance()
maximum).getValueAt(0))).doubleValue(); .trim(at.getAttribute(maximum).getValueAt(0)))
.doubleValue();
lowerRight.y = new Double(OpenDAPParseUtility.getInstance().trim(at lowerRight.y = new Double(OpenDAPParseUtility.getInstance()
.getAttribute(minimum).getValueAt(0))).doubleValue(); .trim(at.getAttribute(minimum).getValueAt(0)))
.doubleValue();
} catch (Exception le) { } catch (Exception le) {
logParsingException(lat, "Latitude", collectionName, url); logParsingException(lat, "Latitude", collectionName, url);
@ -288,17 +296,21 @@ class OpenDAPMetaDataParser extends MetaDataParser {
try { try {
AttributeTable at = das.getAttributeTable(lon); AttributeTable at = das.getAttributeTable(lon);
// nx // nx
gridCoverage.setNx(new Integer(OpenDAPParseUtility.getInstance().trim(at gridCoverage.setNx(new Integer(OpenDAPParseUtility
.getAttribute(size).getValueAt(0))).intValue()); .getInstance()
.trim(at.getAttribute(size).getValueAt(0))).intValue());
// dx // dx
gridCoverage.setDx(new Float(OpenDAPParseUtility.getInstance().trim(at gridCoverage.setDx(new Float(OpenDAPParseUtility.getInstance()
.getAttribute(resolution).getValueAt(0))).floatValue()); .trim(at.getAttribute(resolution).getValueAt(0)))
.floatValue());
// min Lon // min Lon
double minLon = new Double(OpenDAPParseUtility.getInstance().trim(at double minLon = new Double(OpenDAPParseUtility.getInstance()
.getAttribute(minimum).getValueAt(0))).doubleValue(); .trim(at.getAttribute(minimum).getValueAt(0)))
.doubleValue();
// max Lon // max Lon
double maxLon = new Double(OpenDAPParseUtility.getInstance().trim(at double maxLon = new Double(OpenDAPParseUtility.getInstance()
.getAttribute(maximum).getValueAt(0))).doubleValue(); .trim(at.getAttribute(maximum).getValueAt(0)))
.doubleValue();
gridCoverage.setLo1(minLon); gridCoverage.setLo1(minLon);
upperLeft.x = minLon; upperLeft.x = minLon;
@ -312,12 +324,13 @@ class OpenDAPMetaDataParser extends MetaDataParser {
if (das.getAttributeTable(lev) != null) { if (das.getAttributeTable(lev) != null) {
try { try {
AttributeTable at = das.getAttributeTable(lev); AttributeTable at = das.getAttributeTable(lev);
dz = new Double(OpenDAPParseUtility.getInstance().trim(at.getAttribute( dz = new Double(OpenDAPParseUtility.getInstance().trim(
resolution).getValueAt(0))).doubleValue(); at.getAttribute(resolution).getValueAt(0)))
levMin = new Float(OpenDAPParseUtility.getInstance().trim(at.getAttribute( .doubleValue();
minimum).getValueAt(0))).floatValue(); levMin = new Float(OpenDAPParseUtility.getInstance().trim(
levMax = new Float(OpenDAPParseUtility.getInstance().trim(at.getAttribute( at.getAttribute(minimum).getValueAt(0))).floatValue();
maximum).getValueAt(0))).floatValue(); levMax = new Float(OpenDAPParseUtility.getInstance().trim(
at.getAttribute(maximum).getValueAt(0))).floatValue();
hasLevels = true; hasLevels = true;
} catch (Exception le) { } catch (Exception le) {
@ -329,10 +342,11 @@ class OpenDAPMetaDataParser extends MetaDataParser {
try { try {
AttributeTable at = das.getAttributeTable(nc_global); AttributeTable at = das.getAttributeTable(nc_global);
dataSet.setDataSetType(DataType dataSet.setDataSetType(DataType
.valueOfIgnoreCase(OpenDAPParseUtility.getInstance().trim(at .valueOfIgnoreCase(OpenDAPParseUtility.getInstance()
.getAttribute(data_type).getValueAt(0)))); .trim(at.getAttribute(data_type).getValueAt(0))));
String description = at.getAttribute(title).getValueAt(0); String description = at.getAttribute(title).getValueAt(0);
gdsmd.setDataSetDescription(OpenDAPParseUtility.getInstance().trim(description)); gdsmd.setDataSetDescription(OpenDAPParseUtility.getInstance()
.trim(description));
} catch (Exception ne) { } catch (Exception ne) {
logParsingException(nc_global, "Global Dataset Info", logParsingException(nc_global, "Global Dataset Info",
collectionName, url); collectionName, url);
@ -387,8 +401,8 @@ class OpenDAPMetaDataParser extends MetaDataParser {
// descriptions, default fill, or missing vals. // descriptions, default fill, or missing vals.
String description = "unknown description"; String description = "unknown description";
try { try {
description = OpenDAPParseUtility.getInstance().trim(at description = OpenDAPParseUtility.getInstance().trim(
.getAttribute(long_name).getValueAt(0)); at.getAttribute(long_name).getValueAt(0));
} catch (Exception iae) { } catch (Exception iae) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
@ -396,11 +410,13 @@ class OpenDAPMetaDataParser extends MetaDataParser {
} }
parm.setDefinition(description); parm.setDefinition(description);
parm.setUnits(OpenDAPParseUtility.getInstance().parseUnits(description)); parm.setUnits(OpenDAPParseUtility.getInstance().parseUnits(
description));
try { try {
parm.setMissingValue(OpenDAPParseUtility.getInstance().trim(at parm.setMissingValue(OpenDAPParseUtility.getInstance()
.getAttribute(missing_value).getValueAt(0))); .trim(at.getAttribute(missing_value)
.getValueAt(0)));
} catch (Exception iae) { } catch (Exception iae) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Invalid DAP missing value block! " + name); "Invalid DAP missing value block! " + name);
@ -408,8 +424,9 @@ class OpenDAPMetaDataParser extends MetaDataParser {
} }
try { try {
parm.setFillValue(OpenDAPParseUtility.getInstance().trim(at parm.setFillValue(OpenDAPParseUtility
.getAttribute(fill_value).getValueAt(0))); .getInstance()
.trim(at.getAttribute(fill_value).getValueAt(0)));
} catch (Exception iae) { } catch (Exception iae) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Invalid DAP fill value block! " + name); "Invalid DAP fill value block! " + name);
@ -640,8 +657,8 @@ class OpenDAPMetaDataParser extends MetaDataParser {
List<String> vals = null; List<String> vals = null;
try { try {
vals = OpenDAPParseUtility.getInstance().getDataSetNameAndCycle(linkKey, vals = OpenDAPParseUtility.getInstance()
collection.getName()); .getDataSetNameAndCycle(linkKey, collection.getName());
} catch (Exception e1) { } catch (Exception e1) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Failed to get cycle and dataset name set...", e1); "Failed to get cycle and dataset name set...", e1);

View file

@ -114,7 +114,7 @@ public class ACARSDecoder extends AbstractDecoder {
public static final void main(String [] args) { public static final void main(String [] args) {
com.raytheon.edex.util.Util.isEmptyString(" "); com.raytheon.uf.common.util.StringUtil.isEmptyString(" ");
ACARSRecord r = new ACARSRecord("/acars/2011-03-21_17:58:32.0/2TPYR4JA/null/42.85/-84.92/9754"); ACARSRecord r = new ACARSRecord("/acars/2011-03-21_17:58:32.0/2TPYR4JA/null/42.85/-84.92/9754");
System.out.println(r.getLatitude()); System.out.println(r.getLatitude());

View file

@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class AirmetSeparator extends AbstractRecordSeparator { public class AirmetSeparator extends AbstractRecordSeparator {
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
@ -82,7 +82,7 @@ public class AirmetSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -105,7 +105,7 @@ public class AtcfSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class AwwSeparator extends AbstractRecordSeparator { public class AwwSeparator extends AbstractRecordSeparator {
private final Logger log = Logger.getLogger(getClass().getName()); private final Logger log = Logger.getLogger(getClass().getName());
@ -98,7 +98,7 @@ public class AwwSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class ConvSigmetSeparator extends AbstractRecordSeparator { public class ConvSigmetSeparator extends AbstractRecordSeparator {
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
@ -82,7 +82,7 @@ public class ConvSigmetSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
public class FfgSeparator extends AbstractRecordSeparator { public class FfgSeparator extends AbstractRecordSeparator {
@ -89,7 +89,7 @@ public class FfgSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -36,7 +36,7 @@ import org.apache.log4j.Logger;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
public class IdftSeparator extends AbstractRecordSeparator { public class IdftSeparator extends AbstractRecordSeparator {
@ -114,7 +114,7 @@ public class IdftSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();
@ -145,7 +145,7 @@ public class IdftSeparator extends AbstractRecordSeparator {
public byte[] getRecord() { public byte[] getRecord() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();
@ -163,7 +163,7 @@ public class IdftSeparator extends AbstractRecordSeparator {
public byte[] getBulletin() { public byte[] getBulletin() {
try { try {
String temp = bulIterator.next(); String temp = bulIterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class IntlSigmetSeparator extends AbstractRecordSeparator { public class IntlSigmetSeparator extends AbstractRecordSeparator {
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
@ -88,7 +88,7 @@ public class IntlSigmetSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -12,7 +12,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -91,7 +91,7 @@ public class NcccfpSeparator extends AbstractRecordSeparator {
public String next() { public String next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return ""; return "";
} else { } else {
return temp; return temp;

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.GridUtil;
import com.raytheon.uf.common.util.file.FilenameFilters; import com.raytheon.uf.common.util.file.FilenameFilters;
import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.database.plugin.PluginFactory;
@ -102,8 +103,8 @@ public class NcgridAssembler {
FilenameFilters.ACCEPT_FILES, FilenameFilters.ACCEPT_FILES,
FilenameFilters.byFileExtension(".xml")); FilenameFilters.byFileExtension(".xml"));
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, filter,
filter, false); false);
for (File file : thinnedModelFiles) { for (File file : thinnedModelFiles) {
// System.out.println(" load thin models file=" + file.getName()); // System.out.println(" load thin models file=" + file.getName());
@ -111,7 +112,8 @@ public class NcgridAssembler {
try { try {
NccompositeModel model = (NccompositeModel) SerializationUtil NccompositeModel model = (NccompositeModel) SerializationUtil
.jaxbUnmarshalFromXmlFile(file.getPath()); .jaxbUnmarshalFromXmlFile(file.getPath());
//System.out.println(" load thin models model=" + model.getModelName()); // System.out.println(" load thin models model=" +
// model.getModelName());
ncthinnedModels.put(model.getModelName(), model); ncthinnedModels.put(model.getModelName(), model);
} catch (SerializationException e) { } catch (SerializationException e) {
@ -199,15 +201,15 @@ public class NcgridAssembler {
* @return The new grib record * @return The new grib record
* @throws Exception * @throws Exception
*/ */
private NcgribRecord processGrid(NcgribRecord record, NccompositeModel thinned) private NcgribRecord processGrid(NcgribRecord record,
throws Exception { NccompositeModel thinned) throws Exception {
NcgribDao dao = (NcgribDao) PluginFactory.getInstance() NcgribDao dao = (NcgribDao) PluginFactory.getInstance().getPluginDao(
.getPluginDao("ncgrib"); "ncgrib");
String modelName = record.getModelInfo().getModelName(); String modelName = record.getModelInfo().getModelName();
String dataURI = record.getDataURI(); String dataURI = record.getDataURI();
String assembledDataURI = dataURI.replace(modelName, thinned String assembledDataURI = dataURI.replace(modelName,
.getModelName()); thinned.getModelName());
List<?> result = dao.queryBySingleCriteria("dataURI", assembledDataURI); List<?> result = dao.queryBySingleCriteria("dataURI", assembledDataURI);
NcgribRecord assembledRecord = null; NcgribRecord assembledRecord = null;
@ -240,8 +242,9 @@ public class NcgridAssembler {
* @return The composite NcgribRecord * @return The composite NcgribRecord
* @throws Exception * @throws Exception
*/ */
private NcgribRecord mergeData(NcgribRecord record, NcgribRecord assembledRecord, private NcgribRecord mergeData(NcgribRecord record,
NcgribDao dao, NccompositeModel thinned) throws Exception { NcgribRecord assembledRecord, NcgribDao dao,
NccompositeModel thinned) throws Exception {
String modelName = record.getModelInfo().getModelName(); String modelName = record.getModelInfo().getModelName();
NcgridCoverage coverage = record.getModelInfo().getLocation(); NcgridCoverage coverage = record.getModelInfo().getLocation();
@ -264,9 +267,11 @@ public class NcgridAssembler {
"Error assembling ncgrids. Thinned ncgrid definition does not contain " "Error assembling ncgrids. Thinned ncgrid definition does not contain "
+ modelName); + modelName);
} }
Util.insertSubgrid(assembledData, Util.resizeDataTo2D((float[]) record Util.insertSubgrid(
.getMessageData(), coverage.getNx(), coverage.getNy()), nx assembledData,
* modIndex, 0, nx, ny); Util.resizeDataTo2D((float[]) record.getMessageData(),
coverage.getNx(), coverage.getNy()), nx * modIndex, 0,
nx, ny);
assembledRecord.setMessageData(Util.resizeDataTo1D(assembledData, assembledRecord.setMessageData(Util.resizeDataTo1D(assembledData,
(int) sizes[1], (int) sizes[0])); (int) sizes[1], (int) sizes[0]));
@ -279,8 +284,8 @@ public class NcgridAssembler {
* Creates the composite grib record and stores it to the HDF5 repository * Creates the composite grib record and stores it to the HDF5 repository
* *
* @param record * @param record
* The recieved NcgribRecord used to initialize the composite grid * The recieved NcgribRecord used to initialize the composite
* with * grid with
* @param dao * @param dao
* An instance of the grib data access object * An instance of the grib data access object
* @param thinned * @param thinned
@ -297,7 +302,7 @@ public class NcgridAssembler {
float[] data = new float[(gridLoc.getNx() * 4) * gridLoc.getNy()]; float[] data = new float[(gridLoc.getNx() * 4) * gridLoc.getNy()];
for (int i = 0; i < data.length; i++) { for (int i = 0; i < data.length; i++) {
data[i] = Util.GRID_FILL_VALUE; data[i] = GridUtil.GRID_FILL_VALUE;
} }
NcgribRecord newRecord = new NcgribRecord(); NcgribRecord newRecord = new NcgribRecord();
NcgribModel newModel = new NcgribModel(record.getModelInfo()); NcgribModel newModel = new NcgribModel(record.getModelInfo());
@ -310,8 +315,8 @@ public class NcgridAssembler {
try { try {
newModel = NcgribModelCache.getInstance().getModel(newModel); newModel = NcgribModelCache.getInstance().getModel(newModel);
} catch (DataAccessLayerException e) { } catch (DataAccessLayerException e) {
throw new GribException("Unable to get ncep model info from the cache!", throw new GribException(
e); "Unable to get ncep model info from the cache!", e);
} }
newRecord.setModelInfo(newModel); newRecord.setModelInfo(newModel);
newRecord.setMessageData(data); newRecord.setMessageData(data);

View file

@ -40,8 +40,8 @@ import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.edex.colormap.ColorMapManager; import com.raytheon.edex.colormap.ColorMapManager;
import com.raytheon.edex.uengine.tasks.ScriptTask; import com.raytheon.edex.uengine.tasks.ScriptTask;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.util.GridUtil;
/** /**
* GribMap task derived from original uEngine GribMap task. Maps grid data to an * GribMap task derived from original uEngine GribMap task. Maps grid data to an
@ -163,7 +163,7 @@ public class NcgribMap extends ScriptTask {
int pixels = gribData.length; int pixels = gribData.length;
for (int i = 0; i < pixels; i++) { for (int i = 0; i < pixels; i++) {
if (gribData[i] != Util.GRID_FILL_VALUE) { if (gribData[i] != GridUtil.GRID_FILL_VALUE) {
if (max < gribData[i]) { if (max < gribData[i]) {
max = gribData[i]; max = gribData[i];
} }

View file

@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class NcPafmSeparator extends AbstractRecordSeparator { public class NcPafmSeparator extends AbstractRecordSeparator {
@ -97,7 +97,7 @@ public class NcPafmSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -38,7 +38,7 @@ import org.apache.log4j.Logger;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
public class NcScdSeparator extends AbstractRecordSeparator { public class NcScdSeparator extends AbstractRecordSeparator {
@ -91,7 +91,7 @@ public class NcScdSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -31,7 +31,8 @@
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
public class NcUairSeparator extends AbstractRecordSeparator { public class NcUairSeparator extends AbstractRecordSeparator {
@ -108,7 +109,7 @@ import org.apache.log4j.Logger;
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[])null; return (byte[])null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -25,7 +25,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
public class NonConvSigmetSeparator extends AbstractRecordSeparator { public class NonConvSigmetSeparator extends AbstractRecordSeparator {
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
@ -88,7 +88,7 @@ public class NonConvSigmetSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -23,7 +23,8 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
/** /**
@ -107,7 +108,7 @@ public class StormTrackSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
public class TcmSeparator extends AbstractRecordSeparator { public class TcmSeparator extends AbstractRecordSeparator {
@ -100,7 +100,7 @@ public class TcmSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
/** /**
* *
@ -113,7 +113,7 @@ public class WcpSeparator extends AbstractRecordSeparator {
public byte[] next() { public byte[] next() {
try { try {
String temp = iterator.next(); String temp = iterator.next();
if (Util.isEmptyString(temp)) { if (StringUtil.isEmptyString(temp)) {
return (byte[]) null; return (byte[]) null;
} else { } else {
return temp.getBytes(); return temp.getBytes();

View file

@ -9,7 +9,7 @@ import java.util.UUID;
import com.raytheon.edex.uengine.exception.MicroEngineException; import com.raytheon.edex.uengine.exception.MicroEngineException;
import com.raytheon.edex.uengine.tasks.ScriptTask; import com.raytheon.edex.uengine.tasks.ScriptTask;
import com.raytheon.edex.util.Util; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.props.EnvProperties; import com.raytheon.uf.edex.core.props.EnvProperties;
import com.raytheon.uf.edex.core.props.PropertiesFactory; import com.raytheon.uf.edex.core.props.PropertiesFactory;
@ -65,7 +65,7 @@ public class GridOut extends ScriptTask {
/* /*
* make sure there is an output directory defined * make sure there is an output directory defined
*/ */
if (Util.isEmptyString(destDir)) { if (StringUtil.isEmptyString(destDir)) {
// default to uengineOutDir // default to uengineOutDir
destDir = uengineOutDir; destDir = uengineOutDir;
// logger.debug("Defaulting destDir to: " + destDir); // logger.debug("Defaulting destDir to: " + destDir);
@ -91,7 +91,7 @@ public class GridOut extends ScriptTask {
// get the URI for the image out // get the URI for the image out
String suffix = "." + format; String suffix = "." + format;
if (uri != null && !Util.isEmptyString(uri.toString())) { if (uri != null && !StringUtil.isEmptyString(uri.toString())) {
destFile = new File(uri).getName(); destFile = new File(uri).getName();
if (!destFile.endsWith(suffix)) { if (!destFile.endsWith(suffix)) {
destFile += suffix; destFile += suffix;