Merge tag 'OB_14.3.1-32m' into omaha_14.4.1

Conflicts:
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java
	cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources.xml
	edexOsgi/build.edex/esb/conf/logback-ingest.xml
	edexOsgi/com.raytheon.uf.edex.core/src/com/raytheon/uf/edex/core/IMessageProducer.java
	edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/MessageProducer.java

Former-commit-id: f2f468fb55 [formerly 79a5171143] [formerly a8a97501ac] [formerly a8a97501ac [formerly a16abe1b8b]] [formerly 9de825c332 [formerly a8a97501ac [formerly a16abe1b8b] [formerly 9de825c332 [formerly 565efec2ebe5a3a1a009d213a77617f4a593aa6b]]]]
Former-commit-id: 9de825c332
Former-commit-id: d4eb1c8ea6b361e80e76a7f995f909b42100e4aa [formerly 29ce0315e9304041fd7bae8c79ce27a5695cbd1b] [formerly 548f32e067 [formerly 5e6aa15038]]
Former-commit-id: 548f32e067
Former-commit-id: 2955b2190c
This commit is contained in:
Steve Harris 2014-11-10 08:42:01 -06:00
commit 2c93b5896b
27 changed files with 412 additions and 292 deletions

View file

@ -102,6 +102,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here.
* 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier
* 09/09/2014 3592 randerso Added call to SampleSetManager.dispose()
* 10/30/2014 3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -223,7 +224,7 @@ public class DataManager {
NotificationManagerJob.addObserver("edex.alerts.gfe", this.router);
this.parmManager = new ParmManager(this);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this.parmManager);
GFEParmCacheInitJob cacheJob = new GFEParmCacheInitJob(this);
cacheJob.setSystem(true);
cacheJob.schedule();
this.refManager = new ReferenceSetManager(this);

View file

@ -29,6 +29,7 @@ package com.raytheon.viz.gfe.core.internal;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 25, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -38,12 +39,22 @@ package com.raytheon.viz.gfe.core.internal;
public class DataMgrInitStatus {
private boolean parmCacheInitDone = false;
private boolean iscInitDone = false;
private boolean selectTRMgrDone = false;
private boolean sampleSetMgrDone = false;
public boolean isParmCacheInitDone() {
return parmCacheInitDone;
}
public void setParmCacheInitDone(boolean parmCacheInitDone) {
this.parmCacheInitDone = parmCacheInitDone;
}
public boolean isIscInitDone() {
return iscInitDone;
}
@ -69,7 +80,8 @@ public class DataMgrInitStatus {
}
public boolean isDone() {
return iscInitDone && sampleSetMgrDone && selectTRMgrDone;
return parmCacheInitDone && iscInitDone && sampleSetMgrDone
&& selectTRMgrDone;
}
}

View file

@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.viz.gfe.core.IParmManager;
import com.raytheon.viz.gfe.core.DataManager;
/**
* Job for initializing a cache in memory of all available parms.
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.core.IParmManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 19, 2011 njensen Initial creation
* Oct 30, 2014 #3775 randerso Added parmCacheInit to initStatus
*
* </pre>
*
@ -45,11 +46,11 @@ import com.raytheon.viz.gfe.core.IParmManager;
public class GFEParmCacheInitJob extends Job {
private IParmManager parmMgr;
private DataManager dataMgr;
public GFEParmCacheInitJob(IParmManager pm) {
public GFEParmCacheInitJob(DataManager dataMgr) {
super("Parm Cache Initialization");
this.parmMgr = pm;
this.dataMgr = dataMgr;
}
/*
@ -61,7 +62,8 @@ public class GFEParmCacheInitJob extends Job {
@Override
protected IStatus run(IProgressMonitor monitor) {
long t0 = System.currentTimeMillis();
this.parmMgr.getAllAvailableParms();
this.dataMgr.getParmManager().getAllAvailableParms();
this.dataMgr.getInitStatus().setParmCacheInitDone(true);
System.out.println("GFEParmCacheInitJob took: "
+ (System.currentTimeMillis() - t0) + "ms");

View file

@ -143,6 +143,8 @@ import com.raytheon.viz.gfe.types.MutableInteger;
* 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded.
* 05/28/2014 #3110 randerso Remove #3105 changes
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
* 10/08/2014 #3684 randerso Minor code optimization
* 10/30/2014 #3775 randerso Changed to createMutableDb before getting initial database inventory
* </pre>
*
* @author chammack
@ -359,9 +361,6 @@ public class ParmManager implements IParmManager, IMessageClient {
dbCategories = Arrays.asList(prefs.getStringArray("dbTypes"));
this.availableDatabases = new HashSet<DatabaseID>(
getDatabaseInventory());
this.dbInvChangeListener = new AbstractGFENotificationObserver<DBInvChangeNotification>(
DBInvChangeNotification.class) {
@ -1282,6 +1281,20 @@ public class ParmManager implements IParmManager, IMessageClient {
}
private void updateDatabaseLists() throws GFEServerException {
boolean containsMutable = false;
DatabaseID mutableDbId = getMutableDatabase();
if (mutableDbId.isValid()) {
// createMutableDb is it doesn't already exist
ServerResponse<?> sr = this.dataManager.getClient().createNewDb(
mutableDbId);
containsMutable = sr.isOkay();
}
if (this.availableDatabases == null) {
this.availableDatabases = new HashSet<DatabaseID>(
getDatabaseInventory());
}
this.availableServerDatabases = new ArrayList<DatabaseID>(
availableDatabases);
this.availableVCParmDatabases = determineVCParmDatabases(vcModules);
@ -1307,39 +1320,24 @@ public class ParmManager implements IParmManager, IMessageClient {
}
Collections.sort(this.availableServerDatabases);
DatabaseID mutableDbId = getMutableDatabase();
if (mutableDbId.isValid()) {
boolean containsMutable = availableServerDatabases
.contains(mutableDbId);
if (!containsMutable) {
ServerResponse<?> sr = this.dataManager.getClient()
.createNewDb(mutableDbId);
containsMutable = sr.isOkay();
if (containsMutable) {
// order of isc databases is important, since ISCDataAccess will
// look for the first match. That's why we don't use
// availableDbs()
// and simplify the three loops into one.
for (DatabaseID dbid : availableVCParmDatabases) {
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
if (containsMutable) {
// order of isc databases is important, since ISCDataAccess will
// look for the first match. That's why we don't use
// availableDbs()
// and simplify the three loops into one.
for (DatabaseID dbid : availableVCParmDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
for (DatabaseID dbid : availableVParmDatabases) {
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
for (DatabaseID dbid : availableVParmDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC")
&& !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
for (DatabaseID dbid : availableServerDatabases) {
if (dbid.getModelName().equals("ISC") && !iscDbs.contains(dbid)) {
iscDbs.add(dbid);
}
}
}
@ -2920,7 +2918,7 @@ public class ParmManager implements IParmManager, IMessageClient {
List<DatabaseID> newAdditions = new ArrayList<DatabaseID>(additions);
newAdditions.removeAll(availableDatabases);
availableDatabases.addAll(additions);
availableDatabases.addAll(newAdditions);
availableDatabases.removeAll(deletions);
List<ParmID> toDelete = new ArrayList<ParmID>();

View file

@ -85,6 +85,8 @@ import com.raytheon.viz.gfe.rsc.GFEFonts;
* 02/19/2008 dfitch Initial creation.
* Apr 7, 2009 #2212 randerso Reimplemented
* Jun 23, 2011 #9897 ryu Update static variables on new GFE config
* Oct 29, 2014 #3776 randerso Cached fill patterns used in history mode
* Renamed static variables to match AWIPS standards
*
* </pre>
*
@ -108,18 +110,22 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
private static final Date BASE_DATE = new Date(0);
private static Color DEFAULT_COLOR = new Color(null,
private static final Color DEFAULT_COLOR = new Color(null,
RGBColors.getRGBColor("gray75"));
protected static Pattern LockedByMe;
protected static Pattern lockedByMe;
public static Pattern LockedByOther;
public static Pattern lockedByOther;
protected static Color TimeBlockVisible_color;
protected static Map<RGB, Pattern> modifiedByMe = new HashMap<RGB, Pattern>();
protected static Color TimeBlockActive_color;
protected static Map<RGB, Pattern> modifiedByOther = new HashMap<RGB, Pattern>();
protected static Color TimeBlockInvisible_color;
protected static Color timeBlockVisible_color;
protected static Color timeBlockActive_color;
protected static Color timeBlockInvisible_color;
protected static boolean showEditorTimeLines;
@ -140,10 +146,10 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
if ((pattern = prefs.getString("LockedByMe_pattern")).isEmpty()) {
pattern = "WHOLE";
}
if (LockedByMe != null) {
LockedByMe.dispose();
if (lockedByMe != null) {
lockedByMe.dispose();
}
LockedByMe = FillPatterns.getSWTPattern(
lockedByMe = FillPatterns.getSWTPattern(
RGBColors.getRGBColor(color), pattern);
if ((color = prefs.getString("LockedByOther_color")).isEmpty()) {
@ -153,40 +159,50 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
.isEmpty()) {
pattern = "WHOLE";
}
if (LockedByOther != null) {
LockedByOther.dispose();
if (lockedByOther != null) {
lockedByOther.dispose();
}
LockedByOther = FillPatterns.getSWTPattern(
lockedByOther = FillPatterns.getSWTPattern(
RGBColors.getRGBColor(color), pattern);
for (RGB key : modifiedByMe.keySet()) {
Pattern pat = modifiedByMe.remove(key);
pat.dispose();
}
for (RGB key : modifiedByOther.keySet()) {
Pattern pat = modifiedByOther.remove(key);
pat.dispose();
}
if ((color = prefs.getString("TimeBlockVisible_color"))
.isEmpty()) {
color = "White";
}
if (TimeBlockVisible_color != null) {
TimeBlockVisible_color.dispose();
if (timeBlockVisible_color != null) {
timeBlockVisible_color.dispose();
}
TimeBlockVisible_color = new Color(Display.getDefault(),
timeBlockVisible_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color));
if ((color = prefs.getString("TimeBlockActive_color"))
.isEmpty()) {
color = "Yellow";
}
if (TimeBlockActive_color != null) {
TimeBlockActive_color.dispose();
if (timeBlockActive_color != null) {
timeBlockActive_color.dispose();
}
TimeBlockActive_color = new Color(Display.getDefault(),
timeBlockActive_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color));
if ((color = prefs.getString("TimeBlockInvisible_color"))
.isEmpty()) {
color = "Gray50";
}
if (TimeBlockInvisible_color != null) {
TimeBlockInvisible_color.dispose();
if (timeBlockInvisible_color != null) {
timeBlockInvisible_color.dispose();
}
TimeBlockInvisible_color = new Color(Display.getDefault(),
timeBlockInvisible_color = new Color(Display.getDefault(),
RGBColors.getRGBColor(color));
showEditorTimeLines = true;
@ -496,7 +512,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
LockTable lockTable = parm.getLockTable();
gc.setBackgroundPattern(LockedByMe);
gc.setBackgroundPattern(lockedByMe);
for (TimeRange timeRange : lockTable.lockedByMe()) {
if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) {
Rectangle rect = computeLockRect(timeRange);
@ -505,7 +521,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
}
gc.setBackgroundPattern(LockedByOther);
gc.setBackgroundPattern(lockedByOther);
for (TimeRange timeRange : lockTable.lockedByOther()) {
if (timeRange.overlaps(this.gridManager.getVisibleTimeRange())) {
Rectangle rect = computeLockRect(timeRange);
@ -519,7 +535,7 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
TimeRange dataTR[]) {
GC gc = event.gc;
TimeRange visibleRange = gridManager.getVisibleTimeRange();
gc.setForeground(TimeBlockInvisible_color);
gc.setForeground(timeBlockInvisible_color);
gc.setLineStyle(DATA_BLOCK_LINE_STYLE);
gc.setLineWidth(0);
@ -684,18 +700,18 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
}
if (!active && !visible) {
gc.setBackground(TimeBlockInvisible_color);
gc.setBackground(timeBlockInvisible_color);
gc.fillRectangle(rect);
} else if (!active && visible) {
gc.setBackground(TimeBlockVisible_color);
gc.setBackground(timeBlockVisible_color);
gc.fillRectangle(rect);
} else if (active && visible) {
gc.setBackground(TimeBlockActive_color);
gc.setBackground(timeBlockActive_color);
gc.fillRectangle(rect);
} else {
gc.setBackground(TimeBlockInvisible_color);
gc.setBackground(timeBlockInvisible_color);
gc.fillRectangle(rect);
gc.setForeground(TimeBlockActive_color);
gc.setForeground(timeBlockActive_color);
gc.drawRectangle(rect);
}
}
@ -760,13 +776,21 @@ public class GridBar implements IMessageClient, IParmInventoryChangedListener,
patt = Activator.getDefault().getPreferenceStore()
.getString("HistoryUserModPattern_Me");
if (!patt.isEmpty()) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
fp = modifiedByMe.get(color.getRGB());
if (fp == null) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
modifiedByMe.put(color.getRGB(), fp);
}
}
} else {
patt = Activator.getDefault().getPreferenceStore()
.getString("HistoryUserModPattern_Other");
if (!patt.isEmpty()) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
fp = modifiedByOther.get(color.getRGB());
if (fp == null) {
fp = FillPatterns.getSWTPattern(color.getRGB(), patt);
modifiedByOther.put(color.getRGB(), fp);
}
}
}
}

View file

@ -52,9 +52,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.GFEPreference;
import com.raytheon.viz.gfe.constants.StatusConstants;
import com.raytheon.viz.gfe.core.griddata.IGridData;
import com.raytheon.viz.gfe.core.msgs.IParmInventoryChangedListener;
import com.raytheon.viz.gfe.core.parm.Parm;
@ -78,6 +76,7 @@ import com.raytheon.viz.gfe.temporaleditor.mousehandler.TitleBarMouseHandler;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 30, 2009 2159 rjpeter Initial creation.
* Oct 29, 2014 #3776 randerso Renamed static variables to match AWIPS standards
* </pre>
*
* @author rjpeter
@ -85,7 +84,9 @@ import com.raytheon.viz.gfe.temporaleditor.mousehandler.TitleBarMouseHandler;
*/
public abstract class AbstractTemporalEditorBar implements
Comparable<AbstractTemporalEditorBar> {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(AbstractTemporalEditorBar.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AbstractTemporalEditorBar.class);
protected static final Color DEFAULT_COLOR = Display.getDefault()
.getSystemColor(SWT.COLOR_GRAY);
@ -552,7 +553,7 @@ public abstract class AbstractTemporalEditorBar implements
for (Parm parm : parmList) {
LockTable lockTable = parm.getLockTable();
gc.setBackgroundPattern(GridBar.LockedByOther);
gc.setBackgroundPattern(GridBar.lockedByOther);
for (TimeRange timeRange : lockTable.lockedByOther()) {
if (timeRange.overlaps(range)) {
Rectangle rect = teUtil.timeRangeToPixels(timeRange);
@ -643,7 +644,7 @@ public abstract class AbstractTemporalEditorBar implements
scaleCanvas.redraw();
editorCanvas.redraw();
bottomLabel.redraw();
}
}
}
/**

View file

@ -34,6 +34,28 @@
</encoder>
</appender>
<!-- activeTableChange log -->
<appender name="activeTableLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${edex.home}/logs/edex-${edex.run.mode}-activeTableChange-%d{yyyyMMdd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%-5p %d [%t] %c{0}: %m%n</pattern>
</encoder>
</appender>
<appender name="activeTableChangeLogAsync" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="activeTableChangeLog" />
</appender>
<logger name="ActiveTableChange" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="activeTableChangeLogAsync" />
</logger>
<!-- Purge log -->
<appender name="purge" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

View file

@ -31,25 +31,9 @@
depends-on="commonTimeRegistered, gfeDbRegistered, levelFactoryInitialized">
</bean>
<bean id="gfeNotifyFilter" class="com.raytheon.edex.plugin.gfe.server.notify.GfeNotificationFilter"/>
<bean id="ifpServer" class="com.raytheon.edex.plugin.gfe.server.IFPServer.Wrapper"/>
<camelContext id="gfe-common-camel" xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
<route id="gfeNotify">
<from uri="vm:edex.gfeNotification?size=5000"/>
<doTry>
<filter>
<method bean="gfeNotifyFilter" method="isGfeNotification"/>
<bean ref="serializationUtil" method="transformToThrift"/>
<to uri="jms-generic:topic:edex.alerts.gfe?timeToLive=60000"/>
</filter>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:gfeNotify?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="notifyIfpServer">
<from uri="jms-generic:topic:edex.alerts.gfe?threadName=notifyIfpServer-edex.alerts.gfe" />

View file

@ -79,6 +79,7 @@ import com.raytheon.uf.edex.site.notify.SendSiteActivationNotifications;
* May 15, 2014 #3157 dgilling Mark getActiveSites() as deprecated.
* Jul 09, 2014 #3146 randerso Eliminated redundant evaluation of serverConfig
* Sent activation failure message to alertViz
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
* </pre>
*
* @author njensen

View file

@ -39,6 +39,8 @@ import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabase;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabase;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.VGridDatabase;
import com.raytheon.edex.plugin.gfe.server.lock.LockManager;
import com.raytheon.edex.plugin.gfe.smartinit.SmartInitQueue;
@ -127,6 +129,14 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
* Cleaned up commented code.
* 07/21/2014 #3415 randerso Fixed d2dGridDataPurged to not purge NetCDF databases.
* 09/21/2014 #3648 randerso Changed to do version purging when new databases are added
* 10/07/2014 #3684 randerso Restructured IFPServer start up.
* Reordered handling of DbInvChangeNotification
* Don't process GFENotifications sent by this JVM
* Prevent createDB from creating databases that are immediately purged
* Send DBInvChangeNotifications at site activation so new D2D data
* ingested while deactivated gets recognized
* 10/27/2014 #3766 randerso Fixed return type and javadoc for createNewDb
*
* </pre>
*
* @author bphillip
@ -158,6 +168,8 @@ public class GridParmManager {
private LockManager lockMgr;
private TopoDatabaseManager topoMgr;
private Map<DatabaseID, GridDatabase> dbMap = new ConcurrentHashMap<DatabaseID, GridDatabase>();
/**
@ -165,18 +177,16 @@ public class GridParmManager {
*
* @param siteID
* @param config
* @param lockMgr
* @throws PluginException
* @throws DataAccessLayerException
* @throws GfeException
*/
public GridParmManager(String siteID, IFPServerConfig config,
LockManager lockMgr) throws PluginException,
DataAccessLayerException, GfeException {
public GridParmManager(String siteID, IFPServerConfig config)
throws PluginException, DataAccessLayerException, GfeException {
this.siteID = siteID;
this.config = config;
this.lockMgr = lockMgr;
this.lockMgr.setGridParmMgr(this);
this.lockMgr = new LockManager(siteID, config, this);
this.topoMgr = new TopoDatabaseManager(siteID, config);
initializeManager();
}
@ -188,6 +198,20 @@ public class GridParmManager {
NetCDFDatabaseManager.removeDatabases(siteID);
}
/**
* @return the lockMgr
*/
public LockManager getLockMgr() {
return lockMgr;
}
/**
* @return the topoMgr
*/
public TopoDatabaseManager getTopoMgr() {
return topoMgr;
}
private GridParm gridParm(ParmID id) {
GridDatabase db = getDatabase(id.getDbId());
if (db != null) {
@ -879,6 +903,10 @@ public class GridParmManager {
if (notify) {
createDbNotification(Arrays.asList(dbId), purged);
}
// always notify on purges
else {
createDbNotification(null, purged);
}
}
}
@ -889,11 +917,11 @@ public class GridParmManager {
* Create a new database
*
* @param dbId
* @return ServerResponse containing the created database
* @return ServerResponse containing status only
*/
public ServerResponse<GridDatabase> createNewDb(DatabaseID dbId) {
public ServerResponse<?> createNewDb(DatabaseID dbId) {
ServerResponse<GridDatabase> sr = new ServerResponse<GridDatabase>();
ServerResponse<?> sr = new ServerResponse<Object>();
if (!dbId.getFormat().equals(DataType.GRID)) {
sr.addMessage("Invalid database id for createNewDb(): " + dbId);
@ -903,6 +931,8 @@ public class GridParmManager {
GridDatabase db = this.getDatabase(dbId);
if (db != null) {
return sr; // database already exists
} else {
sr.addMessage("Unable to create database: " + dbId);
}
// is it a singleton database?
@ -1042,42 +1072,64 @@ public class GridParmManager {
return sr;
}
private ServerResponse<GridDatabase> createDB(DatabaseID id) {
private ServerResponse<GridDatabase> createDB(DatabaseID dbId) {
// TODO: consider merging this into getDatabase()
ServerResponse<GridDatabase> status = new ServerResponse<GridDatabase>();
if (!id.isValid() || !id.getFormat().equals(DataType.GRID)) {
if (!dbId.isValid() || !dbId.getFormat().equals(DataType.GRID)) {
status.addMessage("Database id "
+ id
+ dbId
+ " is not valid, or is not a grid-type. Cannot create database.");
return status;
}
// create the grid database
// get the dbConfig
IFPGridDatabase db = null;
GridDbConfig dbConfig = this.config.gridDbConfig(id);
GridDbConfig dbConfig = this.config.gridDbConfig(dbId);
if (dbConfig == null) {
status.addMessage("Unable to obtain GridDbConfig information for creation"
+ " in createDB() for " + id);
+ " in createDB() for " + dbId);
} else {
// don't create if this version would be immediately purgeable
List<DatabaseID> existing = new ArrayList<DatabaseID>();
for (DatabaseID id : this.dbMap.keySet()) {
if (id.sameModel(dbId)) {
existing.add(id);
}
}
if (!existing.contains(dbId)) {
existing.add(dbId);
}
// sort by model time (most recent first)
Collections.sort(existing);
int desiredVersions = this.config.desiredDbVersions(dbId);
if (existing.indexOf(dbId) >= desiredVersions) {
status.addMessage("Unable to create " + dbId
+ " as it would exceed the desired number of versions");
return status;
}
// attempt to create the GridDatabase
db = new IFPGridDatabase(id, dbConfig);
db = new IFPGridDatabase(dbId, dbConfig);
if (db.databaseIsValid()) {
// get databaseID object from database
DatabaseID dbId = db.getDbId();
DatabaseID id = db.getDbId();
if (dbId.getRemovedDate() != null) {
if (id.getRemovedDate() != null) {
// mark database as not removed
try {
GFEDao gfeDao = new GFEDao();
gfeDao.setDatabaseRemovedDate(dbId, null);
statusHandler.info("Database " + dbId + " restored");
gfeDao.setDatabaseRemovedDate(id, null);
statusHandler.info("Database " + id + " restored");
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to mark database restored: " + dbId, e);
"Unable to mark database restored: " + id, e);
}
}
} else {
status.addMessage("Database " + id + " is not valid.");
status.addMessage("Database " + dbId + " is not valid.");
db = null;
}
}
@ -1086,12 +1138,13 @@ public class GridParmManager {
// mark database as removed
try {
GFEDao gfeDao = new GFEDao();
gfeDao.setDatabaseRemovedDate(id, new Date());
statusHandler.warn("Database " + id + " marked for removal in "
gfeDao.setDatabaseRemovedDate(dbId, new Date());
statusHandler.warn("Database " + dbId
+ " marked for removal in "
+ GFEDao.REMOVED_DB_PURGE_TIME + " days.");
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to mark database removed: " + id, e);
"Unable to mark database removed: " + dbId, e);
}
}
@ -1112,6 +1165,13 @@ public class GridParmManager {
private void initializeManager() throws GfeException,
DataAccessLayerException, PluginException {
// add the topo database
TopoDatabase topoDb = topoMgr.getTopoDatabase();
if (topoDb != null) {
this.addDB(topoDb);
}
// get existing list (of just GRIDs)
GFEDao gfeDao = new GFEDao();
List<DatabaseID> inventory = gfeDao.getDatabaseInventory(siteID);
@ -1126,8 +1186,12 @@ public class GridParmManager {
}
// create the databases (the list should now only contain GRID dbs)
List<DatabaseID> added = new ArrayList<DatabaseID>(inventory.size());
for (DatabaseID dbId : inventory) {
getDatabase(dbId, false);
GridDatabase db = getDatabase(dbId, false);
if (db != null) {
added.add(db.getDbId());
}
}
NetCDFDatabaseManager.initializeNetCDFDatabases(config);
@ -1140,7 +1204,8 @@ public class GridParmManager {
D2DSatDatabase satDb = new D2DSatDatabase(config);
addDB(satDb);
initD2DDbs();
added.addAll(initD2DDbs());
createDbNotification(added, null);
// only fire smartInits if queue is instantiated
SmartInitQueue queue = SmartInitQueue.getQueue();
@ -1156,7 +1221,9 @@ public class GridParmManager {
boolean clearTime = false;
try {
for (DatabaseID dbId : this.dbMap.keySet()) {
if (dbId.getDbType().equals("D2D")) {
if (dbId.getDbType().equals("D2D")
&& !config.initModels(dbId.getModelName())
.isEmpty()) {
statusHandler.info("Firing smartinit for: " + dbId);
VGridDatabase db = (VGridDatabase) getDatabase(dbId);
SortedSet<Date> validTimes = db.getValidTimes();
@ -1179,7 +1246,8 @@ public class GridParmManager {
}
}
private void initD2DDbs() throws GfeException {
private List<DatabaseID> initD2DDbs() {
List<DatabaseID> added = new ArrayList<DatabaseID>();
for (String d2dModelName : config.getD2dModels()) {
try {
// get dbId to get desiredDbVersions (date doesn't matter)
@ -1191,13 +1259,17 @@ public class GridParmManager {
d2dModelName, desiredVersions)) {
dbId = D2DGridDatabase.getDbId(d2dModelName, refTime,
config);
getDatabase(dbId, false);
GridDatabase db = getDatabase(dbId, false);
if (db != null) {
added.add(db.getDbId());
}
}
} catch (Exception e) {
statusHandler.error("Error initializing D2D model: "
+ d2dModelName, e);
}
}
return (added);
}
/**
@ -1218,6 +1290,9 @@ public class GridParmManager {
}
D2DGridDatabase db = (D2DGridDatabase) getDatabase(dbId, true);
if (db == null) {
continue;
}
GridUpdateNotification gun = db.update(record);
if (gun != null) {
@ -1247,7 +1322,7 @@ public class GridParmManager {
public void filterSatelliteRecords(List<SatelliteRecord> records) {
DatabaseID dbId = D2DSatDatabase.getDbId(siteID);
D2DSatDatabase db = (D2DSatDatabase) getDatabase(dbId);
D2DSatDatabase db = (D2DSatDatabase) getDatabase(dbId, true);
List<GridUpdateNotification> guns = new LinkedList<GridUpdateNotification>();
for (SatelliteRecord record : records) {
@ -1343,7 +1418,7 @@ public class GridParmManager {
} else if (req.isDatabaseRequest()) {
// get the parm list for this database
GridDatabase db = this.getDatabase(req.getDbId());
GridDatabase db = this.getDatabase(req.getDbId(), true);
if (db != null) {
List<ParmID> parmList = db.getParmList().getPayload();
for (ParmID pid : parmList) {
@ -1398,7 +1473,8 @@ public class GridParmManager {
private void createDbNotification(List<DatabaseID> additions,
List<DatabaseID> deletions) {
if (!additions.isEmpty() || !deletions.isEmpty()) {
if ((additions != null && !additions.isEmpty())
|| (deletions != null && !deletions.isEmpty())) {
DBInvChangeNotification notify = new DBInvChangeNotification(
additions, deletions, siteID);
SendNotifications.send(notify);
@ -1409,30 +1485,33 @@ public class GridParmManager {
* @param notif
*/
public void handleGfeNotification(GfeNotification notif) {
// TODO: add UUID or some other identifier (hostname/process id?) to
// notif so we can recognize
// and not process notifications sent by this GridParmManager instance
// Don't handle notifications sent by this JVM
if (notif.isLocal()) {
return;
}
if (notif instanceof DBInvChangeNotification) {
DBInvChangeNotification invChanged = (DBInvChangeNotification) notif;
// handle additions first to try to get old out-of-synch versions
// are purged sooner
for (DatabaseID dbId : invChanged.getAdditions()) {
this.getDatabase(dbId, false);
}
for (DatabaseID dbId : invChanged.getDeletions()) {
deallocateDb(dbId, false);
}
ServerResponse<GridDatabase> sr = new ServerResponse<GridDatabase>();
for (DatabaseID dbId : invChanged.getAdditions()) {
this.getDatabase(dbId, false);
}
if (!sr.isOkay()) {
statusHandler.error("Error updating GridParmManager: "
+ sr.message());
}
} else if (notif instanceof GridUpdateNotification) {
DatabaseID satDbId = D2DSatDatabase.getDbId(siteID);
GridUpdateNotification gun = (GridUpdateNotification) notif;
if (gun.getParmId().getDbId().equals(satDbId)) {
D2DSatDatabase db = (D2DSatDatabase) this.dbMap.get(satDbId);
db.update(gun);
DatabaseID dbid = gun.getParmId().getDbId();
// get the database as an extra attempt to
// keep the IFPServers in sync
GridDatabase db = getDatabase(dbid, false);
if (db instanceof D2DSatDatabase) {
((D2DSatDatabase) db).update(gun);
}
}
}
@ -1440,7 +1519,7 @@ public class GridParmManager {
/**
* @param db
*/
public void addDB(GridDatabase db) {
private void addDB(GridDatabase db) {
DatabaseID dbId = db.getDbId();
statusHandler.info("addDB called, adding " + dbId);
this.dbMap.put(dbId, db);
@ -1529,14 +1608,9 @@ public class GridParmManager {
// process the inventory looking for "old" unwanted databases
List<DatabaseID> purged = new ArrayList<DatabaseID>();
String model = modelToPurge.getModelName();
String site = modelToPurge.getSiteId();
String type = modelToPurge.getDbType();
int count = 0;
for (DatabaseID dbId : currentInv) {
// new series?
if (dbId.getSiteId().equals(site) && dbId.getDbType().equals(type)
&& dbId.getModelName().equals(model)) {
if (dbId.sameModel(modelToPurge)) {
// process the id and determine whether it should be purged
count++;

View file

@ -60,8 +60,9 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 30, 2013 2044 randerso Initial creation
* Nov 20, 2013 #2331 randerso Added getTopoData method
* May 30, 2013 #2044 randerso Initial creation
* Nov 20, 2013 #2331 randerso Added getTopoData method
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
*
* </pre>
*
@ -191,26 +192,21 @@ public class IFPServer {
return activeServers.get(siteID);
}
String siteId;
private String siteId;
IFPServerConfig config;
private IFPServerConfig config;
GridParmManager gridParmMgr;
LockManager lockMgr;
TopoDatabaseManager topoMgr; // TODO do we need this?
private GridParmManager gridParmMgr;
private IFPServer(String siteId, IFPServerConfig config)
throws DataAccessLayerException, PluginException, GfeException {
this.siteId = siteId;
this.config = config;
this.lockMgr = new LockManager(siteId, config);
this.gridParmMgr = new GridParmManager(siteId, config, lockMgr);
this.topoMgr = new TopoDatabaseManager(siteId, config, gridParmMgr);
statusHandler.info("MapManager initializing...");
new MapManager(config);
this.gridParmMgr = new GridParmManager(siteId, config);
}
private void dispose() {
@ -258,14 +254,14 @@ public class IFPServer {
* @return the lockMgr
*/
public LockManager getLockMgr() {
return lockMgr;
return this.gridParmMgr.getLockMgr();
}
/**
* @return the topoMgr
*/
public TopoDatabaseManager getTopoMgr() {
return topoMgr;
return this.gridParmMgr.getTopoMgr();
}
/**
@ -317,8 +313,6 @@ public class IFPServer {
*/
public static void filterDataURINotifications(
DataURINotificationMessage message) throws Exception {
// ITimer timer = TimeUtil.getTimer();
// timer.start();
List<GridRecord> gridRecords = new LinkedList<GridRecord>();
List<SatelliteRecord> satRecords = new LinkedList<SatelliteRecord>();
@ -332,26 +326,12 @@ public class IFPServer {
for (IFPServer ifpServer : getActiveServers()) {
if (!gridRecords.isEmpty()) {
// TODO: remove this info before check in
String msg = "Processing " + gridRecords.size()
+ " grid DataURINotifications";
statusHandler.info(msg);
ifpServer.getGridParmMgr().filterGridRecords(gridRecords);
}
if (!satRecords.isEmpty()) {
// TODO: remove this info before check in
String msg = "Processing " + satRecords.size()
+ " satellite DataURINotifications";
statusHandler.info(msg);
ifpServer.getGridParmMgr().filterSatelliteRecords(satRecords);
}
}
// timer.stop();
// perfLog.logDuration(
// "GfeIngestNotificationFilter: processing DataURINotificationMessage",
// timer.getElapsedTime());
}
/**
@ -362,7 +342,7 @@ public class IFPServer {
* @return topo gridslice
*/
public ServerResponse<ScalarGridSlice> getTopoData(GridLocation gloc) {
return this.topoMgr.getTopoData(gloc);
return getTopoMgr().getTopoData(gloc);
}
}

View file

@ -30,7 +30,6 @@ import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
@ -76,6 +75,7 @@ import com.raytheon.uf.common.topo.TopoQuery;
* code cleanup
* Nov 20, 2013 #2331 randerso Changed return type of getTopoData
* Feb 11, 2014 #2788 randerso Set missing data points to 0 to match A1
* Oct 07, 2014 #3684 randerso Restructured IFPServer start up
*
* </pre>
*
@ -101,10 +101,8 @@ public class TopoDatabaseManager {
*
* @param siteID
* @param config
* @param gridMgr
*/
public TopoDatabaseManager(String siteID, IFPServerConfig config,
GridParmManager gridMgr) {
public TopoDatabaseManager(String siteID, IFPServerConfig config) {
this.config = config;
statusHandler.info("Topography Manager started for " + siteID);
@ -119,15 +117,20 @@ public class TopoDatabaseManager {
// create the disk cache
createDiskCache(gloc);
// Add the topo database.
statusHandler.info("Topography Manager ready for " + siteID);
}
/**
* @return the topo database
*/
public TopoDatabase getTopoDatabase() {
TopoDatabase tdb = new TopoDatabase(this.config, this);
if (tdb.databaseIsValid()) {
gridMgr.addDB(tdb);
return tdb;
} else {
statusHandler.error("Invalid Topo database");
}
statusHandler.info("Topography Manager ready for " + siteID);
return null;
}
/**

View file

@ -67,6 +67,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* fixed inefficiencies in querying/merging
* 06/13/13 #2044 randerso Converted from singleton to instance per
* site managed by IFPServer
* 10/07/2014 #3684 randerso Restructured IFPServer start up
* </pre>
*
* @author bphillip
@ -91,21 +92,12 @@ public class LockManager {
*
* @param siteId
* @param config
*/
public LockManager(String siteId, IFPServerConfig config) {
this.siteId = siteId;
this.config = config;
}
/**
* Sets the GridParmManager instance to be used by this LockManager.
*
* Done post construction since GridParmManager and LockManager have
* references to each other
*
* @param gridParmMgr
*/
public void setGridParmMgr(GridParmManager gridParmMgr) {
public LockManager(String siteId, IFPServerConfig config,
GridParmManager gridParmMgr) {
this.siteId = siteId;
this.config = config;
this.gridParmMgr = gridParmMgr;
}

View file

@ -1,53 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.plugin.gfe.server.notify;
import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification;
/**
* TODO Add Description
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 3, 2008 njensen Initial creation
* </pre>
*
* @author njensen
* @version 1.0
*/
public class GfeNotificationFilter {
public boolean isGfeNotification(Object body) {
Object obj = body;
if (body instanceof List) {
List<?> list = (List<?>) body;
if (list.size() > 0) {
obj = list.get(0);
}
}
return obj instanceof GfeNotification;
}
}

View file

@ -49,6 +49,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Jul 25, 2012 #957 dgilling Implement getEditAreaNames().
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer
* Nov 20, 2013 #2331 randerso Changed return type of getTopoData
* Oct 08, 2014 #3684 randerso Changed createDB to return status
* Oct 27, 2014 #3766 randerso Fixed return type for createDB
*
* </pre>
*
@ -98,13 +100,10 @@ public class InitClient {
*
* @param key
*/
public void createDB(String key) {
public ServerResponse<?> createDB(String key) {
DatabaseID id = new DatabaseID(key);
ServerResponse<?> sr = ifpServer.getGridParmMgr().createNewDb(id);
if (!sr.isOkay()) {
statusHandler.error("Error creating database " + id + ": "
+ sr.message());
}
return sr;
}
/**

View file

@ -23,14 +23,11 @@ package com.raytheon.edex.plugin.gfe.util;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification;
import com.raytheon.uf.common.dataplugin.gfe.util.GfeUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.core.EdexException;
/**
* Sends GFE notifications to the GFE notify JMS topic.
@ -43,14 +40,16 @@ import com.raytheon.uf.edex.core.EdexException;
* 09/22/09 3058 rjpeter changed to utility.
* 06/12/13 2099 dgilling Remove error when passed empty list of
* notifications.
* 10/08/14 #3684 randerso Changed to send directly to JMS topic
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
public class SendNotifications {
protected static final transient Log logger = LogFactory
.getLog(SendNotifications.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(SendNotifications.class);
public static ServerResponse<?> send(GfeNotification notification) {
List<GfeNotification> notifications = new ArrayList<GfeNotification>();
@ -66,12 +65,11 @@ public class SendNotifications {
}
try {
EDEXUtil.getMessageProducer().sendAsync(GfeUtil.NOTIFY,
EDEXUtil.getMessageProducer().sendAsyncThriftUri(
"jms-generic:topic:edex.alerts.gfe?timeToLive=60000",
notifications);
// logger.info("Sending " + notifications.size() + " "
// + notifications.get(0).getClass().getSimpleName());
} catch (EdexException e) {
logger.error("Error sending gfe notification", e);
} catch (Exception e) {
statusHandler.error("Error sending gfe notification", e);
sr.addMessage("Error sending gfe notification");
}
return sr;

View file

@ -1223,6 +1223,7 @@ else: #######DCS3501 WEST_CONUS
('HPCqpf', 'HPCQPF'),
('HPCqpfNDFD', 'HPCERP'),
('RFCqpf', 'RFCQPF'),
('HRRR', 'HRRR'),
#DR3511 'HPCdelta',
'GLERL',
'WNAWAVE238',

View file

@ -28,7 +28,8 @@
# 04/04/13 #1787 randerso fix validTime check to work with accumulative parms
# fix logging so you can actually determine why
# a smartInit is not calculating a parameter
# Oct 29, 2013 2476 njensen Improved getting wx/discrete keys when retrieving data
# 10/29/2013 #2476 njensen Improved getting wx/discrete keys when retrieving data
# 10/27/2014 #3766 randerso Changed _getLatest to include error text returned from InitClient.createDB()
#
##
import string, sys, re, time, types, getopt, fnmatch, LogStream, DatabaseID, JUtil, AbsTime, TimeRange
@ -325,7 +326,9 @@ class Forecaster(GridUtilities):
msg = "No databases for " + self._srcName
LogStream.logProblem(msg)
return
#sys.exit(1)
if self.newdb() is None:
return
self.__topo = self.getTopo() * .3048
srcdbkeys = self.srcdb().getKeys()
@ -551,6 +554,9 @@ class Forecaster(GridUtilities):
start = time.time()
self.__init()
if self.newdb() is None:
return
msgDest = "Destination database:" + self.newdb().getModelIdentifier()
if validTime is not None:
@ -647,10 +653,16 @@ class Forecaster(GridUtilities):
break
if singletonNeeded:
newdb = newdb[:-13] + '00000000_0000'
newdb = self.getDb(newdb)
else:
client.createDB(newdb)
newdb = self.getDb(newdb)
sr = client.createDB(newdb)
if sr.isOkay():
newdb = self.getDb(newdb)
else:
msg = "Unable to create database for " + str(newdb) + ":\n" + \
str(sr.message())
LogStream.logProblem(msg)
newdb = None
return srcdb, newdb

View file

@ -19,7 +19,7 @@
further_licensing_information.
-->
<latLonGridCoverage>
<name>gridHFR-EAST1_6KM</name>
<name>gridHFR-EAST_6KM</name>
<description>High Frequency Radar (EAST_6KM) total vector velocity (TVV)
Lon/Lat Resolution
</description>

View file

@ -19,8 +19,8 @@
further_licensing_information.
-->
<latLonGridCoverage>
<name>gridHFR-EAST2_6KM</name>
<description>High Frequency Radar (EAST_6KM) total vector velocity (TVV)
<name>gridHFR-EAST_PR_6KM</name>
<description>High Frequency Radar (PUERTO RICO_6KM) total vector velocity (TVV)
Lon/Lat Resolution
</description>
<la1>14.5</la1>

View file

@ -19,8 +19,8 @@
further_licensing_information.
-->
<latLonGridCoverage>
<name>gridHFR-WEST2_6KM</name>
<description>High Frequency Radar (WEST_6KM) total vector velocity (TVV)
<name>gridHFR-US_HAWAII_6KM</name>
<description>High Frequency Radar (US_WEST_HAWAII_6KM) total vector velocity (TVV)
Lon/Lat Resolution
</description>
<la1>16.2204</la1>

View file

@ -19,7 +19,7 @@
further_licensing_information.
-->
<latLonGridCoverage>
<name>gridHFR-WEST1_6KM</name>
<name>gridHFR-WEST_6KM</name>
<description>High Frequency Radar (WEST_6KM) total vector velocity (TVV)
Lon/Lat Resolution
</description>

View file

@ -138,17 +138,17 @@
<name>HFR-EAST_6KM</name>
<center>9</center>
<subcenter>0</subcenter>
<grid>gridHFR-EAST1_6KM</grid>
<grid>gridHFR-EAST_6KM</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>HFR-EAST_6KM</name>
<name>HFR-EAST_PR_6KM</name>
<center>9</center>
<subcenter>0</subcenter>
<grid>gridHFR-EAST2_6KM</grid>
<grid>gridHFR-EAST_PR_6KM</grid>
<process>
<id>255</id>
</process>
@ -168,17 +168,17 @@
<name>HFR-WEST_6KM</name>
<center>9</center>
<subcenter>0</subcenter>
<grid>gridHFR-WEST1_6KM</grid>
<grid>gridHFR-WEST_6KM</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>HFR-WEST_6KM</name>
<name>HFR-US_HAWAII_6KM</name>
<center>9</center>
<subcenter>0</subcenter>
<grid>gridHFR-WEST2_6KM</grid>
<grid>gridHFR-US_HAWAII_6KM</grid>
<process>
<id>255</id>
</process>

View file

@ -67,6 +67,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdap
* 06/20/13 2127 rjpeter Removed unused bidirectional relationship.
* 06/13/13 2044 randerso Code cleanup
* 07/31/13 2057 randerso Added removedDate
* 10/08/14 #3684 randerso Added sameModel()
*
* </pre>
*
* @author bphillip
@ -598,6 +600,23 @@ public class DatabaseID implements Comparable<DatabaseID> {
return cal.getTime();
}
public boolean sameModel(DatabaseID other) {
if (!this.siteId.equals(other.getSiteId())) {
return false;
}
if (!this.format.equals(other.getFormat())) {
return false;
}
if (!this.dbType.equals(other.getDbType())) {
return false;
}
return this.modelName.equals(other.getModelName());
}
/*
* (non-Javadoc)
*

View file

@ -26,21 +26,56 @@ import java.util.Map;
import com.raytheon.uf.common.message.IMessage;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.util.SystemUtil;
/**
* Base class for GFE Notifications
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 7, 2014 #3684 randerso Added sourceId field
*
* </pre>
*
* @author randerso
* @version 1.0
*/
@DynamicSerialize
public class GfeNotification implements IMessage {
private static final String localSourceID;
static {
String host = SystemUtil.getHostName();
int pid = SystemUtil.getPid();
localSourceID = host + ":" + pid;
}
@DynamicSerializeElement
protected String siteID;
public GfeNotification() {
@DynamicSerializeElement
protected String sourceID;
public GfeNotification() {
this.sourceID = localSourceID;
}
public GfeNotification(String siteId) {
this();
this.siteID = siteId;
}
public String getSourceID() {
return sourceID;
}
public void setSourceID(String sourceId) {
this.sourceID = sourceId;
}
public String getSiteID() {
return siteID;
}
@ -49,6 +84,15 @@ public class GfeNotification implements IMessage {
this.siteID = siteID;
}
/**
*
*
* @return
*/
public boolean isLocal() {
return localSourceID.equals(this.sourceID);
}
/*
* (non-Javadoc)
*

View file

@ -67,6 +67,7 @@ import com.vividsolutions.jts.operation.polygonize.Polygonizer;
* favor of new GridLocation constructor
* 06/24/13 #2044 randerso Changed format of hdf5 group to include
* minutes for satellite data
* 10/08/14 #3684 randerso Removed NOTIFY
*
* </pre>
*
@ -105,8 +106,6 @@ public class GfeUtil {
public static final String HAZARDS_KEY = "Hazards";
public static final String NOTIFY = "gfeNotify";
private static Pattern DISCRETE_PATTERN = Pattern
.compile("'[\\w<>+/^\\[\\]\\.,:-]*'");

View file

@ -22,6 +22,7 @@ class GfeNotification:
def __init__(self):
self.siteID = None
self.sourceID = None
def getSiteID(self):
return self.siteID
@ -29,3 +30,9 @@ class GfeNotification:
def setSiteID(self, siteID):
self.siteID = siteID
def getSourceID(self):
return self.sourceID
def setSourceID(self, sourceID):
self.sourceID = sourceID