From 810388f00a8bb2211fa58135e68d6f1d2f74e393 Mon Sep 17 00:00:00 2001 From: Steve Harris Date: Mon, 24 Jun 2013 09:29:43 -0400 Subject: [PATCH] 13.5.1-3 baseline Former-commit-id: 63803c14240bb1943c65c9afbec3e0efda25cfb6 [formerly cc90f0c02410fef504ec9de389c07dfa41164247] Former-commit-id: 72d22a30c950e6e3f15822e9c119d65d12f4857d --- .../uf/viz/core/drawables/ColorMapLoader.java | 60 +- .../uf/viz/monitor/ffmp/FFMPMonitor.java | 227 +- .../uf/viz/monitor/ffmp/FFMPProcessUris.java | 130 + .../monitor/ffmp/ui/dialogs/FFMPTable.java | 21 +- .../ffmp/ui/dialogs/FFMPTableCellData.java | 38 +- .../ffmp/ui/dialogs/FFMPTableComp.java | 11 +- .../ffmp/ui/dialogs/FFMPTableData.java | 22 +- .../ffmp/ui/dialogs/FfmpBasinTableDlg.java | 53 +- .../ffmp/ui/dialogs/TimeDurScaleComp.java | 19 - .../ffmp/ui/listeners/FFMPLoadListener.java | 8 - .../ffmp/ui/listeners/FFMPLoaderEvent.java | 33 - .../monitor/ffmp/ui/rsc/FFFGForceUtil.java | 71 +- .../monitor/ffmp/ui/rsc/FFMPColorUtils.java | 172 +- .../ffmp/ui/rsc/FFMPDataGenerator.java | 760 +----- .../monitor/ffmp/ui/rsc/FFMPDataLoader.java | 533 ---- .../monitor/ffmp/ui/rsc/FFMPLoaderStatus.java | 82 - .../viz/monitor/ffmp/ui/rsc/FFMPResource.java | 267 +- .../monitor/ffmp/ui/rsc/FFMPResourceData.java | 178 +- .../monitor/ffmp/ui/rsc/FFMPRowGenerator.java | 841 ++++++ .../monitor/ffmp/ui/rsc/ForceUtilResult.java | 84 + .../ffmp/ui/thread/AbstractLoadJob.java | 313 +++ .../ffmp/ui/thread/BackgroundLoadJob.java | 132 + .../ffmp/ui/thread/InitHucLevelGeomsJob.java | 105 + .../ffmp/ui/thread/InitialLoadJob.java | 236 ++ .../monitor/ffmp/ui/thread/UpdateLoadJob.java | 120 + .../common/stormtrack/StormTrackDisplay.java | 7 + .../viz/gfe/core/internal/IFPClient.java | 17 +- .../raytheon/viz/gfe/sampler/HistSample.java | 65 +- .../viz/hydro/timeseries/TimeSeriesDlg.java | 8 +- .../ui/dialogs/EditPrecipStationsDialog.java | 3 + edexOsgi/build.edex/esb/conf/log4j-ingest.xml | 14 +- edexOsgi/build.edex/esb/conf/log4j.xml | 20 +- .../base/ffmp/FFMPSourceConfig.xml | 6 +- .../binlightning/BinLightningDecoder.java | 167 +- .../binlightning/BinLightningAESKey.java | 239 ++ .../BinLightningAESKey.properties | 33 + .../BinLightningDataDecryptionException.java | 44 + .../binlightning/BinLigntningDecoderUtil.java | 529 ++++ .../EncryptedBinLightningCipher.java | 184 ++ .../handler/GetGridInventoryHandler.java | 10 +- .../gfe/server/handler/LockChangeHandler.java | 21 +- .../plugin/gfe/util/SendNotifications.java | 3 +- .../binlightning/impl/LtgStrikeType.java | 4 +- .../common/dataplugin/ffmp/FFMPTemplates.java | 32 +- .../common/monitor/data/ColumnAttribData.java | 4 - .../uf/common/stats/xml/StatisticsEvent.java | 182 -- .../META-INF/MANIFEST.MF | 3 +- .../uf/edex/activetable/ActiveTable.java | 33 +- .../common_static/base/vtec/ActiveTable.py | 68 +- .../common_static/base/vtec/MergeVTEC.py | 11 +- .../common_static/base/vtec/VTECPartners.py | 15 +- .../resources/stats.properties | 4 - .../res/spring/edex-process-stats.xml | 51 - .../res/spring/stats-graph-request.xml | 18 - .../resources/edexProcessStats.properties | 4 - .../raytheon/uf/edex/stats/util/Archiver.java | 276 -- .../com.raytheon.uf.tools.cli/impl/capture | 3 + .../impl/retrieveActivity | 51 + .../impl/src/pgen/ProductRetriever.py | 50 + .../impl/src/pgen/ProductStorer.py | 28 + .../impl/src/pgen/retrieveActivity.py | 286 ++ .../impl/src/pgen/storeActivity.py | 113 + .../impl/src/qpidNotify/mhsAckNotify.py | 5 +- .../impl/storeActivity | 51 + .../src/ifpBreakAllLocks/ifpBreakAllLocks.py | 227 +- .../res/spring/ntrans-ingest.xml | 8 +- .../res/spring/purgeutil-request.xml | 6 +- .../ThriftSerializationContext.py | 11 +- .../adapters/LockTableAdapter.py | 12 +- .../common/dataplugin/gfe/server/lock/Lock.py | 54 +- .../com/raytheon/uf/common/message/WsId.py | 5 + pythonPackages/ufpy/qpidingest.py | 13 +- .../datadelivery.patch0 | 11 +- .../Installer.edex/scripts/init.d/edex_camel | 7 +- rpms/build/i386/build.sh | 19 +- rpms/legal/FOSS_licenses/java/COPYRIGHT.txt | 81 - rpms/legal/FOSS_licenses/java/LICENSE.txt | 342 --- rpms/legal/FOSS_licenses/java/README.html | 719 ------ .../java/THIRDPARTYLICENSEREADME.txt | 2289 ----------------- .../FOSS_licenses/postgresql/bsd_license.txt | 15 - 80 files changed, 4540 insertions(+), 6457 deletions(-) create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPProcessUris.java delete mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoadListener.java delete mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoaderEvent.java delete mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataLoader.java delete mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPLoaderStatus.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/ForceUtilResult.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/AbstractLoadJob.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/BackgroundLoadJob.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitHucLevelGeomsJob.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitialLoadJob.java create mode 100644 cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/UpdateLoadJob.java create mode 100644 edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.java create mode 100644 edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.properties create mode 100644 edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningDataDecryptionException.java create mode 100644 edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLigntningDecoderUtil.java create mode 100644 edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/EncryptedBinLightningCipher.java delete mode 100644 edexOsgi/com.raytheon.uf.common.stats/src/com/raytheon/uf/common/stats/xml/StatisticsEvent.java delete mode 100644 edexOsgi/com.raytheon.uf.edex.datadelivery.event/resources/stats.properties delete mode 100644 edexOsgi/com.raytheon.uf.edex.stats/res/spring/edex-process-stats.xml delete mode 100644 edexOsgi/com.raytheon.uf.edex.stats/res/spring/stats-graph-request.xml delete mode 100644 edexOsgi/com.raytheon.uf.edex.stats/resources/edexProcessStats.properties delete mode 100644 edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/util/Archiver.java create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/retrieveActivity create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductRetriever.py create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductStorer.py create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/retrieveActivity.py create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/storeActivity.py create mode 100644 edexOsgi/com.raytheon.uf.tools.cli/impl/storeActivity delete mode 100755 rpms/legal/FOSS_licenses/java/COPYRIGHT.txt delete mode 100755 rpms/legal/FOSS_licenses/java/LICENSE.txt delete mode 100755 rpms/legal/FOSS_licenses/java/README.html delete mode 100755 rpms/legal/FOSS_licenses/java/THIRDPARTYLICENSEREADME.txt delete mode 100644 rpms/legal/FOSS_licenses/postgresql/bsd_license.txt diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ColorMapLoader.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ColorMapLoader.java index a8cf4acafd..00209e8942 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ColorMapLoader.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/drawables/ColorMapLoader.java @@ -53,6 +53,7 @@ import com.raytheon.uf.viz.core.exception.VizException; * Aug 20, 2007 njensen Added listColorMaps(). * Aug 20, 2008 dglazesk JiBX to JaXB * Aug 20, 2008 dglazesk Updated for new ColorMap interface + * Jun 10, 2013 2075 njensen Added listColorMapFiles(subdirectory) * * * @@ -62,6 +63,10 @@ import com.raytheon.uf.viz.core.exception.VizException; public class ColorMapLoader { + private static final String EXTENSION = ".cmap"; + + private static final String DIR_NAME = "colormaps"; + private static final String sharedMutex = ""; /* This class is used to cache the color maps and update them upon changes */ @@ -132,8 +137,8 @@ public class ColorMapLoader { try { LocalizationFile f = PathManagerFactory.getPathManager() .getStaticLocalizationFile( - "colormaps" + IPathManager.SEPARATOR + name - + ".cmap"); + DIR_NAME + IPathManager.SEPARATOR + name + + EXTENSION); if (f == null || !f.exists()) { // If the file was not found check to see if the // localization context is encoded as part of the path. @@ -146,9 +151,8 @@ public class ColorMapLoader { f = PathManagerFactory.getPathManager() .getLocalizationFile( context, - "colormaps" - + IPathManager.SEPARATOR - + split[2] + ".cmap"); + DIR_NAME + IPathManager.SEPARATOR + + split[2] + EXTENSION); if (f == null) { return loadColorMap(split[2]); } @@ -170,7 +174,15 @@ public class ColorMapLoader { return cm; } - public static LocalizationFile[] listColorMapFiles() { + /** + * Recursively searches for the colormaps that are in the specified + * directory + * + * @param dir + * the directory to search recursively + * @return the localization files of the colormaps that are found + */ + private static LocalizationFile[] internalListColorMapFiles(String dir) { IPathManager pm = PathManagerFactory.getPathManager(); Set searchContexts = new HashSet(); @@ -195,15 +207,38 @@ public class ColorMapLoader { } LocalizationFile[] files = pm.listFiles(searchContexts - .toArray(new LocalizationContext[searchContexts.size()]), - "colormaps", new String[] { ".cmap" }, true, true); + .toArray(new LocalizationContext[searchContexts.size()]), dir, + new String[] { EXTENSION }, true, true); return files; } + /** + * Lists all the colormaps in the specified subdirectory. For example, if + * subdirectory is "ffmp", it will recursively walk down the colormaps/ffmp + * directory + * + * @param subDirectory + * the subdirectory of the colormaps dir to search + * @return + */ + public static LocalizationFile[] listColorMapFiles(String subDirectory) { + return internalListColorMapFiles(DIR_NAME + IPathManager.SEPARATOR + + subDirectory); + } + + /** + * Lists all the colormaps found in the system + * + * @return + */ + public static LocalizationFile[] listColorMapFiles() { + return internalListColorMapFiles(DIR_NAME); + } + public static String shortenName(LocalizationFile file) { String name = file.getName() - .replace("colormaps" + IPathManager.SEPARATOR, "") - .replace(".cmap", ""); + .replace(DIR_NAME + IPathManager.SEPARATOR, "") + .replace(EXTENSION, ""); if (!file.getContext().getLocalizationLevel() .equals(LocalizationLevel.BASE)) { String level = file.getContext().getLocalizationLevel().name(); @@ -234,9 +269,8 @@ public class ColorMapLoader { private static IColorMap loadColorMap(String name, LocalizationFile colorMapFile) throws SerializationException { if (colorMapFile != null) { - ColorMap cm = (ColorMap) SerializationUtil - .jaxbUnmarshalFromXmlFile(colorMapFile.getFile() - .getAbsolutePath()); + ColorMap cm = SerializationUtil.jaxbUnmarshalFromXmlFile( + ColorMap.class, colorMapFile.getFile().getAbsolutePath()); cm.setName(name); cm.setChanged(false); return cm; diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPMonitor.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPMonitor.java index e74baa8077..bae7775927 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPMonitor.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPMonitor.java @@ -6,7 +6,6 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -20,6 +19,7 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentNavigableMap; +import org.eclipse.core.runtime.SubMonitor; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; @@ -44,7 +44,6 @@ import com.raytheon.uf.common.monitor.config.FFFGDataMgr; import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE; -import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager; import com.raytheon.uf.common.monitor.xml.DomainXML; import com.raytheon.uf.common.monitor.xml.FFMPRunXML; import com.raytheon.uf.common.monitor.xml.ProductRunXML; @@ -71,10 +70,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfig; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.IFFMPResourceListener; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResource; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResourceData; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTimeWindow; import com.raytheon.uf.viz.monitor.listeners.IMonitorListener; @@ -95,10 +91,12 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener; * 02/01/13 1627 D. Hladky removed unused(useless) db load method * 02/19/13 1639 njensen Replaced ConcurrentHashMaps with data structures * 02/20/13 1635 D. Hladky Fixed multi guidance sources - * Mar 6, 2013 1769 dhladky Changed threading to use count down latch. - * Apr 9, 2013 1890 dhladky Fixed the broken cache file load + * Mar 06, 2013 1769 dhladky Changed threading to use count down latch. + * Apr 09, 2013 1890 dhladky Fixed the broken cache file load * Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. + * Jun 06, 2013 2075 njensen No longer starts loading threads, resourceData does that + * Jun 07, 2013 2075 njensen Extracted FFMPProcessUris to separate class * * * @@ -107,7 +105,6 @@ import com.raytheon.uf.viz.monitor.listeners.IMonitorListener; */ public class FFMPMonitor extends ResourceMonitor { - private static long SECONDS_PER_HOUR = 60 * 60; /** Singleton instance of this class */ private static FFMPMonitor monitor = null; @@ -143,8 +140,8 @@ public class FFMPMonitor extends ResourceMonitor { private FFMPTimeWindow qpeWindow = null; - /** The infamous templates **/ - private FFMPTemplates templates = null; + /** The infamous templates, now volatile! **/ + private volatile FFMPTemplates templates = null; private FFMPRunConfigurationManager frcm = null; @@ -168,12 +165,6 @@ public class FFMPMonitor extends ResourceMonitor { if (res.basinTableDlg != null) { closeDialog(res); } - - // will kill any loaders running - if (res.getResourceData().floader != null) { - res.getResourceData().floader.kill(); - res.getResourceData().floader = null; - } } } @@ -247,7 +238,6 @@ public class FFMPMonitor extends ResourceMonitor { * @return */ public static boolean isRunning() { - if (monitor == null) { return false; } @@ -301,7 +291,7 @@ public class FFMPMonitor extends ResourceMonitor { * @param phuc * @return */ - private List getLoadedUris(String siteKey, String source, + protected List getLoadedUris(String siteKey, String source, String phuc) { FFMPSiteData siteData = siteDataMap.get(siteKey); FFMPSourceData sourceData = siteData.getSourceData(source); @@ -338,8 +328,8 @@ public class FFMPMonitor extends ResourceMonitor { || !getLoadedUris(siteKey, source, phuc) .contains(uri)) { try { - populateFFMPRecord(siteKey, - new FFMPRecord(uri), source, phuc); + populateFFMPRecord(siteKey, new FFMPRecord( + uri), source, phuc); } catch (Exception e) { statusHandler.handle(Priority.PROBLEM, "FFMP Can't retrieve FFMP URI, " @@ -435,11 +425,10 @@ public class FFMPMonitor extends ResourceMonitor { * @param phuc * @throws Exception */ - public void populateFFMPRecord(String siteKey, - FFMPRecord ffmpRec, String source, String phuc) throws Exception { + public void populateFFMPRecord(String siteKey, FFMPRecord ffmpRec, + String source, String phuc) throws Exception { - FFMPLoadRecord flr = new FFMPLoadRecord(siteKey, - ffmpRec, source, phuc); + FFMPLoadRecord flr = new FFMPLoadRecord(siteKey, ffmpRec, source, phuc); flr.run(); } @@ -469,9 +458,9 @@ public class FFMPMonitor extends ResourceMonitor { if (sourceXML.getSourceType().equals( SOURCE_TYPE.GAGE.getSourceType()) && phuc.equals(FFMPRecord.ALL)) { - ffmpRec.retrieveVirtualBasinFromDataStore(loc, - dataUri, getTemplates(siteKey), ffmpRec - .getDataTime().getRefTime(), basin); + ffmpRec.retrieveVirtualBasinFromDataStore(loc, dataUri, + getTemplates(siteKey), ffmpRec.getDataTime() + .getRefTime(), basin); } else { ffmpRec.retrieveBasinFromDataStore(dataStore, dataUri, getTemplates(siteKey), phuc, ffmpRec @@ -509,7 +498,7 @@ public class FFMPMonitor extends ResourceMonitor { return uris; } - + /** * Perform a single database request to populate the availableUris for * multiple sources. After preloading the uris the uris for each source can @@ -790,13 +779,13 @@ public class FFMPMonitor extends ResourceMonitor { retrieveNew); } } else { - populateFFMPRecord(siteKey, dataKey, - sourceName, ptime, phuc, retrieveNew); + populateFFMPRecord(siteKey, dataKey, sourceName, + ptime, phuc, retrieveNew); } } } else { - populateFFMPRecord(siteKey, dataKey, sourceName, - ptime, phuc, retrieveNew); + populateFFMPRecord(siteKey, dataKey, sourceName, ptime, + phuc, retrieveNew); } } else { // special case where FFG is the primary source @@ -858,39 +847,6 @@ public class FFMPMonitor extends ResourceMonitor { } } - /** - * Start secondary and tertiary data loads - * - * @param startTime - * @param loadType - * @throws VizException - */ - public void startLoad(FFMPResource resource, Date startTime, - LOADER_TYPE loadType) throws VizException { - Date timeBack = null; - FFMPTemplateConfigurationManager ftcm = FFMPTemplateConfigurationManager - .getInstance(); - ArrayList hucsToLoad = ftcm.getHucLevels(); - FFMPResourceData frd = resource.getResourceData(); - - if (loadType == LOADER_TYPE.SECONDARY) { - timeBack = new Date(resource.getMostRecentTime().getTime() - - (6 * TimeUtil.MILLIS_PER_HOUR)); - frd.timeBack = timeBack; - } else if (loadType == LOADER_TYPE.TERTIARY) { - hucsToLoad.clear(); - hucsToLoad.add(FFMPRecord.ALL); - timeBack = new Date(resource.getMostRecentTime().getTime() - - (TimeUtil.MILLIS_PER_HOUR * 24)); - } - - frd.floader = new FFMPDataLoader(frd, timeBack, startTime, loadType, - hucsToLoad); - frd.floader.addListener(resource); - frd.floader.start(); - - } - public void launchSplash(final String siteKey) { VizApp.runAsync(new Runnable() { @Override @@ -985,7 +941,7 @@ public class FFMPMonitor extends ResourceMonitor { } } - public synchronized void splashDisposeAndDataLoad(FFMPResource resource) { + public synchronized void splashDispose(FFMPResource resource) { if (ffmpSplash != null) { ffmpSplash.close(); ffmpSplash = null; @@ -993,15 +949,6 @@ public class FFMPMonitor extends ResourceMonitor { if (resource.isFirst) { updateDialog(resource); } - - // start secondary data load - try { - startLoad(resource, resource.getResourceData().timeBack, - LOADER_TYPE.SECONDARY); - } catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, - "Secondary Data Load failure", e); - } } } @@ -1044,10 +991,6 @@ public class FFMPMonitor extends ResourceMonitor { if (listener instanceof FFMPResource) { FFMPResource res = (FFMPResource) listener; - if (res.getResourceData().floader != null) { - res.getResourceData().floader.kill(); - } - res.getResourceData().floader = null; int val = siteCount.get(res.getSiteKey()); if ((val == 1) && (siteCount.size() > 1)) { @@ -1684,12 +1627,12 @@ public class FFMPMonitor extends ResourceMonitor { * @param barrierTime * @param phuc */ - public void processUri(String uri, String siteKey, - String sourceName, Date barrierTime, String phuc) { + public void processUri(String uri, String siteKey, String sourceName, + Date barrierTime, String phuc) { if (uri != null) { try { - FFMPRecord record = populateFFMPRecord(uri, - siteKey, sourceName, phuc); + FFMPRecord record = populateFFMPRecord(uri, siteKey, + sourceName, phuc); if (record != null) { record.getBasinData(phuc).loadNow(); SourceXML source = getSourceConfig().getSource(sourceName); @@ -1713,10 +1656,11 @@ public class FFMPMonitor extends ResourceMonitor { * @param sourceName */ public void processUris(NavigableMap> uriMap, - String siteKey, String sourceName, Date barrierTime, String phuc) { - FFMPProcessUris processor = new FFMPProcessUris(uriMap, - siteKey, sourceName, barrierTime, phuc); - processor.run(); + String siteKey, String sourceName, Date barrierTime, String phuc, + SubMonitor smonitor) { + FFMPProcessUris processor = new FFMPProcessUris(this, uriMap, siteKey, + sourceName, barrierTime, phuc); + processor.run(smonitor); } @Override @@ -1732,17 +1676,25 @@ public class FFMPMonitor extends ResourceMonitor { */ public FFMPTemplates getTemplates(String siteKey) { if (templates == null) { - FFMPRunXML runner = getRunConfig().getRunner(wfo); - this.templates = FFMPTemplates.getInstance( - runner.getPrimaryDomain(), siteKey, MODE.CAVE); - // backup domains - if (runner.getBackupDomains() != null) { - for (DomainXML backup : runner.getBackupDomains()) { - templates.addDomain(siteKey, backup); + long t0 = System.currentTimeMillis(); + synchronized (this) { + if (templates == null) { + FFMPRunXML runner = getRunConfig().getRunner(wfo); + this.templates = FFMPTemplates.getInstance( + runner.getPrimaryDomain(), siteKey, MODE.CAVE); + + // backup domains + if (runner.getBackupDomains() != null) { + for (DomainXML backup : runner.getBackupDomains()) { + templates.addDomain(siteKey, backup); + } + } else { + templates.done = true; + } } - } else { - templates.done = true; } + System.out.println("Time spent initializing templates: " + + (System.currentTimeMillis() - t0)); } if (!templates.isSiteLoaded(siteKey)) { @@ -1962,7 +1914,7 @@ public class FFMPMonitor extends ResourceMonitor { .getTime()) / 1000; if (((Integer) data1Dur.get(i)[2]) > 1000) { dur = ((Integer) data1Dur.get(i)[2] - 1000) - * SECONDS_PER_HOUR; + * TimeUtil.SECONDS_PER_HOUR; } else { dur = ((Integer) data1Dur.get(i)[2]) * 1000; } @@ -2241,11 +2193,6 @@ public class FFMPMonitor extends ResourceMonitor { dataUri, getTemplates(fsiteKey), refTime, fffmpRec.getSourceName()); } else { - if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { - statusHandler.handle(Priority.DEBUG, - "Retrieving and Populating URI: , " - + dataUri); - } curRecord.retrieveMapFromDataStore(loc, dataUri, getTemplates(fffmpRec.getSiteKey()), fhuc, refTime, fffmpRec.getSourceName()); @@ -2260,80 +2207,4 @@ public class FFMPMonitor extends ResourceMonitor { } } - /** - * The uri processing - * - * @author dhladky - * - */ - private class FFMPProcessUris implements Runnable { - - final NavigableMap> furiMap; - - - final String fsiteKey; - - final String fsourceName; - - final Date fbarrierTime; - - final String fhuc; - - public FFMPProcessUris(NavigableMap> uriMap, - String siteKey, String sourceName, Date barrierTime, String phuc) { - this.furiMap = uriMap; - this.fsiteKey = siteKey; - this.fbarrierTime = barrierTime; - this.fsourceName = sourceName; - this.fhuc = phuc; - - } - - public void run() { - if (furiMap != null) { - SourceXML source = getSourceConfig().getSource(fsourceName); - boolean isGuidance = false; - if (source != null - && source.getSourceType().equals( - SOURCE_TYPE.GUIDANCE.getSourceType())) { - isGuidance = true; - } - List loadedUris = getLoadedUris(fsiteKey, fsourceName, - fhuc); - Set populatedRecords = new HashSet(); - for (List uris : furiMap.descendingMap().values()) { - for (String uri : uris) { - if (uri == null || loadedUris.contains(uri)) { - continue; - } - FFMPRecord record = new FFMPRecord(uri); - if (record.getDataTime().getRefTime() - .after(fbarrierTime) - || isGuidance) { - try { - record = populateFFMPRecord(uri, fsiteKey, - fsourceName, fhuc); - if (record != null) { - populatedRecords.add(record); - if (source != null) { - record.setExpiration(source - .getExpirationMinutes(fsiteKey)); - record.setRate(source.isRate()); - } - } - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, - "FFMP Can't retrieve FFMP URI, " + uri, - e); - } - } - } - } - for (FFMPRecord record : populatedRecords) { - record.getBasinData(fhuc).loadNow(); - } - } - } - } - } diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPProcessUris.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPProcessUris.java new file mode 100644 index 0000000000..5da9a9ea9d --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPProcessUris.java @@ -0,0 +1,130 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp; + +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.NavigableMap; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; +import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE; +import com.raytheon.uf.common.monitor.xml.SourceXML; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; + +/** + * Processes the FFMP URIs. Extracted from FFMPMonitor. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 7, 2013            njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class FFMPProcessUris { + + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(FFMPProcessUris.class); + + private final NavigableMap> furiMap; + + private final String fsiteKey; + + private final String fsourceName; + + private final Date fbarrierTime; + + private final String fhuc; + + private final FFMPMonitor ffmpMonitor; + + public FFMPProcessUris(FFMPMonitor ffmpMonitor, + NavigableMap> uriMap, String siteKey, + String sourceName, Date barrierTime, String phuc) { + this.furiMap = uriMap; + this.fsiteKey = siteKey; + this.fbarrierTime = barrierTime; + this.fsourceName = sourceName; + this.fhuc = phuc; + this.ffmpMonitor = ffmpMonitor; + } + + public void run(IProgressMonitor monitor) { + if (furiMap != null) { + SourceXML source = ffmpMonitor.getSourceConfig().getSource( + fsourceName); + boolean isGuidance = false; + if (source != null + && source.getSourceType().equals( + SOURCE_TYPE.GUIDANCE.getSourceType())) { + isGuidance = true; + } + List loadedUris = ffmpMonitor.getLoadedUris(fsiteKey, + fsourceName, fhuc); + Set populatedRecords = new HashSet(); + for (List uris : furiMap.descendingMap().values()) { + for (String uri : uris) { + if (uri == null || loadedUris.contains(uri)) { + continue; + } + FFMPRecord record = new FFMPRecord(uri); + if (record.getDataTime().getRefTime().after(fbarrierTime) + || isGuidance) { + try { + record = ffmpMonitor.populateFFMPRecord(uri, + fsiteKey, fsourceName, fhuc); + if (record != null) { + populatedRecords.add(record); + if (source != null) { + record.setExpiration(source + .getExpirationMinutes(fsiteKey)); + record.setRate(source.isRate()); + } + } + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + "FFMP Can't retrieve FFMP URI, " + uri, e); + } + } + } + } + + monitor.beginTask(null, populatedRecords.size()); + for (FFMPRecord record : populatedRecords) { + record.getBasinData(fhuc).loadNow(); + monitor.worked(1); + } + } + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTable.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTable.java index a921dfad4f..9baf612067 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTable.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTable.java @@ -69,6 +69,7 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML; * Mar 15,2012 DR 14406 gzhang Fixing QPF Column Title Missing * Mar 20,2012 DR 14250 gzhang Eliminating column Missing values * Aug 01, 2012 14168 mpduff Only allow filtering if ColorCell is true + * Jun 11, 2013 2075 njensen Optimized createTableItems() * * * @author lvenable @@ -149,8 +150,6 @@ public abstract class FFMPTable extends Composite { protected int textHeight = 0; - private String centeredAggregateKey; - private ArrayList indexArray = new ArrayList(); private Point extent = new Point(0, 0); @@ -281,7 +280,6 @@ public abstract class FFMPTable extends Composite { item.setBackground(j, cellData[j].getBackgroungColor()); } } - table.getColumn(0).setWidth(extent.x + 10); table.redraw(); } @@ -394,7 +392,9 @@ public abstract class FFMPTable extends Composite { ArrayList ffmpTableCols = ffmpCfgBasin .getTableColumnData(); - if (!sortedColumnName.equalsIgnoreCase(NAME)) { + boolean sortedColumnIsName = sortedColumnName.equalsIgnoreCase(NAME); + + if (!sortedColumnIsName) { for (ThreshColNames threshColName : ThreshColNames.values()) { if (sortedColumnName.contains(threshColName.name())) { sortedThreshCol = threshColName; @@ -429,6 +429,7 @@ public abstract class FFMPTable extends Composite { indexArray.clear(); FFMPTableRowData rowData; ArrayList rowArray = tableData.getTableRows(); + indexArray.ensureCapacity(rowArray.size()); GC gc = new GC(table); gc.setFont(tiFont); @@ -444,7 +445,7 @@ public abstract class FFMPTable extends Composite { /* * Check if the data value is Not A Number. */ - if (!sortedColumnName.equalsIgnoreCase(NAME)) { + if (!sortedColumnIsName) { float dataVal = cellData[sortColIndex].getValueAsFloat(); // DR 14250 fix: any value not a number will be omitted @@ -731,7 +732,7 @@ public abstract class FFMPTable extends Composite { int xCoord = 0; int yCoord = 0; if (colName.indexOf("\n") > 0) { - int maxTextLen = 0; + // int maxTextLen = 0; String[] tmpArray = colName.split("\n"); for (int j = 0; j < tmpArray.length; j++) { @@ -835,14 +836,6 @@ public abstract class FFMPTable extends Composite { showHideTableColumns(attrData); } - public void setCenteredAggregationKey(Object key) { - if (key instanceof Long) { - this.centeredAggregateKey = String.valueOf(key); - } else { - this.centeredAggregateKey = (String) key; - } - } - /** * Handle the mouse button down on the table. * diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableCellData.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableCellData.java index 28a93bbb9c..da0d958832 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableCellData.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableCellData.java @@ -36,9 +36,10 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig.ThreshColNames; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 6, 2009 lvenable Initial creation - * Apr 12, 2013 1902 mpduff Optimized the color assignments. - * May 7, 2013 1986 njensen Optimized sortBy + * Apr 06, 2009 lvenable Initial creation + * Apr 12, 2013 1902 mpduff Optimized the color assignments. + * May 07, 2013 1986 njensen Optimized sortBy + * Jun 10, 2013 2085 njensen Generate color on demand * * * @@ -120,8 +121,6 @@ public class FFMPTableCellData { colorValue = Float.NaN; } } - - this.generateCellColor(); } /** @@ -179,21 +178,21 @@ public class FFMPTableCellData { /** * Set the RGB which is the cell background color. */ - public void generateCellColor() { + private Color generateCellColor() { + Color retVal = null; if ((columnName == FIELDS.GUIDANCE) && this.guidForcedFlag) { if (this.value.isNaN()) { - backgroundColor = ffmpCfg.getCellColor(TableCellColor.Default); + retVal = ffmpCfg.getCellColor(TableCellColor.Default); } else { - backgroundColor = ffmpCfg - .getCellColor(TableCellColor.ForcedFFG); + retVal = ffmpCfg.getCellColor(TableCellColor.ForcedFFG); } } else if (columnName == FIELDS.GUIDANCE) { - backgroundColor = ffmpCfg.getThresholdColor( - ThreshColNames.GUID.name(), colorValue); - } else { - backgroundColor = ffmpCfg.getThresholdColor(columnName.name(), + retVal = ffmpCfg.getThresholdColor(ThreshColNames.GUID.name(), colorValue); + } else { + retVal = ffmpCfg.getThresholdColor(columnName.name(), colorValue); } + return retVal; } /** @@ -249,6 +248,19 @@ public class FFMPTableCellData { * @return The cell background RGB. */ public Color getBackgroungColor() { + if (backgroundColor == null) { + synchronized (this) { + if (backgroundColor == null) { + backgroundColor = generateCellColor(); + } + } + } return backgroundColor; } + + public void clearColor() { + synchronized (this) { + backgroundColor = null; + } + } } diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableComp.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableComp.java index a75879819d..1eb2ffc8f1 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableComp.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableComp.java @@ -47,7 +47,8 @@ public class FFMPTableComp extends FFMPTable { private String siteKey; - public FFMPTableComp(Composite parent, FFMPTableData data, ITableSelection tableSelectionCB, String siteKey) { + public FFMPTableComp(Composite parent, FFMPTableData data, + ITableSelection tableSelectionCB, String siteKey) { super(parent, data, siteKey); this.siteKey = siteKey; @@ -67,12 +68,14 @@ public class FFMPTableComp extends FFMPTable { @Override protected ColumnAttribData getColumnAttributeData(String colName) { - return tableConfig.getTableConfigData(siteKey).getTableColumnAttr(colName); + return tableConfig.getTableConfigData(siteKey).getTableColumnAttr( + colName); } @Override protected int getColumnIndex(String sortCol) { - return tableConfig.getTableConfigData(siteKey).getTableColumnIndex(sortCol); + return tableConfig.getTableConfigData(siteKey).getTableColumnIndex( + sortCol); } @Override @@ -148,7 +151,7 @@ public class FFMPTableComp extends FFMPTable { ArrayList rowData = tableData.getTableRows(); for (int i = 0; i < rowData.size(); i++) { rowData.get(i).getTableCellData(threshColumn.getColIndex()) - .generateCellColor(); + .clearColor(); } sortTableUsingConfig(); diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableData.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableData.java index 17b4b25647..89663028b3 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableData.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPTableData.java @@ -21,7 +21,6 @@ package com.raytheon.uf.viz.monitor.ffmp.ui.dialogs; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import org.eclipse.swt.SWT; @@ -61,33 +60,30 @@ public class FFMPTableData implements ISortColumn { */ private int currentSortDirection = SWT.DOWN; - private HashMap pfafMap; - /** * Constructor. */ public FFMPTableData() { tableRows = new ArrayList(); - pfafMap = new HashMap(); } /** - * Add or replace a row of cell data to the table rows collection. A row is - * replaced if the area Id already exists. + * Constructor. + */ + public FFMPTableData(int initialCapacity) { + tableRows = new ArrayList(initialCapacity); + } + + /** + * Add a row of cell data to the table rows collection. * * @param data * Table row data. */ - public void addDataRow(FFMPTableRowData data) { - pfafMap.put(data.getPfaf().toString(), null); - data.setSortCallback(this); + public synchronized void addDataRow(FFMPTableRowData data) { tableRows.add(data); } - public boolean containsPfaf(String pfaf) { - return pfafMap.containsKey(pfaf); - } - /** * Replace the data in a table cell. * diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FfmpBasinTableDlg.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FfmpBasinTableDlg.java index e6e1d5eeff..ff4b418949 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FfmpBasinTableDlg.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FfmpBasinTableDlg.java @@ -84,9 +84,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPScreenCenterEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPStreamTraceEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPTimeChangeEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPWorstCaseEvent; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPGraphData; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPLoaderStatus; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResource; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataLoader; import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPTableDataUpdate; @@ -120,6 +118,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * Mar 29, 2013 1790 rferrel Bug fix for non-blocking dialogs. * Apr 15, 2013 1904 mpduff Remove calls to reset FFMPConfig. * Apr 25, 2013 1902 mpduff Fixed Thresholds dialog on multiple opens, needed an isDisposed check. + * Jun 06, 2013 2075 njensen Removed loading labels * * * @author lvenable @@ -273,8 +272,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements */ private String previousHuc; - private FFMPLoaderStatus loadStatus; - public FfmpBasinTableDlg(Shell parent, FFMPTableData tData, FFMPResource resource) { super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.INDEPENDENT_SHELL @@ -1751,8 +1748,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements if (!ffmpTable.isDisposed()) { this.mainTableData = tData; ffmpTable.clearTableSelection(); - ffmpTable - .setCenteredAggregationKey(resource.centeredAggregationKey); ffmpTable.setTableData(mainTableData); resetCursor(); shell.pack(); @@ -2097,47 +2092,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements allowNewTableUpdate = true; } - public void updateLoadingLabel(FFMPLoaderStatus status) { - this.loadStatus = status; - if (dataLoadComp == null) { - return; - } - - GridData gd = (GridData) dataLoadComp.getLayoutData(); - - if (gd.exclude == true) { - ((GridData) dataLoadComp.getLayoutData()).exclude = false; - dataLoadComp.setVisible(true); - shell.pack(); - } - - String prefix = null; - - if (status.getLoaderType() == LOADER_TYPE.SECONDARY) { - prefix = " Secondary Data Load: "; - } else if (status.getLoaderType() == LOADER_TYPE.TERTIARY) { - prefix = " Tertiary Data Load: "; - } else if (status.getLoaderType() == LOADER_TYPE.GENERAL) { - prefix = " General Data Load: "; - } else { - prefix = " Tertiary Data Load: "; - } - - if (status.isDone() == false) { - dataLoadingLbl.setText(prefix + status.getMessage()); - dataLoadingLbl.setBackground(getDisplay().getSystemColor( - SWT.COLOR_CYAN)); - } else { - dataLoadingLbl.setText(""); - dataLoadingLbl.setBackground(getDisplay().getSystemColor( - SWT.COLOR_WIDGET_BACKGROUND)); - - ((GridData) dataLoadComp.getLayoutData()).exclude = true; - dataLoadComp.setVisible(false); - shell.pack(); - } - } - /** * {@inheritDoc} */ @@ -2241,11 +2195,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements updateGapValueLabel(fupdateData.getGapValueLabel()); resetCursor(); - - // start tertiary loader if not run yet - if (loadStatus != null) { - resource.manageLoaders(loadStatus); - } } /** diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/TimeDurScaleComp.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/TimeDurScaleComp.java index 672086b461..a82796bb47 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/TimeDurScaleComp.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/TimeDurScaleComp.java @@ -118,9 +118,6 @@ public class TimeDurScaleComp extends Composite { */ private double[] displayNumbers; - // = new double[] { 0.00, 3.00, 6.00, 9.00, 12.00, 15.00, 18.00, - // 21.00, 24.00 }; - /** * Thumb pixel index array. */ @@ -635,8 +632,6 @@ public class TimeDurScaleComp extends Composite { private void setTimeDurationScale(double hourVal) { for (int key : indexSelHrsMap.keySet()) { - // TODO : remove print statements - if (hourVal == indexSelHrsMap.get(key)) { // Find an 'X' coordinate for the thumb slider. @@ -687,18 +682,8 @@ public class TimeDurScaleComp extends Composite { } private void calcDisplayNumbers() { - // displayNumbers = new double[] { 0.00, 3.00, 6.00, 9.00, 12.00, 15.00, - // 18.00, - // 21.00, 24.00 }; - - // displayNumbers = new double[] { 0.00, 3.00, 6.00, 9.00, 12.00, 15.00, - // 18.00, - // 23.00 }; - double hours = validateHours(upperHourRangeVal); - int divisor = getDivisor(hours); - int hourLbls = (int) (hours / divisor); // Account for the 0.00 hour label @@ -717,10 +702,6 @@ public class TimeDurScaleComp extends Composite { displayNumbers[i] = (i * divisor); } } - - for (double d : displayNumbers) { - System.out.println("d = " + d); - } } private double validateHours(double hours) { diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoadListener.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoadListener.java deleted file mode 100644 index 3e52580d80..0000000000 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoadListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.raytheon.uf.viz.monitor.ffmp.ui.listeners; - - -public interface FFMPLoadListener { - - public void loadStatus(FFMPLoaderEvent event); - -} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoaderEvent.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoaderEvent.java deleted file mode 100644 index 3023786e7b..0000000000 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/listeners/FFMPLoaderEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.raytheon.uf.viz.monitor.ffmp.ui.listeners; - -import java.util.EventObject; - -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPLoaderStatus; - -/** - * - * FFMP loader event updates - * - *
- * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * May 31, 2011 8661       dhladky     Initial creation
- * 
- * - * @author dhladky - * @version 1.0 - * - */ - -public class FFMPLoaderEvent extends EventObject { - - /** - * - */ - private static final long serialVersionUID = 135784L; - - public FFMPLoaderEvent(FFMPLoaderStatus status) { - super(status); - } -} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFFGForceUtil.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFFGForceUtil.java index dac07a4582..4c9b090340 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFFGForceUtil.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFFGForceUtil.java @@ -44,6 +44,7 @@ import com.raytheon.uf.common.monitor.xml.SourceXML; * 04/15/13 1890 dhladky Changed COUNTY to use constant * 05/10/13 1919 mpduff If there are forced pfafs then the aggregate is forced. * 05/22/13 1902 mpduff Added methods to get forced values. + * 06/17/13 2085 njensen Made forceIt() more thread safe * * * @@ -52,16 +53,9 @@ import com.raytheon.uf.common.monitor.xml.SourceXML; */ public class FFFGForceUtil { - private boolean forced = false; - - private List forcedPfafList = new ArrayList(); - - private List pfafList = new ArrayList(); private final FFMPResource resource; - private String domain = "NA"; - private SourceXML sourceXML1 = null; private SourceXML sourceXML2 = null; @@ -114,21 +108,24 @@ public class FFFGForceUtil { } } - public void calculateForcings(String domain, FFMPTemplates ft, + public ForceUtilResult calculateForcings(String domain, FFMPTemplates ft, FFMPBasin cBasin) { - this.domain = domain; - forceIt(ft, cBasin); + return forceIt(ft, cBasin, null, domain); } - public void calculateForcings(List pfafList, FFMPTemplates ft, - FFMPBasin cBasin) { - this.pfafList = pfafList; - forceIt(ft, cBasin); + public ForceUtilResult calculateForcings(List pfafList, + FFMPTemplates ft, FFMPBasin cBasin) { + return forceIt(ft, cBasin, pfafList, "NA"); } - private void forceIt(FFMPTemplates ft, FFMPBasin cBasin) { + private ForceUtilResult forceIt(FFMPTemplates ft, FFMPBasin cBasin, + List pfafList, String domain) { + boolean forced = false; + List forcedPfafList = new ArrayList(); + ForceUtilResult retVal = new ForceUtilResult(forced, pfafList, + forcedPfafList); if (interp == null) { - return; + return retVal; } if (domain == null) { @@ -215,6 +212,11 @@ public class FFFGForceUtil { forced = true; } } + + retVal.forced = forced; + retVal.pfafList = pfafList; + retVal.forcedPfafList = forcedPfafList; + return retVal; } private ArrayList getForcedBasins(String source, @@ -312,43 +314,6 @@ public class FFFGForceUtil { return Float.NaN; } - /** - * @return the forced - */ - public boolean isForced() { - return forced; - } - - /** - * @param forced - * the forced to set - */ - public void setForced(boolean forced) { - this.forced = forced; - } - - /** - * @return the forcedPfafList - */ - public List getForcedPfafList() { - return forcedPfafList; - } - - /** - * @param forcedPfafList - * the forcedPfafList to set - */ - public void setForcedPfafList(ArrayList forcedPfafList) { - this.forcedPfafList = forcedPfafList; - } - - /** - * @return the pfafList - */ - public List getPfafList() { - return pfafList; - } - /** * @param sliderTime * the sliderTime to set diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPColorUtils.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPColorUtils.java index bd083c812b..423497d410 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPColorUtils.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPColorUtils.java @@ -52,6 +52,7 @@ import com.raytheon.viz.core.style.image.ImagePreferences; * 08/29/09 2152 D. Hladky Initial release * 05/21/12 DR 14833 G. Zhang Error handling for invalid cmap * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. + * Jun 10, 2013 2075 njensen Improved init time * * * @@ -69,16 +70,14 @@ public class FFMPColorUtils { private double time = 0.0; - private ArrayList fileArray = new ArrayList(); + private TreeMap hourColorMapMap = new TreeMap(); - private TreeMap hourColorMapMap = new TreeMap(); - // DR 14833: replacing the one in the constructor private StyleRule sr = null; - + // DR 14833: used when no colormap found - private static final String DEFAULT_COLORMAP = "ffmp/qpe"; - + private static final String DEFAULT_COLORMAP = "ffmp/qpe"; + // DR 14833: used when paramname not matching colormap name found private static final String DEFAULT_PARAMNAME = "qpe"; @@ -96,18 +95,7 @@ public class FFMPColorUtils { this.tableLoad = tableLoad; this.colormapparams = null; - // LocalizationFile[] files = ColorMapLoader.listColorMapFiles(); - // for (LocalizationFile file : files) { - // String fn = file.getName(); - // if (fn.startsWith("colormaps/ffmp/qpe")) - // { - // System.out.println(file.getName()); - // String hour = fn.s - // } - // - // } - -// StyleRule sr = null;// DR 14833 replaced by a instance field + // StyleRule sr = null;// DR 14833 replaced by a instance field try { sr = StyleManager.getInstance().getStyleRule( StyleManager.StyleType.IMAGERY, getMatchCriteria()); @@ -125,7 +113,8 @@ public class FFMPColorUtils { e.printStackTrace(); } - if(cxml == null) cxml = getDefaultColorMap(); // DR 14833: load the default map + if (cxml == null) + cxml = getDefaultColorMap(); // DR 14833: load the default map ColorMap colorMap = new ColorMap(colormapfile, (ColorMap) cxml); colormapparams = new ColorMapParameters(); colormapparams.setColorMap(colorMap); @@ -188,16 +177,15 @@ public class FFMPColorUtils { double value = (Math.round(valueArg * 100.0)) / 100.0; - if (field == FIELDS.DIFF) { Color color = colormapparams.getColorByValue((float) value); rgb = convert(color); return rgb; } else if (value >= 0.005) { - Color color = colormapparams.getColorByValue((float) value); - rgb = convert(color); - return rgb; + Color color = colormapparams.getColorByValue((float) value); + rgb = convert(color); + return rgb; } List colors = getColorMap().getColors(); @@ -255,14 +243,13 @@ public class FFMPColorUtils { } private String determineQpeToUse(double time) { - getQpeColorMapFiles(); - parseFileNames(); + parseFileNames(getQpeColorMapFiles()); String qpeHourToUse = determineColorMap(time); return qpeHourToUse; } - private void parseFileNames() { + private void parseFileNames(List fileArray) { double hour = 0.0; for (String fn : fileArray) { hour = 0.0; @@ -327,80 +314,89 @@ public class FFMPColorUtils { return qpeHourToUse; } - private void getQpeColorMapFiles() { - LocalizationFile[] files = ColorMapLoader.listColorMapFiles(); + private List getQpeColorMapFiles() { + List colormaps = new ArrayList(); + LocalizationFile[] files = ColorMapLoader.listColorMapFiles("ffmp"); for (LocalizationFile file : files) { String fn = file.getName(); - if (fn.indexOf("ffmp/qpe") > 0) { - fileArray.add(fn); + if (fn.indexOf("qpe") > 0) { + colormaps.add(fn); } } - } - - + return colormaps; + } + /** - * DR 14833: Error handling for the following: - * when a user modified the ffmpImageryStyleRules.xml file - * without adding the related qpeX.cmap and for a user made - * error like: qpe6/qpe4.cmap then default qpe/qpe.cmap used. + * DR 14833: Error handling for the following: when a user modified the + * ffmpImageryStyleRules.xml file without adding the related qpeX.cmap and + * for a user made error like: qpe6/qpe4.cmap then default qpe/qpe.cmap + * used. * - */ - public IColorMap getDefaultColorMap(){ - IColorMap cxml = null; - - /*see parseFileNames(): colormap_name is "0.0" or qpe+key+".cmap" - double hour = hourColorMapMap.firstKey(); - String cmapHour = ( hour==0.0 ? "" : String.valueOf(hour) ); - System.out.println("FFMPColorUtils.getDefaultColorMap() cmapHour: "+cmapHour );*/ + */ + public IColorMap getDefaultColorMap() { + IColorMap cxml = null; - /* Loop through all StyleRules to get the default. - * In StyleManager.loadRules(StyleType), all levels(not only USER) - * StyleRule loaded. So it is guaranteed the default can be loaded. - */ - - com.raytheon.uf.viz.core.style.StyleRuleset srs = - StyleManager.getInstance().getStyleRuleSet(StyleManager.StyleType.IMAGERY); - - for(StyleRule srl : srs.getStyleRules()){ - String pn="", cm=""; - try{ - pn = ((ParamLevelMatchCriteria)srl.getMatchCriteria()).getParameterNames().get(0); - cm = ((ImagePreferences)srl.getPreferences()).getDefaultColormap(); - }catch(Exception e){ continue; } - - if(DEFAULT_PARAMNAME.equalsIgnoreCase(pn) && DEFAULT_COLORMAP.equalsIgnoreCase(cm)){ - sr = srl; - System.out.println("FFMPColorUtils.getDefaultColorMap(): StyleRule pn-cm value: "+pn+"-"+cm); - break; - } - - } - /* - if(sr == null){ - //get the MatchCriteria - ParamLevelMatchCriteria match = new ParamLevelMatchCriteria(); - ArrayList paramList = new ArrayList(); - paramList.add( FIELDS.QPE.getFieldName()+cmapHour ); - match.setParameterName(paramList); - - //get the StyleRule - try { - sr=StyleManager.getInstance().getStyleRule(StyleManager.StyleType.IMAGERY, match); - } catch (VizStyleException e) { - e.printStackTrace(); - } - } - */ - //get the colormapfile name - String colormapfile = ((ImagePreferences) sr.getPreferences()).getDefaultColormap(); + /* + * see parseFileNames(): colormap_name is "0.0" or qpe+key+".cmap" + * double hour = hourColorMapMap.firstKey(); String cmapHour = ( + * hour==0.0 ? "" : String.valueOf(hour) ); + * System.out.println("FFMPColorUtils.getDefaultColorMap() cmapHour: " + * +cmapHour ); + */ - //load the colormap + /* + * Loop through all StyleRules to get the default. In + * StyleManager.loadRules(StyleType), all levels(not only USER) + * StyleRule loaded. So it is guaranteed the default can be loaded. + */ + + com.raytheon.uf.viz.core.style.StyleRuleset srs = StyleManager + .getInstance().getStyleRuleSet(StyleManager.StyleType.IMAGERY); + + for (StyleRule srl : srs.getStyleRules()) { + String pn = "", cm = ""; + try { + pn = ((ParamLevelMatchCriteria) srl.getMatchCriteria()) + .getParameterNames().get(0); + cm = ((ImagePreferences) srl.getPreferences()) + .getDefaultColormap(); + } catch (Exception e) { + continue; + } + + if (DEFAULT_PARAMNAME.equalsIgnoreCase(pn) + && DEFAULT_COLORMAP.equalsIgnoreCase(cm)) { + sr = srl; + System.out + .println("FFMPColorUtils.getDefaultColorMap(): StyleRule pn-cm value: " + + pn + "-" + cm); + break; + } + + } + /* + * if(sr == null){ //get the MatchCriteria ParamLevelMatchCriteria match + * = new ParamLevelMatchCriteria(); ArrayList paramList = new + * ArrayList(); paramList.add( + * FIELDS.QPE.getFieldName()+cmapHour ); + * match.setParameterName(paramList); + * + * //get the StyleRule try { + * sr=StyleManager.getInstance().getStyleRule(StyleManager + * .StyleType.IMAGERY, match); } catch (VizStyleException e) { + * e.printStackTrace(); } } + */ + // get the colormapfile name + String colormapfile = ((ImagePreferences) sr.getPreferences()) + .getDefaultColormap(); + + // load the colormap try { cxml = ColorMapLoader.loadColorMap(colormapfile); } catch (VizException e) { e.printStackTrace(); } - - return cxml; + + return cxml; } } diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java index 3ce931953a..01827ef296 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java @@ -19,24 +19,20 @@ **/ package com.raytheon.uf.viz.monitor.ffmp.ui.rsc; -import java.util.ArrayList; -import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.eclipse.core.runtime.jobs.Job; + import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceBasin; import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceInterpolation; import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS; import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasin; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasinMetaData; import com.raytheon.uf.common.monitor.config.FFFGDataMgr; import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; import com.raytheon.uf.common.monitor.xml.DomainXML; @@ -48,11 +44,10 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.jobs.JobPool; import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig; -import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableCellData; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableData; -import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableRowData; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfig; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData; @@ -80,6 +75,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData; * May 07, 2013 1986 njensen Removed unnecessary sort * May 10, 2013 1919 mpduff Fixed problem with VGBs * May 22, 2013 1902 mpduff Code cleanup. + * Jun 11, 2013 2085 njensen Extracted row creation to FFMPRowGenerator and + * multi-threaded row creation. * * * @@ -93,51 +90,50 @@ public class FFMPDataGenerator { private static final IUFStatusHandler statusHandler = UFStatus .getHandler(FFMPDataGenerator.class); - private static final String ALL = FFMPRecord.ALL; + protected final String siteKey; - private static final String NA = "NA"; + protected final Date paintRefTime; - private final String siteKey; + protected final Object centeredAggregationKey; - private final Date paintRefTime; + protected final String huc; - private final Object centeredAggregationKey; + protected final double sliderTime; - private final String huc; + protected boolean isWorstCase = false; - private final double sliderTime; + protected FFMPTemplates ft = null; - private boolean isWorstCase = false; + protected FFMPResource resource = null; - private FFMPTemplates ft = null; + protected FFMPMonitor monitor = null; - private FFMPResource resource = null; + protected FFMPBasinData qpeBasin = null; - private FFMPMonitor monitor = null; + protected FFMPBasinData qpfBasin = null; - private FFMPBasinData qpeBasin = null; + protected FFMPBasinData rateBasin = null; - private FFMPBasinData qpfBasin = null; + protected Map guidBasins = null; - private FFMPBasinData rateBasin = null; + protected FFMPBasinData virtualBasin = null; - private Map guidBasins = null; + protected Map guidRecords = null; - private FFMPBasinData virtualBasin = null; + protected FFMPRecord baseRec = null; - private Map guidRecords = null; + protected boolean isRate = false; - private FFMPRecord baseRec = null; + protected long expirationTime = 0l; - private boolean isRate = false; + protected String[] cwaArr = null; - private long expirationTime = 0l; + protected Map forceUtils = null; - private String[] cwaArr = null; + protected FfmpTableConfigData ffmpTableCfgData = null; - private Map forceUtils = null; - - private FfmpTableConfigData ffmpTableCfgData = null; + private JobPool jobPool = new JobPool("Table Data Generation", 3, true, + Job.INTERACTIVE); public FFMPDataGenerator(FFMPMonitor monitor, FFMPResource resource) { siteKey = resource.getSiteKey(); @@ -171,7 +167,6 @@ public class FFMPDataGenerator { // update the FFFGDataManager FFFGDataMgr.getUpdatedInstance(); - tData = new FFMPTableData(); try { FIELDS field = getBaseField(); @@ -181,18 +176,20 @@ public class FFMPDataGenerator { } FFMPBasinData fbd = null; if (centeredAggregationKey != null) { - fbd = baseRec.getBasinData(ALL); + fbd = baseRec.getBasinData(FFMPRecord.ALL); } else { fbd = baseRec.getBasinData(huc); } + tData = new FFMPTableData(fbd.getBasins().size()); List domains = resource.getDomains(); if (!fbd.getBasins().isEmpty()) { - if ((centeredAggregationKey == null) || huc.equals(ALL)) { + if ((centeredAggregationKey == null) + || huc.equals(FFMPRecord.ALL)) { // System.out.println(fbd.getBasins().keySet().size() // + " rows in the table"); for (Long key : fbd.getBasins().keySet()) { - if (huc.equals(ALL)) { + if (huc.equals(FFMPRecord.ALL)) { FFMPBasinMetaData fmdb = ft.getBasin(siteKey, key); if (fmdb == null) { continue; @@ -307,689 +304,20 @@ public class FFMPDataGenerator { statusHandler.handle(Priority.PROBLEM, "Failed to load FFMP table data!", e); } + + // wait for all the rows to finish being created before continuing on + long t0 = System.currentTimeMillis(); + jobPool.join(); + System.out.println("Waited on FFMP job pool for: " + + (System.currentTimeMillis() - t0)); return tData; } private void setFFMPRow(FFMPBasin cBasin, FFMPTableData tData, boolean isVGB, String domain) { - try { - String pfafToTest = null; - if (cBasin instanceof FFMPVirtualGageBasin) { - pfafToTest = ((FFMPVirtualGageBasin) cBasin).getLid(); - } else { - pfafToTest = cBasin.getPfaf().toString(); - } - if (tData.containsPfaf(pfafToTest)) { - return; - } - } catch (Exception e) { - return; - } - - String displayName = ""; - String mouseOverText = ""; - - FFMPTableRowData trd = new FFMPTableRowData( - ffmpTableCfgData.getTableColumnKeys().length); - - Float guidance = Float.NaN; - Float qpe = Float.NaN; - Float rate = Float.NaN; - Float qpf = Float.NaN; - FIELDS rowField = FIELDS.NAME; - - if (isVGB) { - rowField = FIELDS.VIRTUAL; - } - - if (cBasin instanceof FFMPVirtualGageBasin) { - rowField = FIELDS.VIRTUAL; - - FFMPVirtualGageBasin vgBasin = (FFMPVirtualGageBasin) cBasin; - - String lid = vgBasin.getLid(); - - if (lid != null) { - StringBuilder sb = new StringBuilder(lid); - // in this special case it is actually the LID - trd.setPfaf(lid); - FFMPVirtualGageBasinMetaData fvgmbd = ft - .getVirtualGageBasinMetaData(siteKey, lid); - FFMPBasinMetaData metabasin = ft.getBasin(siteKey, - fvgmbd.getParentPfaf()); - Long parentBasinPfaf = fvgmbd.getParentPfaf(); - - mouseOverText = metabasin.getBasinId() + "\n" + lid + "-" - + fvgmbd.getName(); - - if (!huc.equals(ALL)) { - sb.append("-").append(fvgmbd.getName()); - } - - trd.setTableCellData(0, - new FFMPTableCellData(rowField, sb.toString(), - mouseOverText)); - - if (!isWorstCase || huc.equals(ALL) - || (centeredAggregationKey != null)) { - - if (!cBasin.getValues().isEmpty()) { - rate = vgBasin.getValue(paintRefTime); - if (sliderTime > 0.00) { - FFMPTimeWindow window = monitor.getQpeWindow(); - qpe = cBasin.getAccumValue(window.getAfterTime(), - window.getBeforeTime(), expirationTime, - isRate); - } else { - qpe = 0.0f; - } - } - - trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, - rate)); - trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, - qpe)); - - if (qpfBasin != null) { - FFMPBasin basin = qpfBasin.get(parentBasinPfaf); - if (basin != null) { - FFMPTimeWindow window = monitor.getQpfWindow(); - qpf = basin.getAverageValue(window.getAfterTime(), - window.getBeforeTime()); - } - } - trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, - qpf)); - - // run over each guidance type - int i = 0; - for (String guidType : guidBasins.keySet()) { - guidance = Float.NaN; - - FFMPTableCellData guidCellData = getGuidanceCellData( - cBasin, domain, guidType, parentBasinPfaf); - if (guidCellData == null) { - // check for forcing even if no data are available - guidance = getForcedAvg(domain, cBasin, guidType); - boolean forced = !guidance.isNaN(); - guidCellData = new FFMPTableCellData( - FIELDS.GUIDANCE, guidance, forced); - } else { - guidance = guidCellData.getValueAsFloat(); - } - - trd.setTableCellData(i + 4, guidCellData); - - float ratioValue = Float.NaN; - float diffValue = Float.NaN; - - // If guidance is NaN then it cannot be > 0 - if (!qpe.isNaN() && (guidance > 0.0f)) { - ratioValue = FFMPUtils.getRatioValue(qpe, guidance); - diffValue = FFMPUtils.getDiffValue(qpe, guidance); - } - trd.setTableCellData(i + 5, new FFMPTableCellData( - FIELDS.RATIO, ratioValue)); - trd.setTableCellData(i + 6, new FFMPTableCellData( - FIELDS.DIFF, diffValue)); - i += 3; - } - } else { - trd = getMaxValue(trd, cBasin); - } - - tData.addDataRow(trd); - } - } else { - displayName = getDisplayName(cBasin); - if (displayName != null) { - long cBasinPfaf = cBasin.getPfaf(); - String cBasinPfafStr = Long.toString(cBasinPfaf); - StringBuilder sb = new StringBuilder(cBasinPfafStr); - sb.append("\n").append(displayName); - trd.setPfaf(cBasinPfafStr); - trd.setTableCellData(0, new FFMPTableCellData(rowField, - displayName, sb.toString())); - - if (!isWorstCase || huc.equals(ALL) - || (centeredAggregationKey != null)) { - if (rateBasin != null) { - FFMPBasin basin = rateBasin.get(cBasinPfaf); - if (basin != null) { - rate = basin.getValue(paintRefTime); - } - } - trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, - rate)); - - if (qpeBasin != null) { - FFMPBasin basin = qpeBasin.get(cBasinPfaf); - if (basin != null) { - FFMPTimeWindow window = monitor.getQpeWindow(); - qpe = basin.getAccumValue(window.getAfterTime(), - window.getBeforeTime(), expirationTime, - isRate); - } - } - - trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, - qpe)); - - if (qpfBasin != null) { - FFMPBasin basin = qpfBasin.get(cBasinPfaf); - if (basin != null) { - FFMPTimeWindow window = monitor.getQpfWindow(); - qpf = basin.getAverageValue(window.getAfterTime(), - window.getBeforeTime()); - } - } - - trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, - qpf)); - - // run over each guidance type - int i = 0; - for (String guidType : guidBasins.keySet()) { - guidance = Float.NaN; - FFFGForceUtil forceUtil = forceUtils.get(guidType); - forceUtil.setSliderTime(sliderTime); - - FFMPTableCellData guidCellData = getGuidanceCellData( - cBasin, domain, guidType, cBasinPfaf); - if (guidCellData == null) { - // check for forcing even if no data are available - guidance = getForcedAvg(domain, cBasin, guidType); - boolean forced = !guidance.isNaN(); - guidCellData = new FFMPTableCellData( - FIELDS.GUIDANCE, guidance, forced); - } else { - guidance = guidCellData.getValueAsFloat(); - } - - trd.setTableCellData(i + 4, guidCellData); - - float ratioValue = Float.NaN; - float diffValue = Float.NaN; - // If guidance is NaN then it cannot be > 0 - if (!qpe.isNaN() && (guidance > 0.0f)) { - ratioValue = FFMPUtils.getRatioValue(qpe, guidance); - diffValue = FFMPUtils.getDiffValue(qpe, guidance); - } - trd.setTableCellData(i + 5, new FFMPTableCellData( - FIELDS.RATIO, ratioValue)); - trd.setTableCellData(i + 6, new FFMPTableCellData( - FIELDS.DIFF, diffValue)); - - i += 3; - } - } else { - trd = getMaxValue(trd, cBasin); - } - - tData.addDataRow(trd); - } - } - } - - private FFMPTableCellData getGuidanceCellData(FFMPBasin cBasin, - String domain, String guidType, Long parentBasinPfaf) { - long cBasinPfaf = cBasin.getPfaf(); - - FFMPBasinData guidBasin = guidBasins.get(guidType); - - FFMPGuidanceBasin ffmpGuidBasin = null; - if (guidBasin != null) { - ffmpGuidBasin = (FFMPGuidanceBasin) guidBasin.get(cBasinPfaf); - } - - if (ffmpGuidBasin == null) { - return null; - } - List pfafList = Collections.emptyList(); - List forcedPfafs = Collections.emptyList(); - boolean forced = false; - Float guidance = Float.NaN; - FFFGForceUtil forceUtil = forceUtils.get(guidType); - forceUtil.setSliderTime(sliderTime); - - // If aggregate, get basins within the aggregate - if (cBasin.getAggregated()) { - if (domain == null) { - pfafList = ft.getAggregatePfafs(cBasinPfaf, siteKey, huc); - } else if (!domain.equals(NA)) { - if (!huc.equals(ALL)) { - pfafList = ft.getAggregatePfafsByDomain(parentBasinPfaf, - siteKey, domain, huc); - } - } else { - pfafList = ft.getAggregatePfafsByDomain(parentBasinPfaf, - siteKey, domain, huc); - pfafList.add(ft.getAggregatedPfaf(cBasinPfaf, siteKey, huc)); - } - } else { - pfafList = new ArrayList(); - pfafList.add(cBasinPfaf); - } - - if (FFFGDataMgr.getInstance().isForcingConfigured()) { - FFMPBasin parentBasin = cBasin; - if (cBasinPfaf != parentBasinPfaf.longValue()) { - parentBasin = baseRec.getBasinData(ALL).get(parentBasinPfaf); - } - forceUtil.calculateForcings(domain, ft, parentBasin); - forcedPfafs = forceUtil.getForcedPfafList(); - forced = forceUtil.isForced(); - } - - if (!forcedPfafs.isEmpty() || forced || !pfafList.isEmpty()) { - // Recalculate guidance using the forced value(s) - guidance = guidRecords - .get(guidType) - .getBasinData(ALL) - .getAverageGuidanceValue(pfafList, - resource.getGuidanceInterpolators().get(guidType), - guidance, forcedPfafs, - resource.getGuidSourceExpiration(guidType)); - } else { - if (ffmpGuidBasin != null) { - guidance = resource.getGuidanceValue(ffmpGuidBasin, - paintRefTime, guidType); - - if (guidance < 0.0f) { - guidance = Float.NaN; - } - } - } - - return new FFMPTableCellData(FIELDS.GUIDANCE, guidance, forced); - } - - private float getForcedAvg(String domain, FFMPBasin cBasin, String guidType) { - FFFGForceUtil forceUtil = forceUtils.get(guidType); - forceUtil.setSliderTime(sliderTime); - FFFGDataMgr fdm = FFFGDataMgr.getInstance(); - List forcedPfafs; - List pfafList = new ArrayList(); - float guidance = Float.NaN; - - boolean forced = false; - if (fdm.isForcingConfigured()) { - forceUtil.calculateForcings(domain, ft, cBasin); - forcedPfafs = forceUtil.getForcedPfafList(); - forced = forceUtil.isForced(); - if (!forced) { - return Float.NaN; - } - } else { - return Float.NaN; - } - - if (cBasin.getAggregated()) { - if (domain == null) { - pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), siteKey, huc); - } else if (!domain.equals(NA)) { - if (!huc.equals(ALL)) { - pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), - siteKey, domain, huc); - } - } else { - pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), - siteKey, domain, huc); - pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), siteKey, - huc)); - } - } - - if (!isWorstCase || huc.equals(ALL) || (centeredAggregationKey != null)) { - if (((forcedPfafs.size() > 1)) || forced) { - // Calculate an average - guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs, - resource.getGuidanceInterpolators().get(guidType), - resource.getGuidSourceExpiration(guidType), ft); - } - } else { - // TODO Calculate a max value - - } - - return guidance; - } - - /** - * Regular basin display name - * - * @param basin - * @return - */ - private String getDisplayName(FFMPBasin basin) { - String name = null; - - try { - if (huc.equals(ALL) || (centeredAggregationKey != null)) { - name = ft.getBasin(siteKey, basin.getPfaf()).getStreamName(); - } - // aggregations - else { - - ArrayList pfafs = ft.getAggregatePfafs(basin.getPfaf(), - siteKey, huc); - if (!pfafs.isEmpty()) { - if (huc.equals(FFMPRecord.COUNTY)) { - name = ft.getCountyStateName(siteKey, basin.getPfaf()); - } else { - for (int i = 0; i < pfafs.size(); i++) { - if (ft.getBasin(siteKey, pfafs.get(0)).getHucName() != null) { - name = ft.getBasin(siteKey, pfafs.get(0)) - .getHucName(); - break; - } - } - } - } - } - } catch (Exception e) { - statusHandler.handle(Priority.WARN, "No display name for basin.." - + basin.getPfaf()); - } - return name; - } - - private FFMPTableRowData getMaxValue(FFMPTableRowData trd, FFMPBasin cBasin) { - ArrayList domainList = FFMPRunConfigurationManager - .getInstance().getDomains(); - ArrayList activeDomains = new ArrayList(); - for (DomainXML domainXml : domainList) { - for (String cwa : cwaArr) { - if (domainXml.getCwa().equalsIgnoreCase(cwa)) { - activeDomains.add(domainXml); - break; - } - } - } - - ArrayList pfafs = ft.getAggregatePfafs(cBasin.getPfaf(), siteKey, - huc, activeDomains); - trd.setPfaf(cBasin.getPfaf().toString()); - Float qpe = Float.NaN; - Float guidance = Float.NaN; - Float rate = Float.NaN; - Float qpf = Float.NaN; - Float ratioValue = Float.NaN; - Float diffValue = Float.NaN; - - if (cBasin instanceof FFMPVirtualGageBasin) { - if (!pfafs.isEmpty()) { - if (virtualBasin != null) { - rate = virtualBasin.get(cBasin.getPfaf()).getValue( - paintRefTime); - - if (sliderTime > 0.00) { - qpe = virtualBasin.get(cBasin.getPfaf()).getAccumValue( - monitor.getQpeWindow().getAfterTime(), - monitor.getQpeWindow().getBeforeTime(), - expirationTime, isRate); - } else { - qpe = 0.0f; - } - } - trd.setTableCellData(1, - new FFMPTableCellData(FIELDS.RATE, rate)); - - trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); - - if (qpfBasin != null) { - qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue( - monitor.getQpfWindow().getAfterTime(), - monitor.getQpfWindow().getBeforeTime())) - .floatValue(); - } - - trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf)); - - processGuidance(trd, cBasin, pfafs, qpe); - } - } else { - // Not Virtual - if (!pfafs.isEmpty()) { - if (rateBasin != null) { - rate = rateBasin.getMaxValue(pfafs, paintRefTime); - } - trd.setTableCellData(1, - new FFMPTableCellData(FIELDS.RATE, rate)); - - if (qpeBasin != null) { - qpe = qpeBasin.getAccumMaxValue(pfafs, monitor - .getQpeWindow().getBeforeTime(), monitor - .getQpeWindow().getAfterTime(), expirationTime, - isRate); - } - trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); - - if (qpfBasin != null) { - qpf = qpfBasin.getAverageMaxValue(pfafs, monitor - .getQpfWindow().getAfterTime(), monitor - .getQpfWindow().getBeforeTime()); - - // qpf = getQPFValue(true, new Long(0l), pfafs);/* DR13839 - // */ - } - trd.setTableCellData(3, - new FFMPTableCellData(FIELDS.QPF, qpf.floatValue())); - - // run over each guidance type - int i = 0; - for (String guidType : guidBasins.keySet()) { - guidance = Float.NaN; - diffValue = Float.NaN; - ratioValue = Float.NaN; - - FFFGForceUtil forceUtil = forceUtils.get(guidType); - forceUtil.setSliderTime(sliderTime); - - FFMPBasinData guidBasin = guidBasins.get(guidType); - - List pfafList = new ArrayList(); - if (cBasin.getAggregated()) { - pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), - siteKey, huc); - pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), - siteKey, huc)); - } - - boolean forced = false; - List forcedPfafs = new ArrayList(); - FFFGDataMgr fdm = FFFGDataMgr.getInstance(); - - if (fdm.isForcingConfigured()) { - forceUtil.calculateForcings(pfafList, ft, cBasin); - forcedPfafs = forceUtil.getForcedPfafList(); - forced = forceUtil.isForced(); - } - - if (!forced) { - if ((forcedPfafs != null) && (!forcedPfafs.isEmpty())) { - forced = true; - } - } - if ((guidBasin != null) - && (!guidBasin.getBasins().isEmpty())) { - - if (isWorstCase) { - guidance = guidRecords - .get(guidType) - .getBasinData(ALL) - .getMaxGuidanceValue( - pfafs, - resource.getGuidanceInterpolators() - .get(guidType), - resource.getGuidSourceExpiration(guidType), - cBasin.getPfaf()); - } else { - FFMPGuidanceBasin basin = (FFMPGuidanceBasin) guidRecords - .get(guidType).getBasinData(huc) - .get(cBasin.getPfaf()); - guidance = resource.getGuidanceValue(basin, monitor - .getQpeWindow().getBeforeTime(), guidType); - } - - trd.setTableCellData(i + 4, new FFMPTableCellData( - FIELDS.GUIDANCE, guidance, forced)); - } else { - if (forced) { - // Recalculate guidance using the forced value(s) - guidance = forceUtil.getMaxForcedValue( - pfafList, - forcedPfafs, - resource.getGuidanceInterpolators().get( - guidType), resource - .getGuidSourceExpiration(guidType), - ft); - } - - trd.setTableCellData(i + 4, new FFMPTableCellData( - FIELDS.GUIDANCE, guidance, forced)); - } - - // If guidance is NaN then it cannot be > 0 - if (!qpe.isNaN() && (guidance > 0.0f)) { - - List qpes = qpeBasin.getAccumValues(pfafs, - monitor.getQpeWindow().getAfterTime(), monitor - .getQpeWindow().getBeforeTime(), - expirationTime, isRate); - List guids = null; - if (guidBasin != null) { - guids = guidBasin.getGuidanceValues(pfafs, resource - .getGuidanceInterpolators().get(guidType), - resource.getGuidSourceExpiration(guidType)); - } else if (forced) { - guids = forceUtil.getForcedGuidValues( - pfafList, - forcedPfafs, - resource.getGuidanceInterpolators().get( - guidType), resource - .getGuidSourceExpiration(guidType), - ft); - } - - if ((!qpes.isEmpty()) - && ((guids != null) && (!guids.isEmpty()))) { - ratioValue = FFMPUtils - .getMaxRatioValue(qpes, guids); - diffValue = FFMPUtils.getMaxDiffValue(qpes, guids); - } - trd.setTableCellData(i + 5, new FFMPTableCellData( - FIELDS.RATIO, ratioValue)); - trd.setTableCellData(i + 6, new FFMPTableCellData( - FIELDS.DIFF, diffValue)); - } else { - trd.setTableCellData(i + 5, new FFMPTableCellData( - FIELDS.RATIO, Float.NaN)); - trd.setTableCellData(i + 6, new FFMPTableCellData( - FIELDS.DIFF, Float.NaN)); - } - - i += 3; - } - - } else { - if ((rateBasin != null) - && (rateBasin.get(cBasin.getPfaf()) != null)) { - rate = rateBasin.get(cBasin.getPfaf()).getValue( - paintRefTime); - } - trd.setTableCellData(1, - new FFMPTableCellData(FIELDS.RATE, rate)); - - if ((qpeBasin != null) - && (qpeBasin.get(cBasin.getPfaf()) != null)) { - qpe = qpeBasin.get(cBasin.getPfaf()).getAccumValue( - monitor.getQpeWindow().getAfterTime(), - monitor.getQpeWindow().getBeforeTime(), - expirationTime, isRate); - } - trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); - - if ((qpfBasin != null) - && (qpfBasin.get(cBasin.getPfaf()) != null)) { - qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue( - monitor.getQpfWindow().getAfterTime(), - monitor.getQpfWindow().getBeforeTime())) - .floatValue(); - } - trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf)); - - processGuidance(trd, cBasin, pfafs, qpe); - } - - } - - return trd; - } - - /** - * @param trd - * @param cBasin - * @param pfafs - * @param qpe - */ - private void processGuidance(FFMPTableRowData trd, FFMPBasin cBasin, - ArrayList pfafs, Float qpe) { - Float guidance; - Float ratioValue; - Float diffValue; - int i = 0; - for (String guidType : guidBasins.keySet()) { - guidance = Float.NaN; - diffValue = Float.NaN; - ratioValue = Float.NaN; - - FFFGForceUtil forceUtil = forceUtils.get(guidType); - forceUtil.setSliderTime(sliderTime); - - FFMPBasinData guidBasin = guidBasins.get(guidType); - - if (guidBasin != null) { - - FFMPGuidanceBasin basin = ((FFMPGuidanceBasin) guidBasin - .get(cBasin.getPfaf())); - guidance = resource.getGuidanceValue(basin, monitor - .getQpeWindow().getBeforeTime(), guidType); - - if (guidance < 0.0f) { - guidance = Float.NaN; - } - - forceUtil.calculateForcings(pfafs, ft, cBasin); - - List forcedPfafs = forceUtil.getForcedPfafList(); - boolean forced = forceUtil.isForced(); - - if (!forced) { - if ((forcedPfafs != null) && (!forcedPfafs.isEmpty())) { - forced = true; - } - } - - trd.setTableCellData(i + 4, new FFMPTableCellData( - FIELDS.GUIDANCE, guidance, forced)); - } else { - trd.setTableCellData(i + 4, new FFMPTableCellData( - FIELDS.GUIDANCE, Float.NaN)); - } - - // If guidance is NaN then it cannot be > 0 - if (!qpe.isNaN() && (guidance > 0.0f)) { - ratioValue = FFMPUtils.getRatioValue(qpe, guidance); - diffValue = FFMPUtils.getDiffValue(qpe, guidance); - } - trd.setTableCellData(i + 5, new FFMPTableCellData(FIELDS.RATIO, - ratioValue)); - trd.setTableCellData(i + 6, new FFMPTableCellData(FIELDS.DIFF, - diffValue)); - - i += 3; - } + FFMPRowGenerator rowTask = new FFMPRowGenerator(this, cBasin, tData, + isVGB, domain); + jobPool.schedule(rowTask); } /** @@ -1032,7 +360,7 @@ public class FFMPDataGenerator { if (isWorstCase || (centeredAggregationKey != null)) { // make sure that "ALL" is loaded - localHuc = ALL; + localHuc = FFMPRecord.ALL; } else { localHuc = huc; } @@ -1046,7 +374,7 @@ public class FFMPDataGenerator { guidRecords = monitor.getGuidanceRecords(product, siteKey, tableTime, localHuc, true); FFMPRecord virtualRecord = null; - if (localHuc.equals(ALL)) { + if (localHuc.equals(FFMPRecord.ALL)) { virtualRecord = monitor.getVirtualRecord(product, siteKey, dataKey, product.getVirtual(), tableTime, localHuc, true); } diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataLoader.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataLoader.java deleted file mode 100644 index 6128e1fb79..0000000000 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataLoader.java +++ /dev/null @@ -1,533 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.monitor.ffmp.ui.rsc; - -import java.io.File; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.Set; -import java.util.concurrent.CountDownLatch; - -import com.raytheon.uf.common.dataplugin.ffmp.FFMPAggregateRecord; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; -import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils; -import com.raytheon.uf.common.datastorage.DataStoreFactory; -import com.raytheon.uf.common.datastorage.IDataStore; -import com.raytheon.uf.common.datastorage.Request; -import com.raytheon.uf.common.datastorage.records.ByteDataRecord; -import com.raytheon.uf.common.datastorage.records.IDataRecord; -import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; -import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; -import com.raytheon.uf.common.monitor.xml.FFMPRunXML; -import com.raytheon.uf.common.monitor.xml.ProductRunXML; -import com.raytheon.uf.common.monitor.xml.ProductXML; -import com.raytheon.uf.common.monitor.xml.SourceXML; -import com.raytheon.uf.common.serialization.SerializationUtil; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; -import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig; -import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoadListener; -import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent; - -/** - * Place holder more or less for a ResourceData Object This dosen't do anything - * currently. - * - *
- * 
- * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 28 Feb, 2011   7587    dhladky     Initial creation
- * 25 Jan, 2012   DR13839 gzhang      Handle Uris and Huc processing
- * 01/27/13     1478      D. Hladky   revamped the cache file format to help NAS overloading
- * 02/01/13      1569    D. Hladky   Changed to reading aggregate records from pypies
- * Feb 28, 2013  1729      dhladky   Changed the way status messages are sent to the FFMP Dialog.
- * Mar 6, 2013   1769     dhladky    Changed threading to use count down latch.
- * Apr 9, 2013   1890     dhladky    removed loading of phantom Virtual template and cache file processing.
- * Apr 18, 2013 1912       bsteffen    Increase bulk requests to pypies.
- * Apr 26, 2013 1954       bsteffen    Minor code cleanup throughout FFMP.
- * May 22, 2013 1902       mpduff      Check for null times.
- * 
- * 
- * - * @author dhladky - * @version 1.0 - */ -public class FFMPDataLoader extends Thread { - - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(FFMPDataLoader.class); - - private ProductXML product = null; - - private FFMPRunXML runner = null; - - private Date timeBack = null; - - private Date mostRecentTime = null; - - public LOADER_TYPE loadType = null; - - private String siteKey = null; - - private String dataKey = null; - - private List hucsToLoad = null; - - private String wfo = null; - - private FFMPResourceData resourceData = null; - - private FFMPConfig config = null; - - private final ArrayList loadListeners = new ArrayList(); - - private final CountDownLatch latch; - - public FFMPDataLoader(FFMPResourceData resourceData, Date timeBack, - Date mostRecentTime, LOADER_TYPE loadType, List hucsToLoad) { - - this.product = resourceData.getProduct(); - this.siteKey = resourceData.siteKey; - this.dataKey = resourceData.dataKey; - this.timeBack = timeBack; - this.mostRecentTime = mostRecentTime; - this.loadType = loadType; - this.hucsToLoad = hucsToLoad; - this.wfo = resourceData.wfo; - this.resourceData = resourceData; - this.runner = FFMPRunConfigurationManager.getInstance().getRunner(wfo); - this.config = FFMPConfig.getInstance(); - this.latch = new CountDownLatch(1); - - if ((loadType == LOADER_TYPE.INITIAL) - || (loadType == LOADER_TYPE.GENERAL)) { - this.setPriority(MAX_PRIORITY); - } else { - this.setPriority(MIN_PRIORITY); - } - } - - public void waitFor() throws InterruptedException { - latch.await(); - } - - /** - * Add listener - * - * @param fl - */ - public synchronized void addListener(FFMPLoadListener fl) { - loadListeners.add(fl); - } - - /** - * Remove listener - * - * @param fl - */ - public synchronized void removeListener(FFMPLoadListener fl) { - loadListeners.remove(fl); - } - - // kills the loader - public void kill() { - latch.countDown(); - } - - @Override - public void run() { - - long time = System.currentTimeMillis(); - - try { - resourceData.setLoader(loadType); - FFMPMonitor monitor = getMonitor(); - FFMPSourceConfigurationManager sourceConfig = monitor - .getSourceConfig(); - - ProductRunXML productRun = runner.getProduct(siteKey); - List qpfSources = new ArrayList(); - String layer = config.getFFMPConfigData().getLayer(); - String rateURI = null; - - if (loadType != LOADER_TYPE.GENERAL) { - // preload all the uris except guidance. Guidance loads data - // much further back and it is not efficient to group with the - // rest. - Set sources = new HashSet(); - sources.add(product.getRate()); - sources.add(product.getQpe()); - sources.add(product.getVirtual()); - for (String qpfType : productRun.getQpfTypes(product)) { - for (SourceXML qpfSource : productRun.getQpfSources( - product, qpfType)) { - sources.add(qpfSource.getSourceName()); - } - } - monitor.preloadAvailableUris(siteKey, dataKey, sources, - timeBack); - } - if ((loadType == LOADER_TYPE.INITIAL || loadType == LOADER_TYPE.GENERAL) - && !product.getRate().equals(product.getQpe())) { - Map> rateURIs = monitor.getAvailableUris( - siteKey, dataKey, product.getRate(), mostRecentTime); - if (rateURIs.containsKey(mostRecentTime)) { - rateURI = rateURIs.get(mostRecentTime).get(0); - } - } - - NavigableMap> qpeURIs = monitor - .getAvailableUris(siteKey, dataKey, product.getQpe(), - timeBack); - - ArrayList>> qpfs = new ArrayList>>(); - - for (String qpfType : productRun.getQpfTypes(product)) { - for (SourceXML qpfSource : productRun.getQpfSources(product, - qpfType)) { - - NavigableMap> qpfURIs = null; - Date qpfTime = timeBack; - - if (loadType == LOADER_TYPE.GENERAL) { - qpfTime = monitor.getPreviousQueryTime(siteKey, - qpfSource.getSourceName()); - } - - qpfURIs = monitor.getAvailableUris(siteKey, dataKey, - qpfSource.getSourceName(), qpfTime); - - if (qpfURIs != null && !qpfURIs.isEmpty()) { - qpfs.add(qpfURIs); - qpfSources.add(qpfSource); - } - } - } - - NavigableMap> virtualURIs = monitor - .getAvailableUris(siteKey, dataKey, product.getVirtual(), - timeBack); - - HashMap>> guids = new HashMap>>(); - - for (String type : productRun.getGuidanceTypes(product)) { - for (SourceXML guidSource : productRun.getGuidanceSources( - product, type)) { - - NavigableMap> iguidURIs = null; - Date guidTime = timeBack; - if (loadType == LOADER_TYPE.GENERAL) { - guidTime = monitor.getPreviousQueryTime(siteKey, - guidSource.getSourceName()); - } - if (guidTime == null) { - continue; - } - - iguidURIs = monitor.getAvailableUris(siteKey, dataKey, - guidSource.getSourceName(), guidTime); - - if (iguidURIs != null && !iguidURIs.isEmpty()) { - guids.put(guidSource.getSourceName(), iguidURIs); - } - } - } - // We only load all for long range data, all + layer for medium - // range - if (loadType == LOADER_TYPE.TERTIARY) { - hucsToLoad.clear(); - hucsToLoad.add(FFMPRecord.ALL); - } else { - // Only used as place holder name, No data is linked to it, uses - // ALL - hucsToLoad.remove(FFMPRecord.VIRTUAL); - } - - if (isDone()) { - return; - } - - // rate - if (rateURI != null) { - fireLoaderEvent(loadType, "Processing " + product.getRate(), - isDone()); - for (String phuc : hucsToLoad) { - monitor.processUri(rateURI, siteKey, product.getRate(), - timeBack, phuc); - } - fireLoaderEvent(loadType, product.getRate(), isDone()); - } - - // qpes - fireLoaderEvent(loadType, "Processing " + product.getQpe(), - isDone()); - FFMPAggregateRecord qpeCache = null; - - if (loadType == LOADER_TYPE.INITIAL) { - - SourceXML source = sourceConfig.getSource(product.getQpe()); - - qpeCache = readAggregateRecord(source, dataKey, wfo); - - if (qpeCache != null) { - monitor.insertFFMPData(qpeCache, qpeURIs, siteKey, - product.getQpe()); - } - } - - // Use this method of QPE data retrieval if you don't have cache - // files - if (!qpeURIs.isEmpty()) { - for (String phuc : hucsToLoad) { - if (phuc.equals(layer) || phuc.equals(FFMPRecord.ALL)) { - monitor.processUris(qpeURIs, siteKey, product.getQpe(), - timeBack, phuc); - } - } - } - - fireLoaderEvent(loadType, product.getQpe(), isDone()); - - int i = 0; - for (NavigableMap> qpfURIs : qpfs) { - // qpf - fireLoaderEvent(loadType, "Processing " + product.getQpf(i), - isDone()); - FFMPAggregateRecord qpfCache = null; - - if (loadType == LOADER_TYPE.INITIAL) { - - SourceXML source = qpfSources.get(i); - - String pdataKey = findQPFHomeDataKey(source); - qpfCache = readAggregateRecord(source, pdataKey, wfo); - - if (qpfCache != null) { - monitor.insertFFMPData(qpfCache, qpfURIs, siteKey, - source.getSourceName()); - } - } - - // Use this method of QPF data retrieval if you don't have cache - // files - if (!qpfURIs.isEmpty()) { - for (String phuc : hucsToLoad) { - if (phuc.equals(layer) || phuc.equals(FFMPRecord.ALL)) { // old - monitor.processUris(qpfURIs, siteKey, - product.getQpf(i), timeBack, phuc); - } - } - } - - fireLoaderEvent(loadType, product.getQpf(i), isDone()); - - i++; - } - - fireLoaderEvent(loadType, "Processing " + product.getVirtual(), - isDone()); - // process virtual all for all only, never uses cache files - if (!virtualURIs.isEmpty()) { - monitor.processUris(virtualURIs, siteKey, product.getVirtual(), - timeBack, FFMPRecord.ALL); - } - - fireLoaderEvent(loadType, product.getVirtual(), isDone()); - - // process guidance all for all only, never uses cache files - for (String type : productRun.getGuidanceTypes(product)) { - - ArrayList guidSources = productRun - .getGuidanceSources(product, type); - for (SourceXML guidSource : guidSources) { - - NavigableMap> iguidURIs = guids - .get(guidSource.getSourceName()); - - fireLoaderEvent(loadType, - "Processing " + guidSource.getSourceName(), - isDone()); - - monitor.processUris(iguidURIs, siteKey, - guidSource.getSourceName(), timeBack, - FFMPRecord.ALL); - - fireLoaderEvent(loadType, guidSource.getSourceName(), - isDone()); - - } - } - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, - "General Problem in Loading FFMP Data", e); - } finally { - latch.countDown(); - synchronized (this) { - this.notifyAll(); - } - } - - String message = null; - if (loadType == LOADER_TYPE.INITIAL) { - message = "Finished Initial Load"; - } else { - message = "Finished General Data Load"; - } - - long endTime = (System.currentTimeMillis()) - time; - System.out.println(loadType.loaderType + " Loader took: " + endTime - / 1000 + " seconds"); - fireLoaderEvent(loadType, message, isDone()); - } - - /** - * Fire loader updates to the front end displays - * - * @param FFMPLoaderStatus - **/ - public void fireLoaderEvent(LOADER_TYPE ltype, String lmessage, - boolean lstatus) { - - FFMPLoaderStatus sstatus = new FFMPLoaderStatus(ltype, lmessage, - lstatus); - - FFMPLoaderEvent fle = new FFMPLoaderEvent(sstatus); - Iterator iter = loadListeners.iterator(); - - while (iter.hasNext()) { - FFMPLoadListener listener = iter.next(); - listener.loadStatus(fle); - } - - } - - private FFMPMonitor getMonitor() { - if (FFMPMonitor.isRunning()) { - return FFMPMonitor.getInstance(); - } else { - latch.countDown(); - return null; - } - } - - public enum LOADER_TYPE { - - INITIAL("Initial"), GENERAL("General"), SECONDARY("Secondary"), TERTIARY( - "Tertiary"); - - private final String loaderType; - - private LOADER_TYPE(String name) { - loaderType = name; - } - - public String getLoaderType() { - return loaderType; - } - }; - - /** - * Loads the Cache files - * - * @param sourceName - * @param huc - * @param wfo - * @return - */ - private FFMPAggregateRecord readAggregateRecord(SourceXML source, - String pdataKey, String wfo) throws Exception { - - FFMPAggregateRecord record = null; - String sourceSiteDataKey = getSourceSiteDataKey(source, pdataKey); - - try { - - File hdf5File = FFMPUtils.getHdf5File(wfo, sourceSiteDataKey); - IDataStore dataStore = DataStoreFactory.getDataStore(hdf5File); - IDataRecord rec = dataStore.retrieve(wfo, sourceSiteDataKey, - Request.ALL); - byte[] bytes = ((ByteDataRecord) rec).getByteData(); - record = SerializationUtil.transformFromThrift( - FFMPAggregateRecord.class, bytes); - } catch (Exception e) { - statusHandler.handle(Priority.WARN, - "Couldn't read Aggregate Record" + sourceSiteDataKey); - } - - return record; - } - - /** - * Finds the home datakey identifier for QPF sources - * - * @param source - * @return - */ - private String findQPFHomeDataKey(SourceXML source) { - - FFMPRunConfigurationManager runManager = FFMPRunConfigurationManager - .getInstance(); - - for (ProductRunXML product : runManager.getProducts()) { - - try { - // we are just checking if it exists or not - String pdataKey = product.getProductKey(); - String sourceSiteDataKey = getSourceSiteDataKey(source, - pdataKey); - File hdf5File = FFMPUtils.getHdf5File(wfo, sourceSiteDataKey); - DataStoreFactory.getDataStore(hdf5File); - - return pdataKey; - } catch (Exception e) { - // not the right key, doesn't exist - continue; - } - } - - return siteKey; - } - - /** - * Get the sourceSiteDataKey for this piece of data - * - * @param source - * @param pdataKey - * @return - */ - private String getSourceSiteDataKey(SourceXML source, String pdataKey) { - return source.getSourceName() + "-" + siteKey + "-" + pdataKey; - } - - public boolean isDone() { - return latch.getCount() == 0; - } - -} \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPLoaderStatus.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPLoaderStatus.java deleted file mode 100644 index ba52505621..0000000000 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPLoaderStatus.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.raytheon.uf.viz.monitor.ffmp.ui.rsc; - -/** - * 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. - **/ - -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE; - -/** - * Loader status for FFMP - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * 04/23/10     4494        D. Hladky   Initial release
- * 02/01/13     1569        D. Hladky   Added constants
- * 
- * 
- * - * @author dhladky - * @version 1 - */ - -public class FFMPLoaderStatus { - - private LOADER_TYPE loaderType = null; - - private String message = null; - - private boolean isDone = false; - - public FFMPLoaderStatus(LOADER_TYPE loaderType, String message, - boolean isDone) { - this.loaderType = loaderType; - this.message = message; - this.isDone = isDone; - } - - public LOADER_TYPE getLoaderType() { - return loaderType; - } - - public void setLoaderName(LOADER_TYPE loaderType) { - this.loaderType = loaderType; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isDone() { - return isDone; - } - - public void isDone(boolean isDone) { - this.isDone = isDone; - } - -} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java index d2831220b8..666aff8afb 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java @@ -38,7 +38,9 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; @@ -123,8 +125,6 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPCWAChangeEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPFieldChangeEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPHUCChangeEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPListener; -import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoadListener; -import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPLoaderEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPMaintainLayerEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPParentBasinEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPScreenCenterEvent; @@ -132,7 +132,7 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPStreamTraceEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPTimeChangeEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.FFMPWorstCaseEvent; import com.raytheon.uf.viz.monitor.ffmp.ui.listeners.IFFMPResourceListener; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE; +import com.raytheon.uf.viz.monitor.ffmp.ui.thread.UpdateLoadJob; import com.raytheon.viz.core.rsc.jts.JTSCompiler; import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle; import com.raytheon.viz.ui.input.EditableManager; @@ -148,25 +148,27 @@ import com.vividsolutions.jts.geom.Point; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 29 June, 2009 2521 dhladky Initial creation - * 11 Apr. 2012 DR 14522 gzhang Fixing invalid thread error. - * 31 July 2012 14517 mpduff Fix for blanking map on update. - * 14 Sep 2012 1048 njensen Code cleanup - * 07 Dec 2012 1353 rferrel Changes for non-blocking FFMPSplash dialog. - * 10 Jan 2013 1475 dhladky Some cleanup - * 27 Jan 2013 1478 dhladky Changed gap collection to a generic list instead of Arraylist - * 02/01/13 1569 D. Hladky Added constants - * 10 Feb 2013 1584 mpduff Add performance logging. - * Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord - * Feb 20, 2013 1635 dhladky Fixed multiple guidance display - * Feb 28, 2013 1729 dhladky Changed the way the loaders are managed via the status updates. - * Mar 6, 2013 1769 dhladky Changed threading to use count down latch. - * Apr 9, 2013 1890 dhladky General cleanup. - * Apr 10, 2013 1896 bsteffen Make FFMPResource work better with D2D - * time matcher. - * Apr 25, 2013 1954 bsteffen Skip extent checking for FFMP shape - * generation. - * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. + * 29 June, 2009 2521 dhladky Initial creation + * 11 Apr. 2012 DR 14522 gzhang Fixing invalid thread error. + * 31 July 2012 14517 mpduff Fix for blanking map on update. + * 14 Sep 2012 1048 njensen Code cleanup + * 07 Dec 2012 1353 rferrel Changes for non-blocking FFMPSplash dialog. + * 10 Jan 2013 1475 dhladky Some cleanup + * 27 Jan 2013 1478 dhladky Changed gap collection to a generic list instead of Arraylist + * 02/01/13 1569 D. Hladky Added constants + * 10 Feb 2013 1584 mpduff Add performance logging. + * Feb 19, 2013 1639 njensen Replaced FFMPCacheRecord with FFMPRecord + * Feb 20, 2013 1635 dhladky Fixed multiple guidance display + * Feb 28, 2013 1729 dhladky Changed the way the loaders are managed via the status updates. + * Mar 6, 2013 1769 dhladky Changed threading to use count down latch. + * Apr 9, 2013 1890 dhladky General cleanup. + * Apr 10, 2013 1896 bsteffen Make FFMPResource work better with D2D + * time matcher. + * Apr 25, 2013 1954 bsteffen Skip extent checking for FFMP shape + * generation. + * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. + * Jun 06, 2013 2075 njensen No longer schedules load threads, + * refactored updates * * * @@ -176,8 +178,7 @@ import com.vividsolutions.jts.geom.Point; public class FFMPResource extends AbstractVizResource implements - IResourceDataChanged, IFFMPResourceListener, FFMPListener, - FFMPLoadListener { + IResourceDataChanged, IFFMPResourceListener, FFMPListener { /** Status handler */ private static final IUFStatusHandler statusHandler = UFStatus @@ -356,9 +357,6 @@ public class FFMPResource extends */ public FfmpBasinTableDlg basinTableDlg; - /** data loader **/ - private FFMPDataLoader loader = null; - /** Guidance Interpolation Map **/ public HashMap interpolationMap; @@ -437,19 +435,16 @@ public class FFMPResource extends */ @Override public void resourceChanged(ChangeType type, Object object) { - ITimer timer = TimeUtil.getTimer(); - timer.start(); if (type.equals(ChangeType.DATA_UPDATE)) { FFFGDataMgr.getUpdatedInstance(); PluginDataObject[] pdos = (PluginDataObject[]) object; FFMPRecord ffmpRec = (FFMPRecord) pdos[pdos.length - 1]; - // an update clears everything - clear(); - // only care about the most recent one try { - if (ffmpRec.getSourceName() .equals(getResourceData().sourceName)) { + // an update clears everything + clear(); + // go back an extra time step Date previousMostRecentTime = null; List tok = getTimeOrderedKeys(); @@ -458,66 +453,58 @@ public class FFMPResource extends } else { previousMostRecentTime = tok.get(0); } - Date refTime = ffmpRec.getDataTime().getRefTime(); - + final Date refTime = ffmpRec.getDataTime().getRefTime(); updateTimeOrderedkeys(refTime); - if (getResourceData().tableLoad) { setTableTime(); } resourceData.populateRecord(ffmpRec); - statusHandler.handle(Priority.INFO, "Updating : Previous: " + previousMostRecentTime + " New: " + ffmpRec.getDataTime().getRefTime()); if (getResourceData().tableLoad) { - - if (loader == null) { - startLoader(previousMostRecentTime, refTime, - LOADER_TYPE.GENERAL); - } else { - try { - loader.waitFor(); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } - - startLoader(previousMostRecentTime, refTime, - LOADER_TYPE.GENERAL); - try { - loader.waitFor(); - } catch (InterruptedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } + List hucsToLoad = new ArrayList(); + hucsToLoad.add(FFMPRecord.ALL); + String currentHuc = getHuc(); + if (!currentHuc.equals(FFMPRecord.ALL)) { + hucsToLoad.add(currentHuc); } - - purge(refTime); + UpdateLoadJob updateJob = new UpdateLoadJob( + resourceData, previousMostRecentTime, refTime, + hucsToLoad); + updateJob.addJobChangeListener(new JobChangeAdapter() { + @Override + public void done(IJobChangeEvent event) { + purge(refTime); + finishUpdate(); + } + }); + updateJob.schedule(); + } else { + finishUpdate(); } - - resetRecords(); } - } catch (VizException ve) { statusHandler.handle(Priority.PROBLEM, "Error updating record", ve); } } + } + /** + * Finishes the last actions triggered by an update. Should run after the + * data is loaded if the update triggered a data load. + */ + private void finishUpdate() { + resetRecords(); if (getResourceData().tableLoad) { allowNewTableUpdate(); isFirst = true; } refresh(); - - if (type.equals(ChangeType.DATA_UPDATE)) { - timer.stop(); - perfLog.logDuration("Load Time", timer.getElapsedTime()); - } } /** @@ -707,7 +694,8 @@ public class FFMPResource extends long fips = monitor.getTemplates(getSiteKey()) .getCountyFipsByPfaf(pfafs.get(0)); - value = getGuidanceRecord().getBasinData(FFMPRecord.ALL) + value = getGuidanceRecord() + .getBasinData(FFMPRecord.ALL) .getMaxGuidanceValue(pfafs, getGuidanceInterpolation(getFFGName()), getGuidSourceExpiration(getFFGName()), fips); @@ -814,12 +802,12 @@ public class FFMPResource extends forceUtil.setSliderTime(this.getTime()); if (pfafs != null) { - forceUtil.calculateForcings(pfafs, + ForceUtilResult forceResult = forceUtil.calculateForcings(pfafs, monitor.getTemplates(getSiteKey()), basin); - List forcedPfafs = forceUtil.getForcedPfafList(); - List pfafList = forceUtil.getPfafList(); - boolean forced = forceUtil.isForced(); + List forcedPfafs = forceResult.getForcedPfafList(); + List pfafList = forceResult.getPfafList(); + boolean forced = forceResult.isForced(); if ((forcedPfafs.size() > 0) && forced) { // Recalculate the guidance using the forced value(s) value = guidRecord.getBasinData(FFMPRecord.ALL) @@ -1077,13 +1065,6 @@ public class FFMPResource extends } if (this.getName().indexOf("Table Display") > -1) { - - if (resourceData.floader != null) { - resourceData.floader.removeListener(this); - resourceData.floader.kill(); - resourceData.floader = null; - } - if (basinTableDlg != null) { closeDialog(); if (smallBasinOverlayShape != null) { @@ -1210,10 +1191,6 @@ public class FFMPResource extends FFMPDrawable drawable = null; if (paintTime != null) { - if (loader != null && !loader.isDone() - && loader.loadType == LOADER_TYPE.GENERAL) { - return; - } if (!drawables.containsKey(paintTime)) { drawable = new FFMPDrawable(getDomains()); @@ -2316,8 +2293,7 @@ public class FFMPResource extends requestQueue.poll(); } - Request req = new Request(target, drawable, - time); + Request req = new Request(target, drawable, time); requestQueue.add(req); this.schedule(); } @@ -2332,7 +2308,6 @@ public class FFMPResource extends @SuppressWarnings({ "unchecked" }) @Override protected IStatus run(IProgressMonitor progMonitor) { - VizApp.runSync(new Runnable() { @Override @@ -2414,8 +2389,7 @@ public class FFMPResource extends centeredAggr = templates .findAggregatedVGB( (String) centeredAggregationKey, - siteKey, - phuc); + siteKey, phuc); } } @@ -2429,8 +2403,7 @@ public class FFMPResource extends centeredAggr = templates .getAggregatedPfaf( (Long) centeredAggregationKey, - siteKey, - phuc); + siteKey, phuc); } } } @@ -2463,7 +2436,6 @@ public class FFMPResource extends String shadedHuc = null; if (!isAllPhuc) { - Map geomMap = hucGeomFactory .getGeometries(templates, siteKey, cwa, phuc); @@ -2482,8 +2454,8 @@ public class FFMPResource extends .keySet(); } else { allPfafs = (List) (templates - .getMap(siteKey, - cwa, phuc) + .getMap(siteKey, cwa, + phuc) .get(centeredAggr)); } @@ -2491,8 +2463,7 @@ public class FFMPResource extends Map allGeomMap = hucGeomFactory .getGeometries( templates, - siteKey, - cwa, + siteKey, cwa, FFMPRecord.ALL); IColormapShadedShape shape = shadedShapes .getShape(cwa, @@ -2521,12 +2492,10 @@ public class FFMPResource extends .keySet(); if (allPfafs != null) { - Map allGeomMap = hucGeomFactory .getGeometries( templates, - siteKey, - cwa, + siteKey, cwa, FFMPRecord.ALL); IColormapShadedShape shape = shadedShapes @@ -2655,7 +2624,7 @@ public class FFMPResource extends fshell.setCursor(null); // check whether or not the dialog needs to be dumped - monitor.splashDisposeAndDataLoad(getResource()); + monitor.splashDispose(getResource()); if (getResourceData().tableLoad && isFirst) { isFirst = false; @@ -2756,7 +2725,6 @@ public class FFMPResource extends try { for (DomainXML domains : templates.getDomains()) { String cwa = domains.getCwa(); - Map geomMap = hucGeomFactory .getGeometries(templates, getSiteKey(), cwa, FFMPRecord.ALL); @@ -3212,7 +3180,8 @@ public class FFMPResource extends for (SourceXML ffgSource : getProduct().getGuidanceSourcesByType( ffgGraphType)) { if (guidBasin.getValue(ffgSource.getSourceName(), - guidanceInterpolator, getGuidSourceExpiration(ffgGraphType)) != null) { + guidanceInterpolator, + getGuidSourceExpiration(ffgGraphType)) != null) { double time = FFMPGuiUtils.getTimeDiff(mostRecentRefTime, FFMPGuiUtils.getHourDisplacement(mostRecentRefTime, @@ -3948,32 +3917,6 @@ public class FFMPResource extends return false; } - @Override - public void loadStatus(FFMPLoaderEvent event) { - - if (basinTableDlg != null) { - // call to update the basin table dialog - if (event.getSource() instanceof FFMPLoaderStatus) { - final FFMPLoaderStatus status = (FFMPLoaderStatus) event - .getSource(); - VizApp.runAsync(new Runnable() { - public void run() { - if (basinTableDlg != null - && !basinTableDlg.isDisposed()) { - basinTableDlg.updateLoadingLabel(status); - } - } - }); - } - } - if (event.getSource() instanceof FFMPLoaderStatus) { - FFMPLoaderStatus status = (FFMPLoaderStatus) event.getSource(); - if (status.isDone()) { - issueRefresh(); - } - } - } - /** * Get the FFG used * @@ -4060,52 +4003,6 @@ public class FFMPResource extends refresh(); } - /** - * Start up a loader - * - * @param startDate - * @param endDate - * @param type - */ - private void startLoader(Date startDate, Date endDate, LOADER_TYPE type) { - - ArrayList hucsToLoad = new ArrayList(); - - if (isWorstCase) { - hucsToLoad.add(FFMPRecord.ALL); - } - - // tertiary loader only loads ALL - if (type != LOADER_TYPE.TERTIARY) { - if (!hucsToLoad.contains(getHuc())) { - hucsToLoad.add(getHuc()); - } - } else { - if (!hucsToLoad.contains(FFMPRecord.ALL)) { - hucsToLoad.add(FFMPRecord.ALL); - } - } - // destroy any old loader - if (loader != null) { - loader = null; - } - - loader = new FFMPDataLoader(getResourceData(), endDate, startDate, - type, hucsToLoad); - - loader.addListener(this); - - try { - if (!loader.isAlive()) { - loader.start(); - } - } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, "FFMP " + type - + " Data update failed", e); - loader.removeListener(this); - } - } - /** * Get the purge file time */ @@ -4137,30 +4034,6 @@ public class FFMPResource extends return 24 * TimeUtil.MILLIS_PER_HOUR; } - /** - * Kicks off additional loaders that need to be fired off - * - * @param loader - * @param isDone - */ - public void manageLoaders(FFMPLoaderStatus status) { - - if (status.getLoaderType() == LOADER_TYPE.SECONDARY) { - if (status.isDone() && !this.getResourceData().isTertiaryLoad) { - try { - Date startDate = new Date(getMostRecentTime().getTime() - - (6 * TimeUtil.MILLIS_PER_HOUR)); - FFMPMonitor.getInstance().startLoad(this, startDate, - LOADER_TYPE.TERTIARY); - - } catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, - "Secondary Data Load failure", e); - } - } - } - } - @Override public DataTime[] getDataTimes() { List dates = getTimeOrderedKeys(); diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResourceData.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResourceData.java index 7077b1f71d..d4df307a8c 100644 --- a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResourceData.java +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResourceData.java @@ -30,6 +30,11 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; + import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS; @@ -37,15 +42,13 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE; +import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager; import com.raytheon.uf.common.monitor.xml.DomainXML; import com.raytheon.uf.common.monitor.xml.ProductRunXML; import com.raytheon.uf.common.monitor.xml.ProductXML; import com.raytheon.uf.common.monitor.xml.SourceXML; import com.raytheon.uf.common.status.IPerformanceStatusHandler; -import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.PerformanceStatus; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.exception.VizException; @@ -57,24 +60,27 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfig; -import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPDataLoader.LOADER_TYPE; +import com.raytheon.uf.viz.monitor.ffmp.ui.thread.BackgroundLoadJob; +import com.raytheon.uf.viz.monitor.ffmp.ui.thread.InitHucLevelGeomsJob; +import com.raytheon.uf.viz.monitor.ffmp.ui.thread.InitialLoadJob; import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML; /** - * Place holder more or less for a ResourceData Object This dosen't do anything - * currently. + * Resource data for an FFMPResource. Schedules all of the loading jobs except + * for jobs triggered by updates. * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * 29 June, 2009   2521    dhladky     Initial creation
- * 02/01/13     1569        D. Hladky   Added constants
- * Feb 10, 2013  1584      mpduff      Add performance logging.
- * Feb 28, 2013  1729      dhladky     Got rid of thread sleeps
- * Mar 6, 2013   1769     dhladky    Changed threading to use count down latch.
+ * Jun 29, 2009 2521       dhladky     Initial creation
+ * Feb 01, 2013 1569       D. Hladky   Added constants
+ * Feb 10, 2013 1584       mpduff      Add performance logging.
+ * Feb 28, 2013 1729       dhladky     Got rid of thread sleeps
+ * Mar 06, 2013 1769       dhladky     Changed threading to use count down latch.
  * Apr 26, 2013 1954       bsteffen    Minor code cleanup throughout FFMP.
+ * Jun 06, 2013 2075       njensen     Use new load jobs
  * 
  * 
* @@ -84,11 +90,9 @@ import com.raytheon.uf.viz.monitor.ffmp.xml.FFMPConfigBasinXML; @XmlAccessorType(XmlAccessType.NONE) @XmlType(name = "ffmpResourceData") public class FFMPResourceData extends AbstractRequestableResourceData { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(FFMPResourceData.class); /** Performance log entry prefix */ - private final String prefix = "FFMP ResourceData:"; + private static final String prefix = "FFMP ResourceData:"; /** Performance logger */ private final IPerformanceStatusHandler perfLog = PerformanceStatus @@ -139,20 +143,6 @@ public class FFMPResourceData extends AbstractRequestableResourceData { /** Field default **/ protected FIELDS field = FIELDS.QPE; - public Date timeBack = null; - - /** active loader **/ - public FFMPDataLoader floader = null; - - /** mark whether or not the tertiary load has run or not **/ - public boolean isTertiaryLoad = false; - - /** mark whether or not the secondary load has run or not **/ - public boolean isSecondaryLoad = false; - - /** mark whether or not the initial load has run or not **/ - public boolean isInitialLoad = false; - public FFMPResourceData() { super(); @@ -185,33 +175,12 @@ public class FFMPResourceData extends AbstractRequestableResourceData { DataTime[] availableTimes = this.getAvailableTimes(); // no data available; + FFMPTemplates templates = null; if (availableTimes.length != 0) { product = monitor.getProductXML(sourceName); if (product != null) { monitor.launchSplash(siteKey); - FFMPTemplates templates = monitor.getTemplates(siteKey); - - // wait for templates to finish load - int i = 0; - while (!templates.done) { - try { - if (i > 5) { - statusHandler.handle(Priority.ERROR, - "Failed to read template in allotted time"); - break; - } - if (floader != null) { - synchronized (floader) { - floader.wait(1000); - } - } - i++; - } catch (InterruptedException e) { - statusHandler.handle(Priority.INFO, - "Data Loader thread interrupted, dying!", e); - } - } - + templates = monitor.getTemplates(siteKey); tableLoad = true; } @@ -242,18 +211,80 @@ public class FFMPResourceData extends AbstractRequestableResourceData { this.domains = defaults; - Date mostRecentTime = availableTimes[availableTimes.length - 1] + final Date mostRecentTime = availableTimes[availableTimes.length - 1] .getRefTime(); - this.timeBack = new Date( - (long) (mostRecentTime.getTime() - (cfgBasinXML - .getTimeFrame() * TimeUtil.MILLIS_PER_HOUR))); - List hucsToLoad = monitor.getTemplates(siteKey) - .getTemplateMgr().getHucLevels(); - // goes back X hours and pre populates the Data Hashes - FFMPDataLoader loader = new FFMPDataLoader(this, timeBack, - mostRecentTime, LOADER_TYPE.INITIAL, - hucsToLoad); - loader.run(); + final double configTimeFrame = cfgBasinXML.getTimeFrame(); + final Date timeBack = new Date( + (long) (mostRecentTime.getTime() - (configTimeFrame * TimeUtil.MILLIS_PER_HOUR))); + final List initialHucs = new ArrayList(); + initialHucs.add(FFMPRecord.ALL); + final String defaultLayer = monitor.getConfig() + .getFFMPConfigData().getLayer(); + if (!defaultLayer.equals(FFMPRecord.ALL)) { + initialHucs.add(defaultLayer); + } + InitialLoadJob initialJob = new InitialLoadJob(this, timeBack, + mostRecentTime, initialHucs); + + // schedule the secondary load to start as soon as the initial + // completes + // secondary load will be the same time period as initial with + // the hucs that the initial job did not do + initialJob.addJobChangeListener(new JobChangeAdapter() { + @Override + public void done(IJobChangeEvent event) { + Date secondStartTime = timeBack; + List secondaryHucs = FFMPTemplateConfigurationManager + .getInstance().getHucLevels(); + secondaryHucs.removeAll(initialHucs); + + BackgroundLoadJob secondaryJob = new BackgroundLoadJob( + "Secondary FFMP Load", FFMPResourceData.this, + secondStartTime, mostRecentTime, secondaryHucs); + secondaryJob.setPriority(Job.SHORT); + // schedule the tertiary load as soon as the + // secondary completes + // tertiary load will do 24 hours back of the + // same hucs as the initial load + secondaryJob + .addJobChangeListener(new JobChangeAdapter() { + @Override + public void done(IJobChangeEvent event) { + List tertiaryHucs = new ArrayList(); + tertiaryHucs.add(FFMPRecord.ALL); + Date tertiaryStartTime = new Date( + mostRecentTime.getTime() + - (24 * TimeUtil.MILLIS_PER_HOUR)); + BackgroundLoadJob tertiaryJob = new BackgroundLoadJob( + "Tertiary FFMP Load", + FFMPResourceData.this, + tertiaryStartTime, timeBack, + tertiaryHucs); + tertiaryJob + .setPreloadAvailableUris(true); + tertiaryJob.schedule(); + } + }); + secondaryJob.schedule(); + } + }); + initialJob.schedule(); + + // schedule this huc geometries job to run in the + // background so the first paints of the resource + // will be faster + List earlyLoadHucs = new ArrayList(); + earlyLoadHucs.addAll(initialHucs); + for (String otherHuc : FFMPTemplateConfigurationManager + .getInstance().getHucLevels()) { + if (!earlyLoadHucs.contains(otherHuc)) { + earlyLoadHucs.add(otherHuc); + } + } + earlyLoadHucs.remove(FFMPRecord.VIRTUAL); + InitHucLevelGeomsJob hucGeomsJob = new InitHucLevelGeomsJob( + this.siteKey, templates, earlyLoadHucs); + hucGeomsJob.schedule(); } else { /* * This appears completely un-orthodox for anything in D2D. But @@ -292,8 +323,9 @@ public class FFMPResourceData extends AbstractRequestableResourceData { NavigableMap> sourceURIs = getMonitor() .getAvailableUris(siteKey, dataKey, sourceName, standAloneTime); - monitor.processUris(sourceURIs, siteKey, - sourceName, standAloneTime, FFMPRecord.ALL); + monitor.processUris(sourceURIs, siteKey, sourceName, + standAloneTime, FFMPRecord.ALL, + SubMonitor.convert(null)); } } } @@ -392,8 +424,7 @@ public class FFMPResourceData extends AbstractRequestableResourceData { * * @param record */ - public void populateRecord(FFMPRecord precord) - throws VizException { + public void populateRecord(FFMPRecord precord) throws VizException { try { getMonitor().populateFFMPRecord(siteKey, precord, precord.getSourceName(), huc); @@ -538,19 +569,4 @@ public class FFMPResourceData extends AbstractRequestableResourceData { return sourceNames; } - /** - * Set them as done - * - * @param type - */ - public void setLoader(LOADER_TYPE type) { - if (type == LOADER_TYPE.INITIAL) { - isInitialLoad = true; - } else if (type == LOADER_TYPE.SECONDARY) { - isSecondaryLoad = true; - } else if (type == LOADER_TYPE.TERTIARY) { - isTertiaryLoad = true; - } - } - } diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java new file mode 100644 index 0000000000..adbce16edc --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPRowGenerator.java @@ -0,0 +1,841 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.rsc; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinData; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPGuidanceBasin; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord.FIELDS; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasin; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPVirtualGageBasinMetaData; +import com.raytheon.uf.common.monitor.config.FFFGDataMgr; +import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; +import com.raytheon.uf.common.monitor.xml.DomainXML; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; +import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableCellData; +import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableData; +import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPTableRowData; +import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData; + +/** + * Generates an FFMPTableRowData for the parameters specified and adds them to + * the table data. This class was created by separating out some of the logic of + * FFMPDataGenerator. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 11, 2013 2085       njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class FFMPRowGenerator implements Runnable { + + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(FFMPRowGenerator.class); + + private static final String NA = "NA"; + + // values specific to this row + private FFMPBasin cBasin; + + private FFMPTableData tData; + + private boolean isVGB; + + private String domain; + + // values shared between all rows + private final String siteKey; + + private final Date paintRefTime; + + private final Object centeredAggregationKey; + + private final String huc; + + private final double sliderTime; + + private boolean isWorstCase = false; + + private FFMPTemplates ft = null; + + private FFMPResource resource = null; + + private FFMPMonitor monitor = null; + + private FFMPBasinData qpeBasin = null; + + private FFMPBasinData qpfBasin = null; + + private FFMPBasinData rateBasin = null; + + private Map guidBasins = null; + + private FFMPBasinData virtualBasin = null; + + private Map guidRecords = null; + + protected FFMPRecord baseRec = null; + + private boolean isRate = false; + + private long expirationTime = 0l; + + private String[] cwaArr = null; + + private Map forceUtils = null; + + private FfmpTableConfigData ffmpTableCfgData = null; + + public FFMPRowGenerator(FFMPDataGenerator parent, FFMPBasin cBasin, + FFMPTableData tData, boolean isVGB, String domain) { + // these are the values related to this specific row + this.cBasin = cBasin; + this.tData = tData; + this.isVGB = isVGB; + this.domain = domain; + + // these are the values shared between all rows + this.siteKey = parent.siteKey; + this.paintRefTime = parent.paintRefTime; + this.centeredAggregationKey = parent.centeredAggregationKey; + this.huc = parent.huc; + this.sliderTime = parent.sliderTime; + this.isWorstCase = parent.isWorstCase; + this.ft = parent.ft; + this.resource = parent.resource; + this.monitor = parent.monitor; + this.qpeBasin = parent.qpeBasin; + this.qpfBasin = parent.qpfBasin; + this.rateBasin = parent.rateBasin; + this.guidBasins = parent.guidBasins; + this.virtualBasin = parent.virtualBasin; + this.guidRecords = parent.guidRecords; + this.baseRec = parent.baseRec; + this.isRate = parent.isRate; + this.expirationTime = parent.expirationTime; + this.cwaArr = parent.cwaArr; + this.forceUtils = parent.forceUtils; + this.ffmpTableCfgData = parent.ffmpTableCfgData; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Runnable#run() + */ + @Override + public void run() { + String displayName = ""; + String mouseOverText = ""; + + FFMPTableRowData trd = new FFMPTableRowData( + ffmpTableCfgData.getTableColumnKeys().length); + + Float guidance = Float.NaN; + Float qpe = Float.NaN; + Float rate = Float.NaN; + Float qpf = Float.NaN; + FIELDS rowField = FIELDS.NAME; + + if (isVGB) { + rowField = FIELDS.VIRTUAL; + } + + if (cBasin instanceof FFMPVirtualGageBasin) { + rowField = FIELDS.VIRTUAL; + + FFMPVirtualGageBasin vgBasin = (FFMPVirtualGageBasin) cBasin; + + String lid = vgBasin.getLid(); + + if (lid != null) { + StringBuilder sb = new StringBuilder(lid); + // in this special case it is actually the LID + trd.setPfaf(lid); + FFMPVirtualGageBasinMetaData fvgmbd = ft + .getVirtualGageBasinMetaData(siteKey, lid); + FFMPBasinMetaData metabasin = ft.getBasin(siteKey, + fvgmbd.getParentPfaf()); + Long parentBasinPfaf = fvgmbd.getParentPfaf(); + + mouseOverText = metabasin.getBasinId() + "\n" + lid + "-" + + fvgmbd.getName(); + + if (!huc.equals(FFMPRecord.ALL)) { + sb.append("-").append(fvgmbd.getName()); + } + + trd.setTableCellData(0, + new FFMPTableCellData(rowField, sb.toString(), + mouseOverText)); + + if (!isWorstCase || huc.equals(FFMPRecord.ALL) + || (centeredAggregationKey != null)) { + + if (!cBasin.getValues().isEmpty()) { + rate = vgBasin.getValue(paintRefTime); + if (sliderTime > 0.00) { + FFMPTimeWindow window = monitor.getQpeWindow(); + qpe = cBasin.getAccumValue(window.getAfterTime(), + window.getBeforeTime(), expirationTime, + isRate); + } else { + qpe = 0.0f; + } + } + + trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, + rate)); + trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, + qpe)); + + if (qpfBasin != null) { + FFMPBasin basin = qpfBasin.get(parentBasinPfaf); + if (basin != null) { + FFMPTimeWindow window = monitor.getQpfWindow(); + qpf = basin.getAverageValue(window.getAfterTime(), + window.getBeforeTime()); + } + } + trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, + qpf)); + + // run over each guidance type + int i = 0; + for (String guidType : guidBasins.keySet()) { + guidance = Float.NaN; + + FFMPTableCellData guidCellData = getGuidanceCellData( + cBasin, domain, guidType, parentBasinPfaf); + if (guidCellData == null) { + // check for forcing even if no data are available + guidance = getForcedAvg(domain, cBasin, guidType); + boolean forced = !guidance.isNaN(); + guidCellData = new FFMPTableCellData( + FIELDS.GUIDANCE, guidance, forced); + } else { + guidance = guidCellData.getValueAsFloat(); + } + + trd.setTableCellData(i + 4, guidCellData); + + float ratioValue = Float.NaN; + float diffValue = Float.NaN; + + // If guidance is NaN then it cannot be > 0 + if (!qpe.isNaN() && (guidance > 0.0f)) { + ratioValue = FFMPUtils.getRatioValue(qpe, guidance); + diffValue = FFMPUtils.getDiffValue(qpe, guidance); + } + trd.setTableCellData(i + 5, new FFMPTableCellData( + FIELDS.RATIO, ratioValue)); + trd.setTableCellData(i + 6, new FFMPTableCellData( + FIELDS.DIFF, diffValue)); + i += 3; + } + } else { + trd = getMaxValue(trd, cBasin); + } + + trd.setSortCallback(tData); + tData.addDataRow(trd); + } + } else { + displayName = getDisplayName(cBasin); + if (displayName != null) { + long cBasinPfaf = cBasin.getPfaf(); + String cBasinPfafStr = Long.toString(cBasinPfaf); + StringBuilder sb = new StringBuilder(cBasinPfafStr); + sb.append("\n").append(displayName); + trd.setPfaf(cBasinPfafStr); + trd.setTableCellData(0, new FFMPTableCellData(rowField, + displayName, sb.toString())); + + if (!isWorstCase || huc.equals(FFMPRecord.ALL) + || (centeredAggregationKey != null)) { + if (rateBasin != null) { + FFMPBasin basin = rateBasin.get(cBasinPfaf); + if (basin != null) { + rate = basin.getValue(paintRefTime); + } + } + trd.setTableCellData(1, new FFMPTableCellData(FIELDS.RATE, + rate)); + + if (qpeBasin != null) { + FFMPBasin basin = qpeBasin.get(cBasinPfaf); + if (basin != null) { + FFMPTimeWindow window = monitor.getQpeWindow(); + qpe = basin.getAccumValue(window.getAfterTime(), + window.getBeforeTime(), expirationTime, + isRate); + } + } + + trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, + qpe)); + + if (qpfBasin != null) { + FFMPBasin basin = qpfBasin.get(cBasinPfaf); + if (basin != null) { + FFMPTimeWindow window = monitor.getQpfWindow(); + qpf = basin.getAverageValue(window.getAfterTime(), + window.getBeforeTime()); + } + } + + trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, + qpf)); + + // run over each guidance type + int i = 0; + for (String guidType : guidBasins.keySet()) { + guidance = Float.NaN; + FFFGForceUtil forceUtil = forceUtils.get(guidType); + forceUtil.setSliderTime(sliderTime); + + FFMPTableCellData guidCellData = getGuidanceCellData( + cBasin, domain, guidType, cBasinPfaf); + if (guidCellData == null) { + // check for forcing even if no data are available + guidance = getForcedAvg(domain, cBasin, guidType); + boolean forced = !guidance.isNaN(); + guidCellData = new FFMPTableCellData( + FIELDS.GUIDANCE, guidance, forced); + } else { + guidance = guidCellData.getValueAsFloat(); + } + + trd.setTableCellData(i + 4, guidCellData); + + float ratioValue = Float.NaN; + float diffValue = Float.NaN; + // If guidance is NaN then it cannot be > 0 + if (!qpe.isNaN() && (guidance > 0.0f)) { + ratioValue = FFMPUtils.getRatioValue(qpe, guidance); + diffValue = FFMPUtils.getDiffValue(qpe, guidance); + } + trd.setTableCellData(i + 5, new FFMPTableCellData( + FIELDS.RATIO, ratioValue)); + trd.setTableCellData(i + 6, new FFMPTableCellData( + FIELDS.DIFF, diffValue)); + + i += 3; + } + } else { + trd = getMaxValue(trd, cBasin); + } + + trd.setSortCallback(tData); + tData.addDataRow(trd); + } + } + } + + /** + * Regular basin display name + * + * @param basin + * @return + */ + private String getDisplayName(FFMPBasin basin) { + String name = null; + + try { + if (huc.equals(FFMPRecord.ALL) || (centeredAggregationKey != null)) { + name = ft.getBasin(siteKey, basin.getPfaf()).getStreamName(); + } + // aggregations + else { + + ArrayList pfafs = ft.getAggregatePfafs(basin.getPfaf(), + siteKey, huc); + if (!pfafs.isEmpty()) { + if (huc.equals(FFMPRecord.COUNTY)) { + name = ft.getCountyStateName(siteKey, basin.getPfaf()); + } else { + for (int i = 0; i < pfafs.size(); i++) { + if (ft.getBasin(siteKey, pfafs.get(0)).getHucName() != null) { + name = ft.getBasin(siteKey, pfafs.get(0)) + .getHucName(); + break; + } + } + } + } + } + } catch (Exception e) { + statusHandler.handle(Priority.WARN, "No display name for basin.." + + basin.getPfaf()); + } + return name; + } + + private FFMPTableRowData getMaxValue(FFMPTableRowData trd, FFMPBasin cBasin) { + ArrayList domainList = FFMPRunConfigurationManager + .getInstance().getDomains(); + ArrayList activeDomains = new ArrayList(); + for (DomainXML domainXml : domainList) { + for (String cwa : cwaArr) { + if (domainXml.getCwa().equalsIgnoreCase(cwa)) { + activeDomains.add(domainXml); + break; + } + } + } + + ArrayList pfafs = ft.getAggregatePfafs(cBasin.getPfaf(), siteKey, + huc, activeDomains); + trd.setPfaf(cBasin.getPfaf().toString()); + Float qpe = Float.NaN; + Float guidance = Float.NaN; + Float rate = Float.NaN; + Float qpf = Float.NaN; + Float ratioValue = Float.NaN; + Float diffValue = Float.NaN; + + if (cBasin instanceof FFMPVirtualGageBasin) { + if (!pfafs.isEmpty()) { + if (virtualBasin != null) { + rate = virtualBasin.get(cBasin.getPfaf()).getValue( + paintRefTime); + + if (sliderTime > 0.00) { + qpe = virtualBasin.get(cBasin.getPfaf()).getAccumValue( + monitor.getQpeWindow().getAfterTime(), + monitor.getQpeWindow().getBeforeTime(), + expirationTime, isRate); + } else { + qpe = 0.0f; + } + } + trd.setTableCellData(1, + new FFMPTableCellData(FIELDS.RATE, rate)); + + trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); + + if (qpfBasin != null) { + qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue( + monitor.getQpfWindow().getAfterTime(), + monitor.getQpfWindow().getBeforeTime())) + .floatValue(); + } + + trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf)); + + processGuidance(trd, cBasin, pfafs, qpe); + } + } else { + // Not Virtual + if (!pfafs.isEmpty()) { + if (rateBasin != null) { + rate = rateBasin.getMaxValue(pfafs, paintRefTime); + } + trd.setTableCellData(1, + new FFMPTableCellData(FIELDS.RATE, rate)); + + if (qpeBasin != null) { + qpe = qpeBasin.getAccumMaxValue(pfafs, monitor + .getQpeWindow().getBeforeTime(), monitor + .getQpeWindow().getAfterTime(), expirationTime, + isRate); + } + trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); + + if (qpfBasin != null) { + qpf = qpfBasin.getAverageMaxValue(pfafs, monitor + .getQpfWindow().getAfterTime(), monitor + .getQpfWindow().getBeforeTime()); + + // qpf = getQPFValue(true, new Long(0l), pfafs);/* DR13839 + // */ + } + trd.setTableCellData(3, + new FFMPTableCellData(FIELDS.QPF, qpf.floatValue())); + + // run over each guidance type + int i = 0; + for (String guidType : guidBasins.keySet()) { + guidance = Float.NaN; + diffValue = Float.NaN; + ratioValue = Float.NaN; + + FFFGForceUtil forceUtil = forceUtils.get(guidType); + forceUtil.setSliderTime(sliderTime); + + FFMPBasinData guidBasin = guidBasins.get(guidType); + + List pfafList = new ArrayList(); + if (cBasin.getAggregated()) { + pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), + siteKey, huc); + pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), + siteKey, huc)); + } + + boolean forced = false; + List forcedPfafs = new ArrayList(); + FFFGDataMgr fdm = FFFGDataMgr.getInstance(); + + if (fdm.isForcingConfigured()) { + ForceUtilResult forceResult = forceUtil + .calculateForcings(pfafList, ft, cBasin); + forcedPfafs = forceResult.getForcedPfafList(); + forced = forceResult.isForced(); + } + + if (!forced) { + if ((forcedPfafs != null) && (!forcedPfafs.isEmpty())) { + forced = true; + } + } + if ((guidBasin != null) + && (!guidBasin.getBasins().isEmpty())) { + + if (isWorstCase) { + guidance = guidRecords + .get(guidType) + .getBasinData(FFMPRecord.ALL) + .getMaxGuidanceValue( + pfafs, + resource.getGuidanceInterpolators() + .get(guidType), + resource.getGuidSourceExpiration(guidType), + cBasin.getPfaf()); + } else { + FFMPGuidanceBasin basin = (FFMPGuidanceBasin) guidRecords + .get(guidType).getBasinData(huc) + .get(cBasin.getPfaf()); + guidance = resource.getGuidanceValue(basin, monitor + .getQpeWindow().getBeforeTime(), guidType); + } + + trd.setTableCellData(i + 4, new FFMPTableCellData( + FIELDS.GUIDANCE, guidance, forced)); + } else { + if (forced) { + // Recalculate guidance using the forced value(s) + guidance = forceUtil.getMaxForcedValue( + pfafList, + forcedPfafs, + resource.getGuidanceInterpolators().get( + guidType), resource + .getGuidSourceExpiration(guidType), + ft); + } + + trd.setTableCellData(i + 4, new FFMPTableCellData( + FIELDS.GUIDANCE, guidance, forced)); + } + + // If guidance is NaN then it cannot be > 0 + if (!qpe.isNaN() && (guidance > 0.0f)) { + + List qpes = qpeBasin.getAccumValues(pfafs, + monitor.getQpeWindow().getAfterTime(), monitor + .getQpeWindow().getBeforeTime(), + expirationTime, isRate); + List guids = null; + if (guidBasin != null) { + guids = guidBasin.getGuidanceValues(pfafs, resource + .getGuidanceInterpolators().get(guidType), + resource.getGuidSourceExpiration(guidType)); + } else if (forced) { + guids = forceUtil.getForcedGuidValues( + pfafList, + forcedPfafs, + resource.getGuidanceInterpolators().get( + guidType), resource + .getGuidSourceExpiration(guidType), + ft); + } + + if ((!qpes.isEmpty()) + && ((guids != null) && (!guids.isEmpty()))) { + ratioValue = FFMPUtils + .getMaxRatioValue(qpes, guids); + diffValue = FFMPUtils.getMaxDiffValue(qpes, guids); + } + trd.setTableCellData(i + 5, new FFMPTableCellData( + FIELDS.RATIO, ratioValue)); + trd.setTableCellData(i + 6, new FFMPTableCellData( + FIELDS.DIFF, diffValue)); + } else { + trd.setTableCellData(i + 5, new FFMPTableCellData( + FIELDS.RATIO, Float.NaN)); + trd.setTableCellData(i + 6, new FFMPTableCellData( + FIELDS.DIFF, Float.NaN)); + } + + i += 3; + } + + } else { + if ((rateBasin != null) + && (rateBasin.get(cBasin.getPfaf()) != null)) { + rate = rateBasin.get(cBasin.getPfaf()).getValue( + paintRefTime); + } + trd.setTableCellData(1, + new FFMPTableCellData(FIELDS.RATE, rate)); + + if ((qpeBasin != null) + && (qpeBasin.get(cBasin.getPfaf()) != null)) { + qpe = qpeBasin.get(cBasin.getPfaf()).getAccumValue( + monitor.getQpeWindow().getAfterTime(), + monitor.getQpeWindow().getBeforeTime(), + expirationTime, isRate); + } + trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE, qpe)); + + if ((qpfBasin != null) + && (qpfBasin.get(cBasin.getPfaf()) != null)) { + qpf = new Float(qpfBasin.get(cBasin.getPfaf()).getMaxValue( + monitor.getQpfWindow().getAfterTime(), + monitor.getQpfWindow().getBeforeTime())) + .floatValue(); + } + trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF, qpf)); + + processGuidance(trd, cBasin, pfafs, qpe); + } + + } + + return trd; + } + + /** + * @param trd + * @param cBasin + * @param pfafs + * @param qpe + */ + private void processGuidance(FFMPTableRowData trd, FFMPBasin cBasin, + ArrayList pfafs, Float qpe) { + Float guidance; + Float ratioValue; + Float diffValue; + int i = 0; + for (String guidType : guidBasins.keySet()) { + guidance = Float.NaN; + diffValue = Float.NaN; + ratioValue = Float.NaN; + + FFFGForceUtil forceUtil = forceUtils.get(guidType); + forceUtil.setSliderTime(sliderTime); + + FFMPBasinData guidBasin = guidBasins.get(guidType); + + if (guidBasin != null) { + + FFMPGuidanceBasin basin = ((FFMPGuidanceBasin) guidBasin + .get(cBasin.getPfaf())); + guidance = resource.getGuidanceValue(basin, monitor + .getQpeWindow().getBeforeTime(), guidType); + + if (guidance < 0.0f) { + guidance = Float.NaN; + } + + ForceUtilResult forceResult = forceUtil.calculateForcings( + pfafs, ft, cBasin); + + List forcedPfafs = forceResult.getForcedPfafList(); + boolean forced = forceResult.isForced(); + + if (!forced) { + if ((forcedPfafs != null) && (!forcedPfafs.isEmpty())) { + forced = true; + } + } + + trd.setTableCellData(i + 4, new FFMPTableCellData( + FIELDS.GUIDANCE, guidance, forced)); + } else { + trd.setTableCellData(i + 4, new FFMPTableCellData( + FIELDS.GUIDANCE, Float.NaN)); + } + + // If guidance is NaN then it cannot be > 0 + if (!qpe.isNaN() && (guidance > 0.0f)) { + ratioValue = FFMPUtils.getRatioValue(qpe, guidance); + diffValue = FFMPUtils.getDiffValue(qpe, guidance); + } + trd.setTableCellData(i + 5, new FFMPTableCellData(FIELDS.RATIO, + ratioValue)); + trd.setTableCellData(i + 6, new FFMPTableCellData(FIELDS.DIFF, + diffValue)); + + i += 3; + } + } + + private float getForcedAvg(String domain, FFMPBasin cBasin, String guidType) { + FFFGForceUtil forceUtil = forceUtils.get(guidType); + forceUtil.setSliderTime(sliderTime); + FFFGDataMgr fdm = FFFGDataMgr.getInstance(); + List forcedPfafs; + List pfafList = new ArrayList(); + float guidance = Float.NaN; + + boolean forced = false; + if (fdm.isForcingConfigured()) { + ForceUtilResult forceResult = forceUtil.calculateForcings(domain, + ft, cBasin); + forcedPfafs = forceResult.getForcedPfafList(); + forced = forceResult.isForced(); + if (!forced) { + return Float.NaN; + } + } else { + return Float.NaN; + } + + if (cBasin.getAggregated()) { + if (domain == null) { + pfafList = ft.getAggregatePfafs(cBasin.getPfaf(), siteKey, huc); + } else if (!domain.equals(NA)) { + if (!huc.equals(FFMPRecord.ALL)) { + pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), + siteKey, domain, huc); + } + } else { + pfafList = ft.getAggregatePfafsByDomain(cBasin.getPfaf(), + siteKey, domain, huc); + pfafList.add(ft.getAggregatedPfaf(cBasin.getPfaf(), siteKey, + huc)); + } + } + + if (!isWorstCase || huc.equals(FFMPRecord.ALL) + || (centeredAggregationKey != null)) { + if (((forcedPfafs.size() > 1)) || forced) { + // Calculate an average + guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs, + resource.getGuidanceInterpolators().get(guidType), + resource.getGuidSourceExpiration(guidType), ft); + } + } else { + // TODO Calculate a max value + + } + + return guidance; + } + + private FFMPTableCellData getGuidanceCellData(FFMPBasin cBasin, + String domain, String guidType, Long parentBasinPfaf) { + long cBasinPfaf = cBasin.getPfaf(); + + FFMPBasinData guidBasin = guidBasins.get(guidType); + + FFMPGuidanceBasin ffmpGuidBasin = null; + if (guidBasin != null) { + ffmpGuidBasin = (FFMPGuidanceBasin) guidBasin.get(cBasinPfaf); + } + + if (ffmpGuidBasin == null) { + return null; + } + List pfafList = Collections.emptyList(); + List forcedPfafs = Collections.emptyList(); + boolean forced = false; + Float guidance = Float.NaN; + FFFGForceUtil forceUtil = forceUtils.get(guidType); + forceUtil.setSliderTime(sliderTime); + + // If aggregate, get basins within the aggregate + if (cBasin.getAggregated()) { + if (domain == null) { + pfafList = ft.getAggregatePfafs(cBasinPfaf, siteKey, huc); + } else if (!domain.equals(NA)) { + if (!huc.equals(FFMPRecord.ALL)) { + pfafList = ft.getAggregatePfafsByDomain(parentBasinPfaf, + siteKey, domain, huc); + } + } else { + pfafList = ft.getAggregatePfafsByDomain(parentBasinPfaf, + siteKey, domain, huc); + pfafList.add(ft.getAggregatedPfaf(cBasinPfaf, siteKey, huc)); + } + } else { + pfafList = new ArrayList(); + pfafList.add(cBasinPfaf); + } + + if (FFFGDataMgr.getInstance().isForcingConfigured()) { + FFMPBasin parentBasin = cBasin; + if (cBasinPfaf != parentBasinPfaf.longValue()) { + parentBasin = baseRec.getBasinData(FFMPRecord.ALL).get( + parentBasinPfaf); + } + ForceUtilResult forceResult = forceUtil.calculateForcings(domain, + ft, parentBasin); + forcedPfafs = forceResult.getForcedPfafList(); + forced = forceResult.isForced(); + } + + if (!forcedPfafs.isEmpty() || forced || !pfafList.isEmpty()) { + // Recalculate guidance using the forced value(s) + guidance = guidRecords + .get(guidType) + .getBasinData(FFMPRecord.ALL) + .getAverageGuidanceValue(pfafList, + resource.getGuidanceInterpolators().get(guidType), + guidance, forcedPfafs, + resource.getGuidSourceExpiration(guidType)); + } else { + if (ffmpGuidBasin != null) { + guidance = resource.getGuidanceValue(ffmpGuidBasin, + paintRefTime, guidType); + + if (guidance < 0.0f) { + guidance = Float.NaN; + } + } + } + + return new FFMPTableCellData(FIELDS.GUIDANCE, guidance, forced); + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/ForceUtilResult.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/ForceUtilResult.java new file mode 100644 index 0000000000..2205033577 --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/ForceUtilResult.java @@ -0,0 +1,84 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.rsc; + +import java.util.List; + +/** + * Holds the results of calculating forcings from the FFFGForceUtil. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 17, 2013 2085       njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class ForceUtilResult { + + protected boolean forced; + + protected List pfafList; + + protected List forcedPfafList; + + /** + * Constructor + * + * @param forced + * @param pfafList + * @param forcedPfafList + */ + protected ForceUtilResult(boolean forced, List pfafList, + List forcedPfafList) { + this.forced = forced; + this.pfafList = pfafList; + this.forcedPfafList = forcedPfafList; + } + + /** + * @return the forced + */ + public boolean isForced() { + return forced; + } + + /** + * @return the forcedPfafList + */ + public List getForcedPfafList() { + return forcedPfafList; + } + + /** + * @return the pfafList + */ + public List getPfafList() { + return pfafList; + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/AbstractLoadJob.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/AbstractLoadJob.java new file mode 100644 index 0000000000..02ae95e599 --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/AbstractLoadJob.java @@ -0,0 +1,313 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.thread; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NavigableMap; +import java.util.Set; + +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.runtime.jobs.Job; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; +import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; +import com.raytheon.uf.common.monitor.xml.FFMPRunXML; +import com.raytheon.uf.common.monitor.xml.ProductRunXML; +import com.raytheon.uf.common.monitor.xml.ProductXML; +import com.raytheon.uf.common.monitor.xml.SourceXML; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; +import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResourceData; + +/** + * FFMP load job that retrieves and loads data. Created by refactoring and + * separating out the logic in the FFMPDataLoader. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 04, 2013 2075       njensen     Initial creation
+ * Jun 07, 2013 2075       njensen     Added progress monitoring
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public abstract class AbstractLoadJob extends Job { + + protected static final int PROGRESS_FACTOR = 10; + + protected static final IUFStatusHandler statusHandler = UFStatus + .getHandler(AbstractLoadJob.class); + + protected ProductXML product = null; + + protected ProductRunXML productRun; + + protected FFMPResourceData resourceData; + + // TODO contemplate making the two times into a TimeRange + protected Date startTime = null; + + protected Date endTime = null; + + protected FFMPMonitor ffmpMonitor; + + protected List hucsToLoad = null; + + /** + * Constructor + * + * @param name + * name of the job + * @param resourceData + * the resource data that is loading + * @param timeBack + * the oldest time to load data for + * @param mostRecentTime + * the newest time to load for + * @param hucsToLoad + * the hucs to load + */ + public AbstractLoadJob(String name, FFMPResourceData resourceData, + Date timeBack, Date mostRecentTime, List hucsToLoad) { + super(name); + this.setSystem(false); + + this.resourceData = resourceData; + this.startTime = timeBack; + this.endTime = mostRecentTime; + this.hucsToLoad = hucsToLoad; + + // configure FFMP + this.hucsToLoad.remove(FFMPRecord.VIRTUAL); + FFMPRunXML runXML = FFMPRunConfigurationManager.getInstance() + .getRunner(resourceData.wfo); + this.productRun = runXML.getProduct(resourceData.siteKey); + this.product = resourceData.getProduct(); + this.ffmpMonitor = FFMPMonitor.getInstance(); + + // just for debugging/logging + StringBuilder sb = new StringBuilder(); + sb.append(name); + sb.append(" hucs to load: "); + Iterator itr = this.hucsToLoad.iterator(); + while (itr.hasNext()) { + sb.append(itr.next()); + if (itr.hasNext()) { + sb.append(", "); + } + } + System.out.println(sb.toString()); + } + + /** + * Preloads the available URIs. Should NOT be called by the update job. + */ + protected void preloadAvailableUris() { + // preload all the uris except guidance. Guidance loads data + // much further back and it is not efficient to group with the + // rest. + Set sources = new HashSet(); + sources.add(product.getRate()); + sources.add(product.getQpe()); + sources.add(product.getVirtual()); + for (String qpfType : productRun.getQpfTypes(product)) { + for (SourceXML qpfSource : productRun.getQpfSources(product, + qpfType)) { + sources.add(qpfSource.getSourceName()); + } + } + ffmpMonitor.preloadAvailableUris(resourceData.siteKey, + resourceData.dataKey, sources, startTime); + } + + /** + * Gets and processes the rate URIs. Should only be used by the initial job + * and update jobs. + */ + protected void doRate() { + String rateURI = null; + if (!product.getRate().equals(product.getQpe())) { + Map> rateURIs = ffmpMonitor.getAvailableUris( + resourceData.siteKey, resourceData.dataKey, + product.getRate(), endTime); + if (rateURIs.containsKey(endTime)) { + rateURI = rateURIs.get(endTime).get(0); + } + } + if (rateURI != null) { + for (String phuc : hucsToLoad) { + ffmpMonitor.processUri(rateURI, resourceData.siteKey, + product.getRate(), startTime, phuc); + } + } + } + + /** + * Gets the available QPE URIs + * + * @return + */ + protected NavigableMap> getQpeUris() { + return ffmpMonitor.getAvailableUris(resourceData.siteKey, + resourceData.dataKey, product.getQpe(), startTime); + } + + /** + * Processes the qpe URIs + * + * @param qpeURIs + */ + protected void doQpe(NavigableMap> qpeURIs, + SubMonitor smonitor) { + if (!qpeURIs.isEmpty()) { + smonitor.beginTask(null, hucsToLoad.size() * PROGRESS_FACTOR); + for (String phuc : hucsToLoad) { + ffmpMonitor.processUris(qpeURIs, resourceData.siteKey, + product.getQpe(), startTime, phuc, + smonitor.newChild(PROGRESS_FACTOR)); + } + } + } + + /** + * Gets the available QPF URIs for a particular source + * + * @param sourceName + * @param qpfTime + * @return + */ + protected NavigableMap> getQpfUris(String sourceName, + Date qpfTime) { + return ffmpMonitor.getAvailableUris(resourceData.siteKey, + resourceData.dataKey, sourceName, qpfTime); + } + + /** + * Gets the available QPF URIs for all sources + * + * @param qpfTime + * @return + */ + protected List>> getQpfUris(Date qpfTime) { + ArrayList>> qpfs = new ArrayList>>(); + for (String qpfType : productRun.getQpfTypes(product)) { + for (SourceXML qpfSource : productRun.getQpfSources(product, + qpfType)) { + NavigableMap> qpfURIs = getQpfUris( + qpfSource.getSourceName(), qpfTime); + + if (qpfURIs != null && !qpfURIs.isEmpty()) { + qpfs.add(qpfURIs); + } + } + } + + return qpfs; + } + + /** + * Processes the QPF URIs + * + * @param qpfURIs + * @param productQpf + */ + protected void doQpf(NavigableMap> qpfURIs, + String productQpf, SubMonitor smonitor) { + // Use this method of QPF data retrieval if you don't have cache + // files + if (!qpfURIs.isEmpty()) { + smonitor.beginTask(null, hucsToLoad.size() * PROGRESS_FACTOR); + for (String phuc : hucsToLoad) { + ffmpMonitor.processUris(qpfURIs, resourceData.siteKey, + productQpf, startTime, phuc, + smonitor.newChild(PROGRESS_FACTOR)); + } + } + } + + /** + * Processes the available virtual URIs + */ + protected void doVirtual(SubMonitor smonitor) { + NavigableMap> virtualURIs = ffmpMonitor + .getAvailableUris(resourceData.siteKey, resourceData.dataKey, + product.getVirtual(), startTime); + if (!virtualURIs.isEmpty()) { + ffmpMonitor.processUris(virtualURIs, resourceData.siteKey, + product.getVirtual(), startTime, FFMPRecord.ALL, smonitor); + } + } + + /** + * Gets the available guidance URIs for a particular source + * + * @param sourceName + * @param guidTime + * @return + */ + protected NavigableMap> getGuidURIs(String sourceName, + Date guidTime) { + NavigableMap> retVal = null; + if (guidTime != null) { + retVal = ffmpMonitor.getAvailableUris(resourceData.siteKey, + resourceData.dataKey, sourceName, guidTime); + } + return retVal; + } + + /** + * Gets and processes the available guidance URIs + * + * @param guidTime + */ + protected void doGuidance(Date guidTime, SubMonitor smonitor) { + List guidanceTypes = productRun.getGuidanceTypes(product); + smonitor.beginTask(null, guidanceTypes.size() * PROGRESS_FACTOR); + for (String type : guidanceTypes) { + List guidanceSources = productRun.getGuidanceSources( + product, type); + int subWork = guidanceSources.size(); + for (SourceXML guidSource : guidanceSources) { + NavigableMap> iguidURIs = getGuidURIs( + guidSource.getSourceName(), guidTime); + if (iguidURIs != null && !iguidURIs.isEmpty()) { + ffmpMonitor.processUris(iguidURIs, resourceData.siteKey, + guidSource.getSourceName(), startTime, + FFMPRecord.ALL, + smonitor.newChild(PROGRESS_FACTOR / subWork)); + } + } + } + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/BackgroundLoadJob.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/BackgroundLoadJob.java new file mode 100644 index 0000000000..db6bb80458 --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/BackgroundLoadJob.java @@ -0,0 +1,132 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.thread; + +import java.util.Date; +import java.util.List; +import java.util.NavigableMap; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubMonitor; + +import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResourceData; + +/** + * Retrieves and loads FFMP data in the background. Used as the secondary and + * tertiary loaders. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 04, 2013 2075       njensen     Initial creation
+ * Jun 07, 2013 2075       njensen     Added progress monitoring
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class BackgroundLoadJob extends AbstractLoadJob { + + protected boolean preloadAvailableUris = false; + + public BackgroundLoadJob(String name, FFMPResourceData resourceData, + Date timeBack, Date mostRecentTime, List hucsToLoad) { + super(name, resourceData, timeBack, mostRecentTime, hucsToLoad); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + protected IStatus run(IProgressMonitor monitor) { + SubMonitor smonitor = SubMonitor.convert(monitor, "Loading Data", 2500); + long t0 = System.currentTimeMillis(); + + // preload available URIs + smonitor.subTask("Preloading URIs..."); + if (preloadAvailableUris) { + preloadAvailableUris(); + } + smonitor.worked(100); + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // QPE + smonitor.subTask("Processing QPE..."); + NavigableMap> qpeURIs = getQpeUris(); + smonitor.worked(100); + doQpe(qpeURIs, smonitor.newChild(1000)); + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // QPF + smonitor.subTask("Processing QPF..."); + List>> qpfs = getQpfUris(startTime); + smonitor.worked(100); + SubMonitor qpfmonitor = smonitor.newChild(1000); + qpfmonitor.beginTask(null, qpfs.size() * PROGRESS_FACTOR); + int i = 0; + for (NavigableMap> qpfURIs : qpfs) { + doQpf(qpfURIs, product.getQpf(i), + qpfmonitor.newChild(PROGRESS_FACTOR)); + i++; + } + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // Virtual + smonitor.subTask("Processing Virtual..."); + doVirtual(smonitor.newChild(200)); + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // Guidance + smonitor.subTask("Processing Guidance..."); + doGuidance(startTime, smonitor.newChild(200)); + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + smonitor.done(); + System.out.println(this.getName() + " took: " + + (System.currentTimeMillis() - t0)); + + return Status.OK_STATUS; + } + + public void setPreloadAvailableUris(boolean preload) { + this.preloadAvailableUris = preload; + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitHucLevelGeomsJob.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitHucLevelGeomsJob.java new file mode 100644 index 0000000000..d2b1cf7664 --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitHucLevelGeomsJob.java @@ -0,0 +1,105 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.thread; + +import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates; +import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory; +import com.raytheon.uf.common.monitor.xml.DomainXML; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; + +/** + * Initialization job that initializes the huc level geometries in the + * HucLevelGeometriesFactory's internal cache. This is to speed up overall + * loading of the display so the FFMPResource's paintInternal() does not have to + * wait on these geometries. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 11, 2013 2075           njensen     Initial creation
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class InitHucLevelGeomsJob extends Job { + + protected static final IUFStatusHandler statusHandler = UFStatus + .getHandler(InitHucLevelGeomsJob.class); + + private String siteKey; + + private FFMPTemplates templates; + + private List hucs; + + public InitHucLevelGeomsJob(String siteKey, FFMPTemplates templates, + List hucs) { + super("Initializing HUC Level Geometries"); + this.setSystem(true); + this.siteKey = siteKey; + this.templates = templates; + this.hucs = hucs; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + protected IStatus run(IProgressMonitor monitor) { + HucLevelGeometriesFactory hucGeomFactory = HucLevelGeometriesFactory + .getInstance(); + for (DomainXML domain : templates.getDomains()) { + String cwa = domain.getCwa(); + for (String huc : hucs) { + try { + // since there's only one instance and it caches the + // results, this will speed up all future calls to the + // factory, ie speed up the initial display + hucGeomFactory.getGeometries(templates, siteKey, cwa, huc); + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, + "Error with early initialization of huc geometries: cwa=" + + cwa + ", huc=" + huc, e); + } + } + } + + return Status.OK_STATUS; + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitialLoadJob.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitialLoadJob.java new file mode 100644 index 0000000000..adfb5e9e3e --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/InitialLoadJob.java @@ -0,0 +1,236 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.thread; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.NavigableMap; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubMonitor; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPAggregateRecord; +import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils; +import com.raytheon.uf.common.datastorage.DataStoreFactory; +import com.raytheon.uf.common.datastorage.IDataStore; +import com.raytheon.uf.common.datastorage.Request; +import com.raytheon.uf.common.datastorage.records.ByteDataRecord; +import com.raytheon.uf.common.datastorage.records.IDataRecord; +import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; +import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; +import com.raytheon.uf.common.monitor.xml.ProductRunXML; +import com.raytheon.uf.common.monitor.xml.SourceXML; +import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResourceData; + +/** + * The initial FFMP load job for the data required initially by the displays. + * Attempts to use the FFMPAggregateRecords for faster loading. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 04, 2013 2075       njensen     Initial creation
+ * Jun 07, 2013 2075       njensen     Added progress monitoring
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class InitialLoadJob extends AbstractLoadJob { + + public InitialLoadJob(FFMPResourceData resourceData, Date timeBack, + Date mostRecentTime, List hucsToLoad) { + super("Initial FFMP Load", resourceData, timeBack, mostRecentTime, + hucsToLoad); + this.setPriority(INTERACTIVE); + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + SubMonitor smonitor = SubMonitor.convert(monitor, "Loading Data", 1200); + long t0 = System.currentTimeMillis(); + smonitor.subTask("Preloading URIs..."); + preloadAvailableUris(); + smonitor.worked(100); + + // Rate + smonitor.subTask("Processing Rate..."); + doRate(); + smonitor.worked(200); + + // QPE + smonitor.subTask("Processing QPE..."); + NavigableMap> qpeURIs = getQpeUris(); + FFMPSourceConfigurationManager sourceConfig = this.ffmpMonitor + .getSourceConfig(); + SourceXML source = sourceConfig.getSource(product.getQpe()); + FFMPAggregateRecord qpeCache = readAggregateRecord(source, + resourceData.dataKey, resourceData.wfo); + if (qpeCache != null) { + this.ffmpMonitor.insertFFMPData(qpeCache, qpeURIs, + resourceData.siteKey, product.getQpe()); + } + smonitor.worked(25); + doQpe(qpeURIs, smonitor.newChild(225)); + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // QPF + smonitor.subTask("Processing QPF..."); + List>> qpfs = new ArrayList>>(); + List qpfSources = new ArrayList(); + for (String qpfType : productRun.getQpfTypes(product)) { + for (SourceXML qpfSource : productRun.getQpfSources(product, + qpfType)) { + + NavigableMap> qpfURIs = getQpfUris( + qpfSource.getSourceName(), startTime); + + if (qpfURIs != null && !qpfURIs.isEmpty()) { + qpfs.add(qpfURIs); + qpfSources.add(qpfSource); + } + } + } + + int i = 0; + smonitor.worked(25); + SubMonitor qpfmonitor = smonitor.newChild(225); + qpfmonitor.beginTask(null, qpfs.size() * PROGRESS_FACTOR); + for (NavigableMap> qpfURIs : qpfs) { + FFMPAggregateRecord qpfCache = null; + source = qpfSources.get(i); + + String pdataKey = findQPFHomeDataKey(source); + qpfCache = readAggregateRecord(source, pdataKey, resourceData.wfo); + + if (qpfCache != null) { + this.ffmpMonitor.insertFFMPData(qpfCache, qpfURIs, + resourceData.siteKey, source.getSourceName()); + } + + doQpf(qpfURIs, product.getQpf(i), + qpfmonitor.newChild(PROGRESS_FACTOR)); + i++; + } + if (!this.shouldRun()) { + return Status.CANCEL_STATUS; + } + + // Virtual + smonitor.subTask("Processing Virtual..."); + doVirtual(smonitor.newChild(200)); + + // Guidance + smonitor.subTask("Processing Guidance..."); + doGuidance(startTime, smonitor.newChild(200)); + + System.out.println("Initial Load Job took: " + + (System.currentTimeMillis() - t0)); + return Status.OK_STATUS; + } + + /** + * Loads the aggregate files + * + * @param sourceName + * @param huc + * @param wfo + * @return + */ + private FFMPAggregateRecord readAggregateRecord(SourceXML source, + String pdataKey, String wfo) { + + FFMPAggregateRecord record = null; + String sourceSiteDataKey = getSourceSiteDataKey(source, pdataKey); + + try { + File hdf5File = FFMPUtils.getHdf5File(wfo, sourceSiteDataKey); + IDataStore dataStore = DataStoreFactory.getDataStore(hdf5File); + IDataRecord rec = dataStore.retrieve(wfo, sourceSiteDataKey, + Request.ALL); + byte[] bytes = ((ByteDataRecord) rec).getByteData(); + record = SerializationUtil.transformFromThrift( + FFMPAggregateRecord.class, bytes); + } catch (Exception e) { + statusHandler.handle(Priority.WARN, + "Couldn't read Aggregate Record" + sourceSiteDataKey); + } + + return record; + } + + /** + * Get the sourceSiteDataKey for this piece of data + * + * @param source + * @param pdataKey + * @return + */ + private String getSourceSiteDataKey(SourceXML source, String pdataKey) { + return source.getSourceName() + "-" + resourceData.siteKey + "-" + + pdataKey; + } + + /** + * Finds the home datakey identifier for QPF sources + * + * @param source + * @return + */ + private String findQPFHomeDataKey(SourceXML source) { + + FFMPRunConfigurationManager runManager = FFMPRunConfigurationManager + .getInstance(); + + for (ProductRunXML product : runManager.getProducts()) { + + try { + // we are just checking if it exists or not + String pdataKey = product.getProductKey(); + String sourceSiteDataKey = getSourceSiteDataKey(source, + pdataKey); + File hdf5File = FFMPUtils.getHdf5File(resourceData.wfo, + sourceSiteDataKey); + DataStoreFactory.getDataStore(hdf5File); + + return pdataKey; + } catch (Exception e) { + // not the right key, doesn't exist + continue; + } + } + + return resourceData.siteKey; + } + +} diff --git a/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/UpdateLoadJob.java b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/UpdateLoadJob.java new file mode 100644 index 0000000000..6a9e0f972d --- /dev/null +++ b/cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/thread/UpdateLoadJob.java @@ -0,0 +1,120 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.monitor.ffmp.ui.thread; + +import java.util.Date; +import java.util.List; +import java.util.NavigableMap; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubMonitor; + +import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord; +import com.raytheon.uf.viz.monitor.ffmp.ui.rsc.FFMPResourceData; + +/** + * An FFMP load job for when updates arrive. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 04, 2013 2075       njensen     Initial creation
+ * Jun 07, 2013 2075       njensen     Added progress monitoring
+ * 
+ * 
+ * + * @author njensen + * @version 1.0 + */ + +public class UpdateLoadJob extends AbstractLoadJob { + + public UpdateLoadJob(FFMPResourceData resourceData, Date timeBack, + Date mostRecentTime, List hucsToLoad) { + super("Update FFMP", resourceData, timeBack, mostRecentTime, hucsToLoad); + this.setPriority(INTERACTIVE); + hucsToLoad.remove(FFMPRecord.VIRTUAL); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime. + * IProgressMonitor) + */ + @Override + protected IStatus run(IProgressMonitor monitor) { + SubMonitor smonitor = SubMonitor.convert(monitor, "Loading Data", 1100); + // Rate + doRate(); + smonitor.worked(200); + + // QPE + NavigableMap> qpeURIs = getQpeUris(); + smonitor.worked(25); + doQpe(qpeURIs, smonitor.newChild(250)); + + // QPF + List>> qpfs = getQpfUris(startTime); + smonitor.worked(25); + SubMonitor qpfMonitor = smonitor.newChild(225); + int i = 0; + qpfMonitor.beginTask(null, qpfs.size() * PROGRESS_FACTOR); + for (NavigableMap> qpfURIs : qpfs) { + doQpf(qpfURIs, product.getQpf(i), + qpfMonitor.newChild(PROGRESS_FACTOR)); + i++; + } + + // Virtual + doVirtual(smonitor.newChild(200)); + + // Guidance + doGuidance(startTime, smonitor.newChild(200)); + + return Status.OK_STATUS; + } + + @Override + protected NavigableMap> getQpfUris(String sourceName, + Date qpfTime) { + return super.getQpfUris(sourceName, ffmpMonitor.getPreviousQueryTime( + resourceData.siteKey, sourceName)); + } + + @Override + protected NavigableMap> getGuidURIs(String sourceName, + Date guidTime) { + NavigableMap> retVal = null; + Date prevTime = ffmpMonitor.getPreviousQueryTime(resourceData.siteKey, + sourceName); + if (prevTime != null) { + retVal = ffmpMonitor.getAvailableUris(resourceData.siteKey, + resourceData.dataKey, sourceName, prevTime); + } + return retVal; + } + +} diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java index 095360fa47..fbb1e772e7 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java @@ -96,6 +96,7 @@ import com.vividsolutions.jts.geom.LineString; * 10-27-2010 #6964 bkowal The LineStyle is now passed as a parameter to * the IGraphicsTarget drawWireframeShape method. * 15Mar2013 15693 mgamazaychikov Made sure that magnification capability works. + * 06-11-2013 DR 16234 D. Friedman Fix pivot index when frames count is reduced. * * * @@ -215,6 +216,12 @@ public class StormTrackDisplay implements IRenderable { } } + if (currentState.displayedPivotIndex >= times.length) { + currentState.displayedPivotIndex = Math.max(0, + currentFrame != times.length - 1 ? + times.length - 1 : times.length - 2); + } + currentState.geomChanged = true; target.setNeedsRefresh(true); } else if (lastFrame != -1 && lastFrame != currentFrame) { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/IFPClient.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/IFPClient.java index 9ac2a67853..563e6977af 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/IFPClient.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/IFPClient.java @@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.core.internal; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -112,6 +113,8 @@ import com.raytheon.viz.gfe.core.parm.Parm; * 07/09/09 #2590 njensen Site ID from preferences and sent on all requests. * 09/22/09 #3058 rjpeter Removed GFE Edex dependency. * 05/02/13 #1969 randerso Added createNewDb method + * 06/06/13 #2073 dgilling Make getGridInventory() better match A1, + * fix warnings. * * * @@ -255,7 +258,7 @@ public class IFPClient { .asList(new ParmID[] { parmId })); List times = inventory.get(parmId); if (times == null) { - times = new ArrayList(); + times = Collections.emptyList(); } return times; } @@ -275,7 +278,8 @@ public class IFPClient { throws GFEServerException { GetGridInventoryRequest request = new GetGridInventoryRequest(); request.setParmIds(parmIds); - ServerResponse>> response = (ServerResponse>>) makeRequest(request); + ServerResponse>> response = (ServerResponse>>) makeRequest( + request, false); return response.getPayload(); } @@ -634,7 +638,6 @@ public class IFPClient { return (ServerResponse>) makeRequest(request); } - @SuppressWarnings("unchecked") public List getVTECActiveTable(String siteId) throws VizException { CAVEMode mode = dataManager.getOpMode(); @@ -695,6 +698,11 @@ public class IFPClient { public ServerResponse makeRequest(AbstractGfeRequest request) throws GFEServerException { + return makeRequest(request, true); + } + + private ServerResponse makeRequest(AbstractGfeRequest request, + boolean throwExceptionsBasedOnResponse) throws GFEServerException { ServerResponse rval = null; try { @@ -716,7 +724,8 @@ public class IFPClient { throw new GFEServerException(e); } - if ((rval != null) && !rval.isOkay()) { + if ((throwExceptionsBasedOnResponse) && (rval != null) + && (!rval.isOkay())) { StringBuilder msg = new StringBuilder(); if (rval.getMessages().size() > 1) { msg.append("Errors "); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/sampler/HistSample.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/sampler/HistSample.java index 5937b85968..7c2b7b48bd 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/sampler/HistSample.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/sampler/HistSample.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -52,7 +52,7 @@ import com.raytheon.viz.gfe.types.MutableInteger; /** * Contains a complete histogram for a single grid and parameter - * + * *
  * SOFTWARE HISTORY
  * Date			Ticket#		Engineer	Description
@@ -62,9 +62,10 @@ import com.raytheon.viz.gfe.types.MutableInteger;
  * Sep 9, 2008  1283        njensen     Implemented sample methods
  * May 29, 2009 2159        rjpeter     Optimized sample methods.
  * May 24, 2012  673        randerso    Added defaulted method calls
- * 
+ * Jun 17, 2013 15951       ryu         Fix index to wx/discrete key array
+ *
  * 
- * + * * @author mnash * @version 1.0 */ @@ -175,7 +176,7 @@ public class HistSample { * Description : Constructor far HistSample taking a histogram in the form * of a time range and a sequence of HistPairs, stores the information in * private data. Counts up the samples and stores that in _numSamplePoints. - * + * * @param timeRange * @param histPairs */ @@ -210,7 +211,7 @@ public class HistSample { * cached. Sets number of sample points to zero. Calls sampleGrid() to * sample the grid. If successful, stores the time range and counts up the * number of sample points. - * + * * @param gridSlice * @param sampleArea * @param cachePoints @@ -250,7 +251,7 @@ public class HistSample { * for WEATHER. The most common value for DISCRETE. For vector, if * separateMagDir is true, the magnitude is averaged separately from the * direction. - * + * * @param separateMagDir * @return */ @@ -360,7 +361,7 @@ public class HistSample { /** * Description : the square root function - * + * * @param val * @return */ @@ -377,7 +378,7 @@ public class HistSample { * Returns the standard deviation of each component separately for VECTOR. * Should not be called for WEATHER. For vector, if separate MagDir is true, * the magnitude is averaged separately from the direction. - * + * * @return */ public final HistValue stdDev() { @@ -469,7 +470,7 @@ public class HistSample { * the HistPair's for the maximum count value and returns it. In the case * where more than one entry shares the maximum count value, then only the * highest value (sort order) value will be returned. - * + * * @return */ public final HistValue mostCommonValue() { @@ -503,7 +504,7 @@ public class HistSample { * case where more than one entyr shares the maximum count value, then only * the highest value (sort order) value will be returned. Works only on * SCALAR and VECTOR. - * + * * @param resolution * @return */ @@ -542,7 +543,7 @@ public class HistSample { * Finds and returns the middle value associated with the sample. The middle * value is that value that is halfway between the lowest and highest in * terms of count, and not value. This is a no-op for WEATHER/DISCRETE. - * + * * @return */ public final HistValue middleValue() { @@ -576,7 +577,7 @@ public class HistSample { * Description : Returns the absolute minimum value for the sample points. * This is a no-op for WEATHER/DISCRETE. Only the magnitude component for * VECTOR is used for comparison. - * + * * @return */ public final HistValue absoluteMin() { @@ -602,7 +603,7 @@ public class HistSample { * Description : REturns the absolute maximum value for the sample points. * This is a no-op for WEATHER/DISCRETE. Only the magnitude component for * VECTOR is used for comparison. - * + * * @return */ public final HistValue absoluteMax() { @@ -642,7 +643,7 @@ public class HistSample { * most common value is provide for WEATERH. Outliers are eliminated. * Percent ranges from 0 to 50. For vector, if separateMagDir is true, the * magnitude is averaged separately from the direction. - * + * * @param minpercent * @param maxpercent * @param separateMagDir @@ -820,7 +821,7 @@ public class HistSample { * points. this is a no-op for WEATHER/DISCRETE. Percent should be between 0 * and 50. This routine eliminates the bottom xx% of sample values and * returns that value. - * + * * @param percent * @return */ @@ -864,7 +865,7 @@ public class HistSample { * points. This is a no-op for WEATHER/DISCRETE. Percent should be between 0 * and 50. This routine eliminates the top 15% of sample values and returns * that value. - * + * * @param percent * @return */ @@ -921,7 +922,7 @@ public class HistSample { * most common value is provided for WEATHER/DISCRETE. Outliers are * eliminated based on standard deviation. For vector, if separateMagDir is * true, the magnitude is averaged separately from the direction. - * + * * @param minStdD * @param maxStdD * @param separateMagDir @@ -1074,7 +1075,7 @@ public class HistSample { * Description : Returns the representative minimum value for the sample * points. This is a no-op for WEATHER/DISCRETE. Based on standard * deviations. - * + * * @param stdD * @return */ @@ -1117,7 +1118,7 @@ public class HistSample { * Description : Returns the representative maximum value for the sample * points. This is a no-op for WEATHER/DISCRETE. Based on standard * deviations. - * + * * @param stdD * @return */ @@ -1155,7 +1156,7 @@ public class HistSample { /** * OUtputs the histogram for this grid, but binned by the specified float * value. This only applies to SCALAR and VECTOR data. - * + * * @param resolution * @return */ @@ -1229,7 +1230,7 @@ public class HistSample { /** * Description : Bins the data sample based on the resolution - * + * * @param v * @param resolution * @return @@ -1254,7 +1255,7 @@ public class HistSample { * that the grid is valid and grid and Grid2DBit sizes match. Ensures there * are points in the sample area. Switch cases on data type and then * extracts out the data for each sample point. - * + * * @param grid * @param area * @param cachePoints @@ -1309,7 +1310,7 @@ public class HistSample { /** * If the sample was of scalars this function is called - * + * * @param grid * @param area * @param cachePoints @@ -1411,7 +1412,7 @@ public class HistSample { for (int x = ll.x; x <= ur.x; x++) { for (int y = ll.y; y <= ur.y; y++) { if (area.get(x, y) != 0) { - WeatherKey k = key[gs.get(x, y)]; + WeatherKey k = key[0xFF & gs.get(x, y)]; if (_subkeymode) { List subkeys = k.getSubKeys(); for (int z = 0; z < subkeys.size(); z++) { @@ -1472,7 +1473,7 @@ public class HistSample { for (int x = ll.x; x <= ur.x; x++) { for (int y = ll.y; y <= ur.y; y++) { if (area.get(x, y) != 0) { - DiscreteKey k = key[gs.get(x, y)]; + DiscreteKey k = key[0xFF & gs.get(x, y)]; if (_subkeymode) { List subkeys = k.getSubKeys(); for (int z = 0; z < subkeys.size(); z++) { @@ -1524,7 +1525,7 @@ public class HistSample { /** * Description : counts the number of sample points and returns the number - * + * * @return */ private int countSamplePoints() { @@ -1552,7 +1553,7 @@ public class HistSample { /** * Description : Returns the sample's valid time - * + * * @return */ public final TimeRange validTime() { @@ -1561,7 +1562,7 @@ public class HistSample { /** * Description : Returns the histogram associated with this sample - * + * * @return */ public final HistPair[] histogram() { @@ -1570,7 +1571,7 @@ public class HistSample { /** * Description : Returns the number of points associated with this sample - * + * * @return */ public int numOfPoints() { diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDlg.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDlg.java index 57bdf49c89..70017bfcb3 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDlg.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDlg.java @@ -121,6 +121,7 @@ import com.raytheon.viz.hydrocommon.util.StnClassSyncUtil; * 30 Jan 2013 15264 wkwock Fix the missing group_definition.cfg file crash * 05 Feb 2013 1578 rferrel Dialog made non-blocking and a singleton. * 06 May 2013 1976 mpduff Code cleanup. + * 06 Jun 2013 2076 mpduff Fix station list selection and graph button enabling. * * * @author lvenable @@ -678,6 +679,8 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog { if (rsc instanceof MultiPointResource) { ((MultiPointResource) rsc).setTs(this); } + + checkBottomButtons(); } /** @@ -1460,7 +1463,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog { while (iter2.hasNext()) { if (idRdo.getSelection()) { if (iter2.next().equalsIgnoreCase(currentLid)) { - topDataList.setSelection(iter2.previousIndex()); + // Bug with show selection requires the select(0) first. + topDataList.select(0); + topDataList.select(iter2.previousIndex()); topDataList.showSelection(); /* set to null so we don't enter this block again */ @@ -2606,6 +2611,5 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog { @Override protected void preOpened() { super.preOpened(); - checkBottomButtons(); } } diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/EditPrecipStationsDialog.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/EditPrecipStationsDialog.java index 68be199f65..1bfc9ab114 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/EditPrecipStationsDialog.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/EditPrecipStationsDialog.java @@ -83,6 +83,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 13, 2009 snaples Initial creation + * Jun 27, 2013 15859 wkwock Update this dialog after click Apply button * * * @@ -1460,6 +1461,8 @@ public class EditPrecipStationsDialog extends AbstractMPEDialog implements changeCustomFile(); // shell.dispose(); } + + this.open();//redraw this updated dialog } protected void read_text() { diff --git a/edexOsgi/build.edex/esb/conf/log4j-ingest.xml b/edexOsgi/build.edex/esb/conf/log4j-ingest.xml index ef6f9fb78d..ca2218847a 100644 --- a/edexOsgi/build.edex/esb/conf/log4j-ingest.xml +++ b/edexOsgi/build.edex/esb/conf/log4j-ingest.xml @@ -56,18 +56,18 @@ - - + + - + - - + + @@ -296,9 +296,9 @@ - + - + diff --git a/edexOsgi/build.edex/esb/conf/log4j.xml b/edexOsgi/build.edex/esb/conf/log4j.xml index 551a20e825..53bad3b72c 100644 --- a/edexOsgi/build.edex/esb/conf/log4j.xml +++ b/edexOsgi/build.edex/esb/conf/log4j.xml @@ -55,6 +55,20 @@ + + + + + + + + + + + + + + @@ -65,9 +79,9 @@ - - - + + + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ffmp/FFMPSourceConfig.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ffmp/FFMPSourceConfig.xml index 08b5cba234..a535884d7e 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ffmp/FFMPSourceConfig.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ffmp/FFMPSourceConfig.xml @@ -94,7 +94,7 @@ FFG0124hr RFCFFG 1 - /grid/%/%/.*/.*/null/FFG0124hr/SFC/0.0/-999999.0/ + /grid/%/%/.*/.*/.*/FFG0124hr/SFC/0.0/-999999.0/ grid GRID GUIDANCE @@ -110,7 +110,7 @@ FFG0324hr RFCFFG 3 - /grid/%/%/.*/.*/null/FFG0324hr/SFC/0.0/-999999.0/ + /grid/%/%/.*/.*/.*/FFG0324hr/SFC/0.0/-999999.0/ grid GRID GUIDANCE @@ -126,7 +126,7 @@ FFG0624hr RFCFFG 6 - /grid/%/%/.*/.*/null/FFG0624hr/SFC/0.0/-999999.0/ + /grid/%/%/.*/.*/.*/FFG0624hr/SFC/0.0/-999999.0/ grid GRID GUIDANCE diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java index 023b451191..40a557f8ec 100644 --- a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java @@ -19,9 +19,11 @@ **/ package com.raytheon.edex.plugin.binlightning; +import gov.noaa.nws.ost.edex.plugin.binlightning.BinLigntningDecoderUtil; + import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Calendar; +import java.util.List; import java.util.TimeZone; import org.apache.commons.logging.Log; @@ -30,9 +32,6 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.plugin.AbstractDecoder; -import com.raytheon.edex.plugin.binlightning.impl.BinLightningFactory; -import com.raytheon.edex.plugin.binlightning.impl.IBinLightningDecoder; -import com.raytheon.edex.plugin.binlightning.impl.LightningDataSource; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord; @@ -41,7 +40,6 @@ import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.edex.decodertools.core.DecoderTools; -import com.raytheon.uf.edex.decodertools.core.IBinDataSource; import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.wmo.message.WMOHeader; @@ -77,6 +75,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * 20080318 1026 jkorman Added debug strike info. * 20080408 1039 jkorman Added traceId for tracing data. * 11/11/08 1684 chammack Refactored for camel integration + * 20130503 DCS 112 Wufeng Zhou Modified to be able to handle both the new encrypted data and legacy bit-shifted data * * * @@ -93,7 +92,7 @@ public class BinLightningDecoder extends AbstractDecoder { private SimpleDateFormat SDF; - private Log logger = LogFactory.getLog(getClass()); + private Log logger = LogFactory.getLog(getClass()); /** * Default lightning strike type for FLASH messages. RT_FLASH documents @@ -102,7 +101,7 @@ public class BinLightningDecoder extends AbstractDecoder { public LtgStrikeType DEFAULT_FLASH_TYPE = LtgStrikeType.STRIKE_CG; private String traceId = null; - + /** * Construct a BinLightning decoder. Calling hasNext() after construction * will return false, decode() will return a null. @@ -119,13 +118,12 @@ public class BinLightningDecoder extends AbstractDecoder { * @throws DecoderException * Thrown if no data is available. */ - public PluginDataObject[] decode(byte[] data, Headers headers) - throws DecoderException { + public PluginDataObject[] decode(byte[] data, Headers headers) throws DecoderException { - String traceId = null; + //String traceId = null; PluginDataObject[] reports = new PluginDataObject[0]; - if (data != null) { + if (data != null) { traceId = (String) headers.get(DecoderTools.INGEST_FILE_NAME); WMOHeader wmoHdr = new WMOHeader(data); @@ -133,92 +131,93 @@ public class BinLightningDecoder extends AbstractDecoder { Calendar baseTime = TimeTools.findDataTime(wmoHdr.getYYGGgg(), headers); - - byte[] pdata = DecoderTools.stripWMOHeader(data, SFUS_PATTERN); - if (pdata == null) { - pdata = DecoderTools.stripWMOHeader(data, SFPA_PATTERN); + + // Because binary nature of the encrypted data, the string created with its byte[] array may not have the same length of the byte[] array length + // So when DecoderTools.stripWMOHeader() assumes byte[] length == String length in it logic, it is observed that it may return a shorter byte[] than + // the real data array. (Looks like a bug???) +// byte[] pdata = DecoderTools.stripWMOHeader(data, SFUS_PATTERN); +// if (pdata == null) { +// pdata = DecoderTools.stripWMOHeader(data, SFPA_PATTERN); +// } + // instead the following is used to strip WMO header a little more safely. + byte[] pdata = null; + if (wmoHdr.isValid() && wmoHdr.getMessageDataStart() > 0) { + pdata = new byte[data.length - wmoHdr.getMessageDataStart()]; + System.arraycopy(data, wmoHdr.getMessageDataStart(), pdata, 0, data.length - wmoHdr.getMessageDataStart()); + } + + if ((pdata == null) || (pdata.length == 0)) { + return new PluginDataObject[0]; } - if (pdata != null) { + + // + // Modified by Wufeng Zhou to handle both legacy bit-shifted and new encryted data + // + // Preserved the legacy decoding in BinLigntningDecoderUtil.decodeBitShiftedBinLightningData(), and added logic to process + // both encrypted data and legacy data + // + + List strikes = BinLigntningDecoderUtil.decodeBinLightningData(data, pdata, traceId, baseTime.getTime()); - // Init all values before this decode cycle. This resets all - // internal - // decoder state. - ArrayList strikes = new ArrayList(); + if (strikes == null) { // keep-alive record, log and return + logger.info(traceId + " - found keep-alive record. ignore for now."); + return reports; + } - if ((pdata == null) || (pdata.length == 0)) { - return new PluginDataObject[0]; + // + // Done MOD by Wufeng Zhou + // + + // post processing data - if not keep-alive record + BinLightningRecord report = null; + if (strikes.size() > 0) { + report = new BinLightningRecord(strikes.size()); + for (LightningStrikePoint strike : strikes) { + report.addStrike(strike); + logger.debug(traceId + "-" + strike); } + } else { + return new PluginDataObject[0]; + } - IBinDataSource msgData = new LightningDataSource(pdata); + Calendar c = TimeTools.copy(baseTime); + if (c == null) { + throw new DecoderException(traceId + " - Error decoding times"); + } + //report.setInsertTime(c); // OB13.4 source code does not have this line anymore, WZ 05/03/2013 - boolean continueDecode = true; - while (continueDecode) { - IBinLightningDecoder decoder = BinLightningFactory - .getDecoder(msgData); + Calendar cStart = report.getStartTime(); + if (cStart.getTimeInMillis() > c.getTimeInMillis() + + TEN_MINUTES) { + synchronized (SDF) { + logger.info("Discarding future data for " + traceId + + " at " + SDF.format(cStart.getTime())); + } + } else { + Calendar cStop = report.getStopTime(); - switch (decoder.getError()) { - case IBinLightningDecoder.NO_ERROR: { - for (LightningStrikePoint strike : decoder) { - strikes.add(strike); - } - break; - } - default: { - continueDecode = false; - } - } - } + TimeRange range = new TimeRange( + cStart.getTimeInMillis(), + cStop.getTimeInMillis()); - BinLightningRecord report = null; + DataTime dataTime = new DataTime(cStart, range); + report.setDataTime(dataTime); - if (strikes.size() > 0) { - report = new BinLightningRecord(strikes.size()); - for (LightningStrikePoint strike : strikes) { - report.addStrike(strike); - logger.debug(traceId + "-" + strike); - } - } else { - return new PluginDataObject[0]; - } - - Calendar c = TimeTools.copy(baseTime); - if (c == null) { - throw new DecoderException(traceId - + "-Error decoding times"); - } - - Calendar cStart = report.getStartTime(); - if (cStart.getTimeInMillis() > c.getTimeInMillis() - + TEN_MINUTES) { - synchronized (SDF) { - logger.info("Discarding future data for " + traceId - + " at " + SDF.format(cStart.getTime())); - } - } else { - Calendar cStop = report.getStopTime(); - - TimeRange range = new TimeRange( - cStart.getTimeInMillis(), - cStop.getTimeInMillis()); - - DataTime dataTime = new DataTime(cStart, range); - report.setDataTime(dataTime); - - if (report != null) { - report.setTraceId(traceId); - report.setPluginName("binlightning"); - try { - report.constructDataURI(); - reports = new PluginDataObject[] { report }; - } catch (PluginException e) { - logger.error("Error constructing datauri", e); - } + if (report != null) { + report.setTraceId(traceId); + report.setPluginName("binlightning"); + try { + report.constructDataURI(); + reports = new PluginDataObject[] { report }; + } catch (PluginException e) { + logger.error("Error constructing datauri", e); + throw new DecoderException("Error constructing datauri", e); } } } - } else { - logger.error("No WMOHeader found in data"); } + } else { + logger.error("No WMOHeader found in data"); } return reports; } diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.java new file mode 100644 index 0000000000..0aabd36243 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.java @@ -0,0 +1,239 @@ +/** + * This code has been developed by NWS/OST to support AWIPS II + * + */ +package gov.noaa.nws.ost.edex.plugin.binlightning; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.security.Key; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * BinLightningAESKey + * + * Simple representation of bin lightning AES encryption key and its associated key aliases in the keystore + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 20130503      DCS 112   Wufeng Zhou To handle both the new encrypted data and legacy bit-shifted data
+ * 
+ * 
+ * + * @author Wufeng Zhou + * + */ +public class BinLightningAESKey { + /** Default location to search for BinLightningAESKey.properties file, and keystore file (normally binLightningAESKeystore.jce as configured in properties file) */ + public static final String DEFAULT_KEYSTORE_LOC = "/usr/local/ldm"; + + /** System property name that can used to specify configuration property file, which will overwrite the default keystore location */ + public static final String SYS_PROP_FOR_CONF_FILE = "binlightning.aeskeypropfile"; + + public static final String KEYSTORE_PROP = "binlightning.AESKeystore"; + public static final String KEYSTORE_PASS_PROP = "binlightning.AESKeystorePassword"; + + private static final String CONF_PROPERTIES_FILE = "BinLightningAESKey.properties"; + public static final String KEY_ALIAS_PREFIX = "^\\d{4}-\\d{2}-\\d{2}"; + private static final Pattern KEY_ALIAS_PREFIX_PATTERN = Pattern.compile(KEY_ALIAS_PREFIX); + private static final SimpleDateFormat KEY_ALIAS_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + private static Log logger = LogFactory.getLog(BinLightningAESKey.class); + + private static Properties props = new Properties(); + private static KeyStore keystore; + private static BinLightningAESKey[] keys = null; + + /** + * Helper method to selectively get all the bin lightning related AES encryption keys, ordered by key issue date in descending order. + * Keys will be ignored when its alias is not starting with yyyy-MM-dd prefix or key algorithm is not "AES" + * + * If properties file is specified through system property binlightning.aeskeypropfile, then use it to load the properties. + * Otherwise, load the default property that is at the same place as this class, and overwrite properties + * if the property is specified through system property. + * So, binlightning.aeskeypropfile has higher priority, if it is specified, other properties specified in system property will be ignored + * + * Assumption: Valid key imported/stored to the keystore will have yyyy-MM-dd prefix in its alias. + * + * @return valid bin lightning AES keys (with aliases) in descending order of key issue date + * or null when no valid keys found + */ + public static BinLightningAESKey[] getBinLightningAESKeys() { + if (keys != null) return keys; + + // if properties file is specified through system property binlightning.aeskeypropfile, then use it to load the properties + // otherwise, use default property file and overwrite with available system properties + try { + if (System.getProperty(SYS_PROP_FOR_CONF_FILE, "").equals("") == false) { + File file = new File(System.getProperty(SYS_PROP_FOR_CONF_FILE)); + if (file.exists() == false) { + logger.error("System specified property file " + file.getAbsolutePath() + " does not exist."); + } else { + FileInputStream fis = new FileInputStream(file); + props.load(fis); + fis.close(); + } + } else { + // load default properties file + Properties defProps = new Properties(); + File file = new File(DEFAULT_KEYSTORE_LOC, CONF_PROPERTIES_FILE); + if (file.exists() == false) { + logger.error("Default properties file " + file.getAbsolutePath() + " does not exist."); + } else { + FileInputStream fis = new FileInputStream(file); + defProps.load(fis); + fis.close(); + } + props.putAll(defProps); + + // now check if the properties should be overwritten, if it is specified in system properties + Iterator iter = defProps.keySet().iterator(); + while (iter.hasNext()) { + String key = (String)iter.next(); + if (System.getProperty(key, "").equals("") == false) { + props.setProperty(key, System.getProperty(key)); + } + } + } + } catch (IOException ioe) { + logger.error("Fail to load BinLightningAESCipher configuration from file or system properties.", ioe); + } + + // load keystore + try { + if (props.getProperty(KEYSTORE_PROP, "").equals("") == false) { + File ksFile = new File(props.getProperty(KEYSTORE_PROP)); + keystore = KeyStore.getInstance("JCEKS"); // type JCEKS can store AES symmetric secret key, while default JKS store can't + FileInputStream fis = null; + try { + fis = new FileInputStream(ksFile); + char[] keystorePassword = null; + if (props.getProperty(KEYSTORE_PASS_PROP) != null) { + keystorePassword = props.getProperty(KEYSTORE_PASS_PROP).toCharArray(); + } + keystore.load(fis, keystorePassword); + } finally { + if (fis != null) fis.close(); + } + + Enumeration enu = keystore.aliases(); + TreeMap treeMap = new TreeMap(); + while (enu.hasMoreElements()) { + String alias = enu.nextElement(); + Matcher matcher = KEY_ALIAS_PREFIX_PATTERN.matcher(alias); + if (matcher.lookingAt()) { // alias starts with yyyy-MM-dd pattern + Key key = keystore.getKey(alias, props.getProperty(KEYSTORE_PASS_PROP).toCharArray()); + if (key.getAlgorithm().equals("AES")) { + // valid AES key for bin lightning decryption + treeMap.put(alias, key); + } + } + } + List keyListSortedByAliasDesc = new ArrayList(); + for (Entry entry = treeMap.pollLastEntry(); entry != null; entry = treeMap.pollLastEntry()) { + Date keyDate = KEY_ALIAS_DATE_FORMAT.parse(entry.getKey().substring(0, 10)); + BinLightningAESKey blkey = new BinLightningAESKey(entry.getKey(), entry.getValue(), keyDate); + keyListSortedByAliasDesc.add(blkey); + } + keys = keyListSortedByAliasDesc.toArray(new BinLightningAESKey[] {}); + return keys; + } else { + logger.error("binlightning.AESKeystore property not set."); + } + } catch (KeyStoreException kse) { + logger.error("Fail to getInstance of JCEKS keystore.", kse); + } catch (FileNotFoundException fnfe) { + logger.error("Fail to find the keystore file configured: " + props.getProperty(KEYSTORE_PROP), fnfe); + } catch (NoSuchAlgorithmException e) { + logger.error("NoSuchAlgorithmException in loading keystore from file: " + props.getProperty(KEYSTORE_PROP), e); + } catch (CertificateException e) { + logger.error("CertificateException in loading keystore from file: " + props.getProperty(KEYSTORE_PROP), e); + } catch (IOException e) { + logger.error("IOException in loading keystore from file: " + props.getProperty(KEYSTORE_PROP), e); + } catch (UnrecoverableKeyException e) { + logger.error("UnrecoverableKeyException in loading keystore from file: " + props.getProperty(KEYSTORE_PROP), e); + } catch (ParseException e) { + logger.error("ParseException in parsing alias for key date: " + props.getProperty(KEYSTORE_PROP), e); + } + return null; + } + + /** + * force to reload keys, useful for testing + * @return + */ + public static BinLightningAESKey[] reloadBinLightningAESKeys() { + if (keys != null) keys = null; + return getBinLightningAESKeys(); + } + + + private String alias; + private Key key; + private Date keyDate; + + public BinLightningAESKey(String alias, Key key, Date keyDate) { + this.alias = alias; + this.key = key; + this.keyDate = keyDate; + } + + /** + * @return the alias + */ + public String getAlias() { + return alias; + } + /** + * @param alias the alias to set + */ + public void setAlias(String alias) { + this.alias = alias; + } + /** + * @return the key + */ + public Key getKey() { + return key; + } + /** + * @param key the key to set + */ + public void setKey(Key key) { + this.key = key; + } + + public Date getKeyDate() { + return keyDate; + } + + public void setKeyDate(Date keyDate) { + this.keyDate = keyDate; + } + +} diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.properties b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.properties new file mode 100644 index 0000000000..df6cd6c483 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningAESKey.properties @@ -0,0 +1,33 @@ +# +# Sample template Configuration information for bin lightning AES cipher +# Per design review discussions, the default location to look for this file is external to AWIPS II tree at /usr/local/ldm +# +# properties include: +# binlightning.AESKeystore: the java keystore that store AES cipher key or keys (if ever vendors changes keys in the future) +# Keystore type should be JCEKS, and the key aliases should be prefixed with date in the format of yyyy-MM-dd so +# that if more than one keys found, the latest key will be tried first. +# The keystore should not be distributed with AWIPS II and should be protected by a store password +# +# binlightning.AESKeystorePassword: the password for the keystore +# +# The above properties could be overwritten by system properties, e.g., through -D options in EDEX startup script +# +# NOTE: since the key is not supposed to release with the source and rpm files, the program has built two ways for you +# to specify keystore and key pass information: +# 1. Use binlightning.aeskeypropfile system property (e.g., -D option on command line) to specify location of a valid properties file +# to overwrite the default location of this file (/usr/local/ldm/BinLightningAESKey.properties). +# When binlightning.aeskeypropfile system property is used, other -D options (as listed below in 2) are ignored. +# 2. Use system properties (e.g., -D optinos on command line) to overwrite binlightning.AESKeystore & binlightning.AESKeystorePassword properties +# + +# +# sample, self-generated key, safe to distribute +# +binlightning.AESKeystore=/usr/local/ldm/binLightningTestKeystore.jce +binlightning.AESKeystorePassword=testStorePass + +# +# production key, do not distribute keystore and password +# +#binlightning.AESKeystore=/usr/local/ldm/binLightningAESKeystore.jce +#binlightning.AESKeystorePassword=notShownHere diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningDataDecryptionException.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningDataDecryptionException.java new file mode 100644 index 0000000000..e4686dadfe --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLightningDataDecryptionException.java @@ -0,0 +1,44 @@ +/** + * This code has been developed by NWS/OST to support AWIPS II + * + */ +package gov.noaa.nws.ost.edex.plugin.binlightning; + +/** + * BinLightningDataDecryptionException + * + * @author Wufeng Zhou + * + */ +public class BinLightningDataDecryptionException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + private byte[] data = null; + + /** + * + */ + public BinLightningDataDecryptionException(String message) { + super(message); + } + + /** + * @param message + */ + public BinLightningDataDecryptionException(String message, byte[] data) { + super(message); + this.data = data; + } + + /** + * @return the data + */ + public byte[] getData() { + return data; + } + +} diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLigntningDecoderUtil.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLigntningDecoderUtil.java new file mode 100644 index 0000000000..4f665bcd2f --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/BinLigntningDecoderUtil.java @@ -0,0 +1,529 @@ +/** + * This code has been developed by NWS/OST to support AWIPS II + * + */ +package gov.noaa.nws.ost.edex.plugin.binlightning; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import javax.crypto.BadPaddingException; +import javax.crypto.IllegalBlockSizeException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.raytheon.edex.plugin.binlightning.impl.BinLightningFactory; +import com.raytheon.edex.plugin.binlightning.impl.IBinLightningDecoder; +import com.raytheon.edex.plugin.binlightning.impl.LightningDataSource; +import com.raytheon.uf.common.dataplugin.binlightning.impl.LightningStrikePoint; +import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgMsgType; +import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType; +import com.raytheon.uf.edex.decodertools.core.BasePoint; +import com.raytheon.uf.edex.decodertools.core.IBinDataSource; +import com.raytheon.uf.edex.wmo.message.WMOHeader; + +/** + * BinLigntningDecoderUtil + * + * Utility method to decode legacy (bit-shifted) or new encrypted bin lightning + * data + * + * Some utility code were adapted from vendor supplied sample code + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 20130503        DCS 112 Wufeng Zhou To handle both the new encrypted data and legacy bit-shifted data
+ * 
+ * 
+ * + * @author Wufeng Zhou + * + */ +public class BinLigntningDecoderUtil { + + /** + * Message type for keep alive data records. + */ + final static short KEEP_ALIVE_TYPE = 0x0000; + + /** + * Message type for lightning data records. + */ + final static short LIGHTNING_TYPE = 0x00ff; + + /** + * If there are more elements within the data record, this terminator is used. + */ + final static byte[] MORE_TERM_BYTES = {0x0d, 0x0d, 0x0a, 0x00}; + /** + * Last element within data records should be terminated by these 4 bytes. + */ + final static byte[] LAST_TERM_BYTES = {0x0d, 0x0d, 0x0a, 0x03}; + + /** + * WMO header start bytes, optional (it is known that TG will strip this away) + */ + final static byte[] WMO_HEADER_START_BYTES = {0x01, 0x0d, 0x0d, 0x0a}; + + /* Size of binary NWS lightning data record. */ + static final int BINLIGHTNING_RECORD_SIZE = 32; + + private static Log logger = LogFactory.getLog(BinLigntningDecoderUtil.class); + + /** + * extracted from the decode() of the original + * com.raytheon.edex.plugin.binlightning.BinLightningDecoder class + * + * @param pdata + * @return + */ + public static List decodeBitShiftedBinLightningData(byte[] pdata) { + List strikes = new ArrayList(); + + IBinDataSource msgData = new LightningDataSource(pdata); + + boolean continueDecode = true; + while (continueDecode) { + IBinLightningDecoder decoder = BinLightningFactory.getDecoder(msgData); + + switch (decoder.getError()) { + case IBinLightningDecoder.NO_ERROR: { + for (LightningStrikePoint strike : decoder) { + strikes.add(strike); + } + break; + } + default: { + continueDecode = false; + } + } + } + return strikes; + } + + /** + * decode the new bin lightning data, after the data record is decrypted, and it is not keep-alive record + * @param pdata + * @return + */ + public static List decodeDecryptedBinLightningData(byte[] data) { + List strikes = new ArrayList(); + + int offset = 0; + // length of data to be put in ByteBuffer for easier reading of the little-endian data + // data put into ByteBuffer would be byte 2 to byte 27 (skipping leading 2 type bytes and trailing 4 terminator bytes) + int dataLen = BINLIGHTNING_RECORD_SIZE - 2 - LAST_TERM_BYTES.length; + + for (int i = 0; i < data.length / BINLIGHTNING_RECORD_SIZE; i++) { + ByteBuffer buffer = ByteBuffer.allocate(dataLen); + buffer.order(ByteOrder.LITTLE_ENDIAN); + + // put the data into ByteBuffer + buffer.put(data, offset + 2, dataLen); + + // Reset buffer position to read in data we just stored. + buffer.position(0); + + // Do NOT change the read order below + // read signed 16 bit integer as short and assigned to short + // read other 16 bit (unsigned) integer as short, but assign to int after bit & with 0xffff, so no negatives when first bit is 1 + // Read count of seconds first + long epochSeconds = buffer.getInt() & 0xffffffffL; + // Convert to millisecond and add on millisecond offset + int miliseconds = buffer.getShort() & 0xffff; // valid range: 0 to 999 + long epochTime = epochSeconds * 1000 + miliseconds; + + // read lat/lon as float + float lat = buffer.getFloat(); // valid range: -90.0 to 90.0 + float lon = buffer.getFloat(); // valid range: -180.0 to 180.0 + + // vendor, 0x01 for CONUS, i.e. NLD data; + // 0x02 for long range source, GLD360? + int vendor = buffer.getShort() & 0xffff; // valid values: 0x0001 (CONUS) or 0x0002 (long range source) + + int strokeType = buffer.getShort() & 0xffff; // 0x0000 for cloud-to-ground, 0x00ff for cloud-to-cloud, 0xffff for total flash + short strokeKiloAmps = buffer.getShort(); // valid range: -254 to 254, specifically 16 bit signed integer + int strokeMultiplicity = buffer.getShort() & 0xffff; // i.e. stroke count, valid range: 0 to 15 + int strokeDuration = buffer.getShort() & 0xffff; // valid range: 0 to 65535 (i.e., looks like unsigned short) + int reserved = buffer.getShort() & 0xffff; + + // Create the strike record from the report info and base time information. + BasePoint base = new BasePoint(lat, lon); + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(epochTime); + base.setYear(cal.get(Calendar.YEAR)); + base.setMonth(cal.get(Calendar.MONTH) + 1); + base.setDay(cal.get(Calendar.DAY_OF_MONTH)); + base.setHour(cal.get(Calendar.HOUR_OF_DAY)); + base.setMinute(cal.get(Calendar.MINUTE)); + base.setSecond(cal.get(Calendar.SECOND)); + base.setMillis(cal.get(Calendar.MILLISECOND)); + + // new spec does not seem to have lightning message type indicator such as FL (Flash Lightning) or RT (Real Time flash lightning) + // The source of lightning data in the vendor specific data bytes (byte 16-17) may related to this (???), + // and it is used here for now. 04/182/013 Wufeng Zhou + /** 05/02/2013, found DSI-9603 Spec (http://www1.ncdc.noaa.gov/pub/data/documentlibrary/tddoc/td9603.pdf) on NLDN lightning data format, + * on Message Type and Stroke Type: + * POS: 37-38 Message Type + * This field identifies whether this record was U.S. continental data or an international location. + * Values are “FL†and “RTâ€. + * A value of “FL†stands for FLASH and identifies this record as U.S. data. + * A value of “RT†stands for Real-Time data type and identifies this record as international data. + * POS: 40-41 Stroke Type + * This field identifies whether this lightning stroke was cloud-to-ground or cloud-to-cloud. + * Values are “CG†for cloud-to-ground and “CC†for cloud-to-cloud. FLASH (FL) data are always cloud-to-ground + * while REAL-TIME (RT) data can be either type. + */ + LtgMsgType msgType = LtgMsgType.STRIKE_MSG_FL; // as default + if (vendor == ((short)0x0001)) { // CONUS source + msgType = LtgMsgType.STRIKE_MSG_FL; + } else if (vendor == ((short)0x0002)) { // long range source + msgType = LtgMsgType.STRIKE_MSG_RT; + } + + LightningStrikePoint lsp = new LightningStrikePoint(base, lat, lon, msgType); + LtgStrikeType ltgStrikeType = LtgStrikeType.STRIKE_CG; // default ?? + if (strokeType == 0x0000) { + ltgStrikeType = LtgStrikeType.STRIKE_CG; + } else if (strokeType == 0x00ff) { + ltgStrikeType = LtgStrikeType.STRIKE_CC; + } else if (strokeType == 0xffff) { + ltgStrikeType = LtgStrikeType.STRIKE_TF; + } + lsp.setType(ltgStrikeType); + + // as of OB13.3 for World Wide Lightning Location Network (WWLLN) data (decoded by textlightning though, not this bin lightning decoder), + // added lightning source field in LightningStrikePoint, as well as column in binlightning database table defaults to NLDN + if (vendor == ((short)0x0001)) { // CONUS source + lsp.setLightSource("NLDN"); + } else if (vendor == ((short)0x0002)) { // long range source, i.e., GLD360. + // However, since the database table column for lightning source is 5 characters + lsp.setLightSource("GLD"); + } + + lsp.setStrikeCount(strokeMultiplicity); + lsp.setStrikeStrength(strokeKiloAmps); + // stroke duration does not seem to be used + + strikes.add(lsp); + } + return strikes; + } + + /** + * Decode bin lightning data, able to handle both legacy bit-shifted and new encryted data + * + * The modified BinLightningDecoder.decode() method will use this method to decode data, which + * will try to decrypt first, and decode the old fashioned way when decryption fails + * + * @param data - data content from file, including WMO header section + * @param pdata - data with WMO header stripped, optional, if null, will strip WMO header internally from passed in data parameter + * @param traceId - the file name of the data to be deoced + * @param dataDate - date of the data, optional, used as a hint to find appropriate encryption key faster + * @return null if keep-alive record, otherwise a list (could be empty) of LightningStrikePoint + */ + public static List decodeBinLightningData(byte[] data, byte[] pdata, String traceId, Date dataDate) { + if (pdata == null) { // if data without header not passed, we'll strip the WMO header here + WMOHeader header = new WMOHeader(data); + if (header.isValid() && header.getMessageDataStart() > 0) { + pdata = new byte[data.length - header.getMessageDataStart()]; + System.arraycopy(data, header.getMessageDataStart(), pdata, 0, data.length - header.getMessageDataStart()); + } + } + + List strikes = new ArrayList(); + boolean needDecrypt = true; // set as default unless clear evidence says otherwise + boolean decodeDone = false; + EncryptedBinLightningCipher cipher = new EncryptedBinLightningCipher(); + + // + // Using different WMO headers to indicate whether the data is encrypted or not would be a nice option. + // However, that idea has been discussed but not adopted. + // If in the future, WMO header can be different for legacy and encrypted data, or some other metadata can be used to decide + // whether deceyption is needed, logic can be added here. + // + // Before that happens, we'll use hints and trial & error to decode the data + // Hints: Per lightning data format spec, there are 3 bytes in the WMO header starting line that indicates the size of the encrypted block + // or the ASCII sequence # for legacy bit-shifted data + // However, the starting line is optional and AWIPS decode may not see it at all because TG will strip that starting line away + // We'll try to use this hint first, if is is not found, then trial and error way to decrypt and decode + if (data != null) { + byte[] sizeSeqBytes = BinLigntningDecoderUtil.findSizeOrSeqBytesFromWMOHeader(data); + if (sizeSeqBytes != null) { + // if this is in the header (which may not), use that as a hint to determine which decoding route to go + if (BinLigntningDecoderUtil.isPossibleWMOHeaderSequenceNumber(sizeSeqBytes) + && BinLigntningDecoderUtil.getEncryptedBlockSizeFromWMOHeader(sizeSeqBytes) != pdata.length) { + // looks like a sequence #, and if treat as size, it does not equal to the data block size, so most likely legacy data + needDecrypt = false; + } + } + } + + if (needDecrypt) { + try { + byte[] decryptedData = cipher.decryptData(pdata, dataDate); + // decrypt ok, then decode, first check if keep-alive record + if (BinLigntningDecoderUtil.isKeepAliveRecord(decryptedData)) { + logger.info(traceId + " - Keep-alive record detected, ignore for now."); + decodeDone = true; + return null; + } + // not keep-alive record, then decode into an ArrayList of strikes + strikes = BinLigntningDecoderUtil.decodeDecryptedBinLightningData(decryptedData); + decodeDone = true; + } catch (IllegalBlockSizeException e) { + logger.info(traceId + " - " + e.getMessage() + ": Decryption failed, will try decode the old-fashioned way."); + decodeDone = false; + } catch (BadPaddingException e) { + logger.info(traceId + " - " + e.getMessage() + ": Decryption failed, will try decode the old-fashioned way."); + decodeDone = false; + } catch (BinLightningDataDecryptionException e) { + logger.info(traceId + " - " + e.getMessage() + ": Decryption failed, will try decode the old-fashioned way."); + decodeDone = false; + } + } + + if (decodeDone == false) { // not decoded through decrypt->decode process, try the legacy decoder + strikes = BinLigntningDecoderUtil.decodeBitShiftedBinLightningData(pdata); + } + + return strikes; + } + + /** + * Determines if the bytes passed are a standard "NWS Keep Alive" message. + * + * Note, record type in data are represented as 16-bit little-endian integer + * i.e., for keep alive record type (0x0000), byte[0] will be 0x00, byte[1] will be ox00 + * + * @param raw - Buffer containing bytes to check. + * + * @return true if bytes specified match a full "keep alive" message. + */ + + public static boolean isKeepAliveRecord(byte[] data) { + return (data.length == 6) && ((data[0] & 0xff) == (KEEP_ALIVE_TYPE & 0xff)) + && ((data[1] & 0xff) == ((KEEP_ALIVE_TYPE >> 8) & 0xff)) + && isLastTerminator(data, 2, data.length - 2); + } + + /** + * Determines if the bytes passed are a standard "NWS Last Element" terminator sequence. + * + * Note, record type in data are represented as 16-bit little-endian integer + * i.e., for lightning data record type (0x00ff), byte[0] will be 0xff, byte[1] will be ox00 + * + * @param raw - Buffer containing bytes to check. + * @param ofs - Offset within buffer to start check at. + * @param len - How many bytes from offset are available in the buffer. + * + * @return true if enough bytes are available and match the expected sequence. + */ + public static boolean isLastTerminator(byte[] raw, int ofs, int len) { + return compareBytes(LAST_TERM_BYTES, raw, ofs, len); + } + + /** + * Checks to see if raw data looks like a NWS lightning record. + * + * @param raw Buffer of bytes to inspect. + * @param ofs Current offset into the buffer. + * @param len Length of bytes left in the buffer. + * + * @return -1 if not bin lightning record, + * 0 if bin lightning record with continuation terminator (terminated with bytes 0x0D 0x0D, 0x0A, 0x00) + * 3 if it is the last bin lightning record (terminated with bytes 0x0D 0x0D, 0x0A, 0x03) + */ + public static int checkBinLightningRecord(byte[] raw, int ofs, int len) { + if (len < 0) { + len = raw.length - ofs; + } + if (len < BINLIGHTNING_RECORD_SIZE) { + return -1; + } + int terminatorOffset = BINLIGHTNING_RECORD_SIZE - 4; + if (((raw[ofs] & 0xff) == (LIGHTNING_TYPE & 0xff)) && ((raw[ofs + 1] & 0xff) == ((LIGHTNING_TYPE >> 8) & 0xff))) { + // record type indicates lightning record, now check record terminator + if (isMoreTerminator(raw, ofs + terminatorOffset, len - terminatorOffset)) { + return 0; + } else if (isLastTerminator(raw, ofs + terminatorOffset, len - terminatorOffset)) { + return 3; + } + } + return -1; + } + + /** + * check if the decrypted data is valid, i.e. contains either keep-alive record or a series of lightning data records + * + * @param data + * @return + */ + public static boolean isLightningDataRecords(byte[] data) { + if (data == null) return false; + + if (data.length % BINLIGHTNING_RECORD_SIZE != 0) { // not a multiple of bin lightning data record size (32) + return false; + } + + // check all records + int recordCount = data.length / BINLIGHTNING_RECORD_SIZE; + for (int i = 0; i < recordCount; i++) { + int offset = i * BINLIGHTNING_RECORD_SIZE; + int lenLeft = data.length - offset; + if (i < (recordCount - 1) && checkBinLightningRecord(data, offset, lenLeft) != 0) { + return false; + } else if (i == (recordCount - 1) && checkBinLightningRecord(data, offset, lenLeft) != 3) { + return false; + } + } + return true; + } + + /** + * check if the decrypted data is valid, check record by record for either keep-alive record or lightning data record + * + * NOTE: use this to check data validity only if keep-alive record is allowed to be mixed with lightning record (as in one sample file). + * However, generally as email communication cleared, keep-alive record should be in its own file. + * @param data + * @return + */ + public static boolean isValidMixedRecordData(byte[] data) { + if (data == null) return false; + int ofs = 0; + while ((ofs + 1) < data.length) { + // check record type bytes + if (((data[ofs] & 0xff) == (KEEP_ALIVE_TYPE & 0xff)) && ((data[ofs + 1] & 0xff) == ((KEEP_ALIVE_TYPE >> 8) & 0xff))) { + // keep-alive record, check its ending bytes after 2 bytes + if (isLastTerminator(data, ofs+2, data.length - ofs - 2)) { + ofs += 6; + if (data.length == ofs) return true; // reach the end + } else { + return false; + } + } else if (((data[ofs] & 0xff) == (LIGHTNING_TYPE & 0xff)) && ((data[ofs + 1] & 0xff) == ((LIGHTNING_TYPE >> 8) & 0xff))) { + // lightning record, check ending bytes after 28 bytes + if (isMoreTerminator(data, ofs + 28, data.length - ofs - 28)) { + ofs += 32; + if (data.length == ofs) return false; // reach the end but not last terminator + } else if (isLastTerminator(data, ofs + 28, data.length - ofs - 28)) { + ofs += 32; + if (data.length == ofs) return true; // reach the end + } else { + return false; + } + } + } + return false; + } + + /** + * Determines if the bytes passed are a standard "NWS Last Element" OR a "NWS More Elements" terminator sequence. + * + * @param raw - Buffer containing bytes to check. + * @param ofs - Offset within buffer to start check at. + * @param len - How many bytes from offset are available in the buffer. + * + * @return true if enough bytes are available and match the expected sequence. + */ + + public static boolean isTerminator(byte[] raw, int ofs, int len) { + return isMoreTerminator(raw, ofs, len) || isLastTerminator(raw, ofs, len); + } + + /** + * Determines if the bytes passed are a standard "NWS More Element" terminator sequence. + * + * @param raw - Buffer containing bytes to check. + * @param ofs - Offset within buffer to start check at. + * @param len - How many bytes from offset are available in the buffer. + * + * @return true if enough bytes are available and match the expected sequence. + */ + + public static boolean isMoreTerminator(byte[] raw, int ofs, int len) { + return compareBytes(MORE_TERM_BYTES, raw, ofs, len); + } + + + /** + * Helper method to compare bytes in a buffer to a known source. + * + * @param ref - Reference set of bytes you want to check against + * (all bytes in this array must be present in the src array starting + * at the offset specified and the length of the reference array + * must be equal to or less than the 'len' specified). + * + * @param raw - Buffer containing bytes to check. + * @param ofs - Offset within buffer to start check at. + * @param len - How many bytes from offset are available in the buffer. + * + * @return true if byte range specified matches the reference array. + */ + private static boolean compareBytes(byte[] ref, byte[] src, int ofs, int len) { + + int sizeToCompare = ref.length; + if (len < sizeToCompare) { + return false; + } + for (int i = 0; i < sizeToCompare; i++) { + if (ref[i] != src[ofs + i]) { + return false; + } + } + // Source bytes to check matched if this point reached + return true; + } + + /** + * find from the optional WMO header line (which could be stripped by switching system such as TG) the size or sequence bytes (3 bytes) + * the 3 bytes should be after the WMO header start bytes if they all exist + * + * @param data - data including the WMO header section + * @return null if not found, + */ + public static byte[] findSizeOrSeqBytesFromWMOHeader(byte[] data) { + if (compareBytes(WMO_HEADER_START_BYTES, data, 0, data.length) == true && data.length > 32) { + // found the [SOH] [CR] [CR] [LF] byte sequence at the beginning, then the next 3 bytes is what we looking for + return Arrays.copyOfRange(data, WMO_HEADER_START_BYTES.length, WMO_HEADER_START_BYTES.length + 3); + } + return null; + } + + /** + * convert the 3 bytes encrypted block size in WMO header to an integer according to spec. + * @param sizeBytes + * @return -1 if invalid sizeBytes + */ + public static int getEncryptedBlockSizeFromWMOHeader(byte[] sizeBytes) { + if (sizeBytes == null || sizeBytes.length != 3) return -1; + + return (sizeBytes[0] & 0xff) + ((sizeBytes[1] & 0xff) << 8) + ((sizeBytes[2] & 0xff) << 16); + } + + /** + * check if the bytes looks like a sequence number in 3 ASCII characters + * + * @param seqBytes + * @return + */ + public static boolean isPossibleWMOHeaderSequenceNumber(byte[] seqBytes) { + if (seqBytes == null || seqBytes.length != 3) return false; + + if (Character.isDigit(seqBytes[0]) && Character.isDigit(seqBytes[1]) && Character.isDigit(seqBytes[2])) { + return true; + } + return false; + } + +} diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/EncryptedBinLightningCipher.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/EncryptedBinLightningCipher.java new file mode 100644 index 0000000000..d0e69bcf22 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/gov/noaa/nws/ost/edex/plugin/binlightning/EncryptedBinLightningCipher.java @@ -0,0 +1,184 @@ +/** + * This code has been developed by NWS/OST to support AWIPS II + * + */ +package gov.noaa.nws.ost.edex.plugin.binlightning; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * EncryptedBinLightningCipher + * + * Use AES secret keys found in configured keystore to decrypt bin lightning data + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 20130503        DCS 112 Wufeng Zhou To handle both the new encrypted data and legacy bit-shifted data
+ * 
+ * 
+ * + * @author Wufeng Zhou + * + */ +public class EncryptedBinLightningCipher { + private static final String BINLIGHTNING_CIPHER_TYPE = "AES"; + + /** Maximum size of the encrypted block, determined by 3 byte length field in the header */ + private static final int MAX_SIZE_ENCRYPTED_BLOCK = 0xffffff; + + /** + * Cipher creation is a relatively expensive operation and would be better to reuse it in the same thread. + **/ + private static final ThreadLocal> decryptCipherMap = new ThreadLocal>() { + + @Override + protected HashMap initialValue() { + // get AES keys from keystore and create encryption and decryption ciphers from them + BinLightningAESKey[] keys = BinLightningAESKey.getBinLightningAESKeys(); + HashMap cipherMap = new HashMap(); + for (BinLightningAESKey key : keys) { + try { + SecretKeySpec skeySpec = (SecretKeySpec)key.getKey(); + Cipher cipher = Cipher.getInstance(BINLIGHTNING_CIPHER_TYPE); + cipher.init(Cipher.DECRYPT_MODE, skeySpec); + + cipherMap.put(key.getAlias(), cipher); + } catch (Exception e) { + logger.error("Fail to create decrypt Cipher from key " + key.getAlias(), e); + } + } + return cipherMap; + } + }; + + private static Log logger = LogFactory.getLog(EncryptedBinLightningCipher.class); + + public EncryptedBinLightningCipher() { + + } + + /** + * decrypt data with AES keys + * + * @param data + * @return + * @throws IllegalBlockSizeException + * @throws BadPaddingException + */ + public byte[] decryptData(byte[] data) throws IllegalBlockSizeException, BadPaddingException, BinLightningDataDecryptionException { + return decryptData(data, null); + } + + /** + * decrypt data with AES keys, using data observation date as a hint to find the best suitable key to try first + * + * @param data + * @param dataDate + * @return + * @throws IllegalBlockSizeException + * @throws BadPaddingException + */ + public byte[] decryptData(byte[] data, Date dataDate) throws IllegalBlockSizeException, BadPaddingException, BinLightningDataDecryptionException { + if (data == null) { + throw new IllegalBlockSizeException("Data is null"); + } + if (data.length == 0) { + throw new IllegalBlockSizeException("Data is empty"); + } + if (data.length > MAX_SIZE_ENCRYPTED_BLOCK) { + throw new IllegalBlockSizeException("Block size exceeds maxinum expected."); + } + + HashMap cipherMap = EncryptedBinLightningCipher.decryptCipherMap.get(); + // find the preferred key order to try decryption based on data date + List preferredKeyList = findPreferredKeyOrderForData(dataDate); + + if (preferredKeyList == null || preferredKeyList.size() == 0) { + throw new BinLightningDataDecryptionException("No AES key found to decrypt data. Please make sure keystore is properly configured with key(s)."); + } + + // try to decrypt the data using ciphers in the list until successful + byte[] decryptedData = null; + for (int i = 0; i < preferredKeyList.size(); i++) { + Cipher cipher = cipherMap.get(preferredKeyList.get(i).getAlias()); + try { + decryptedData = cipher.doFinal(data, 0, data.length); + + // wrong key will decrypt data into random noise/garbage, so we need to do a sanity check to make sure + // we are decrypting with the right key + if ( BinLigntningDecoderUtil.isKeepAliveRecord(decryptedData) == false && BinLigntningDecoderUtil.isLightningDataRecords(decryptedData) == false) { + //if (BinLigntningDecoderUtil.isValidMixedRecordData(decryptedData) == false) { // use this only if keep-alive record could be mixed with lightning records + logger.info("Decrypted data (" + decryptedData.length + " bytes) with key " + preferredKeyList.get(i).getAlias() + + " is not valid keep-alive or binLightning records. Try other key."); + throw new BinLightningDataDecryptionException("Decrypted data (" + decryptedData.length + " bytes) with key " + + preferredKeyList.get(i).getAlias() + " is not valid keep-alive or binLightning records.", decryptedData); + } + logger.info("Data (" + data.length + " bytes) decrypted to " + decryptedData.length + " bytes with key: " + preferredKeyList.get(i).getAlias()); + break; // decrypt ok, break out + } catch (IllegalBlockSizeException e) { + // ignore exception if not the last, and try next cipher + logger.info("Fail to decrypt data (" + data.length + " bytes) with key: " + preferredKeyList.get(i).getAlias() + " - " + e.getMessage() + ", will try other keys"); + if (i == (preferredKeyList.size() - 1)) { + logger.info("Fail to decrypt with all know keys, either data is not encrypted or is invalid."); + throw e; + } + } catch (BadPaddingException e) { + // ignore exception if not the last, and try next cipher + logger.info("Fail to decrypt data (" + data.length + " bytes) with key: " + preferredKeyList.get(i).getAlias() + " - " + e.getMessage() + ", will try other keys"); + if (i == (preferredKeyList.size() - 1)) { + logger.info("Fail to decrypt with all know keys, either data is not encrypted or is invalid."); + throw e; + } + } + } + return decryptedData; + } + + /** + * Assuming the best keys to decrypt data should be issued before the data observation date, so + * if there were many keys issued, this hopefully will reduce the unnecessary decryption tries + * + * @param dataDate + * @return preferred key list order + */ + private List findPreferredKeyOrderForData(Date dataDate) { + List defKeyList = Arrays.asList(BinLightningAESKey.getBinLightningAESKeys()); + if (dataDate == null) { + return defKeyList; // use default order + } + + int preferredKeyIndex = -1; + for (int i = 0; i < defKeyList.size() - 2; i++) { + if (dataDate.before(defKeyList.get(i).getKeyDate()) && dataDate.after(defKeyList.get(i+1).getKeyDate())) { + // found the preferred key at index i+1 + preferredKeyIndex = i+1; + break; + } + } + if (preferredKeyIndex == -1) { // no preferred keys found for data date, use default order + return defKeyList; + } else { + List preferredList = new ArrayList(); + preferredList.addAll(defKeyList.subList(preferredKeyIndex, defKeyList.size())); + preferredList.addAll(defKeyList.subList(0, preferredKeyIndex)); + return preferredList; + } + } + +} diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/GetGridInventoryHandler.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/GetGridInventoryHandler.java index aede0208bf..8f4e2aa04f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/GetGridInventoryHandler.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/GetGridInventoryHandler.java @@ -40,6 +40,7 @@ import com.raytheon.uf.common.time.TimeRange; * ------------ ---------- ----------- -------------------------- * 04/18/08 #875 bphillip Initial Creation * 09/22/09 3058 rjpeter Converted to IRequestHandler + * 06/06/13 #2073 dgilling Ensure payload is always populated. * * * @author bphillip @@ -56,16 +57,11 @@ public class GetGridInventoryHandler implements ServerResponse> timeSr = GridParmManager .getGridInventory(parmId); List times = timeSr.getPayload(); + inventory.put(parmId, times); sr.addMessages(timeSr); - - if (sr.isOkay()) { - inventory.put(parmId, times); - } } - if (sr.isOkay()) { - sr.setPayload(inventory); - } + sr.setPayload(inventory); return sr; } } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/LockChangeHandler.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/LockChangeHandler.java index e76cb1e0b3..310887c9d7 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/LockChangeHandler.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/handler/LockChangeHandler.java @@ -27,11 +27,12 @@ import com.raytheon.edex.plugin.gfe.server.lock.LockManager; import com.raytheon.edex.plugin.gfe.util.SendNotifications; import com.raytheon.uf.common.dataplugin.gfe.request.LockChangeRequest; import com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable; -import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerMsg; 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.server.notify.LockNotification; import com.raytheon.uf.common.serialization.comm.IRequestHandler; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; /** * GFE task for requesting a lock change @@ -44,12 +45,17 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler; * 06/17/08 #940 bphillip Implemented GFE Locking * 09/22/09 3058 rjpeter Converted to IRequestHandler * 04/24/13 1949 rjpeter Added list sizing + * 06/12/13 2099 randerso Send GridUpdateNotifications, + * clean up error handling * * * @author bphillip * @version 1.0 */ public class LockChangeHandler implements IRequestHandler { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(LockChangeHandler.class); + @Override public ServerResponse> handleRequest( LockChangeRequest request) throws Exception { @@ -70,13 +76,16 @@ public class LockChangeHandler implements IRequestHandler { ServerResponse notifyResponse = SendNotifications .send(notes); if (!notifyResponse.isOkay()) { - for (ServerMsg msg : notifyResponse.getMessages()) { - sr.addMessage(msg.getMessage()); - } + statusHandler.error(notifyResponse.message()); + } + + // send out grid update notifications + notifyResponse = SendNotifications.send(sr.getNotifications()); + if (!notifyResponse.isOkay()) { + statusHandler.error(notifyResponse.message()); } } catch (Exception e) { - sr.addMessage("Error sending lock notification - " - + e.getMessage()); + statusHandler.error("Error sending lock notification", e); } } return sr; diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/SendNotifications.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/SendNotifications.java index 20353f62f7..76cce585ff 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/SendNotifications.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/SendNotifications.java @@ -41,6 +41,8 @@ import com.raytheon.uf.edex.core.EdexException; * ------------ ---------- ----------- -------------------------- * 06/30/08 #875 bphillip Initial Creation * 09/22/09 3058 rjpeter changed to utility. + * 06/12/13 2099 dgilling Remove error when passed empty list of + * notifications. * * * @author bphillip @@ -60,7 +62,6 @@ public class SendNotifications { List notifications) { ServerResponse sr = new ServerResponse(); if (notifications.isEmpty()) { - sr.addMessage("Attempting to send empty notification list"); return sr; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/impl/LtgStrikeType.java b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/impl/LtgStrikeType.java index 84e54cc8b2..aa2c50765b 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/impl/LtgStrikeType.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/impl/LtgStrikeType.java @@ -29,6 +29,7 @@ package com.raytheon.uf.common.dataplugin.binlightning.impl; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20070810 379 jkorman Initial Coding from prototype. + * 20130425 DCS 112 Wufeng Zhou Added STRIKE_TF (for Total Flash) in definition for Total Flash * * * @@ -38,7 +39,8 @@ package com.raytheon.uf.common.dataplugin.binlightning.impl; public enum LtgStrikeType { STRIKE_CC("CC"), - STRIKE_CG("CG"); + STRIKE_CG("CG"), + STRIKE_TF("TF"); private final String strikeType; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java index 3f01e2535a..9d3d81a557 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java @@ -87,6 +87,7 @@ import com.vividsolutions.jts.io.WKBReader; * 02/20/13 1635 D. Hladky Constants * 03/18/13 1817 D. Hladky Fixed issue with BOX where only 1 HUC was showing up. * 04/15/13 1902 M. Duff Generic List + * 06/10/13 2085 njensen Use countyMap for efficiency * * * @author dhladky @@ -1282,7 +1283,8 @@ public class FFMPTemplates { * @param huc * @return */ - public synchronized LinkedHashMap getMap(String dataKey, String cwa, String huc) { + public synchronized LinkedHashMap getMap(String dataKey, + String cwa, String huc) { LinkedHashMap map = null; HashMap> hucMap = null; @@ -1927,8 +1929,8 @@ public class FFMPTemplates { getAbsoluteFileName(dataKey, huc, cwa, "list")); try { - list = (long[]) SerializationUtil.transformFromThrift(FileUtil - .file2bytes(f.getFile(), true)); + list = SerializationUtil.transformFromThrift(long[].class, + FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { se.printStackTrace(); } catch (IOException e) { @@ -1959,12 +1961,12 @@ public class FFMPTemplates { if (huc.equals(FFMPRecord.ALL)) { map = (HashMap) SerializationUtil - .transformFromThrift(FileUtil.file2bytes(f.getFile(), - true)); + .transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } else { map = (HashMap) SerializationUtil - .transformFromThrift(FileUtil.file2bytes(f.getFile(), - true)); + .transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } } catch (SerializationException se) { se.printStackTrace(); @@ -1995,7 +1997,8 @@ public class FFMPTemplates { try { map = (HashMap) SerializationUtil - .transformFromThrift(FileUtil.file2bytes(f.getFile(), true)); + .transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { se.printStackTrace(); } catch (IOException e) { @@ -2022,8 +2025,8 @@ public class FFMPTemplates { getAbsoluteFileName(dataKey, FFMPRecord.VIRTUAL, cwa, "list")); try { - list = (String[]) SerializationUtil.transformFromThrift(FileUtil - .file2bytes(f.getFile(), true)); + list = SerializationUtil.transformFromThrift(String[].class, + FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { se.printStackTrace(); } catch (IOException e) { @@ -2342,11 +2345,14 @@ public class FFMPTemplates { getCounties(siteKey); } - FFMPCounty county = FFMPUtils - .getCounty(countyPfaf, MODE.CAVE.getMode()); + FFMPCounty county = countyMap.get(countyPfaf); + if (county == null) { + county = FFMPUtils.getCounty(countyPfaf, MODE.CAVE.getMode()); + countyMap.put(countyPfaf, county); + } if (county != null) { - StringBuffer name = new StringBuffer(); + StringBuilder name = new StringBuilder(); name.append(county.getState() + ", "); name.append(county.getCountyName()); rname = name.toString(); diff --git a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/ColumnAttribData.java b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/ColumnAttribData.java index 4033ef1de4..c1685626d6 100644 --- a/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/ColumnAttribData.java +++ b/edexOsgi/com.raytheon.uf.common.monitor/src/com/raytheon/uf/common/monitor/data/ColumnAttribData.java @@ -166,10 +166,6 @@ public class ColumnAttribData { splitColumnName = this.name.replaceAll(splitStr, "\n"); columnNameWithSpace = tmpName; - - System.out.println("originalName = " + originalName); - System.out.println("columnName = " + columnName); - System.out.println("splitColumnName = " + splitColumnName); } /** diff --git a/edexOsgi/com.raytheon.uf.common.stats/src/com/raytheon/uf/common/stats/xml/StatisticsEvent.java b/edexOsgi/com.raytheon.uf.common.stats/src/com/raytheon/uf/common/stats/xml/StatisticsEvent.java deleted file mode 100644 index 5f58b5a3d5..0000000000 --- a/edexOsgi/com.raytheon.uf.common.stats/src/com/raytheon/uf/common/stats/xml/StatisticsEvent.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.common.stats.xml; - -import java.lang.reflect.Method; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; - -import com.raytheon.uf.common.event.Event; -import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; - -/** - * Statistics Configuration Event xml element. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Nov 6, 2012    728      mpduff      Initial creation.
- * 
- * 
- * - * @author mpduff - * @version 1.0 - */ -@DynamicSerialize -@XmlRootElement(name = "event") -@XmlAccessorType(XmlAccessType.NONE) -public class StatisticsEvent { - - @XmlAttribute - @DynamicSerializeElement - private String type; - - @XmlAttribute - @DynamicSerializeElement - private String displayName; - - @XmlAttribute - @DynamicSerializeElement - private String category; - - @XmlElements({ @XmlElement(name = "statisticsGroup", type = StatisticsGroup.class) }) - @DynamicSerializeElement - private List groupList; - - @XmlElements({ @XmlElement(name = "statisticsAggregate", type = StatisticsAggregate.class) }) - @DynamicSerializeElement - private List aggregateList; - - private Class typeClass = null; - - private List groupByMethods = null; - - private List aggregateMethods = null; - - /** - * @return the aggregateList - */ - public List getAggregateList() { - return aggregateList; - } - - /** - * @return the category - */ - public String getCategory() { - return category; - } - - /** - * @return the displayName - */ - public String getDisplayName() { - return displayName; - } - - /** - * @return the groupList - */ - public List getGroupList() { - return groupList; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param aggregateList - * the aggregateList to set - */ - public void setAggregateList(List aggregateList) { - this.aggregateList = aggregateList; - } - - /** - * @param category - * the category to set - */ - public void setCategory(String category) { - this.category = category; - } - - /** - * @param displayName - * the displayName to set - */ - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - /** - * @param groupList - * the groupList to set - */ - public void setGroupList(List groupList) { - this.groupList = groupList; - } - - /** - * @param type - * the type to set - */ - public void setType(String type) { - this.type = type; - } - - public Class getTypeClass() { - return typeClass; - } - - public void setTypeClass(Class typeClass) { - this.typeClass = typeClass; - } - - public List getGroupByMethods() { - return groupByMethods; - } - - public void setGroupByMethods(List groupByMethods) { - this.groupByMethods = groupByMethods; - } - - public List getAggregateMethods() { - return aggregateMethods; - } - - public void setAggregateMethods(List aggregateMethods) { - this.aggregateMethods = aggregateMethods; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF index 94da0d42f4..3f2f5253c8 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.activetable/META-INF/MANIFEST.MF @@ -23,6 +23,7 @@ Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.1", com.raytheon.uf.common.message;bundle-version="1.12.1174", com.raytheon.uf.common.activetable;bundle-version="1.12.1174", com.raytheon.uf.edex.site;bundle-version="1.0.0", - com.google.guava;bundle-version="1.0.0" + com.google.guava;bundle-version="1.0.0", + org.apache.log4j;bundle-version="1.0.0" Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Export-Package: com.raytheon.uf.edex.activetable diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java index 228f3d8842..de62fb4bdc 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java +++ b/edexOsgi/com.raytheon.uf.edex.activetable/src/com/raytheon/uf/edex/activetable/ActiveTable.java @@ -30,6 +30,8 @@ import java.util.TreeSet; import jep.JepException; +import org.apache.log4j.Logger; + import com.raytheon.edex.util.Util; import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.ActiveTableRecord; @@ -78,6 +80,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * for merge logic. * May 14, 2013 1842 dgilling Also delete cluster locks when purging * PRACTICE active table. + * Jun 11, 2013 2083 randerso Log active table changes * * * @@ -89,15 +92,14 @@ public class ActiveTable { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(ActiveTable.class); - public static final String NATIONAL_CENTERS = ",KWNS,KNHC"; + private static final Logger changeLog = Logger + .getLogger("ActiveTableChange"); private static final String NEXT_ETN_LOCK = "ActiveTableNextEtn"; private static String filePath; - private static String pythonPath; - - private static String vtecPath; + private static String includePath; private static CoreDao practiceDao = new CoreDao( DaoConfig.forClass(PracticeActiveTableRecord.class)); @@ -113,8 +115,15 @@ public class ActiveTable { LocalizationType.COMMON_STATIC, LocalizationLevel.BASE); filePath = pathMgr.getFile(commonCx, "vtec" + File.separator + "ActiveTable.py").getPath(); - pythonPath = pathMgr.getFile(commonCx, "python").getPath(); - vtecPath = pathMgr.getFile(commonCx, "vtec").getPath(); + String siteId = pathMgr.getContext(LocalizationType.COMMON_STATIC, + LocalizationLevel.SITE).getContextName(); + String pythonPath = ActiveTablePyIncludeUtil + .getCommonPythonIncludePath(); + String vtecPath = ActiveTablePyIncludeUtil.getVtecIncludePath(siteId); + String configPath = ActiveTablePyIncludeUtil + .getGfeConfigIncludePath(siteId); + includePath = PyUtil.buildJepIncludePath(pythonPath, vtecPath, + configPath); } public ActiveTable() { @@ -303,7 +312,7 @@ public class ActiveTable { } MergeResult result = filterTable(getActiveTable(siteId, mode), - newRecords, offsetSecs); + newRecords, mode, offsetSecs); updateTable(siteId, result, mode); @@ -325,16 +334,18 @@ public class ActiveTable { * active table and the second being the purged records */ private MergeResult filterTable(List activeTable, - List newRecords, float offsetSecs) { - HashMap args = new HashMap(2); + List newRecords, ActiveTableMode mode, + float offsetSecs) { + HashMap args = new HashMap(5, 1.0f); args.put("activeTable", activeTable); args.put("newRecords", newRecords); + args.put("logger", changeLog); + args.put("mode", mode.toString()); args.put("offsetSecs", offsetSecs); MergeResult result = null; try { try { - python = new PythonScript(filePath, PyUtil.buildJepIncludePath( - pythonPath, vtecPath), + python = new PythonScript(filePath, includePath, ActiveTable.class.getClassLoader()); try { result = (MergeResult) python diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py index d4c538a71b..9b893790f0 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py @@ -17,19 +17,39 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## +# # Code mostly separated from legacy VTECDecoder.py +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/11/13 #2083 randerso Log active table changes, save backups +# import time import copy +import os +import siteConfig import VTECTableUtil, VTECTableSqueeze, VTECPartners import LogStream, ActiveTableVtec, ActiveTableRecord from java.util import ArrayList +from com.raytheon.uf.common.localization import PathManagerFactory +from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType +from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel class ActiveTable(VTECTableUtil.VTECTableUtil): - def __init__(self): + def __init__(self, activeTableMode): self._time = time.time() + # create a dummy name to simplify the file access code in VTECTableUtil + pathMgr = PathManagerFactory.getPathManager() + edexSiteCx = pathMgr.getContext(LocalizationType.EDEX_STATIC, LocalizationLevel.SITE) + filePath = pathMgr.getFile(edexSiteCx,"vtec").getPath() + VTECTableUtil.VTECTableUtil.__init__(self, os.path.join(filePath, activeTableMode + ".tbl")) + def updateActiveTable(self, activeTable, newRecords, offsetSecs=0): #merges the previous active table and new records into a new table. #Returns: @@ -228,27 +248,63 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): return outTable, purgedRecords, changes, changedFlag -def mergeFromJava(activeTable, newRecords, offsetSecs=0): +def mergeFromJava(activeTable, newRecords, logger, mode, offsetSecs=0): pyActive = [] szActive = activeTable.size() for i in range(szActive): pyActive.append(ActiveTableRecord.ActiveTableRecord(activeTable.get(i))) + siteId = siteConfig.GFESUITE_SITEID + + decoderSites = VTECPartners.VTEC_DECODER_SITES + decoderSites.append(VTECPartners.get4ID(siteId)) + decoderSites.append(VTECPartners.VTEC_SPC_SITE) + decoderSites.append(VTECPartners.VTEC_TPC_SITE) + + backup = False pyNew = [] szNew = newRecords.size() for i in range(szNew): - pyNew.append(ActiveTableRecord.ActiveTableRecord(newRecords.get(i))) + rec = ActiveTableRecord.ActiveTableRecord(newRecords.get(i)) + if rec['officeid'] in decoderSites: + backup = True + pyNew.append(rec) - active = ActiveTable() + active = ActiveTable(mode) - updatedTable, purgedTable, changes, changedFlag = active.activeTableMerge(pyActive, pyNew, offsetSecs) + if backup: + oldActiveTable = active._convertTableToPurePython(pyActive, siteId) + active.saveOldActiveTable(oldActiveTable) + pTime = getattr(VTECPartners, "VTEC_BACKUP_TABLE_PURGE_TIME",168) + active.purgeOldSavedTables(pTime) + updatedTable, purgeRecords, changes, changedFlag = active.activeTableMerge(pyActive, pyNew, offsetSecs) + + logger.info("Updated " + mode + " Active Table: purged\n" + + active.printActiveTable(purgeRecords, combine=1)) + + replaced = [] + decoded = [] + other = [] + for r in updatedTable: + if r['state'] == "Replaced": + replaced.append(r) + elif r['state'] == "Decoded": + decoded.append(r) + else: + other.append(r) + + logger.info("Updated " + mode + " Active Table: replaced\n" + + active.printActiveTable(replaced, combine=1)) + logger.info("Updated " + mode + " Active Table: decoded\n" + + active.printActiveTable(decoded, combine=1)) + updatedList = ArrayList() for x in updatedTable: updatedList.add(x.javaRecord()) purgedList = ArrayList() - for x in purgedTable: + for x in purgeRecords: purgedList.add(x.javaRecord()) changeList = ArrayList() diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py index d2e3294a46..016b8f3c0b 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py @@ -31,6 +31,7 @@ # ------------ ---------- ----------- -------------------------- # 01/25/13 1447 dgilling Initial Creation. # 03/19/13 1447 dgilling Merge A1 DR 21434. +# 06/11/13 #2083 randerso Move backups to edex_static # # @@ -75,10 +76,10 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): # create a dummy name to simplify the file access code in VTECTableUtil pathMgr = PathManagerFactory.getPathManager() - commonSiteCx = pathMgr.getContextForSite( - LocalizationType.COMMON_STATIC, siteConfig.GFESUITE_SITEID) - filePath = pathMgr.getFile(commonSiteCx,"vtec").getPath() - self._activeTableFilename = os.path.join(filePath, activeTableMode + ".tbl") + edexSiteCx = pathMgr.getContextForSite( + LocalizationType.EDEX_STATIC, siteConfig.GFESUITE_SITEID) + filePath = pathMgr.getFile(edexSiteCx,"vtec").getPath() + fileName = os.path.join(filePath, activeTableMode + ".tbl") # to ensure time calls are based on Zulu os.environ['TZ'] = "GMT0" @@ -86,7 +87,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): self._makeBackups = makeBackups - VTECTableUtil.VTECTableUtil.__init__(self, self._activeTableFilename) + VTECTableUtil.VTECTableUtil.__init__(self, fileName) # get the SPC site id from the configuration file self._spcSite = getattr(VTECPartners, "VTEC_SPC_SITE", "KWNS") diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py index e690405267..ac11e1b11d 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/VTECPartners.py @@ -17,6 +17,15 @@ # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## +# +# VTEC Partner configuration +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/11/13 #2083 randerso Fixed getISCSites to look in configured #VTEC_Partners.py - configuration file to control filtering and merging #of VTEC active table. @@ -228,9 +237,9 @@ def getISCSites(): from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel pathMgr = PathManagerFactory.getPathManager() - commonStaticSite = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE) - commonStaticSite.setContextName(siteConfig.GFESUITE_SITEID) - eaDir = pathMgr.getFile(commonStaticSite, "gfe/editAreas").getCanonicalPath() + commonStaticCfg = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED) + commonStaticCfg.setContextName(siteConfig.GFESUITE_SITEID) + eaDir = pathMgr.getFile(commonStaticCfg, "gfe/editAreas").getCanonicalPath() files = glob.glob(eaDir + "/ISC_???.xml") sites = [] WFOSites = BackupDict.keys() diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/resources/stats.properties b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/resources/stats.properties deleted file mode 100644 index e3dddc196a..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/resources/stats.properties +++ /dev/null @@ -1,4 +0,0 @@ -# scan interval of stats table in minutes -stats.scanInterval=15 -# bucket interval or period of when to aggregate in minutes -stats.period=5 \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.stats/res/spring/edex-process-stats.xml b/edexOsgi/com.raytheon.uf.edex.stats/res/spring/edex-process-stats.xml deleted file mode 100644 index 985079cecc..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.stats/res/spring/edex-process-stats.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.Throwable - - - - - - - diff --git a/edexOsgi/com.raytheon.uf.edex.stats/res/spring/stats-graph-request.xml b/edexOsgi/com.raytheon.uf.edex.stats/res/spring/stats-graph-request.xml deleted file mode 100644 index 99a7836afb..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.stats/res/spring/stats-graph-request.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/edexOsgi/com.raytheon.uf.edex.stats/resources/edexProcessStats.properties b/edexOsgi/com.raytheon.uf.edex.stats/resources/edexProcessStats.properties deleted file mode 100644 index fe31fc60f3..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.stats/resources/edexProcessStats.properties +++ /dev/null @@ -1,4 +0,0 @@ -# scan interval of stats table in minutes -stats.scanInterval=2 -# bucket interval or period of when to aggregate in minutes -stats.period=5 \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/util/Archiver.java b/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/util/Archiver.java deleted file mode 100644 index 59dd45cd2e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.stats/src/com/raytheon/uf/edex/stats/util/Archiver.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.stats.util; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -import javax.xml.bind.JAXBException; - -import com.raytheon.uf.common.localization.IPathManager; -import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; -import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.stats.AggregateRecord; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.common.time.TimeRange; - -/** - * Archives the data in the aggregate_bucket table to an xml file. - * - *
- * 
- * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Aug 21, 2012            jsanchez     Initial creation.
- * Nov 09, 2012            dhladky      Changed to CSV output
- * Jan 24, 2013   1357     mpduff       Fix comma output and paths.
- * 
- * 
- * - * @author jsanchez - * - */ -public class Archiver { - - private class StatisticsKey { - public String eventType; - - public String grouping; - - public TimeRange timeRange; - - @Override - public boolean equals(Object o) { - if (o != null && o instanceof StatisticsKey) { - StatisticsKey other = (StatisticsKey) o; - - return eventType.equals(other.eventType) - && timeRange.getStart().equals( - other.timeRange.getStart()) - && timeRange.getEnd().equals(other.timeRange.getEnd()); - } - - return false; - } - - @Override - public int hashCode() { - return 1; - } - } - - private static final String COMMA = ","; - - private static final Pattern NLPattern = Pattern.compile("[\\n\\r]+"); - - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(Archiver.class); - - private final IPathManager pm = PathManagerFactory.getPathManager(); - - private final LocalizationContext context = pm.getContext( - LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); - - private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - - private static final String FILE_DATE_FORMAT = "yyyyMMdd_HHmm"; - - private static final Pattern PERIOD_PATTERN = Pattern.compile("\\."); - - public Archiver() { - - } - - /** - * Creates a filename in the format /stats/aggregates/group... - * /eventType.start-end.dat - * - * @param items - * @return - */ - private String createFilename(TimeRange tr, String eventType) { - - SimpleDateFormat fileDateFormatter = new SimpleDateFormat( - FILE_DATE_FORMAT); - StringBuilder sb = new StringBuilder("stats/aggregates"); - String[] chunks = PERIOD_PATTERN.split(eventType); - sb.append("/"); - sb.append(chunks[chunks.length - 1]); - sb.append("."); - sb.append(fileDateFormatter.format(tr.getStart())); - sb.append("-"); - sb.append(fileDateFormatter.format(tr.getEnd())); - sb.append(".csv"); - - return sb.toString(); - } - - /** - * Used for outputting the stats as CSV - * - * @return - */ - private String getCSVOutput(AggregateRecord agrec, - SimpleDateFormat dateFormat) { - - StringBuilder sb = new StringBuilder(); - - String eventType = agrec.getEventType(); - Calendar startDate = agrec.getStartDate(); - Calendar endDate = agrec.getEndDate(); - String grouping = agrec.getGrouping(); - String field = agrec.getField(); - double max = agrec.getMax(); - double min = agrec.getMin(); - double sum = agrec.getSum(); - double count = agrec.getCount(); - - if (eventType != null) { - sb.append(eventType); - } - sb.append(COMMA); - - if (startDate != null) { - sb.append(dateFormat.format(startDate.getTime())); - } - sb.append(COMMA); - - if (endDate != null) { - sb.append(dateFormat.format(endDate.getTime())); - } - sb.append(COMMA); - - if (grouping != null) { - sb.append(NLPattern.matcher(grouping).replaceAll("")); - } - sb.append(COMMA); - - if (field != null) { - sb.append(field); - } - sb.append(COMMA); - - sb.append(max).append(COMMA); - sb.append(min).append(COMMA); - sb.append(sum).append(COMMA); - sb.append(count); - - return sb.toString(); - } - - /** - * Writes the aggregate records to disk. - * - * @param aggregateRecords - * @throws JAXBException - */ - public void writeToDisk(AggregateRecord[] aggregateRecords) { - - Map> statisticsMap = new HashMap>(); - - for (AggregateRecord record : aggregateRecords) { - StatisticsKey key = new StatisticsKey(); - key.eventType = record.getEventType(); - key.grouping = record.getGrouping(); - key.timeRange = new TimeRange(record.getStartDate(), - record.getEndDate()); - - List aggregateRecordList = statisticsMap.get(key); - if (aggregateRecordList == null) { - aggregateRecordList = new ArrayList(); - statisticsMap.put(key, aggregateRecordList); - } - - aggregateRecordList.add(record); - } - - for (StatisticsKey key : statisticsMap.keySet()) { - - String eventType = key.eventType; - List records = statisticsMap.get(key); - - String filename = createFilename(key.timeRange, eventType); - try { - writeToFile(filename, records); - } catch (JAXBException e) { - statusHandler.error("Unable to write statistics file " - + filename, e); - } - } - } - - /** - * Writes the statistics xml to disk. - * - * @param statistics - * @throws JAXBException - */ - public void writeToFile(String filename, List records) - throws JAXBException { - - BufferedWriter bw = null; - SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT); - LocalizationFile siteLocalization = pm.getLocalizationFile(context, - filename); - String outputFilePath = siteLocalization.getFile().getAbsolutePath(); - // pre-create directories if necessary - siteLocalization.getFile().getParentFile().mkdirs(); - // Write this to output CSV - try { - bw = new BufferedWriter(new FileWriter(outputFilePath)); - if (bw != null) { - for (AggregateRecord agrec : records) { - bw.write(getCSVOutput(agrec, dateFormatter)); - bw.newLine(); - } - } - - } catch (IOException e) { - - statusHandler.handle(Priority.ERROR, "Failed to write File: " - + outputFilePath, e); - } finally { - if (bw != null) { - try { - bw.close(); - } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, - "failed to close CSV output file stream. " - + filename, e); - } - } - } - - } -} diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/capture b/edexOsgi/com.raytheon.uf.tools.cli/impl/capture index 346f26fb8b..90de8e49fe 100644 --- a/edexOsgi/com.raytheon.uf.tools.cli/impl/capture +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/capture @@ -542,6 +542,9 @@ fi # grab screen shot, spawns background process for each screen grabScreenShot +# ls users home directory to check nas performance +/usr/bin/time -p ls -la ~ > ${dataPath}/nas_check_ls_home.txt 2>&1 & + # get reason for running capture if [ "$reason" != "n" ]; then reasonForCapture & diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/retrieveActivity b/edexOsgi/com.raytheon.uf.tools.cli/impl/retrieveActivity new file mode 100644 index 0000000000..4c0f9045da --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/retrieveActivity @@ -0,0 +1,51 @@ +#!/bin/bash +## +# 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. +## +############################################################################## +# This script allows users to extract PGEN products from EDEX. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/08/12 #674 dgilling Initial Creation. +############################################################################## + +# this allows you to run this script from outside of ./bin +path_to_script=`readlink -f $0` +RUN_FROM_DIR=`dirname $path_to_script` + +BASE_AWIPS_DIR=`dirname $RUN_FROM_DIR` + +# get the base environment +source ${RUN_FROM_DIR}/setup.env + +# setup the environment needed to run the the Python +export LD_LIBRARY_PATH=${BASE_AWIPS_DIR}/src/lib:${PYTHON_INSTALL}/lib +export PYTHONPATH=${RUN_FROM_DIR}/src:$PYTHONPATH + +# execute the ifpInit Python module +_PYTHON="${PYTHON_INSTALL}/bin/python" +_MODULE="${RUN_FROM_DIR}/src/pgen/retrieveActivity.py" + +# quoting of '$@' is used to prevent command line interpretation +#$_PYTHON $_MODULE -h ${DEFAULT_HOST} -p ${DEFAULT_PORT} "$@" +$_PYTHON $_MODULE "$@" + diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductRetriever.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductRetriever.py new file mode 100644 index 0000000000..c348c48f16 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductRetriever.py @@ -0,0 +1,50 @@ +import os +from ufpy import ThriftClient +from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import StringDataRecord +from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import ByteDataRecord +from dynamicserialize.dstypes.gov.noaa.nws.ncep.common.dataplugin.pgen.request import RetrieveAllProductsRequest + + +class ProductRetriever: + """ Retrieves all PGEN products for a given Activity (dataURI) and writes them to separate files.""" + + def __init__(self,dataURI,label): + self.dataURI = dataURI + self.label = label + self.outdir = os.getcwd() + self.host = os.getenv("DEFAULT_HOST", "localhost") + self.port = os.getenv("DEFAULT_PORT", "9581") + self.client = ThriftClient.ThriftClient(self.host, self.port) + + def setOutputDir(self, outdir): + self.outdir = outdir + + def _writeout(self,filename,bytes): + outname = self.outdir + str(os.sep) + filename + f = open(outname,"wb") + f.write(bytes) + f.close() + + def getProducts(self): + """ Sends ThriftClient request and writes out received files.""" + req = RetrieveAllProductsRequest() + req.setDataURI(self.dataURI) + resp = self.client.sendRequest(req) + #os.mkdir(self.outdir) + for item in resp: + if item.getName() == "ActivityXML": + if self.label.endswith(".xml"): + filename = self.label + else: + filename = self.label + ".xml" + else: + filename = item.getName() + + print "Extracting... " + filename + if isinstance(item, StringDataRecord): + self._writeout(filename,item.getStringData()[0]) + elif isinstance(item, ByteDataRecord): + self._writeout(filename,item.getByteData()) + + return resp + diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductStorer.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductStorer.py new file mode 100644 index 0000000000..2db5c0a355 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/ProductStorer.py @@ -0,0 +1,28 @@ +import os +from ufpy import ThriftClient +#from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import ByteDataRecord +from dynamicserialize.dstypes.gov.noaa.nws.ncep.common.dataplugin.pgen.request import StoreActivityRequest +from dynamicserialize.dstypes.gov.noaa.nws.ncep.common.dataplugin.pgen import ResponseMessageValidate + + +class ProductStorer: + """ Store a PGEN Activity (XML) to EDEX.""" + + def __init__(self, activityInfo, activityXML): + self.activityInfo = activityInfo + self.activityXML = activityXML + self.host = os.getenv("DEFAULT_HOST", "localhost") + self.port = os.getenv("DEFAULT_PORT", "9581") + self.client = ThriftClient.ThriftClient(self.host, self.port) + + def storeActivity(self): + """ Sends ThriftClient request to store Activity.""" + req = StoreActivityRequest() + req.setActivityInfo(self.activityInfo) + req.setActivityXML(self.activityXML) + resp = self.client.sendRequest(req) + if resp.getResult: + return resp.getDataURI() + else: + return None + diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/retrieveActivity.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/retrieveActivity.py new file mode 100644 index 0000000000..347dcff53b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/retrieveActivity.py @@ -0,0 +1,286 @@ +#!/usr/bin/env python + +## +# This script is used to extract PGEN products from EDEX. +# It can be run in batch mode by specifying the "-l" and "-t" options on the +# command line. Optionally, users can run it in interactive mode by invoking it +# with no argument. +# +# Users can override the default EDEX server and port name by specifying them +# in the $DEFAULT_HOST and $DEFAULT_PORT shell environment variables. +# +## + +import os +import logging +import xml.etree.ElementTree as ET +from Tkinter import * + +from ufpy import UsageArgumentParser +import lib.CommHandler as CH +import ProductRetriever + +logger = None +def __initLogger(): + global logger + logger = logging.getLogger("retrieveActivity") + logger.setLevel(logging.DEBUG) + ch = logging.StreamHandler() + ch.setLevel(logging.INFO) + # Uncomment line below to enable debug-level logging + #ch.setLevel(logging.DEBUG) + formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S") + ch.setFormatter(formatter) + logger.addHandler(ch) + +def __parseCommandLine(): + parser = UsageArgumentParser.UsageArgumentParser(prog='retrieveActivity',description="Retrieve PGEN Activities from EDEX. When invoked without any arguments, retrieveActivity is run in interactive mode.") + bgroup = parser.add_argument_group(title='batch',description='For running in scripts and/or batch mode.') + + bgroup.add_argument("-l", action="store", dest="label", + help="Activity Label being requested", + required=False, metavar="label") + bgroup.add_argument("-t", action="store", dest="type", + help="Activity Type being requested", + required=False, metavar="type") + options = parser.parse_args() + + options.interactive = False + if options.label == None and options.type == None : + options.interactive = True + elif options.label == None or options.type == None : + print "Must enter values for both arguments -l and -t" + exit(0) + + logger.debug("Command-line arguments: " + str(options)) + return options + +# +# This method sends a CatalogQuery request to the EDEX uEngine +# for the dataURI associated with the given activity type and label +# +def __getDataURI( type, label): + script='''import CatalogQuery +query = CatalogQuery.CatalogQuery("pgen") +query.addConstraint("activityType","{0}","=") +query.addConstraint("activityLabel","{1}","=") +query.addReturnedField("dataURI") +query.addReturnedField("dataTime.refTime") +return query.execute()'''.format(type,label) + + service = '/services/pyproductjaxb' + host = os.getenv("DEFAULT_HOST", "localhost") + port = os.getenv("DEFAULT_PORT", "9581") + connection=str(host+":"+port) + ch = CH.CommHandler(connection,service) + ch.process(script) + + if not ch.isGoodStatus(): + print ch.formatResponse() + exit(1) + + logger.debug( ch.getContents() ) + return __parseResponse( ch.getContents() ) + +# +# Parses the XML response from the uEngine and extracts +# the value for the dataURI field. If multiple are returned, the last +# one is used. +# +def __parseResponse(xml): + tree = ET.fromstring(xml) + for attr in tree.iter('attributes'): + if attr.attrib['field'] == 'dataURI': + duri = attr.attrib['value'] + + return duri + +def main(): + __initLogger() + logger.info("Starting retrieveActivity.") + options = __parseCommandLine() + + if options.interactive : + # Launch interactive GUI + logger.info("Running in interactive mode.") + root = Tk() + root.title("Retrieve Activity") + app = RetrieveGui(master=root) + app.mainloop() + root.destroy() + else: + # Retrieve products for given activity type and label + logger.info("looking for Product: " + options.type + " - " + options.label) + dataURI = __getDataURI(options.type, options.label) + logger.debug("Found dataURI = " + dataURI) + + pr = ProductRetriever.ProductRetriever(dataURI, options.label) + outdir = os.getcwd() + str(os.sep) + options.type + str(os.sep) + options.label + str(os.sep) + #pr.setOutputDir(outdir) + pr.getProducts() + + #print "Products were written to directory: " + outdir + logger.info("retrieveActivity is complete.") + +class RetrieveGui(Frame): + """ Interactive GUI for PGEN product retrieval """ + + def __init__(self, master=None): + """ Initialize Frame and create widgets """ + Frame.__init__(self, master) + self.pack() + self.createWidgets() + + def getProducts(self): + + # if an activity type and label have been selected, get products and write them out. + if len(self.typeList.curselection()) != 0 and len(self.nameList.curselection()) != 0: + type = self.typeList.get(self.typeList.curselection()) + label = self.nameList.get(self.nameList.curselection()) + labelindex = int(self.nameList.curselection()[0]) + dataURI = self.activityMap[type][labelindex]['dataURI'] + + pr = ProductRetriever.ProductRetriever(dataURI, label) + #outdir = os.getcwd() + str(os.sep) + options.type + str(os.sep) + options.label + str(os.sep) + #pr.setOutputDir(outdir) + pr.getProducts() + + def createWidgets(self): + activityType = Label(self) + activityType["text"] = "Activity Type" + activityType.pack() + + # Activity Type list section + frame = Frame(self) + vscrollbar = Scrollbar(frame, orient=VERTICAL) + hscrollbar = Scrollbar(frame, orient=HORIZONTAL) + self.typeList = Listbox(frame,selectmode=BROWSE,yscrollcommand=vscrollbar.set,xscrollcommand=hscrollbar.set,exportselection=0,width=50,height=15,bg="white") + vscrollbar.config(command=self.typeList.yview) + hscrollbar.config(command=self.typeList.xview) + vscrollbar.pack(side=RIGHT, fill=Y) + hscrollbar.pack(side=BOTTOM, fill=BOTH) + + self.typeList.pack(side=LEFT,fill=BOTH,expand=1) + frame.pack() + self.typeList.insert(END,"Loading...") # Temporary item while data are being requested from EDEX + + activityLabel = Label(self) + activityLabel["text"] = "Activity Label" + activityLabel.pack() + + # Activity Label list section + frame2 = Frame(self) + vscrollbar2 = Scrollbar(frame2, orient=VERTICAL) + hscrollbar2 = Scrollbar(frame2, orient=HORIZONTAL) + self.nameList = Listbox(frame2,yscrollcommand=vscrollbar2.set,xscrollcommand=hscrollbar2.set,exportselection=0, width=50,height=15,bg="white") + vscrollbar2.config(command=self.nameList.yview) + hscrollbar2.config(command=self.nameList.xview) + vscrollbar2.pack(side=RIGHT, fill=Y) + hscrollbar2.pack(side=BOTTOM, fill=BOTH) + self.nameList.pack() + frame2.pack() + + self.QUIT = Button(self) + self.QUIT["text"] = "QUIT" + self.QUIT["fg"] = "red" + self.QUIT["command"] = self.quit + + self.QUIT.pack({"side": "right"}) + + self.retrieve = Button(self) + self.retrieve["text"] = "Retrieve", + self.retrieve["command"] = self.getProducts + + self.retrieve.pack({"side": "left"}) + + # + # Get all Activity Types and Labels from EDEX for use in selection ListBoxes. + # Insert list of Types in Type Listbox + # + self.activityMap = self.__getActivityMap() + self.typeList.delete(0,END) + for key in self.activityMap.iterkeys(): + self.typeList.insert(END,key) + self.current = None + self.poll() + + # + # Continuously polls for user selection changes in the Activity Type ListBox + # + def poll(self): + now = self.typeList.curselection() + if len(now) == 0: + self.after(250, self.poll) + return + + if now != self.current: + self.typeList_has_changed(now) + self.current = now + self.after(250, self.poll) + + # + # Replace the list of Activity Labels in the Label Listbox + # with those associated with the current Activity Type selection + # + def typeList_has_changed(self, index): + self.nameList.delete(0,END) + for label in self.activityMap[ self.typeList.get(index) ]: + #print label + self.nameList.insert(END, label['activityLabel']) + + # + # Sends a CatalogQuery to the EDEX uEngine to get a list of + # PGEN Activity TYpes, Labels, and associated dataURIs + # in the pgen database tables. + # + def __getActivityMap(self): + script='''import CatalogQuery +query = CatalogQuery.CatalogQuery("pgen") +query.addReturnedField("activityType") +query.addReturnedField("activityLabel") +query.addReturnedField("dataURI") +return query.execute()''' + + service = '/services/pyproductjaxb' + host = os.getenv("DEFAULT_HOST", "localhost") + port = os.getenv("DEFAULT_PORT", "9581") + connection=str(host+":"+port) + ch = CH.CommHandler(connection,service) + ch.process(script) + + if not ch.isGoodStatus(): + print ch.formatResponse() + exit(1) + + logger.debug( ch.getContents() ) + return self.__generateMap( ch.getContents() ) + + # + # Generates a map of activity types, label, and dataURIs from + # the XML returned from EDEX uEngine for use in the activity type and label + # Listboxes. + # + # The map is a dictionary (dict) of Activity Types whose values are a list of dicts + # which have keys "activityType", "activityLabel", and "dataURI". + # + def __generateMap(self, xml): + aMap = dict() + tree = ET.fromstring(xml) + for item in tree.iter('items'): + #print item.attrib['key'] + record = dict() + for attr in item.iter('attributes'): + record.update( {attr.attrib['field'] : attr.attrib['value'] } ) + #print record + + atype = record['activityType'] + if aMap.has_key(atype): + aMap[atype].append(record) + else: + aMap.update( {atype: [record]} ) + + return aMap + + +if __name__ == '__main__': + main() diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/storeActivity.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/storeActivity.py new file mode 100644 index 0000000000..9bd036d87c --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/pgen/storeActivity.py @@ -0,0 +1,113 @@ +## +# This script is used to store a PGEN Activity to EDEX. +# +# Users can override the default EDEX server and port name by specifying them +# in the $DEFAULT_HOST and $DEFAULT_PORT shell environment variables. +# +## +import io +import logging +import xml.etree.ElementTree as ET + +from ufpy import UsageArgumentParser +from dynamicserialize.dstypes.gov.noaa.nws.ncep.common.dataplugin.pgen import ActivityInfo +import ProductStorer + +logger = None +def __initLogger(): + global logger + logger = logging.getLogger("storeActivity") + logger.setLevel(logging.DEBUG) + ch = logging.StreamHandler() + ch.setLevel(logging.INFO) + # Uncomment line below to enable debug-level logging + ch.setLevel(logging.DEBUG) + formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S") + ch.setFormatter(formatter) + logger.addHandler(ch) + +def __parseCommandLine(): + parser = UsageArgumentParser.UsageArgumentParser(prog='storeActivity',description="Store a PGEN Activity to EDEX.") + #bgroup = parser.add_argument_group(title='batch',description='For running in scripts and/or batch mode.') + + #parser.add_argument("-i", action="store", dest="infoFile", + # help="Activity Information used to store Activity", + # required=True, metavar="infoFile") + parser.add_argument("-t", action="store", dest="activityType", + help="Activity Type", + required=False, metavar="type") + parser.add_argument("-st", action="store", dest="activitySubtype", + help="Activity Subtype", + required=False, metavar="subtype") + parser.add_argument("-n", action="store", dest="activityName", + help="Activity Name", + required=False, metavar="name") + parser.add_argument("-s", action="store", dest="site", + help="site identifier", + required=False, metavar="site") + parser.add_argument("-f", action="store", dest="forecaster", + help="forecaster", + required=False, metavar="forecaster") + parser.add_argument("filename", + help="File containing XML Activity to be stored", + metavar="filename") + options = parser.parse_args() + + logger.debug("Command-line arguments: " + str(options)) + return options + +def __getActivityInfo(options): + ainfo = ActivityInfo() + ainfo.setActivityLabel(options.filename) + ainfo.setActivityName(options.activityName) + ainfo.setActivityType(options.activityType) + ainfo.setActivitySubtype(options.activitySubtype) + ainfo.setForecaster(options.forecaster) + ainfo.setSite(options.site) + return ainfo + +# Update Product tag attributes with options given on command line +def __updateXML(xml, options): + tree = ET.fromstring(xml) + product = tree.find('Product') + if options.activityName != None: + product.attrib['name'] = options.activityName + + if options.activityType != None: + product.attrib['type'] = options.activityType + + if options.filename != None: + product.attrib['outputFile'] = options.filename + + if options.forecaster != None: + product.attrib['forecaster'] = options.forecaster + + if options.site != None: + product.attrib['center'] = options.site + return ET.tostring(tree) + +def main(): + __initLogger() + logger.info("Starting retrieveActivity.") + options = __parseCommandLine() + + # read in XML from input file + actfile = io.open(options.filename, 'rb') + activityXML = actfile.read() + actfile.close() + + # generate an activityInfo object and update XML with options + # from command line + actinfo = __getActivityInfo(options) + activityXML = __updateXML(activityXML, options) + + # Store Activity to EDEX + ps = ProductStorer.ProductStorer(actinfo, activityXML) + dataURI = ps.storeActivity() + + logger.info("Activity stored with dataURI: " + dataURI) + logger.info("storeActivity is complete.") + + +if __name__ == '__main__': + main() diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/qpidNotify/mhsAckNotify.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/qpidNotify/mhsAckNotify.py index 40000dcb3e..f9da8fc382 100644 --- a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/qpidNotify/mhsAckNotify.py +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/qpidNotify/mhsAckNotify.py @@ -7,6 +7,7 @@ # ------------ ---------- ----------- -------------------------- # 04/06/2012 10388 D. Friedman Initial version # 10/09/12 DR 13901 D. Friedman Limit execution time +# 06/13/2013 DR 16242 D. Friedman Add Qpid authentication info ############################################################################## import getopt @@ -23,6 +24,8 @@ from qpid.datatypes import Message, uuid4 DESTINATION = 'amq.topic' TOPIC_NAME = 'mhs.ackmgr' +QPID_USERNAME = 'guest' +QPID_PASSWORD = 'guest' class MhsAckNotification: def __init__(self): @@ -38,7 +41,7 @@ def remove_file(*parts): def get_qpid_connection(broker_addr): try: socket = connect(broker_addr, 5672) - connection = Connection (sock=socket) + connection = Connection (sock=socket, username=QPID_USERNAME, password=QPID_PASSWORD) connection.start() return connection except: diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/storeActivity b/edexOsgi/com.raytheon.uf.tools.cli/impl/storeActivity new file mode 100644 index 0000000000..7ca60dd3e9 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/storeActivity @@ -0,0 +1,51 @@ +#!/bin/bash +## +# 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. +## +############################################################################## +# This script allows users to extract PGEN products from EDEX. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/08/12 #674 dgilling Initial Creation. +############################################################################## + +# this allows you to run this script from outside of ./bin +path_to_script=`readlink -f $0` +RUN_FROM_DIR=`dirname $path_to_script` + +BASE_AWIPS_DIR=`dirname $RUN_FROM_DIR` + +# get the base environment +source ${RUN_FROM_DIR}/setup.env + +# setup the environment needed to run the the Python +export LD_LIBRARY_PATH=${BASE_AWIPS_DIR}/src/lib:${PYTHON_INSTALL}/lib +export PYTHONPATH=${RUN_FROM_DIR}/src:$PYTHONPATH + +# execute the ifpInit Python module +_PYTHON="${PYTHON_INSTALL}/bin/python" +_MODULE="${RUN_FROM_DIR}/src/pgen/storeActivity.py" + +# quoting of '$@' is used to prevent command line interpretation +#$_PYTHON $_MODULE -h ${DEFAULT_HOST} -p ${DEFAULT_PORT} "$@" +$_PYTHON $_MODULE "$@" + diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/ifpBreakAllLocks/ifpBreakAllLocks.py b/edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/ifpBreakAllLocks/ifpBreakAllLocks.py index cc0c03ac93..eba808c132 100644 --- a/edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/ifpBreakAllLocks/ifpBreakAllLocks.py +++ b/edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/ifpBreakAllLocks/ifpBreakAllLocks.py @@ -33,7 +33,7 @@ import os import logging from ufpy import ThriftClient -from ufpy.UsageOptionParser import UsageOptionParser +from ufpy import UsageArgumentParser # # Provides a command-line utility to break all locks. @@ -44,10 +44,17 @@ from ufpy.UsageOptionParser import UsageOptionParser # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 04/05/2011 8826 rferrel Initial Creation. +# 06/12/2013 2099 dgilling Code cleanup, improve logging. # # # +logging.basicConfig(format="%(asctime)s %(name)s %(levelname)s: %(message)s", + datefmt="%H:%M:%S", + level=logging.INFO) +log = logging.getLogger('ifpBreakAllLocks') + + def __WsId() : return WsId(progName="ifpBreakAllLocks") @@ -71,13 +78,10 @@ def breakAllLocksGRIDRequest(officialDBs, lockTables, databaseIDs, allLocks): if lt.getParmId().getDbId().getFormat() == "GRID": locks = lt.getLocks() for lock in locks: - tr = TimeRange() - tr.setStart(lock.getStartTime()/1000.0) - tr.setEnd(lock.getEndTime()/1000.0) - logInfo('Lock: %s %s' % (lt.getParmId(), tr)) + log.info('Lock: {} {} {}'.format(lt.getParmId(), lock.getTimeRange(), lock.getWsId().toPrettyString())) lr = LockRequest() lr.setParmId(lt.getParmId()) - lr.setTimeRange(tr) + lr.setTimeRange(lock.getTimeRange()) lr.setMode("BREAK_LOCK") if len(req) == 0: siteID = lt.getParmId().getDbId().getSiteId() @@ -90,147 +94,53 @@ def breakAllLocksGRIDRequest(officialDBs, lockTables, databaseIDs, allLocks): lockChangeRequest.setSiteID(siteID) lockChangeRequest.setWorkstationID(__WsId()) return lockChangeRequest - -def __initLogger(): - logger = logging.getLogger("ifpBreakAllLocks.py") - logger.setLevel(logging.INFO) - ch = logging.StreamHandler() - ch.setLevel(logging.INFO) - formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s", "%H:%M:%S") - ch.setFormatter(formatter) - logger.addHandler(ch) + +def getActiveSites(thriftClient): + sites = thriftClient.sendRequest(GetActiveSitesRequest()) + return sites -def logInfo(msg): - logging.getLogger("ifpBreakAllLocks.py").info(msg) -def logError(msg): - logging.getLogger("ifpBreakAllLocks.py").error(msg) - -def validateSiteId(siteId, thriftClient): - try: - sites = thriftClient.sendRequest(GetActiveSitesRequest()) - except Exception, e: - logError("Unable to validate siteId: \n %s" % str(e)) - sys.exit(1) - - if not siteId in sites: - logError('Invalid or not installed siteID: "%s"' % siteId) - sys.exit(1) - -def findSiteID(thriftClient): - try: - sites = thriftClient.sendRequest(GetActiveSitesRequest()) - except Exception, e: - logError("Unable to obtain siteId: \n %s" % str(e)) - sys.exit(1) - - if len(sites) > 1 : - s = [] - while len(sites) > 0 : s.append(sites.pop()) - logError("Must use the -s option to specify one of the following sites: %s " % ", ".join(s)) - sys.exit(1) - elif len(sites) == 0: - logError("No sites configured") - sys.exit(1) - return sites.pop() - -def main(): - (options, args) = validateArgs() - __initLogger() - logInfo('Break All Locks starting') - try: - thriftClient = ThriftClient.ThriftClient(options.host, options.port, "/services") - siteID = options.siteID - if siteID: - validateSiteId(options.siteID, thriftClient) - else: - siteID = findSiteID(thriftClient) - officialDbNamesRequest = getOfficialDbNamesRequest(siteID) - officialDbNameResponse = thriftClient.sendRequest(officialDbNamesRequest) - lockTablesRequest = getLockTablesRequest(siteID) - lockTableResponse = thriftClient.sendRequest(lockTablesRequest) - except Exception, e: - logError("Unhandled exception thrown during break all locks: \n %s" % str(e)) - sys.exit(1) - - if (not officialDbNameResponse.isOkay()): - logError("Errors occurred during break all locks: ", officialDbNameResponse.message()) - sys.exit(1) - officialDBs = officialDbNameResponse.getPayload() - - if (not lockTableResponse.isOkay()): - logError("Errors occurred during break all locks: ", lockTableResponse.message()) - sys.exit(1) - - lockTables = lockTableResponse.getPayload() - breakRequest = breakAllLocksGRIDRequest(officialDBs, lockTables, options.databaseIDs, options.allLocks) - if not breakRequest: - logInfo('No locks found') - else : - try : - breakResponse = thriftClient.sendRequest(breakRequest) - except Exception, e: - import traceback - logError("Unhandled exception thrown during break all locks: \n%s" % str(e)) - print traceback.print_exc(file=sys.stdout) - sys.exit(1) - - if not breakResponse.isOkay(): - logError('Unable to break all locks.') - sys.exit(1) - logInfo('Break All Locks Finished') - def validateArgs(): - usage = """%prog -h hostname -p port -s siteID -a -d databaseID ... - - \tEither -a or at least one -d is required""" - parser = UsageOptionParser(usage=usage, conflict_handler="resolve") - parser.add_option("-h", action="store", type="string", dest="host", - help="ifpServer host name", - metavar="hostname") - parser.add_option("-p", action="store", type="int", dest="port", - help="port number of the ifpServer", + parser = UsageArgumentParser.UsageArgumentParser(prog='ifpBreakAllLocks', conflict_handler="resolve") + parser.add_argument("-h", action="store", dest="host", + help="The host the ifpServer is running on", + metavar="host") + parser.add_argument("-p", action="store", type=int, dest="port", + help="The port number the server is using", metavar="port") - parser.add_option("-s", action="store", type="string", dest="siteID", + parser.add_argument("-s", action="store", dest="siteID", help="Site ID", metavar="siteID") - parser.set_defaults(allLocks=False) - parser.add_option("-a", action="store_true", dest="allLocks", - help="Break all database identifier's locks.", - metavar="allLocks") - parser.add_option("-d", action="append", type="string", dest="databaseIDs", - help="database identifier", - metavar="databaseIDs") - - (options, args) = parser.parse_args() + parser.add_argument("-a", action="store_true", dest="allLocks", + help="Break locks on all databases") + parser.add_argument("-d", action="append", dest="databaseIDs", default=[], + help="Break locks on specified database identifier", + metavar="databaseID") + options = parser.parse_args() if options.host == None: if "CDSHOST" in os.environ: options.host = os.environ["CDSHOST"] else: - parser.error("No server hostname defined.") - + parser.error("Error: host is not specified.") if options.port == None: if "CDSPORT" in os.environ: options.port = int(os.environ["CDSPORT"]) else: - parser.error("No server port defined.") - - if (options.allLocks == False and (options.databaseIDs is None or len(options.databaseIDs) == 0)): - parser.error("Must have -a or at least one DatabaseID (-d) must be provided.") - - msg = [] + parser.error("Error: port is not specified.") + if options.allLocks == False and not options.databaseIDs: + parser.error("Error: either -a or -d are required.") + invalidDbIds = [] if not options.allLocks: for db in options.databaseIDs: if not DatabaseID(dbIdentifier=db).isValid(): - msg.append('Invalid database identifier "%s"' % db) - if len(msg) > 0: - parser.error("\n".join(msg)) - return (options, args) - + invalidDbIds.append(db) + if invalidDbIds: + parser.error("Invalid DatabaseIDs specified: {}".format(invalidDbIds)) + + return options def getLockTablesRequest(siteID): req = GetLockTablesRequest() - req.setWorkstationID(__WsId()) req.setSiteID(siteID) req.setRequests([LockTableRequest()]) @@ -238,11 +148,70 @@ def getLockTablesRequest(siteID): def getOfficialDbNamesRequest(siteID): req = GetOfficialDbNameRequest() - req.setWorkstationID(__WsId()) req.setSiteID(siteID) return req +def main(): + log.info('Break All Locks starting') + + options = validateArgs() + log.info('allLocks= {}, Ids= {}'.format(options.allLocks, options.databaseIDs)) + + thriftClient = ThriftClient.ThriftClient(options.host, options.port, "/services") + + activeSites = [] + try: + activeSites = getActiveSites(thriftClient) + except: + log.exception("Could not retrieve current active sites:") + sys.exit(1) + + if options.siteID and options.siteID in activeSites: + siteID = options.siteID + elif not options.siteID and len(activeSites) == 1: + siteID = activeSites[0] + else: + if options.siteID and options.siteID not in activeSites: + log.error("Invalid site ID {} specified, only sites {} are valid".format(options.siteID, activeSites)) + else: + log.error("Must use the -s option to specify one of the following sites {}".format(activeSites)) + sys.exit(1) + + try: + officialDbNamesRequest = getOfficialDbNamesRequest(siteID) + officialDbNameResponse = thriftClient.sendRequest(officialDbNamesRequest) + except: + log.exception("Unable to retrieve official databases:") + sys.exit(1) + if not officialDbNameResponse.isOkay(): + log.error("Unable to retrieve official databases: ", officialDbNameResponse.message()) + sys.exit(1) + officialDBs = officialDbNameResponse.getPayload() + + try: + lockTablesRequest = getLockTablesRequest(siteID) + lockTableResponse = thriftClient.sendRequest(lockTablesRequest) + except: + log.exception("Unable to retrieve lock table:") + sys.exit(1) + if (not lockTableResponse.isOkay()): + log.error("Unable to retrieve lock table: ", lockTableResponse.message()) + sys.exit(1) + lockTables = lockTableResponse.getPayload() + + breakRequest = breakAllLocksGRIDRequest(officialDBs, lockTables, options.databaseIDs, options.allLocks) + if breakRequest: + try: + breakResponse = thriftClient.sendRequest(breakRequest) + except: + log.exception("Unhandled exception thrown during break all locks:") + sys.exit(1) + if not breakResponse.isOkay(): + log.error('Unable to break all locks.') + sys.exit(1) + log.info('Break All Locks Finished') + + if __name__ == '__main__': main() - diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ntrans/res/spring/ntrans-ingest.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.ntrans/res/spring/ntrans-ingest.xml index 26d5824e66..117694a7f9 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ntrans/res/spring/ntrans-ingest.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ntrans/res/spring/ntrans-ingest.xml @@ -49,12 +49,8 @@ - - - - + + diff --git a/ncep/gov.noaa.nws.ncep.edex.purgeutil/res/spring/purgeutil-request.xml b/ncep/gov.noaa.nws.ncep.edex.purgeutil/res/spring/purgeutil-request.xml index 962361a080..279085101d 100644 --- a/ncep/gov.noaa.nws.ncep.edex.purgeutil/res/spring/purgeutil-request.xml +++ b/ncep/gov.noaa.nws.ncep.edex.purgeutil/res/spring/purgeutil-request.xml @@ -37,10 +37,6 @@ - - - - @@ -52,7 +48,7 @@ - + diff --git a/pythonPackages/dynamicserialize/ThriftSerializationContext.py b/pythonPackages/dynamicserialize/ThriftSerializationContext.py index 05081194e6..1756aa6449 100644 --- a/pythonPackages/dynamicserialize/ThriftSerializationContext.py +++ b/pythonPackages/dynamicserialize/ThriftSerializationContext.py @@ -34,8 +34,9 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/09/10 njensen Initial Creation. -# -# +# 06/12/13 #2099 dgilling Implement readObject() and +# writeObject(). +# # from thrift.Thrift import TType @@ -87,7 +88,7 @@ pythonToThriftMap = { primitiveSupport = (TType.BYTE, TType.I16, TType.I32, TType.I64, SelfDescribingBinaryProtocol.FLOAT) -class ThriftSerializationContext: +class ThriftSerializationContext(object): def __init__(self, serializationManager, selfDescribingBinaryProtocol): self.serializationManager = serializationManager @@ -409,5 +410,9 @@ class ThriftSerializationContext: self.protocol.writeI32(len(floats)) self.protocol.writeF32List(floats) + def readObject(self): + return self.deserializeMessage() + def writeObject(self, obj): + self.serializeMessage(obj) \ No newline at end of file diff --git a/pythonPackages/dynamicserialize/adapters/LockTableAdapter.py b/pythonPackages/dynamicserialize/adapters/LockTableAdapter.py index 09cc54eb8e..1b47747a20 100644 --- a/pythonPackages/dynamicserialize/adapters/LockTableAdapter.py +++ b/pythonPackages/dynamicserialize/adapters/LockTableAdapter.py @@ -18,7 +18,6 @@ # further licensing information. ## - # # Adapter for com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable # @@ -28,7 +27,7 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 04/22/13 rjpeter Initial Creation. -# +# 06/12/13 #2099 dgilling Use new Lock constructor. # # @@ -75,11 +74,10 @@ def deserialize(context): numLocks = context.readI32() locks = [] for x in xrange(numLocks): - lock = Lock() - lock.setParmId(parmId) - lock.setStartTime(context.readI64()) - lock.setEndTime(context.readI64()) - lock.setWsId(wsIds[context.readI32()]) + startTime = context.readI64() + endTime = context.readI64() + wsId = wsIds[context.readI32()] + lock = Lock(parmId, wsId, startTime, endTime) locks.append(lock) lockTable = LockTable() diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py index 1e1a91d3c5..cd3995e2cb 100644 --- a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py @@ -18,49 +18,53 @@ # further licensing information. ## +# # File auto-generated against equivalent DynamicSerialize Java class -# Modified by njensen to add __repr__ +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# xx/xx/xxxx xxxxxxx Initial Creation. +# xx/xx/xxxx xxxx njensen Implemented __repr__. +# 06/12/2013 2099 dgilling Make class immutable, +# add getTimeRange(). +# +# import time +from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange + + class Lock(object): - def __init__(self): - self.parmId = None - self.wsId = None - self.startTime = None - self.endTime = None - self.identifier = None + def __init__(self, parmId, wsId, startTime, endTime): + self.parmId = parmId + self.wsId = wsId + self.startTime = startTime + self.endTime = endTime + self.timeRange = None def getParmId(self): return self.parmId - def setParmId(self, parmId): - self.parmId = parmId - def getWsId(self): return self.wsId - def setWsId(self, wsId): - self.wsId = wsId - def getStartTime(self): return self.startTime - def setStartTime(self, startTime): - self.startTime = startTime - def getEndTime(self): return self.endTime - - def setEndTime(self, endTime): - self.endTime = endTime - - def getIdentifier(self): - return self.identifier - - def setIdentifier(self, identifier): - self.identifier = identifier + + def getTimeRange(self): + if not self.timeRange: + start = self.startTime / 1000.0 + end = self.endTime / 1000.0 + self.timeRange = TimeRange(start, end) + return self.timeRange def __repr__(self): t0 = time.gmtime(self.getStartTime() / 1000.0) diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py index 30daaf5af1..0c5cba6829 100644 --- a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py @@ -24,6 +24,7 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 04/25/12 545 randerso Repurposed the lockKey field as threadId +# 06/12/13 2099 dgilling Implemented toPrettyString(). # import struct @@ -84,6 +85,10 @@ class WsId(object): def toString(self): return self.networkId + ":" + self.userName + ":" + self.progName + ":" + str(self.pid) + ":" + str(self.threadId) + def toPrettyString(self): + hostname = socket.gethostbyaddr(socket.inet_ntoa(struct.pack(' - - - - - - - README -- Java Platform, Standard Edition Development Kit - - - -

README

- -

JavaTM Platform, - Standard Edition 6
- Development Kit

- -

JDKTM 6

- -

Contents

- - - -

Introduction

- -
- Thank you for downloading this release of the JavaTM Platform, Standard Edition Development Kit - (JDKTM). The JDK is a development - environment for building applications, applets, and components using the - Java programming language. -
- -
- The JDK includes tools useful for developing and testing programs written - in the Java programming language and running on the JavaTM platform. -
- -

System Requirements & - Installation

- -
- System requirements, installation instructions and troubleshooting tips - are located on the Java Software web site at: -
- -
- JDK 6 - Installation Instructions -
- -

JDKTM - Documentation

- -
- The on-line JavaTM Platform, Standard Edition (Java SE) - Documentation contains API specifications, feature descriptions, - developer guides, reference pages for JDKTM tools and utilities, demos, and links to related - information. This documentation is also available in a download bundle - which you can install on your machine. To obtain the documentation bundle, - see the download - page. For API documentation, refer to the The - JavaTM Platform, Standard Edition API - Specification This provides brief descriptions of the API with an - emphasis on specifications, not on code examples. -
- -

Release Notes

- -
- See the Java SE 6 Release - Notes on the Java Software web site for additional information - pertaining to this release. Please check the on-line release notes - occasionally for the latest information as they will be updated as needed. -
- -

Compatibility

- -
- See Compatibility - with Previous Releases on the Java Software web site for the list of - known compatibility issues. Every effort has been made to support programs - written for previous versions of the JavaTM platform. Although some incompatible changes were - necessary, most software should migrate to the current version with no - reprogramming. Any failure to do so is considered a bug, except for a - small number of cases where compatibility was deliberately broken, as - described on our compatibility web page. Some compatibility-breaking - changes were required to close potential security holes or to fix - implementation or design bugs. -
- -

Bug Reports and Feedback

- -
- The Bug Database - web site lets you search for and examine existing bug reports, submit your - own bug reports, and tell us which bug fixes matter most to you. To - directly submit a bug or request a feature, fill out this form: -
- -
- http://bugs.sun.com/services/bugreport/index.jsp -
- -
- You can send feedback to the Java SE documentation - team. You can also send comments directly to Java Software engineering - team email addresses. -
- -
- Note - Please do not seek technical support through the Bug - Database or our development teams. For support options, see Support and Services on the - Java Software web site. -
- -

Contents of the JDKTM

- -
- This section contains a general summary of the files and directories in - the JDKTM. For details on the files and - directories, see the JDK - File Structure section of the Java SE documentation for your platform. -
- -
-
-
-
Development Tools
- -
(In the bin/ subdirectory) Tools and utilities that - will help you develop, execute, debug, and document programs written - in the JavaTM programming language. - For further information, see the tool - documentation.
-
- -
Runtime Environment
- -
(In the jre/ subdirectory) An implementation of the - Java Runtime Environment (JRETM) for - use by the JDK. The JRE includes a JavaTM Virtual Machine (JVMTM), class libraries, and other files that support - the execution of programs written in the JavaTM programming language.
-
- -
Additional Libraries
- -
(In the lib/ subdirectory) Additional class libraries - and support files required by the development tools.
-
- -
Demo Applets and Applications
- -
(In the demo/ subdirectory) Examples, with source - code, of programming for the JavaTM - platform. These include examples that use Swing and other - JavaTM Foundation Classes, and the - JavaTM Platform Debugger - Architecture.
-
- -
Sample Code
- -
(In the sample subdirectory) Samples, with source - code, of programming for certain Java API's.
-
- -
C header Files
- -
(In the include/ subdirectory) Header files that - support native-code programming using the Java Native - Interface, the JVMTM - Tool Interface, and other functionality of the - JavaTM platform.
-
- -
Source Code
- -
(In src.zip) JavaTM - programming language source files for all classes that make up the - Java core API (that is, sources files for the java.*, javax.* and - some org.* packages, but not for com.sun.* packages). This source code - is provided for informational purposes only, to help developers learn - and use the JavaTM programming - language. These files do not include platform-specific implementation - code and cannot be used to rebuild the class libraries. To extract - these file, use any common zip utility. Or, you may use the Jar - utility in the JDK's bin/ directory:
-
- jar xvf src.zip
-
-
-
- -

The Java Runtime Environment - (JRETM)

- -
- The JavaTM Runtime Environment - (JRETM) is available as a separately - downloadable product. See the download web site. -
- -
- The JRE allows you to run applications written in the JavaTM programming language. Like the JDKTM, it contains the JavaTM Virtual Machine (JVMTM), classes comprising the JavaTM platform API, and supporting files. Unlike the JDK, - it does not contain development tools such as compilers and debuggers. -
- -
- You can freely redistribute the JRE with your application, according to - the terms of the JRE license. Once you have developed your application - using the JDK, you can ship it with the JRE so your end-users will have a - JavaTM platform on which to run your - software. -
- -

Redistribution

- -
-
-
- NOTE - The license for this software does not allow the redistribution - of beta and other pre-release versions. -
-
-
- -
- Subject to the terms and conditions of the Software License Agreement and - the obligations, restrictions, and exceptions set forth below, You may - reproduce and distribute the Software (and also portions of Software - identified below as Redistributable), provided that: -
- -
-
    -
  1. you distribute the Software complete and unmodified and only bundled - as part of Your applets and applications ("Programs"),
  2. - -
  3. your Programs add significant and primary functionality to the - Software,
  4. - -
  5. your Programs are only intended to run on Java-enabled general - purpose desktop computers and servers,
  6. - -
  7. you distribute Software for the sole purpose of running your - Programs,
  8. - -
  9. you do not distribute additional software intended to replace any - component(s) of the Software,
  10. - -
  11. you do not remove or alter any proprietary legends or notices - contained in or on the Software,
  12. - -
  13. you only distribute the Software subject to a license agreement that - protects Sun's interests consistent with the terms contained in this - Agreement, and
  14. - -
  15. you agree to defend and indemnify Sun and its licensors from and - against any damages, costs, liabilities, settlement amounts and/or - expenses (including attorneys' fees) incurred in connection with any - claim, lawsuit or action by any third party that arises or results from - the use or distribution of any and all Programs and/or Software.
  16. -
-
- -
- The term "vendors" used here refers to licensees, developers, and - independent software vendors (ISVs) who license and distribute the - JavaTM Development Kit - (JDKTM) with their programs. -
- -
- Vendors must follow the terms of the Java Development Kit Binary Code - License agreement. -
- -

Required vs. Optional Files

- -
- The files that make up the JavaTM - Development Kit (JDKTM) are divided into - two categories: required and optional. Optional files may be excluded from - redistributions of the JDK at the vendor's discretion. -
- -
- The following section contains a list of the files and directories that - may optionally be omitted from redistributions of the JDK. All files not - in these lists of optional files must be included in redistributions of - the JDK. -
- -

Optional Files and Directories

- -
- The following files may be optionally excluded from redistributions. These - files are located in the jdk1.6.0_<version> directory, where - <version> is the update version number. SolarisTM and Linux filenames and separators are shown. Windows - executables have the ".exe" suffix. Corresponding files with - _g in the name can also be excluded. The corresponding man - pages should be excluded for any excluded executables (with paths listed - below beginning with bin/, for the SolarisTM Operating System and Linux). -
- -
-
-
-
jre/lib/charsets.jar
- -
Character conversion classes
- -
jre/lib/ext/
- -
sunjce_provider.jar - the SunJCE provider for Java - Cryptography APIs
- localedata.jar - contains many of the resources needed - for non US English locales
- ldapsec.jar - contains security features supported by the - LDAP service provider
- dnsns.jar - for the InetAddress wrapper of JNDI DNS - provider
- -
bin/rmid and jre/bin/rmid
- -
Java RMI Activation System Daemon
- -
bin/rmiregistry and - jre/bin/rmiregistry
- -
Java Remote Object Registry
- -
bin/tnameserv and jre/bin/tnameserv
- -
Java IDL Name Server
- -
bin/keytool and jre/bin/keytool
- -
Key and Certificate Management Tool
- -
bin/kinit and jre/bin/kinit
- -
Used to obtain and cache Kerberos ticket-granting tickets
- -
bin/klist and jre/bin/klist
- -
Kerberos display entries in credentials cache and keytab
- -
bin/ktab and jre/bin/ktab
- -
Kerberos key table manager
- -
bin/policytool and - jre/bin/policytool
- -
Policy File Creation and Management Tool
- -
bin/orbd and jre/bin/orbd
- -
Object Request Broker Daemon
- -
bin/servertool and - jre/bin/servertool
- -
Java IDL Server Tool
- -
bin/javaws, jre/bin/javaws, - jre/lib/javaws/ and jre/lib/javaws.jar
- -
Java Web Start
- -
db/
- -
- Java DB, Sun Microsystems's distribution of the Apache Derby - database technology. Default installation locations are: - -
    -
  • Solaris: /opt/SUNWjavadb
  • - -
  • Linux: /opt/sun/javadb
  • - -
  • Windows: C:\Program Files\Sun\JavaDB
  • -
For information on Java DB and Derby, including user and API - documentation, the capabilities of Java DB and further resources, - see the index.html file in the above directories. -
- -
demo/
- -
Demo Applets and Applications
- -
sample/
- -
Sample Code
- -
src.zip
- -
Archive of source files
-
-
-
- -

Redistributable JDKTM Files

- -
- The limited set of files and directories from the JDK listed below may be - included in vendor redistributions of the JavaTM Runtime Environment (JRETM). They cannot be redistributed separately, and must - accompany an identically versioned JRE distribution. All paths are - relative to the top-level directory of the JDK. The corresponding man - pages should be included for any included executables (with paths listed - below beginning with bin/, for the SolarisTM Operating System and Linux). -
- -
-
-
-
jre/lib/cmm/PYCC.pf
- -
Color profile. This file is required only if one wishes to convert - between the PYCC color space and another color space.
- -
All .ttf font files in the - jre/lib/fonts/ directory.
- -
Note that the LucidaSansRegular.ttf font is already contained in - the JRE, so there is no need to bring that file over from the - JDK.
- -
jre/lib/audio/soundbank.gm
- -
This MIDI soundbank is present in the JDK, but it has been removed - from the JRE in order to reduce the size of the JRE download bundle. - However, a soundbank file is necessary for MIDI playback, and - therefore the JDK's soundbank.gm file may be included in - redistributions of the JRE at the vendor's discretion. Several - versions of enhanced MIDI soundbanks are available from the Java Sound - web site: http://java.sun.com/products/java-media/sound/. - These alternative soundbanks may be included in redistributions of the - JRE.
- -
The javac bytecode compiler, consisting of the following - files:
- -
bin/javac [SolarisTM Operating System and Linux]
- bin/sparcv9/javac [SolarisTM Operating System (SPARC(R) Platform Edition)]
- bin/amd64/javac [SolarisTM Operating System (AMD)]
- bin/javac.exe [Microsoft Windows]
- lib/tools.jar [All platforms]
- -
The Annotation Processing Tool, consisting of the following - files:
- -
lib/tools.jar [All platforms]
- bin/apt [SolarisTM - Operating System and Linux]
- bin/sparcv9/apt [SolarisTM Operating System (SPARC(R) Platform Edition)]
- bin/amd64/apt [SolarisTM Operating System (AMD)]
- bin/apt.exe [Microsoft Windows]
- -
lib/jconsole.jar
- -
The Jconsole application. NOTE: The Jconsole application requires - the dynamic attach mechanism.
- -
The dynamic attach mechanism consisting of the following - files:
- -
lib/tools.jar [All platforms]
- jre/lib/sparc/libattach.so [SolarisTM Operating System (SPARC(R) Platform Edition) and - Linux]
- jre/lib/sparcv9/libattach.so [SolarisTM Operating System (SPARC(R) Platform Edition) and - Linux]
- jre/lib/i386/libattach.so [SolarisTM Operating System (x86) and Linux]
- jre/lib/amd64/libattach.so [SolarisTM Operating System (AMD) and Linux]
- jre\bin\attach.dll [Microsoft Windows]
- -
The Java Platform Debugger Architecture implementation consisting - of the files shown in the dynamic attach section above, and the - following files:
- -
lib/tools.jar [All platforms]
- lib/sa-jdi.jar [All platforms]
- jre/lib/sparc/libsaproc.so [SolarisTM Operating System (SPARC(R) Platform Edition) and - Linux]
- jre/lib/sparcv9/libsaproc.so [SolarisTM Operating System (SPARC(R) Platform Edition) and - Linux]
- jre/lib/i386/libsaproc.so [SolarisTM Operating System (x86) and Linux]
- jre/lib/amd64/libsaproc.so [SolarisTM Operating System (AMD) and Linux]
- -
jre\bin\server\
- -
On Microsoft Windows platforms, the JDK includes both the Java - HotSpotTM Server VM and Java - HotSpotTM Client VM. However, the - JRE for Microsoft Windows platforms includes only the Java - HotSpotTM Client VM. Those wishing - to use the Java HotSpotTM Server VM - with the JRE may copy the JDK's jre\bin\server folder to - a bin\server directory in the JRE. Software vendors may - redistribute the Java HotSpotTM - Server VM with their redistributions of the JRE.
-
-
-
- -

Unlimited Strength Java Cryptography Extension

- -
- Due to import control restrictions for some countries, the Java - Cryptography Extension (JCE) policy files shipped with the JDK and the JRE - allow strong but limited cryptography to be used. These files are located - at
-
- <java-home>/lib/security/local_policy.jar
- <java-home>/lib/security/US_export_policy.jar
-
- where <java-home> is the jre directory of - the JDK or the top-level directory of the JRE. -
- -
- An unlimited strength version of these files indicating no restrictions on - cryptographic strengths is available on the JDK web site for those living - in eligible countries. Those living in eligible countries may download the - unlimited strength version and replace the strong cryptography jar files - with the unlimited strength files. -
- -

The cacerts Certificates File

- -
- Root CA certificates may be added to or removed from the Java SE - certificate file located at -
- -
- <java-home>/lib/security/cacerts -
- -
- For more information, see - The cacerts Certificates File section in the keytool documentation. -
- -

Java Endorsed Standards Override - Mechanism

- -
- From time to time it is necessary to update the Java platform in order to - incorporate newer versions of standards that are created outside of the - Java Community ProcessSM (JCPSM http://www.jcp.org/) (Endorsed - Standards), or in order to update the version of a technology included - in the platform to correspond to a later standalone version of that - technology (Standalone Technologies). -
- -
- The Endorsed Standards Override Mechanism provides a means whereby - later versions of classes and interfaces that implement Endorsed Standards - or Standalone Technologies may be incorporated into the Java Platform. -
- -
- For more information on the Endorsed Standards Override Mechanism, - including the list of platform packages that it may be used to override, - see -
- -
- http://java.sun.com/javase/6/docs/technotes/guides/standards/ -
- -

Java DB

- -
- This distribution bundles Java DB, Sun Microsystems' distribution of the - Apache Derby pure Java database technology. Default installation locations - are: - -
    -
  • Solaris: /opt/SUNWjavadb
  • - -
  • Linux: /opt/sun/javadb
  • - -
  • Windows: C:\Program Files\Sun\JavaDB
  • -
- -

For information on Java DB and Derby, including user and API - documentation, the capabilities of Java DB and further resources, see the - index.html file in the above directories.

-
- -

Web Pages

- -
- For additional information, refer to these Sun Microsystems pages on the - World Wide Web: -
- -
-
-
-
http://java.sun.com/
- -
The Java Software web site, with the latest information on Java - technology, product information, news, and features.
- -
http://java.sun.com/docs
- -
JavaTM platform Documentation - provides access to white papers, the Java Tutorial and other - documents.
- -
http://developer.java.sun.com
- -
Developer Services web site (Free registration required). - Additional technical information, news, and features; user forums; - support information, and much more.
- -
http://java.sun.com/products/
- -
Java Technology Products & API
-
-
-
-
- -

The JavaTM Development - Kit (JDKTM) is a product of Sun - MicrosystemsTM, Inc.
-
- Copyright © 2008 Sun Microsystems, Inc.
- 4150 Network Circle, Santa Clara, California 95054, U.S.A.
- All rights reserved.

- - - - diff --git a/rpms/legal/FOSS_licenses/java/THIRDPARTYLICENSEREADME.txt b/rpms/legal/FOSS_licenses/java/THIRDPARTYLICENSEREADME.txt deleted file mode 100755 index 2fc19dc819..0000000000 --- a/rpms/legal/FOSS_licenses/java/THIRDPARTYLICENSEREADME.txt +++ /dev/null @@ -1,2289 +0,0 @@ -DO NOT TRANSLATE OR LOCALIZE. - -%% The following software may be included in this product: CS CodeViewer v1.0; Use of any of this software is governed by the terms of the license below: -Copyright 1999 by CoolServlets.com. - -Any errors or suggested improvements to this class can be reported as instructed on CoolServlets.com. We hope you enjoy this program... your comments will encourage further development! -This software is distributed under the terms of the BSD License. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. -Neither name of CoolServlets.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - -%% The following software may be included in this product: Crimson v1.1.1 ; Use of any of this software is governed by the terms of the license below: -/* -* The Apache Software License, Version 1.1 -* -* -* Copyright (c) 1999-2000 The Apache Software Foundation. All rights * reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* -* 3. The end-user documentation included with the redistribution, -* if any, must include the following acknowledgment: -* "This product includes software developed by the -* Apache Software Foundation (http://www.apache.org/)." -* Alternately, this acknowledgment may appear in the software itself, -* if and wherever such third-party acknowledgments normally appear. -* -* 4. The names "Crimson" and "Apache Software Foundation" must -* not be used to endorse or promote products derived from this -* software without prior written permission. For written -* permission, please contact apache@apache.org. -* -* 5. Products derived from this software may not be called "Apache", -* nor may "Apache" appear in their name, without prior written -* permission of the Apache Software Foundation. -* -* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. -* ====================================================================* -* This software consists of voluntary contributions made by many -* individuals on behalf of the Apache Software Foundation and was -* originally based on software copyright (c) 1999, International -* Business Machines, Inc., http://www.ibm.com. For more -* information on the Apache Software Foundation, please see -* . -*/ - - -%% The following software may be included in this product: Xalan J2; Use of any of this software is governed by the terms of the license below: - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - - -%% The following software may be included in this product: NSIS 1.0j; Use of any of this software is governed by the terms of the license below: -Copyright (C) 1999-2000 Nullsoft, Inc. -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. Justin Frankel justin@nullsoft.com" - -%% Some Portions licensed from IBM are available at: -http://www.ibm.com/software/globalization/icu/ - -%% Portions Copyright Eastman Kodak Company 1992 - -%% Lucida is a registered trademark or trademark of Bigelow & Holmes in the U.S. and other countries. - -%% Portions licensed from Taligent, Inc. - -%% The following software may be included in this product:IAIK PKCS Wrapper; Use of any of this software is governed by the terms of the license below: - -Copyright (c) 2002 Graz University of Technology. All rights reserved. -Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: - - "This product includes software developed by IAIK of Graz University of Technology." - - Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. - -4. The names "Graz University of Technology" and "IAIK of Graz University of Technology" must not be used to endorse or promote products derived from this software without prior written permission. - -5. Products derived from this software may not be called "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior written permission of Graz University of Technology. - -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -%% The following software may be included in this product: Document Object Model (DOM) v. Level 3; Use of any of this software is governed by the terms of the license below: -W3Cýý SOFTWARE NOTICE AND LICENSE - -http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - -This work (and included software, documentation such as READMEs, or other related items) is being -provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you -(the licensee) agree that you have read, understood, and will comply with the following terms and conditions. - -Permission to copy, modify, and distribute this software and its documentation, with or without modification, for -any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies -of the software and documentation or portions thereof, including modifications: - 1.The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. - 2.Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the - W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body - of any redistributed or derivative code. - 3.Notice of any changes or modifications to the files, including the date changes were made. (We - recommend you provide URIs to the location from which the code is derived.) -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKENO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, -WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THEUSE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. -The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the -software without specific, written prior permission. Title to copyright in this software and any associated -documentation will at all times remain with copyright holders. - -____________________________________ - -This formulation of W3C's notice and license became active on December 31 2002. This version removes the -copyright ownership notice such that this license can be used with materials other than those owned by the -W3C, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the -license, and removes the ambiguous grant of "use". Otherwise, this version is the same as the previous -version and is written so as to preserve the Free Software Foundation's assessment of GPL compatibility and -OSI's certification under the Open Source Definition. Please see our Copyright FAQ for common questions -about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, -and Jigsaw. Other questions about this notice can be directed to -site-policy@w3.org. - -%% The following software may be included in this product: Xalan, Xerces; Use of any of this software is governed by the terms of the license below: /* - * The Apache Software License, Version 1.1 - * - * - * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * - * 4. The names "Xerces" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation and was - * originally based on software copyright (c) 1999, International - * Business Machines, Inc., http://www.ibm.com. For more - * information on the Apache Software Foundation, please see - * - -%% The following software may be included in this product: W3C XML Conformance Test Suites v. 20020606; Use of any of this software is governed by the terms of the license below: -W3Cýý SOFTWARE NOTICE AND LICENSE -Copyright ýý 1994-2002 World Wide Web Consortium, (Massachusetts Institute ofTechnology, Institut National de Recherche en Informatique et en Automatique,Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/ -This W3C work (including software, documents, or other related items) is beingprovided by the copyright holders under the following license. By obtaining,using and/or copying this work, you (the licensee) agree that you have read,understood, and will comply with the following terms and conditions: - -Permission to use, copy, modify, and distribute this software and its -documentation, with or without modification, for any purpose and without fee orroyalty is hereby granted, provided that you include the following on ALL copiesof the software and documentation or portions thereof, including modifications,that you make: - - 1. The full text of this NOTICE in a location viewable to users of theredistributed or derivative work. - 2. Any pre-existing intellectual property disclaimers, notices, or terms andconditions. If none exist, a short notice of the following form (hypertext ispreferred, text is permitted) should be used within the body of any -redistributed or derivative code: "Copyright ýý [$date-of-software] World WideWeb Consortium, (Massachusetts Institute of Technology, Institut National deRecherche en Informatique et en Automatique, Keio University). All RightsReserved. http://www.w3.org/Consortium/Legal/" - 3. Notice of any changes or modifications to the W3C files, including thedate changes were made. (We recommend you provide URIs to the location fromwhich the code is derived.) - -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKENO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITEDTO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THATTHE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTYPATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. -The name and trademarks of copyright holders may NOT be used in advertising orpublicity pertaining to the software without specific, written prior permission.Title to copyright in this software and any associated documentation will at alltimes remain with copyright holders. - -____________________________________ - -This formulation of W3C's notice and license became active on August 14 1998 soas to improve compatibility with GPL. This version ensures that W3C softwarelicensing terms are no more restrictive than GPL and consequently W3C softwaremay be distributed in GPL packages. See the older formulation for the policyprior to this date. Please see our Copyright FAQ for common questions aboutusing materials from our site, including specific terms and conditions forpackages like libwww, Amaya, and Jigsaw. Other questions about this notice canbe directed to site-policy@w3.org. - -%% The following software may be included in this product: W3C XML Schema Test Collection v. 1.16.2; Use of any of this software is governed by the terms of the license below: W3Cýýýý DOCUMENT NOTICE AND LICENSE -Copyright ýýýý 1994-2002 World Wide Web Consortium, (Massachusetts Institute ofTechnology, Institut National de Recherche en Informatique et en Automatique,Keio University). All Rights Reserved. -http://www.w3.org/Consortium/Legal/ - -Public documents on the W3C site are provided by the copyright holders under thefollowing license. The software or Document Type Definitions (DTDs) associatedwith W3C specifications are governed by the Software Notice. By using and/orcopying this document, or the W3C document from which this statement is linked,you (the licensee) agree that you have read, understood, and will comply withthe following terms and conditions: - -Permission to use, copy, and distribute the contents of this document, or theW3C document from which this statement is linked, in any medium for any purposeand without fee or royalty is hereby granted, provided that you include thefollowing on ALL copies of the document, or portions thereof, that you use: - 1. A link or URL to the original W3C document. - 2. The pre-existing copyright notice of the original author, or if it doesn'texist, a notice of the form: "Copyright ýýýý [$date-of-document] World Wide WebConsortium, (Massachusetts Institute of Technology, Institut National deRecherche en Informatique et en Automatique, Keio University). All RightsReserved. http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but atextual representation is permitted.) - 3. If it exists, the STATUS of the W3C document. - -When space permits, inclusion of the full text of this NOTICE should beprovided. We request that authorship attribution be provided in any software,documents, or other items or products that you create pursuant to the -implementation of the contents of this document, or any portion thereof. -No right to create modifications or derivatives of W3C documents is grantedpursuant to this license. However, if additional requirements (documented in theCopyright FAQ) are satisfied, the right to create modifications or derivativesis sometimes granted by the W3C to individuals complying with those requirements. -THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONSOR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE;THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THEIMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCEOR IMPLEMENTATION OF THE CONTENTS THEREOF. - -The name and trademarks of copyright holders may NOT be used in advertising orpublicity pertaining to this document or its contents without specific, writtenprior permission. Title to copyright in this document will at all times remainwith copyright holders. - ----------------------------------------------------------------------------- -This formulation of W3C's notice and license became active on April 05 1999 soas to account for the treatment of DTDs, schema's and bindings. See the olderformulation for the policy prior to this date. Please see our Copyright FAQ forcommon questions about using materials from our site, including specific termsand conditions for packages like libwww, Amaya, and Jigsaw. Other questionsabout this notice can be directed to site-policy@w3.org. -webmaster -(last updated by reagle on 1999/04/99.) - - - -%% The following software may be included in this product: Mesa 3-D graphics library v. 5; Use of any of this software is governed by the terms of the license below: core Mesa code include/GL/gl.h Brian Paul Mesa - -GLX driver include/GL/glx.h Brian Paul Mesa - -Ext registry include/GL/glext.h SGI SGI Free B - include/GL/glxext.h - -Mesa license: - -The Mesa distribution consists of several components. Different copyrights andlicenses apply to different components. For example, GLUT is copyrighted by MarkKilgard, some demo programs are copyrighted by SGI, some of the Mesa devicedrivers are copyrighted by their authors. See below for a list of Mesa'scomponents and the copyright/license for each. - -The core Mesa library is licensed according to the terms of the XFree86copyright (an MIT-style license). This allows integration with the XFree86/DRIproject. Unless otherwise stated, the Mesa source code and documentation islicensed as follows: - -Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALLBRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER INAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -SGI FREE SOFTWARE LICENSE B (Version 1.1 [02/22/2000]) -1. Definitions. -1.1 "Additional Notice Provisions" means such additional provisions as appear in the Notice in Original Code under the heading "Additional Notice Provisions."1.2 "Covered Code" means the Original Code or Modifications, or any combination thereof.1.3 "Hardware" means any physical device that accepts input, processes input, stores the results of processing, and/or provides output.1.4 "Larger Work" means a work that combines Covered Code or portions thereof with code not governed by the terms of this License.1.5 "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.1.6 "License" means this document. -1.7 "Licensed Patents" means patent claims Licensable by SGI that are infringed by the use or sale of Original Code or any Modifications provided by SGI, or any combination thereof.1.8 "Modifications" means any addition to or deletion from the substance or structure of the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to the contents of a file containing Original Code and/or addition to or deletion from the contents of a file containing previous Modifications.B. Any new file that contains any part of the Original Code or previous Modifications.1.9 "Notice" means any notice in Original Code or Covered Code, as required by and in compliance with this License.1.10 "Original Code" means source code of computer software code that is described in the source code Notice required by Exhibit A as Original Code, and updates and error corrections specifically thereto.1.11 "Recipient" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 8. For legal entities, "Recipient" includes any entity that controls, is controlled by, or is under common control with Recipient. For purposes of this definition, "control" of an entity means (a) the power, direct or indirect, to direct or manage such entity, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.1.12 "Recipient Patents" means patent claims Licensable by a Recipient that are infringed by the use or sale of Original Code or any Modifications provided by SGI, or any combination thereof. 1.13 "SGI" means Silicon Graphics, Inc. -1.14 "SGI Patents" means patent claims Licensable by SGI other than the Licensed Patents.2. License Grant and Restrictions. -2.1 SGI License Grant. Subject to the terms of this License and any third party intellectual property claims, for the duration of intellectual property protections inherent in the Original Code, SGI hereby grants Recipient a worldwide, royalty-free, non-exclusive license, to do the following: (i) under copyrights Licensable by SGI, to reproduce, distribute, create derivative works from, and, to the extent applicable, display and perform the Original Code and/or any Modifications provided by SGI alone and/or as part of a Larger Work; and (ii) under any Licensable Patents, to make, have made, use, sell, offer for sale, import and/or otherwise transfer the Original Code and/or any Modifications provided by SGI. Recipient accepts the terms and conditions of this License by undertaking any of the aforementioned actions. The patent license shall apply to the Covered Code if, at the time any related Modification is added, such addition of the Modification causes such combination to be covered by the Licensed Patents. The patent license in Section 2.1(ii) shall not apply to any other combinations that include the Modification. No patent license is provided under SGI Patents for infringements of SGI Patents by Modifications not provided by SGI or combinations of Original Code and Modifications not provided by SGI. 2.2 Recipient License Grant. Subject to the terms of this License and any third party intellectual property claims, Recipient hereby grants SGI and any other Recipients a worldwide, royalty-free, non-exclusive license, under any Recipient Patents, to make, have made, use, sell, offer for sale, import and/or otherwise transfer the Original Code and/or any Modifications provided by SGI.2.3 No License For Hardware Implementations. The licenses granted in Section 2.1 and 2.2 are not applicable to implementation in Hardware of the algorithms embodied in the Original Code or any Modifications provided by SGI .3. Redistributions. -3.1 Retention of Notice/Copy of License. The Notice set forth in Exhibit A, below, must be conspicuously retained or included in any and all redistributions of Covered Code. For distributions of the Covered Code in source code form, the Notice must appear in every file that can include a text comments field; in executable form, the Notice and a copy of this License must appear in related documentation or collateral where the Recipient's rights relating to Covered Code are described. Any Additional Notice Provisions which actually appears in the Original Code must also be retained or included in any and all redistributions of Covered Code.3.2 Alternative License. Provided that Recipient is in compliance with the terms of this License, Recipient may, so long as without derogation of any of SGI's rights in and to the Original Code, distribute the source code and/or executable version(s) of Covered Code under (1) this License; (2) a license identical to this License but for only such changes as are necessary in order to clarify Recipient's role as licensor of Modifications; and/or (3) a license of Recipient's choosing, containing terms different from this License, provided that the license terms include this Section 3 and Sections 4, 6, 7, 10, 12, and 13, which terms may not be modified or superseded by any other terms of such license. If Recipient elects to use any license other than this License, Recipient must make it absolutely clear that any of its terms which differ from this License are offered by Recipient alone, and not by SGI. It is emphasized that this License is a limited license, and, regardless of the license form employed by Recipient in accordance with this Section 3.2, Recipient may relicense only such rights, in Original Code and Modifications by SGI, as it has actually been granted by SGI in this License.3.3 Indemnity. Recipient hereby agrees to indemnify SGI for any liability incurred by SGI as a result of any such alternative license terms Recipient offers.4. Termination. This License and the rights granted hereunder will terminate automatically if Recipient breaches any term herein and fails to cure such breach within 30 days thereof. Any sublicense to the Covered Code that is properly granted shall survive any termination of this License, absent termination by the terms of such sublicense. Provisions that, by their nature, must remain in effect beyond the termination of this License, shall survive.5. No Trademark Or Other Rights. This License does not grant any rights to: (i) any software apart from the Covered Code, nor shall any other rights or licenses not expressly granted hereunder arise by implication, estoppel or otherwise with respect to the Covered Code; (ii) any trade name, trademark or service mark whatsoever, including without limitation any related right for purposes of endorsement or promotion of products derived from the Covered Code, without prior written permission of SGI; or (iii) any title to or ownership of the Original Code, which shall at all times remains with SGI. All rights in the Original Code not expressly granted under this License are reserved. 6. Compliance with Laws; Non-Infringement. There are various worldwide laws, regulations, and executive orders applicable to dispositions of Covered Code, including without limitation export, re-export, and import control laws, regulations, and executive orders, of the U.S. government and other countries, and Recipient is reminded it is obliged to obey such laws, regulations, and executive orders. Recipient may not distribute Covered Code that (i) in any way infringes (directly or contributorily) any intellectual property rights of any kind of any other person or entity or (ii) breaches any representation or warranty, express, implied or statutory, to which, under any applicable law, it might be deemed to have been subject.7. Claims of Infringement. If Recipient learns of any third party claim that any disposition of Covered Code and/or functionality wholly or partially infringes the third party's intellectual property rights, Recipient will promptly notify SGI of such claim.8. Versions of the License. SGI may publish revised and/or new versions of the License from time to time, each with a distinguishing version number. Once Covered Code has been published under a particular version of the License, Recipient may, for the duration of the license, continue to use it under the terms of that version, or choose to use such Covered Code under the terms of any subsequent version published by SGI. Subject to the provisions of Sections 3 and 4 of this License, only SGI may modify the terms applicable to Covered Code created under this License.9. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED "AS IS." ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. SGI ASSUMES NO RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY IS AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT SUBJECT TO THIS DISCLAIMER.10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES NOR LEGAL THEORY, WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY), CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOSS OF DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SGI's NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT.11. Indemnity. Recipient shall be solely responsible for damages arising, directly or indirectly, out of its utilization of rights under this License. Recipient will defend, indemnify and hold harmless Silicon Graphics, Inc. from and against any loss, liability, damages, costs or expenses (including the payment of reasonable attorneys fees) arising out of Recipient's use, modification, reproduction and distribution of the Covered Code or out of any representation or warranty made by Recipient.12. U.S. Government End Users. The Covered Code is a "commercial item" consisting of "commercial computer software" as such terms are defined in title 48 of the Code of Federal Regulations and all U.S. Government End Users acquire only the rights set forth in this License and are subject to the terms of this License.13. Miscellaneous. This License represents the complete agreement concerning the its subject matter. If any provision of this License is held to be unenforceable, such provision shall be reformed so as to achieve as nearly as possible the same legal and economic effect as the original provision and the remainder of this License will remain in effect. This License shall be governed by and construed in accordance with the laws of the United States and the State of California as applied to agreements entered into and to be performed entirely within California between California residents. Any litigation relating to this License shall be subject to the exclusive jurisdiction of the Federal Courts of the Northern District of California (or, absent subject matter jurisdiction in such courts, the courts of the State of California), with venue lying exclusively in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation that provides that the language of a contract shall be construed against the drafter shall not apply to this License. -Exhibit A -License Applicability. Except to the extent portions of this file are made subject to an alternative license as permitted in the SGI Free Software License B, Version 1.1 (the "License"), the contents of this file are subject only to the provisions of the License. You may not use this file except in compliance with the License. You may obtain a copy of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: http://oss.sgi.com/projects/FreeB -Note that, as provided in the License, the Software is distributed on an "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.Original Code. The Original Code is: [name of software, version number, and release date], developed by Silicon Graphics, Inc. The Original Code is Copyright (c) [dates of first publication, as appearing in the Notice in the Original Code] Silicon Graphics, Inc. Copyright in any portions created by third parties is as indicated elsewhere herein. All Rights Reserved.Additional Notice Provisions: [such additional provisions, if any, as appear in the Notice in the Original Code under the heading "Additional Notice Provisions"] -%% The following software may be included in this product: Byte Code Engineering Library (BCEL) v. 5; Use of any of this software is governed by the terms of the license below: - Apache Software License - - /* -==================================================================== * The Apache Software License, Version 1.1 - * - * Copyright (c) 2001 The Apache Software Foundation. Allrights - * reserved. - * - * Redistribution and use in source and binary forms, withor without - * modification, are permitted provided that the followingconditions - * are met: - * - * 1. Redistributions of source code must retain the abovecopyright - * notice, this list of conditions and the followingdisclaimer. - * - * 2. Redistributions in binary form must reproduce theabove copyright - * notice, this list of conditions and the followingdisclaimer in - * the documentation and/or other materials providedwith the - * distribution. - * - * 3. The end-user documentation included with theredistribution, - * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation -(http://www.apache.org/)." - * Alternately, this acknowledgment may appear in thesoftware itself, - * if and wherever such third-party acknowledgmentsnormally appear. - * - * 4. The names "Apache" and "Apache Software Foundation"and - * "Apache BCEL" must not be used to endorse or promoteproducts - * derived from this software without prior writtenpermission. For - * written permission, please contact apache@apache.org. * - * 5. Products derived from this software may not be called"Apache", - * "Apache BCEL", nor may "Apache" appear in their name,without - * prior written permission of the Apache SoftwareFoundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED ORIMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWAREFOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF - * SUCH DAMAGE. - * -==================================================================== * - * This software consists of voluntary contributions madeby many - * individuals on behalf of the Apache Software -Foundation. For more - - - * information on the Apache Software Foundation, pleasesee - * . - */ - - - -%% The following software may be included in this product: Regexp, Regular Expression Package v. 1.2; Use of any of this software is governed by the terms of the license below: The Apache Software License, Version 1.1 -Copyright (c) 2001 The Apache Software Foundation. All rights -reserved. -Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the -distribution. - -3. The end-user documentation included with the redistribution, -if any, must include the following acknowledgment: -"This product includes software developed by the -Apache Software Foundation (http://www.apache.org/)." -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names "Apache" and "Apache Software Foundation" and -"Apache Turbine" must not be used to endorse or promote products -derived from this software without prior written permission. For -written permission, please contact apache@apache.org. - -5. Products derived from this software may not be called "Apache", -"Apache Turbine", nor may "Apache" appear in their name, without -prior written permission of the Apache Software Foundation. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -==================================================================== -This software consists of voluntary contributions made by many -individuals on behalf of the Apache Software Foundation. For more -information on the Apache Software Foundation, please see - -http://www.apache.org. - -%% The following software may be included in this product: CUP Parser Generator for Java v. 0.10k; Use of any of this software is governed by the terms of the license below: CUP Parser Generator Copyright Notice, License, and Disclaimer - -Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, provided thatthe above copyright notice appear in all copies and that both the copyrightnotice and this permission notice and warranty disclaimer appear in -supporting documentation, and that the names of the authors or their employersnot be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. - -The authors and their employers disclaim all warranties with regard to thissoftware, including all implied warranties of merchantability and -fitness. In no event shall the authors or their employers be liable for anyspecial, indirect or consequential damages or any damages whatsoever -resulting from loss of use, data or profits, whether in an action of contract,negligence or other tortious action, arising out of or in connection withthe use or performance of this software. - -%% The following software may be included in this product: JLex: A Lexical Analyzer Generator for Java v. 1.2.5; Use of any of this software is governed by the terms of the license below: JLEX COPYRIGHT NOTICE, LICENSE AND DISCLAIMER. - -Copyright 1996-2003 by Elliot Joel Berk and C. Scott Ananian - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose -and without fee is hereby granted, provided that the above copyright noticeappear in all copies -and that both the copyright notice and this permission notice and warrantydisclaimer appear in -supporting documentation, and that the name of the authors or their employersnot be used in -advertising or publicity pertaining to distribution of the software withoutspecific, written prior -permission. - -The authors and their employers disclaim all warranties with regard to thissoftware, including all -implied warranties of merchantability and fitness. In no event shall the authorsor their employers -be liable for any special, indirect or consequential damages or any damageswhatsoever resulting -from loss of use, data or profits, whether in an action of contract, negligenceor other tortious -action, arising out of or in connection with the use or performance of thissoftware. - -Java is a trademark of Sun Microsystems, Inc. References to the Java programminglanguage in -relation to JLex are not meant to imply that Sun endorses this -product. - -%% The following software may be included in this product: SAX v. 2.0.1; Use of any of this software is governed by the terms of the license below: Copyright Status - - SAX is free! - - In fact, it's not possible to own a license to SAX, since it's been placed in the public - domain. - - No Warranty - - Because SAX is released to the public domain, there is no warranty for the design or for - the software implementation, to the extent permitted by applicable law. Except when - otherwise stated in writing the copyright holders and/or other parties provide SAX "as is" - without warranty of any kind, either expressed or implied, including, but not limited to, the - implied warranties of merchantability and fitness for a particular purpose. The entire risk as - to the quality and performance of SAX is with you. Should SAX prove defective, you - assume the cost of all necessary servicing, repair or correction. - - In no event unless required by applicable law or agreed to in writing will any copyright - holder, or any other party who may modify and/or redistribute SAX, be liable to you for - damages, including any general, special, incidental or consequential damages arising out of - the use or inability to use SAX (including but not limited to loss of data or data being - rendered inaccurate or losses sustained by you or third parties or a failure of the SAX to - operate with any other programs), even if such holder or other party has been advised of - the possibility of such damages. - - Copyright Disclaimers - - This page includes statements to that effect by David Megginson, who would have been - able to claim copyright for the original work. - SAX 1.0 - - Version 1.0 of the Simple API for XML (SAX), created collectively by the membership of - the XML-DEV mailing list, is hereby released into the public domain. - - No one owns SAX: you may use it freely in both commercial and non-commercial - applications, bundle it with your software distribution, include it on a CD-ROM, list the - source code in a book, mirror the documentation at your own web site, or use it in any - other way you see fit. - - David Megginson, sax@megginson.com - 1998-05-11 - - SAX 2.0 - - I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and release - all of the SAX 2.0 source code, compiled code, and documentation contained in this - distribution into the Public Domain. SAX comes with NO WARRANTY or guarantee of - fitness for any purpose. - - David Megginson, david@megginson.com - 2000-05-05 - -%% The following software may be included in this product: Cryptix; Use of any of this software is governed by the terms of the license below: -Cryptix General License - -Copyright © 1995-2003 The Cryptix Foundation Limited. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions aremet: - - 1.Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer. 2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BELIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESSINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OFTHE POSSIBILITY OF SUCH DAMAGE. - -%% The following software may be included in this product: W3C XML Schema Test Collection; Use of any of this software is governed by the terms of the license below: -W3C® DOCUMENT NOTICE AND LICENSE -Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts Institute ofTechnology, Institut National de Recherche en Informatique et en Automatique,Keio University). All Rights Reserved. -http://www.w3.org/Consortium/Legal/ - -Public documents on the W3C site are provided by the copyright holders under thefollowing license. The software or Document Type Definitions (DTDs) associatedwith W3C specifications are governed by the Software Notice. By using and/orcopying this document, or the W3C document from which this statement is linked,you (the licensee) agree that you have read, understood, and will comply withthe following terms and conditions: - -Permission to use, copy, and distribute the contents of this document, or theW3C document from which this statement is linked, in any medium for any purposeand without fee or royalty is hereby granted, provided that you include thefollowing on ALL copies of the document, or portions thereof, that you use: - 1. A link or URL to the original W3C document. - 2. The pre-existing copyright notice of the original author, or if it doesn'texist, a notice of the form: "Copyright © [$date-of-document] World Wide WebConsortium, (Massachusetts Institute of Technology, Institut National deRecherche en Informatique et en Automatique, Keio University). All RightsReserved. http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but atextual representation is permitted.) - 3. If it exists, the STATUS of the W3C document. - -When space permits, inclusion of the full text of this NOTICE should beprovided. We request that authorship attribution be provided in any software,documents, or other items or products that you create pursuant to the -implementation of the contents of this document, or any portion thereof. -No right to create modifications or derivatives of W3C documents is grantedpursuant to this license. However, if additional requirements (documented in theCopyright FAQ) are satisfied, the right to create modifications or derivativesis sometimes granted by the W3C to individuals complying with those requirements. -THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONSOR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE;THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THEIMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCEOR IMPLEMENTATION OF THE CONTENTS THEREOF. - -The name and trademarks of copyright holders may NOT be used in advertising orpublicity pertaining to this document or its contents without specific, writtenprior permission. Title to copyright in this document will at all times remainwith copyright holders. - ----------------------------------------------------------------------------- -This formulation of W3C's notice and license became active on April 05 1999 soas to account for the treatment of DTDs, schema's and bindings. See the olderformulation for the policy prior to this date. Please see our Copyright FAQ forcommon questions about using materials from our site, including specific termsand conditions for packages like libwww, Amaya, and Jigsaw. Other questionsabout this notice can be directed to site-policy@w3.org. -webmaster -(last updated by reagle on 1999/04/99.) - -%% The following software may be included in this product: Stax API; Use of any of this software is governed by the terms of the license below: -Streaming API for XML (JSR-173) Specification -Reference Implementation -License Agreement - -READ THE TERMS OF THIS (THE "AGREEMENT") CAREFULLY BEFORE VIEWING OR USING THESOFTWARE LICENS -ED HEREUNDER. BY VIEWING OR USING THE SOFTWARE, YOU AGREE TO THE TERMS OF THISAGREEMENT. IF -YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESETERMS BY SELE -CTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TOALL THESE TERMS -, PROMPTLY RETURN THE UNUSED SOFTWARE TO ORIGINAL CONTRIBUTOR, DEFINED HEREIN. -1.0 DEFINITIONS. - -1.1. "BEA" means BEA Systems, Inc., the licensor of the Original Code. -1.2. "Contributor" means BEA and each entity that creates or contributes to thecreation of Mo -difications. - -1.3. "Covered Code" means the Original Code or Modifications or the combinationof the Origina -l Code and Modifications, in each case including portions thereof and -corresponding documentat -ion released with the source code. - -1.4. "Executable" means Covered Code in any form other than Source Code. -1.5. "FCS" means first commercial shipment of a product. - -1.6. "Modifications" means any addition to or deletion from the substance orstructure of eith -er the Original Code or any previous Modifications. When Covered Code isreleased as a series -of files, a Modification is: - -(a) Any addition to or deletion from the contents of a file containing OriginalCode or previ -ous Modifications. - -(b) Any new file that contains any part of the Original Code or previousModifications. - -1.7. "Original Code" means Source Code of computer software code ReferenceImplementation. - -1.8. "Patent Claims" means any patent claim(s), now owned or hereafter acquired,including wit -hout limitation, method, process, and apparatus claims, in any patent for whichthe grantor ha -s the right to grant a license. - -1.9. "Reference Implementation" means the prototype or "proof of concept"implementaÂtion of -the Specification developed and made available for license by or on behalf of BEA. -1.10. "Source Code" means the preferred form of the Covered Code for makingmodifications to i -t, including all modules it contains, plus any associated documentation,interface definition -files, scripts used to control compilation and installation of an Executable, orsource code d -ifferential comparisons against either the Original Code or another well known,available Cove -red Code of the Contributor's choice. - -1.11. "Specification" means the written specification for the Streaming API forXML , Java te -chnology developed pursuant to the Java Community Process. -1.12. "Technology Compatibility Kit" or "TCK" means the documentation, testingtools and test -suites associated with the Specification as may be revised by BEA from time totime, that is p -rovided so that an implementer of the SpecifiÂcation may determine if itsimplementation is co -mpliant with the Specification. - -1.13. "You" (or "Your") means an individual or a legal entity exercising rightsunder, and com -plying with all of the terms of, this Agreement or a future version of thisAgreement issued u -nder Section 6.1. For legal entities, "You" includes any entity which controls,is controlled -by, or is under common control with You. For purposes of this definition,"control" means (a) -the power, direct or indirect, to cause the direction or management of suchentity, whether by - contract or otherwise, or (b) ownership of more than fifty percent (50%) of theoutstanding s -hares or beneficial ownership of such entity. - -2.0 SOURCE CODE LICENSE. - -2.1. Copyright Grant. Subject to the terms of this Agreement, each Contributorhereby grants -You a non-exclusive, worldwide, royalty-free copyright license to reproduce,prepare derivativ -e works of, publicly display, publicly perform, distribute and sublicense theCovered Code of -such Contributor, if any, and such derivative works, in Source Code andExecutable form. - -2.2. Patent Grant. Subject to the terms of this Agreement, each Contributorhereby grants Yo -u a non-exclusive, worldwide, royalty-free patent license under the PatentClaims to make, use -, sell, offer to sell, import and otherwise transfer the Covered Code preparedand provided by - such Contributor, if any, in Source Code and Executable form. This patentlicense shall apply - to the Covered Code if, at the time a Modification is added by the Contributor,such addition - of the Modification causes such combination to be covered by the Patent Claims.The patent li -cense shall not apply to any other combinations which include the Modification. -2.3. Conditions to Grants. You understand that although each Contributorgrants the licenses - to the Covered Code prepared by it, no assurances are provided by anyContributor that the Co -vered Code does not infringe the patent or other intellectual property rights ofany other ent -ity. Each Contributor disclaims any liability to You for claims brought by anyother entity ba -sed on infringement of intellectual property rights or otherwise. As a conditionto exercising - the rights and licenses granted hereunder, You hereby assume sole -responsibility to secure an -y other intellectual property rights needed, if any. For example, if a thirdparty patent lice -nse is required to allow You to distribute Covered Code, it is Your -responsibility to acquire -that license before distributing such code. - -2.4. Contributors' Representation. Each Contributor represents that to itsknowledge it has -sufficient copyright rights in the Covered Code it provides , if any, to grantthe copyright l -icense set forth in this Agreement. - -3.0 DISTRIBUION RESTRICTIONS. - -3.1. Application of Agreement. - -The Modifications which You create or to which You contribute are governed bythe terms of thi -s Agreement, including without limitation Section 2.0. The Source Code versionof Covered Code - may be distributed only under the terms of this Agreement or a future versionof this Agreeme -nt released under Section 6.1, and You must include a copy of this Agreementwith every copy o -f the Source Code You distribute. You may not offer or impose any terms on anySource Code ver -sion that alters or restricts the applicable version of this Agreement or therecipients' righ -ts hereunder. However, You may include an additional document offering theadditional rights d -escribed in Section 3.3. - -3.2. Description of Modifications. - -You must cause all Covered Code to which You contribute to contain a filedocumenting the chan -ges You made to create that Covered Code and the date of any change. You mustinclude a promin -ent statement that the Modification is derived, directly or indirectly, fromOriginal Code pro -vided by BEA and including the name of BEA in (a) the Source Code, and (b) inany notice in an - Executable version or related documentation in which You describe the origin orownership of -the Covered Code. - -%% The following software may be included in this product: X Window System; Use of any of this software is governed by the terms of the license below: -Copyright The Open Group - -Permission to use, copy, modify, distribute, and sell this software and itsdocumentation for any purpose is hereby granted without fee, provided that theabove copyright notice appear in all copies and that both that copyright noticeand this permission notice appear in supporting documentation. - -The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUPBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OFCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be usedin advertising or otherwise to promote the sale, use or other dealings in thisSoftware without prior written authorization from The Open Group. - -Portions also covered by other licenses as noted in the above URL. - -%% The following software may be included in this product: dom4j v. 1.6; Use of any of this software is governed by the terms of the license below: -Redistribution and use of this software and associated documentation -("Software"), with or without modification, are permitted provided that thefollowing conditions are met: - - 1. Redistributions of source code must retain copyright statements andnotices. Redistributions must also contain a copy of this document. - 2. Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentation and/orother materials provided with the distribution. - 3. The name "DOM4J" must not be used to endorse or promote products derivedfrom this Software without prior written permission of MetaStuff, Ltd. Forwritten permission, please contact dom4j-info@metastuff.com. - 4. Products derived from this Software may not be called "DOM4J" nor may"DOM4J" appear in their names without prior written permission of MetaStuff,Ltd. DOM4J is a registered trademark of MetaStuff, Ltd. - 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org -THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND ANYEXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FORANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. - -%% The following software may be included in this product: Retroweaver; Use of any of this software is governed by the terms of the license below: -Copyright (c) February 2004, Toby Reyelts -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of Toby Reyelts nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%% The following software may be included in this product: stripper; Use of any of this software is governed by the terms of the license below: -Stripper : debug information stripper - Copyright (c) 2003 Kohsuke Kawaguchi - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders nor the names of its - contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -%% The following software may be included in this product: libpng official PNG reference library; Use of any of this software is governed by the terms of the license below: -This copy of the libpng notices is provided for your convenience. In case ofany discrepancy between this copy and the notices in the file png.h that isincluded in the libpng distribution, the latter shall prevail. - -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - -If you modify libpng you may insert additional notices immediately followingthis sentence. - -libpng version 1.2.6, December 3, 2004, is -Copyright (c) 2004 Glenn Randers-Pehrson, and is -distributed according to the same disclaimer and license as libpng-1.2.5with the following individual added to the list of Contributing Authors - Cosmin Truta - -libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, areCopyright (c) 2000-2002 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.0.6with the following individuals added to the list of Contributing Authors - Simon-Pierre Cadieux - Eric S. Raymond - Gilles Vollant - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of the library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes or needs. This library is provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with the user. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, areCopyright (c) 1998, 1999 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-0.96,with the following individuals added to the list of Contributing Authors: - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996, 1997 Andreas Dilger -Distributed according to the same disclaimer and license as libpng-0.88,with the following individuals added to the list of Contributing Authors: - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors"is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing Authorsand Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and offitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary,or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute thissource code, or portions hereof, for any purpose, without fee, subjectto the following restrictions: - -1. The origin of this source code must not be misrepresented. - -2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - -3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, withoutfee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use thissource code in a product, acknowledgment is not required but would be -appreciated. - - -A "png_get_copyright" function is available, for convenient use in "about"boxes and the like: - - printf("%s",png_get_copyright(NULL)); - -Also, the PNG logo (in PNG format, of course) is supplied in the -files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is acertification mark of the Open Source Initiative. - -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -December 3, 2004 - -%% The following software may be included in this product: Libungif - An uncompressed GIF library; Use of any of this software is governed by the terms of the license below: -The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond - -Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE. - - -%% The following software may be included in this product: Ant; Use of any of this software is governed by the terms of the license below: -License -The Apache Software License Version 2.0 - -The Apache Software License Version 2.0 applies to all releases of Ant startingwith ant 1.6.1 - -/* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, * and distribution as defined by Sections 1 through 9 of this document. * - * "Licensor" shall mean the copyright owner or entity authorized by * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all * other entities that control, are controlled by, or are under common * control with that entity. For the purposes of this definition, * "control" means (i) the power, direct or indirect, to cause the * direction or management of such entity, whether by contract or * otherwise, or (ii) ownership of fifty percent (50%) or more of the * outstanding shares, or (iii) beneficial ownership of such entity. * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, * including but not limited to software source code, documentation * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or * Object form, made available under the License, as indicated by a * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object * form, that is based on (or derived from) the Work and for which the * editorial revisions, annotations, elaborations, or other modifications * represent, as a whole, an original work of authorship. For the purposes * of this License, Derivative Works shall not include works that remain * separable from, or merely link (or bind by name) to the interfaces of, * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions * to that Work or Derivative Works thereof, that is intentionally * submitted to Licensor for inclusion in the Work by the copyright owner * or by an individual or Legal Entity authorized to submit on behalf of * the copyright owner. For the purposes of this definition, "submitted" * means any form of electronic, verbal, or written communication sent * to the Licensor or its representatives, including but not limited to * communication on electronic mailing lists, source code control systems, * and issue tracking systems that are managed by, or on behalf of, the * Licensor for the purpose of discussing and improving the Work, but * excluding communication that is conspicuously marked or otherwise * designated in writing by the copyright owner as "Not a Contribution." * - * "Contributor" shall mean Licensor and any individual or Legal Entity * on behalf of whom a Contribution has been received by Licensor and * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * (except as stated in this section) patent license to make, have made, * use, offer to sell, sell, import, and otherwise transfer the Work, * where such license applies only to those patent claims licensable * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) * with the Work to which such Contribution(s) was submitted. If You * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work * or a Contribution incorporated within the Work constitutes direct * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the * Work or Derivative Works thereof in any medium, with or without * modifications, and in Source or Object form, provided that You * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works * that You distribute, all copyright, patent, trademark, and * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must * include a readable copy of the attribution notices contained * within such NOTICE file, excluding those notices that do not * pertain to any part of the Derivative Works, in at least one * of the following places: within a NOTICE text file distributed * as part of the Derivative Works; within the Source form or * documentation, if provided along with the Derivative Works; or, * within a display generated by the Derivative Works, if and * wherever such third-party notices normally appear. The contents * of the NOTICE file are for informational purposes only and * do not modify the License. You may add Your own attribution * notices within Derivative Works that You distribute, alongside * or as an addendum to the NOTICE text from the Work, provided * that such additional attribution notices cannot be construed * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and * may provide additional or different license terms and conditions * for use, reproduction, or distribution of Your modifications, or * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, * any Contribution intentionally submitted for inclusion in the Work * by You to the Licensor shall be under the terms and conditions of * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify * the terms of any separate license agreement you may have executed * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor, * except as required for reasonable and customary use in describing the * origin of the Work and reproducing the content of the NOTICE file. * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied, including, without limitation, any warranties or conditions * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the * appropriateness of using or redistributing the Work and assume any * risks associated with Your exercise of permissions under this License. * - * 8. Limitation of Liability. In no event and under no legal theory, * whether in tort (including negligence), contract, or otherwise, * unless required by applicable law (such as deliberate and grossly * negligent acts) or agreed to in writing, shall any Contributor be * liable to You for damages, including any direct, indirect, special, * incidental, or consequential damages of any character arising as a * result of this License or out of the use or inability to use the * Work (including but not limited to damages for loss of goodwill, * work stoppage, computer failure or malfunction, or any and all * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing * the Work or Derivative Works thereof, You may choose to offer, * and charge a fee for, acceptance of support, warranty, indemnity, * or other liability obligations and/or rights consistent with this * License. However, in accepting such obligations, You may act only * on Your own behalf and on Your sole responsibility, not on behalf * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include * the brackets!) The text should be enclosed in the appropriate * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ - - -You can download the original license file here. - -The License is accompanied by a NOTICE - - ========================================================================= == NOTICE file corresponding to the section 4 d of == == the Apache License, Version 2.0, == == in this case for the Apache Ant distribution. == ========================================================================= - This product includes software developed by - The Apache Software Foundation (http://www.apache.org/). - - This product includes also software developed by : - - the W3C consortium (http://www.w3c.org) , - - the SAX project (http://www.saxproject.org) - - Please read the different LICENSE files present in the root directory of this distribution. - - The names "Ant" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact - apache@apache.org. - -The Apache Software License, Version 1.1 - -The Apache Software License, Version 1.1, applies to all versions of up to ant1.6.0 included. - -/* - * ============================================================================ * The Apache Software License, Version 1.1 - * ============================================================================ * - * Copyright (C) 2000-2003 The Apache Software Foundation. All - * rights reserved. - * - * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * - * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * - * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: "This product includes software * developed by the Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Ant" and "Apache Software Foundation" must not be used to * endorse or promote products derived from this software without prior * written permission. For written permission, please contact - * apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", nor may * "Apache" appear in their name, without prior written permission of the * Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software consists of voluntary contributions made by many individuals * on behalf of the Apache Software Foundation. For more information on the * Apache Software Foundation, please see . - * - */ - - -%% The following software may be included in this product: XML Resolver library; Use of any of this software is governed by the terms of the license below: - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - -%% The following software may be included in this product: ICU4J; Use of any of this software is governed by the terms of the license below: -ICU License - ICU 1.8.1 and later COPYRIGHT AND PERMISSION NOTICE Cop -yright (c) -1995-2003 International Business Machines Corporation and others All rightsreserved. Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the "Software"), todeal in the Software without restriction, including without limitation therights to use, copy, modify, merge, publish, distribute, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,provided that the above copyright notice(s) and this permission notice appear inall copies of the Software and that both the above copyright notice(s) and thispermission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOTLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSEAND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHTHOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANYSPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTINGFROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCEOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ORPERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of acopyright holder shall not be used in advertising or otherwise to promote thesale, use or other dealings in this Software without prior written authorizationof the copyright holder. - - -%% The following software may be included in this product: NekoHTML; Use of any of this software is governed by the terms of the license below: -The CyberNeko Software License, Version 1.0 - - -(C) Copyright 2002,2003, Andy Clark. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. The end-user documentation included with the redistribution, - if any, must include the following acknowledgment: - "This product includes software developed by Andy Clark." - Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. - -4. The names "CyberNeko" and "NekoHTML" must not be used to endorse - or promote products derived from this software without prior - written permission. For written permission, please contact - andy@cyberneko.net. - -5. Products derived from this software may not be called "CyberNeko", - nor may "CyberNeko" appear in their name, without prior written - permission of the author. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -==================================================================== -This license is based on the Apache Software License, version 1.1 - - -%% The following software may be included in this product: Jing; Use of any of this software is governed by the terms of the license below: -Jing Copying Conditions - -Copyright (c) 2001-2003 Thai Open Source Software Center Ltd -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice,this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentation and/orother materials provided with the distribution. - * Neither the name of the Thai Open Source Software Center Ltd nor the namesof its contributors may be used to endorse or promote products derived from thissoftware without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -%% The following software may be included in this product: RelaxNGCC; Use of any of this software is governed by the terms of the license below: -Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. The end-user documentation included with the redistribution, if -any, must include the following acknowledgment: - - "This product includes software developed by Daisuke Okajima - and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)." - -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names of the copyright holders must not be used to endorse or -promote products derived from this software without prior written -permission. For written permission, please contact the copyright -holders. - -5. Products derived from this software may not be called "RELAXNGCC", -nor may "RELAXNGCC" appear in their name, without prior written -permission of the copyright holders. - -THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -%% The following software may be included in this product: RELAX NG Object Model/Parser; Use of any of this software is governed by the terms of the license below: -The MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions: - -The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ORCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHERIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -%% The following software may be included in this product: XFree86-VidMode Extension; Use of any of this software is governed by the terms of the license below: -Version 1.1 of -XFree86ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý ProjectLicence. - - Copyright (C) 1994-2004 The -XFree86ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýProject, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicence, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions: - - 1. Redistributions of source code must retain the above copyright notice,this list of conditions, and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution, and in thesame place and form as other copyright, license and disclaimer information. 3. The end-user documentation included with the redistribution, if any,must include the following acknowledgment: "This product includes softwaredeveloped by The XFree86 Project, Inc (http://www.xfree86.org/) and itscontributors", in the same place and form as other third-party acknowledgments.Alternately, this acknowledgment may appear in the software itself, in the sameform and location as other such third-party acknowledgments. - 4. Except as contained in this notice, the name of The XFree86 Project,Inc shall not be used in advertising or otherwise to promote the sale, use orother dealings in this Software without prior written authorization from TheXFree86 Project, Inc. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ANDFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE XFREE86PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ORBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER INCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISINGIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITYOF SUCH DAMAGE. - - -%% The following software may be included in this product: RelaxNGCC; Use of any of this software is governed by the terms of the license below: -This is version 2003-May-08 of the Info-ZIP copyright and license. -The definitive version of this document should be available at -ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely. - - -Copyright (c) 1990-2003 Info-ZIP. All rights reserved. - -For the purposes of this copyright and license, "Info-ZIP" is defined asthe following set of individuals: - - Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, - Paul von Behren, Rich Wales, Mike White - -This software is provided "as is," without warranty of any kind, expressor implied. In no event shall Info-ZIP or its contributors be held liablefor any direct, indirect, incidental, special or consequential damagesarising out of the use of or inability to use this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute itfreely, subject to the following restrictions: - - 1. Redistributions of source code must retain the above copyright notice, definition, disclaimer, and this list of conditions. - - 2. Redistributions in binary form (compiled executables) must reproduce the above copyright notice, definition, disclaimer, and this list of conditions in documentation and/or other materials provided with the distribution. The sole exception to this condition is redistribution of a standard UnZipSFX binary (including SFXWiz) as part of a - self-extracting archive; that is permitted without inclusion of this license, as long as the normal SFX banner has not been removed from the binary or disabled. - - 3. Altered versions--including, but not limited to, ports to new operating systems, existing ports with new graphical interfaces, and dynamic, shared, or static library versions--must be plainly marked as such and must not be misrepresented as being the original source. Such altered versions also must not be misrepresented as being Info-ZIP releases--including, but not limited to, labeling of the altered versions with the names "Info-ZIP" (or any variation thereof, including, but not limited to, different capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the explicit permission of Info-ZIP. Such altered versions are further prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). - 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and binary releases. - - -%% The following software may be included in this product: XML Security; Use of any of this software is governed by the terms of the license below: - The Apache Software License, - Version 1.1 - - - PDF - - - Copyright (C) 2002 The Apache SoftwareFoundation. - All rights reserved. Redistribution anduse in - source and binary forms, with or withoutmodifica- - tion, are permitted provided that thefollowing - conditions are met: 1. Redistributions ofsource - code must retain the above copyrightnotice, this - list of conditions and the followingdisclaimer. - 2. Redistributions in binary form mustreproduce - the above copyright notice, this list of conditions and the following disclaimerin the - documentation and/or other materialsprovided with - the distribution. 3. The end-userdocumentation - included with the redistribution, if any,must - include the following acknowledgment:"This - product includes software developed bythe Apache - Software Foundation -(http://www.apache.org/)." - Alternately, this acknowledgment mayappear in the - software itself, if and wherever suchthird-party - acknowledgments normally appear. 4. Thenames - "Apache Forrest" and "Apache SoftwareFoundation" - must not be used to endorse or promoteproducts - derived from this software without priorwritten - permission. For written permission,please contact - apache@apache.org. 5. Products derivedfrom this - software may not be called "Apache", normay - "Apache" appear in their name, withoutprior - written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED``AS IS'' - AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESSFOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NOEVENT - SHALL THE APACHE SOFTWARE FOUNDATION ORITS - CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, ORCONSEQUENTIAL - DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, - OR TORT (INCLUDING NEGLIGENCE OROTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF - SUCH DAMAGE. This software consists ofvoluntary - contributions made by many individuals onbehalf - of the Apache Software Foundation. Formore - information on the Apache SoftwareFoundation, - please see . - -%% The following software may be included in this product: Regexp, Regular Expression Package v. 1.2; Use of any of this software is governed by the terms of the license below: The Apache Software License, Version 1.1 -Copyright (c) 2001 The Apache Software Foundation. All rights -reserved. -Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the -distribution. - -3. The end-user documentation included with the redistribution, -if any, must include the following acknowledgment: -"This product includes software developed by the -Apache Software Foundation (http://www.apache.org/)." -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names "Apache" and "Apache Software Foundation" and -"Apache Turbine" must not be used to endorse or promote products -derived from this software without prior written permission. For -written permission, please contact apache@apache.org. - -5. Products derived from this software may not be called "Apache", -"Apache Turbine", nor may "Apache" appear in their name, without -prior written permission of the Apache Software Foundation. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -==================================================================== -This software consists of voluntary contributions made by many -individuals on behalf of the Apache Software Foundation. For more -information on the Apache Software Foundation, please see - -http://www.apache.org. - - -%% The following software may be included in this product: Visual Studio. Use of any of this software is governed by the terms of the license below: - -END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE -IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal -agreement between you (either an individual or a single entity) and Microsoft Corporation ("Microsoft) for the Microsoft software that accompanies this EULA, which includes computer software and may include associated media, printed materials, "online" or electronic documentation, and Internet-based services ("Software"). An amendment or addendum to this EULA may accompany the Software. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE; YOU MAY RETURN IT TO YOUR PLACE OF PURCHASE (IF APPLICABLE) FOR A FULL REFUND. - -MICROSOFT SOFTWARE LICENSE - -1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA -provided that you comply with all terms and conditions of this EULA. NOTE: Microsoft is not -licensing to you any rights with respect to Crystal Reports for Microsoft Visual Studio .NET; -your use of Crystal Reports for Microsoft Visual Studio .NET is subject to your acceptance of -the terms and conditions of the enclosed (hard copy) end user license agreement from Crystal -Decisions for that product. -1.1 General License Grant. Microsoft grants to you as an individual, a personal, -nonexclusive license to use the Software, and to make and use copies of the Software for the -purposes of designing, developing, testing, and demonstrating your software product(s), -provided that you are the only individual using the Software. -If you are an entity, Microsoft grants to you a personal, nonexclusive license to -use the Software, and to make and use copies of the Software, provided that for each individual -using the Software within your organization, you have acquired a separate and valid license for -each such individual. - -1.2 Documentation. You may make and use an unlimited number of copies of any -documentation, provided that such copies shall be used only for personal purposes and are not -to be republished or distributed (either in hard copy or electronic form) beyond your premises. -1.3 Storage/Network Use. You may also store or install a copy of the Software on a -storage device, such as a network server, used only to install or run the Software on computers -used by licensed end users in accordance with Section 1.1. A single license for the Software may -not be shared or used concurrently by multiple end users. -1.4 Visual Studio—Effect of EULA. As a suite of development tools and other -Microsoft software programs (each such tool or software program, a "Component"), -Components that you receive as part of the Software may include a separate end-user license -agreement (each, a "Component EULA"). Except as provided in Section 4 ("Prerelease Code"), in -the event of inconsistencies between this EULA and any Component EULA, the terms of this -EULA shall control. The Software may also contain third-party software programs. Any such -software is provided for your use as a convenience and your use is subject to the terms and -conditions of any license agreement contained in that software. -2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLE CODE. In addition to the -rights granted in Section 1, certain portions of the Software, as described in this Section 2, are -provided to you with additional license rights. These additional license rights are conditioned -Everett VSPro 1 -Final 11.04.02 - - - -upon your compliance with the distribution requirements and license limitations described in -Section 3. - -2.1 Sample Code. Microsoft grants you a limited, nonexclusive, royalty-free license -to: (a) use and modify the source code version of those portions of the Software identified as -"Samples" in REDIST.TXT or elsewhere in the Software ("Sample Code") for the sole purposes -of designing, developing, and testing your software product(s), and (b) reproduce and -distribute the Sample Code, along with any modifications thereof, in object and/or source code -form. For applicable redistribution requirements for Sample Code, see Section 3.1 below. -2.2 Redistributable Code—General. Microsoft grants you a limited, nonexclusive, -royalty-free license to reproduce and distribute the object code form of any portion of the -Software listed in REDIST.TXT ("Redistributable Code"). For general redistribution -requirements for Redistributable Code, see Section 3.1 below. -2.3 Redistributable Code—Microsoft Merge Modules ("MSM"). Microsoft grants -you a limited, nonexclusive, royalty-free license to reproduce and distribute the content of MSM -file(s) listed in REDIST.TXT in the manner described in the Software documentation only so -long as you redistribute such content in its entirety and do not modify such content in any way. -For all other applicable redistribution requirements for MSM files, see Section 3.1 below. -2.4 Redistributable Code—Microsoft Foundation Classes (MFC), Active Template -Libraries (ATL), and C runtimes (CRTs). In addition to the rights granted in Section 1, -Microsoft grants you a license to use and modify the source code version of those portions of -the Software that are identified as MFC, ATL, or CRTs (collectively, the "VC Redistributables"), -for the sole purposes of designing, developing, and testing your software product(s). Provided -you comply with Section 3.1 and you rename any files created by you that are included in the -Licensee Software (defined below), Microsoft grants you a limited, nonexclusive, royalty-free -license to reproduce and distribute the object code version of the VC Redistributables, including -any modifications you make. For purposes of this section, "modifications" shall mean -enhancements to the functionality of the VC Redistributables. For all other applicable -redistribution requirements for VC Redistributables, see Section 3.1 below. -3. DISTRIBUTION REQUIREMENTS AND OTHER LICENSE RIGHTS AND -LIMITATIONS. If you choose to exercise your rights under Section 2, any redistribution by -you is subject to your compliance with Section 3.1; some of the Redistributable Code has -additional limited use rights described in Section 3.2. -3.1 General Distribution Requirements. -(a) If you choose to redistribute Sample Code, or Redistributable Code -(collectively, the "Redistributables") as described in Section 2, you agree: (i) except as otherwise -noted in Section 2.1 (Sample Code), to distribute the Redistributables only in object code form -and in conjunction with and as a part of a software application product developed by you that -adds significant and primary functionality to the Redistributables ("Licensee Software"); -(ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms; -(iii) that if the Licensee Software is distributed beyond Licensee's premises or externally from -Licensee's organization, to distribute the Licensee Software containing the Redistributables -pursuant to an end user license agreement (which may be "break-the-seal", "click-wrap" or -signed), with terms no less protective than those contained in this EULA; (iv) not to use -Microsoft's name, logo, or trademarks to market the Licensee Software; (v) to display your own -valid copyright notice which shall be sufficient to protect Microsoft's copyright in the Software; -Everett VSPro 2 -Final 11.04.02 - - - -(vi) not to remove or obscure any copyright, trademark or patent notices that appear on the -Software as delivered to you; (vii) to indemnify, hold harmless, and defend Microsoft from and -against any claims or lawsuits, including attorney's fees, that arise or result from the use or -distribution of the Licensee Software; (viii) to otherwise comply with the terms of this EULA; -and (ix) agree that Microsoft reserves all rights not expressly granted. -You also agree not to permit further distribution of the Redistributables by your -end users except you may permit further redistribution of the Redistributables by your -distributors to your end-user customers if your distributors only distribute the Redistributables -in conjunction with, and as part of, the Licensee Software, you comply with all other terms of -this EULA, and your distributors comply with all restrictions of this EULA that are applicable -to you. - -(b) If you use the Redistributables, then in addition to your compliance with -the applicable distribution requirements described for the Redistributables, the following also -applies. Your license rights to the Redistributables are conditioned upon your not (i) creating -derivative works of the Redistributables in any manner that would cause the Redistributables in -whole or in part to become subject to any of the terms of an Excluded License; or (ii) -distributing the Redistributables (or derivative works thereof) in any manner that would cause -the Redistributables to become subject to any of the terms of an Excluded License. An -"Excluded License" is any license that requires as a condition of use, modification and/or -distribution of software subject to the Excluded License, that such software or other software -combined and/or distributed with such software be (x) disclosed or distributed in source code -form; (y) licensed for the purpose of making derivative works; or (z) redistributable at no -charge. -3.2 Additional Distribution Requirements for Certain Redistributable Code. -If you choose to redistribute the files discussed in this Section, then in addition to the terms of -Section 3.1, you must ALSO comply with the following. -(a) Microsoft SQL Server Desktop Engine ("MSDE"). If you redistribute -MSDE you agree to comply with the following additional requirements: (a) Licensee -Software shall not substantially duplicate the capabilities of Microsoft Access or, in the -reasonable opinion of Microsoft, compete with same; and (b) unless Licensee Software -requires your customers to license Microsoft Access in order to operate, you shall not -reproduce or use MSDE for commercial distribution in conjunction with a general -purpose word processing, spreadsheet or database management software product, or an -integrated work or product suite whose components include a general purpose word -processing, spreadsheet, or database management software product except for the -exclusive use of importing data to the various formats supported by Microsoft Access. -A product that includes limited word processing, spreadsheet or database components -along with other components which provide significant and primary value, such as an -accounting product with limited spreadsheet capability, is not considered to be a -"general purpose" product. -(b) Microsoft Data Access Components. If you redistribute the Microsoft -Data Access Component file identified as MDAC_TYP.EXE, you also agree to -redistribute such file in object code only in conjunction with and as a part of a Licensee -Software developed by you with a Microsoft development tool product that adds -significant and primary functionality to MDAC_TYP.EXE. -Everett VSPro 3 -Final 11.04.02 - - - -3.3 Separation of Components. The Software is licensed as a single product. Its -component parts may not be separated for use by more than one user. -3.4 Benchmark Testing. The Software may contain the Microsoft .NET Framework. -You may not disclose the results of any benchmark test of the .NET Framework component of -the Software to any third party without Microsoft's prior written approval. -4. PRERELEASE CODE. Portions of the Software may be identified as prerelease code -("Prerelease Code"). Such Prerelease Code is not at the level of performance and compatibility -of the final, generally available product offering. The Prerelease Code may not operate correctly -and may be substantially modified prior to first commercial shipment. Microsoft is not -obligated to make this or any later version of the Prerelease Code commercially available. The -grant of license to use Prerelease Code expires upon availability of a commercial release of the -Prerelease Code from Microsoft. NOTE: In the event that Prerelease Code contains a separate -end-user license agreement, the terms and conditions of such end-user license agreement shall -govern your use of the corresponding Prerelease Code. -5. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not -expressly granted to you in this EULA. The Software is protected by copyright and other -intellectual property laws and treaties. Microsoft or its suppliers own the title, copyright, and -other intellectual property rights in the Software. The Software is licensed, not sold. -6. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND -DISASSEMBLY. You may not reverse engineer, decompile, or disassemble the Software, -except and only to the extent that such activity is expressly permitted by applicable law -notwithstanding this limitation. -7. NO RENTAL/COMMERCIAL HOSTING. You may not rent, lease, lend or provide -commercial hosting services with the Software. -8. CONSENT TO USE OF DATA. You agree that Microsoft and its affiliates may collect -and use technical information gathered as part of the product support services provided to you, -if any, related to the Software. Microsoft may use this information solely to improve our -products or to provide customized services or technologies to you and will not disclose this -information in a form that personally identifies you. -9. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of -the Software. The third party sites are not under the control of Microsoft, and Microsoft is not -responsible for the contents of any third party sites, any links contained in third party sites, or -any changes or updates to third party sites. Microsoft is not responsible for webcasting or any -other form of transmission received from any third party sites. Microsoft is providing these -links to third party sites to you only as a convenience, and the inclusion of any link does not -imply an endorsement by Microsoft of the third party site. -10. ADDITIONAL SOFTWARE/SERVICES. This EULA applies to updates, supplements, -add-on components, or Internet-based services components, of the Software that Microsoft may -provide to you or make available to you after the date you obtain your initial copy of the -Software, unless we provide other terms along with the update, supplement, add-on -component, or Internet-based services component. Microsoft reserves the right to discontinue -any Internet-based services provided to you or made available to you through the use of the -Software. -11. UPGRADES/DOWNGRADES -Everett VSPro 4 -Final 11.04.02 - - - -11.1 Upgrades. To use a version of the Software identified as an upgrade, you must -first be licensed for the software identified by Microsoft as eligible for the upgrade. After -upgrading, you may no longer use the software that formed the basis for your upgrade -eligibility. -11.2 Downgrades. Instead of installing and using the Software, you may install and -use copies of an earlier version of the Software, provided that you completely remove such -earlier version and install the current version of the Software within a reasonable time. Your -use of such earlier version shall be governed by this EULA, and your rights to use such earlier -version shall terminate when you install the Software. -11.3 Special Terms for Version 2003 Upgrade Editions of the Software. If the -Software accompanying this EULA is the version 2003 edition of the Software and you have -acquired it as an upgrade from the corresponding "2002" edition of the Microsoft software -product with the same product name as the Software (the "Qualifying Software"), then -Section 11.1 does not apply to you. Instead, you may continue to use the Qualifying Software -AND the version 2003 upgrade for so long as you continue to comply with the terms of this -EULA and the EULA governing your use of the Qualifying Software. Qualifying Software does -not include non-Microsoft software products. -12. NOT FOR RESALE SOFTWARE. Software identified as "Not For Resale" or "NFR," -may not be sold or otherwise transfered for value, or used for any purpose other than -demonstration, test or evaluation. -13. ACADEMIC EDITION SOFTWARE. To use Software identified as "Academic -Edition" or "AE," you must be a "Qualified Educational User." For qualification-related -questions, please contact the Microsoft Sales Information Center/One Microsoft -Way/Redmond, WA 98052-6399 or the Microsoft subsidiary serving your country. -14. EXPORT RESTRICTIONS. You acknowledge that the Software is subject to U.S. export -jurisdiction. You agree to comply with all applicable international and national laws that apply -to the Software, including the U.S. Export Administration Regulations, as well as end-user, end- -use, and destination restrictions issued by U.S. and other governments. For additional -information see . -15. SOFTWARE TRANSFER. The initial user of the Software may make a one-time -permanent transfer of this EULA and Software to another end user, provided the initial user -retains no copies of the Software. This transfer must include all of the Software (including all -component parts, the media and printed materials, any upgrades (including any Qualifying -Software as defined in Section 11.3), this EULA, and, if applicable, the Certificate of -Authenticity). The transfer may not be an indirect transfer, such as a consignment. Prior to the -transfer, the end user receiving the Software must agree to all the EULA terms. -16. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this -EULA if you fail to comply with the terms and conditions of this EULA. In such event, you -must destroy all copies of the Software and all of its component parts. -Everett VSPro 5 -Final 11.04.02 - - - -17. LIMITED WARRANTY FOR SOFTWARE ACQUIRED IN THE US AND CANADA. -Except for the "Redistributables," which are provided AS IS without warranty of any kind, -Microsoft warrants that the Software will perform substantially in accordance with the -accompanying materials for a period of ninety (90) days from the date of receipt. - -If an implied warranty or condition is created by your state/jurisdiction and federal or -state/provincial law prohibits disclaimer of it, you also have an implied warranty or condition, -BUT ONLY AS TO DEFECTS DISCOVERED DURING THE PERIOD OF THIS LIMITED -WARRANTY (NINETY DAYS). AS TO ANY DEFECTS DISCOVERED AFTER THE -NINETY-DAY PERIOD, THERE IS NO WARRANTY OR CONDITION OF ANY KIND. - -Some states/jurisdictions do not allow limitations on how long an implied warranty or - - -condition lasts, so the above limitation may not apply to you. -Any supplements or updates to the Software, including without limitation, any (if any) service -packs or hot fixes provided to you after the expiration of the ninety day Limited Warranty -period are not covered by any warranty or condition, express, implied or statutory. - - -LIMITATION ON REMEDIES; NO CONSEQUENTIAL OR OTHER DAMAGES. Your -exclusive remedy for any breach of this Limited Warranty is as set forth below. Except for any -refund elected by Microsoft, YOU ARE NOT ENTITLED TO ANY DAMAGES, -INCLUDING BUT NOT LIMITED TO CONSEQUENTIAL DAMAGES, if the Software does -not meet Microsoft's Limited Warranty, and, to the maximum extent allowed by applicable  -law, even if any remedy fails of its essential purpose. The terms of Section 19 ("Exclusion of -Incidental, Consequential and Certain Other Damages") are also incorporated into this Limited -Warranty. Some states/jurisdictions do not allow the exclusion or limitation of incidental or -consequential damages, so the above limitation or exclusion may not apply to you. This -Limited Warranty gives you specific legal rights. You may have other rights which vary from -state/jurisdiction to state/jurisdiction. YOUR EXCLUSIVE REMEDY. Microsoft's and its -suppliers' entire liability and your exclusive remedy for any breach of this Limited Warranty or -for any other breach of this EULA or for any other liability relating to the Software shall be, at -Microsoft's option from time to time exercised subject to applicable law, (a) return of the -amount paid (if any) for the Software, or (b) repair or replacement of the Software, that does not -meet this Limited Warranty and that is returned to Microsoft with a copy of your receipt. You -will receive the remedy elected by Microsoft without charge, except that you are responsible for -any expenses you may incur (e.g. cost of shipping the Software to Microsoft). This Limited -Warranty is void if failure of the Software has resulted from accident, abuse, misapplication, -  -abnormal use or a virus. Any replacement Software will be warranted for the remainder of the -original warranty period or thirty (30) days, whichever is longer, and Microsoft will use -commercially reasonable efforts to provide your remedy within a commercially reasonable time -of your compliance with Microsoft's warranty remedy procedures. Outside the United States or -Canada, neither these remedies nor any product support services offered by Microsoft are -available without proof of purchase from an authorized international source. To exercise your -remedy, contact: Microsoft, Attn. Microsoft Sales Information Center/One Microsoft -Way/Redmond, WA 98052-6399, or the Microsoft subsidiary serving your country. -    - - -18. DISCLAIMER OF WARRANTIES. The Limited Warranty that appears above is the -only express warranty made to you and is provided in lieu of any other express warranties or -similar obligations (if any) created by any advertising, documentation, packaging, or other -communications. EXCEPT FOR THE LIMITED WARRANTY AND TO THE MAXIMUM -Everett VSPro 6 -Final 11.04.02 - - - -EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND ITS SUPPLIERS -PROVIDE THE SOFTWARE AND SUPPORT SERVICES (IF ANY) AS IS AND WITH ALL -FAULTS, AND HEREBY DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, -WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, -ANY (IF ANY) IMPLIED WARRANTIES, DUTIES OR CONDITIONS OF -MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF RELIABILITY -OR AVAILABILITY, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF -RESULTS, OF WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF -NEGLIGENCE, ALL WITH REGARD TO THE SOFTWARE, AND THE PROVISION OF OR -FAILURE TO PROVIDE SUPPORT OR OTHER SERVICES, INFORMATION, SOFTWARE, -AND RELATED CONTENT THROUGH THE SOFTWARE OR OTHERWISE ARISING -OUT OF THE USE OF THE SOFTWARE. ALSO, THERE IS NO WARRANTY OR -CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, -CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO -THE SOFTWARE. - -19. EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER -DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO -EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, -INCIDENTAL, PUNITIVE, INDIRECT, OR CONSEQUENTIAL DAMAGES -WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF -PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS -INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO -MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR -NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) -ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE -THE SOFTWARE, THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT OR -OTHER SERVICES, INFORMATION, SOFTWARE, AND RELATED CONTENT -THROUGH THE SOFTWARE OR OTHERWISE ARISING OUT OF THE USE OF THE -SOFTWARE, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION -OF THIS EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING -NEGLIGENCE), MISREPRESENTATION, STRICT LIABILITY, BREACH OF CONTRACT -OR BREACH OF WARRANTY OF MICROSOFT OR ANY SUPPLIER, AND EVEN IF -MICROSOFT OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. -20. LIMITATION OF LIABILITY AND REMEDIES. NOTWITHSTANDING ANY -DAMAGES THAT YOU MIGHT INCUR FOR ANY REASON WHATSOEVER -(INCLUDING, WITHOUT LIMITATION, ALL DAMAGES REFERENCED HEREIN AND -ALL DIRECT OR GENERAL DAMAGES IN CONTRACT OR ANYTHING ELSE), THE -ENTIRE LIABILITY OF MICROSOFT AND ANY OF ITS SUPPLIERS UNDER ANY -PROVISION OF THIS EULA AND YOUR EXCLUSIVE REMEDY HEREUNDER (EXCEPT -FOR ANY REMEDY OF REPAIR OR REPLACEMENT ELECTED BY MICROSOFT WITH -RESPECT TO ANY BREACH OF THE LIMITED WARRANTY) SHALL BE LIMITED TO -THE GREATER OF THE ACTUAL DAMAGES YOU INCUR IN REASONABLE RELIANCE -ON THE SOFTWARE UP TO THE AMOUNT ACTUALLY PAID BY YOU FOR THE -SOFTWARE OR US$5.00. THE FOREGOING LIMITATIONS, EXCLUSIONS AND -DISCLAIMERS (INCLUDING SECTIONS 17, 18, AND 19) SHALL APPLY TO THE -MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, EVEN IF ANY REMEDY FAILS -ITS ESSENTIAL PURPOSE. -Everett VSPro 7 -Final 11.04.02 - - - -21. U.S. GOVERNMENT LICENSE RIGHTS. All Software provided to the U.S. -Government pursuant to solicitations issued on or after December 1, 1995 is provided with the -commercial license rights and restrictions described elsewhere herein. All Software provided to -the U.S. Government pursuant to solicitations issued prior to December 1, 1995 is provided with -"Restricted Rights" as provided for in FAR, 48 CFR 52.227-14 (JUNE 1987) or DFAR, 48 CFR -252.227-7013 (OCT 1988), as applicable. -22. APPLICABLE LAW. If you acquired this Software in the United States, this EULA is -governed by the laws of the State of Washington. If you acquired this Software in Canada, -unless expressly prohibited by local law, this EULA is governed by the laws in force in the -Province of Ontario, Canada; and, in respect of any dispute which may arise hereunder, you -consent to the jurisdiction of the federal and provincial courts sitting in Toronto, Ontario. If you -acquired this Software in the European Union, Iceland, Norway, or Switzerland, then local law -applies. If you acquired this Software in any other country, then local law may apply. -23. ENTIRE AGREEMENT; SEVERABILITY. This EULA (including any addendum or -amendment to this EULA which is included with the Software) are the entire agreement -between you and Microsoft relating to the Software and the support services (if any) and they -supersede all prior or contemporaneous oral or written communications, proposals and -representations with respect to the Software or any other subject matter covered by this EULA. -To the extent the terms of any Microsoft policies or programs for support services conflict with -the terms of this EULA, the terms of this EULA shall control. If any provision of this EULA is -held to be void, invalid, unenforceable or illegal, the other provisions shall continue in full force -and effect. -Si vous avez acquis votre produit Microsoft au CANADA, la garantie limitée suivante -s'applique : - -GARANTIE LIMITÉE - -Sauf pur celles du "Redistributables," qui sont fournies "comme telles," Microsoft garantit que -le Logiciel fonctionnera conformément aux documents inclus pendant une période de 90 jours -suivant la date de réception. - -Si une garantie ou condition implicite est créée par votre État ou votre territoire et qu'une loifédérale ou provinciale ou d'un État en interdit le déni, vous jouissez également d'une -garantie ou condition implicite, MAIS UNIQUEMENT POUR LES DÉFAUTS DÉCOUVERTS -DURANT LA PÉRIODE DE LA PRÉSENTE GARANTIE LIMITÉE (QUATRE-VINGT-DIX -JOURS). IL N'Y A AUCUNE GARANTIE OU CONDITION DE QUELQUE NATURE QUECE SOIT QUANT AUX DÉFAUTS DÉCOUVERTS APRÈS CETTE PÉRIODE DE QUATRE- -VINGT-DIX JOURS. Certains États ou territoires ne permettent pas de limiter la durée d'une -garantie ou condition implicite de sorte que la limitation ci-dessus peut ne pas s'appliquer à -vous. - -Tous les suppléments ou toutes les mises à jour relatifs au Logiciel, notamment, les ensembles -de services ou les réparations à chaud (le cas échéant) qui vous sont fournis après l'expiration -de la période de quatre-vingt-dix jours de la garantie limitée ne sont pas couverts par quelque -garantie ou condition que ce soit, expresse, implicite ou en vertu de la loi. - -LIMITATION DES RECOURS; ABSENCE DE DOMMAGES INDIRECTS OU AUTRES. - -Votre recours exclusif pour toute violation de la présente garantie limitée est décrit ci-après. - -Sauf pour tout remboursement au choix de Microsoft, si le Logiciel ne respecte pas la - -Everett VSPro 8 -Final 11.04.02 - - - -garantie limitée de Microsoft et, dans la mesure maximale permise par les lois applicables, -même si tout recours n'atteint pas son but essentiel, VOUS N'AVEZ DROIT À AUCUNS -DOMMAGES, NOTAMMENT DES DOMMAGES INDIRECTS. Les termes de la -clause «Exclusion des dommages accessoires, indirects et de certains autres dommages » sontégalement intégrées à la présente garantie limitée. Certains États ou territoires ne permettent -pas l'exclusion ou la limitation des dommages indirects ou accessoires de sorte que la limitation -ou l'exclusion ci-dessus peut ne pas s'appliquer à vous. La présente garantie limitée vous donne -des droits légaux spécifiques. Vous pouvez avoir d'autres droits qui peuvent varier d'unterritoire ou d'un État à un autre. VOTRE RECOURS EXCLUSIF. La seule responsabilité -obligation de Microsoft et de ses fournisseurs et votre recours exclusif pour toute violation de -la présente garantie limitée ou pour toute autre violation du présent contrat ou pour toute autre -responsabilité relative au Logiciel seront, selon le choix de Microsoft exercé de temps à autre -sous réserve de toute loi applicable, a) le remboursement du prix payé, le cas échéant, pour le -Logiciel ou b) la réparation ou le remplacement du Logiciel qui ne respecte pas la présente -garantie limitée et qui est retourné à Microsoft avec une copie de votre reçu. Vous recevrez la -compensation choisie par Microsoft, sans frais, sauf que vous êtes responsable des dépenses que -vous pourriez engager (p. ex., les frais d'envoi du Logiciel à Microsoft). La présente garantie -limitée est nulle si la défectuosité du Logiciel est causée par un accident, un usage abusif, une -mauvaise application, un usage anormal ou un virus. Tout Logiciel de remplacement sera -garanti pour le reste de la période initiale de la garantie ou pendant trente (30) jours, selon la -plus longue entre ces deux périodes. À l'extérieur des États-Unis ou du Canada, ces recours ou -l'un quelconque des services de soutien technique offerts par Microsoft ne sont pas disponibles -sans preuve d'achat d'une source internationale autorisée. Pour exercer votre recours, vous -devez communiquer avec Microsoft et vous adresser au Microsoft Sales Information -Center/One Microsoft Way/Redmond, WA 98052-6399, ou à la filiale de Microsoft de votre -pays. - -DÉNI DE GARANTIES. La garantie limitée qui apparaît ci-dessus constitue la seule garantie -expresse qui vous est donnée et remplace toutes autres garanties expresses (s'il en est) crées par -une publicité, un document, un emballage ou une autre communication. SAUF EN CE QUI A -TRAIT À LA GARANTIE LIMITÉE ET DANS LA MESURE MAXIMALE PERMISE PAR -LES LOIS APPLICABLES, LE LOGICIEL ET LES SERVICES DE SOUTIEN TECHNIQUE -(LE CAS ÉCHÉANT) SONT FOURNIS TELS QUELS ET AVEC TOUS LES DÉFAUTS PAR -MICROSOFT ET SES FOURNISSEURS, LESQUELS PAR LES PRÉSENTES DÉNIENT -TOUTES AUTRES GARANTIES ET CONDITIONS EXPRESSES, IMPLICITES OU EN -VERTU DE LA LOI, NOTAMMENT, MAIS SANS LIMITATION, (LE CAS ÉCHÉANT) LESGARANTIES, DEVOIRS OU CONDITIONS IMPLICITES DE QUALITÉ MARCHANDE, -D'ADAPTATION À UNE FIN PARTICULIÈRE, DE FIABILITÉ OU DE DISPONIBILITÉ, -D'EXACTITUDE OU D'EXHAUSTIVITÉ DES RÉPONSES, DES RÉSULTATS, DES -EFFORTS DÉPLOYÉS SELON LES RÈGLES DE L'ART, D'ABSENCE DE VIRUS ET -D'ABSENCE DE NÉGLIGENCE, LE TOUT À L'ÉGARD DU LOGICIEL ET DE LA -PRESTATION OU DE L'OMISSION DE LA PRESTATION DES SERVICES DE SOUTIEN -TECHNIQUE OU À L'ÉGARD DE LA FOURNITURE OU DE L'OMISSION DE LA -FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET -CONTENU QUI S'Y RAPPORTE GRÂCE AU LOGICIEL OU PROVENANT AUTREMENT -DE L'UTILISATION DU LOGICIEL . PAR AILLEURS, IL N'Y A AUCUNE GARANTIE OU -CONDITION QUANT AU TITRE DE PROPRIÉTÉ, À LA JOUISSANCE OU LA -POSSESSION PAISIBLE, À LA CONCORDANCE À UNE DESCRIPTION NI QUANT À -UNE ABSENCE DE CONTREFAÇON CONCERNANT LE LOGICIEL. - -EXCLUSION DES DOMMAGES ACCESSOIRES, INDIRECTS ET DE CERTAINS AUTRES -DOMMAGES. DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, -EN AUCUN CAS MICROSOFT OU SES FOURNISSEURS NE SERONT RESPONSABLES -DES DOMMAGES SPÉCIAUX, CONSÉCUTIFS, ACCESSOIRES OU INDIRECTS DE - -Everett VSPro 9 -Final 11.04.02 - - - -QUELQUE NATURE QUE CE SOIT (NOTAMMENT, LES DOMMAGES À L'ÉGARD DUMANQUE À GAGNER OU DE LA DIVULGATION DE RENSEIGNEMENTS -CONFIDENTIELS OU AUTRES, DE LA PERTE D'EXPLOITATION, DE BLESSURES -CORPORELLES, DE LA VIOLATION DE LA VIE PRIVÉE, DE L'OMISSION DE REMPLIR -TOUT DEVOIR, Y COMPRIS D'AGIR DE BONNE FOI OU D'EXERCER UN SOIN -RAISONNABLE, DE LA NÉGLIGENCE ET DE TOUTE AUTRE PERTE PÉCUNIAIRE OU -AUTRE PERTE DE QUELQUE NATURE QUE CE SOIT) SE RAPPORTANT DE QUELQUEMANIÈRE QUE CE SOIT À L'UTILISATION DU LOGICIEL OU À L'INCAPACITÉ DE -S'EN SERVIR, À LA PRESTATION OU À L'OMISSION DE LA PRESTATION DE -SERVICES DE SOUTIEN TECHNIQUE OU À LA FOURNITURE OU À L'OMISSION DE -LA FOURNITURE DE TOUS AUTRES SERVICES, RENSEIGNEMENTS, LOGICIELS, ET -CONTENU QUI S'Y RAPPORTE GRÂCE AU LOGICIEL OU PROVENANT AUTREMENT -DE L'UTILISATION DU LOGICIEL OU AUTREMENT AUX TERMES DE TOUTE -DISPOSITION DE LA PRÉSENTE CONVENTION OU RELATIVEMENT À UNE TELLE -DISPOSITION, MÊME EN CAS DE FAUTE, DE DÉLIT CIVIL (Y COMPRIS LANÉGLIGENCE), DE RESPONSABILITÉ STRICTE, DE VIOLATION DE CONTRAT OU DEVIOLATION DE GARANTIE DE MICROSOFT OU DE TOUT FOURNISSEUR ET MÊME -SI MICROSOFT OU TOUT FOURNISSEUR A ÉTÉ AVISÉ DE LA POSSIBILITÉ DE TELS -DOMMAGES. - -LIMITATION DE RESPONSABILITÉ ET RECOURS. MALGRÉ LES DOMMAGES QUE -VOUS PUISSIEZ SUBIR POUR QUELQUE MOTIF QUE CE SOIT (NOTAMMENT, MAISSANS LIMITATION, TOUS LES DOMMAGES SUSMENTIONNÉS ET TOUS LES -DOMMAGES DIRECTS OU GÉNÉRAUX OU AUTRES), LA SEULE RESPONSABILITÉ DE -MICROSOFT ET DE L'UN OU L'AUTRE DE SES FOURNISSEURS AUX TERMES DE -TOUTE DISPOSITION DE LA PRÉSENTE CONVENTION ET VOTRE RECOURS -EXCLUSIF À L'ÉGARD DE TOUT CE QUI PRÉCÈDE (SAUF EN CE QUI CONCERNETOUT RECOURS DE RÉPARATION OU DE REMPLACEMENT CHOISI PAR -MICROSOFT À L'ÉGARD DE TOUT MANQUEMENT À LA GARANTIE LIMITÉE) SELIMITE AU PLUS ÉLEVÉ ENTRE LES MONTANTS SUIVANTS : LE MONTANT QUE -VOUS AVEZ RÉELLEMENT PAYÉ POUR LE LOGICIEL OU 5,00 $US. LES LIMITES, -EXCLUSIONS ET DÉNIS QUI PRÉCÈDENT (Y COMPRIS LES CLAUSES CI-DESSUS), -S'APPLIQUENT DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS -APPLICABLES, MÊME SI TOUT RECOURS N'ATTEINT PAS SON BUT ESSENTIEL. - -À moins que cela ne soit prohibé par le droit local applicable, la présente Convention est régie -par les lois de la province d'Ontario, Canada. Vous consentez à la compétence des tribunaux -fédéraux et provinciaux siégeant à Toronto, dans la province d'Ontario. - -Au cas où vous auriez des questions concernant cette licence ou que vous désiriez vous mettre -en rapport avec Microsoft pour quelque raison que ce soit, veuillez utiliser l'information -contenue dans le Logiciel pour contacter la filiale de Microsoft desservant votre pays, ou visitez -Microsoft sur le World Wide Web à http://www.microsoft.com. - -The following MICROSOFT GUARANTEE applies to you if you acquired this Software in -any other country: - -Statutory rights not affected -The following guarantee is not restricted to any territory and does -not affect any statutory rights that you may have from your reseller or from Microsoft if you -acquired the Software directly from Microsoft. If you acquired the Software or any support -services in Australia, New Zealand or Malaysia, please see the "Consumer rights" section -below. - -Everett VSPro 10 -Final 11.04.02 - - - -The guarantee -The Software is designed and offered as a general-purpose software, not for any -user's particular purpose. You accept that no Software is error free and you are strongly -advised to back-up your files regularly. Provided that you have a valid license, Microsoft -guarantees that a) for a period of 90 days from the date of receipt of your license to use the -Software or the shortest period permitted by applicable law it will perform substantially in -accordance with the written materials that accompany the Software; and b) any support services -provided by Microsoft shall be substantially as described in applicable written materials -provided to you by Microsoft and Microsoft support engineers will use reasonable efforts, care -and skill to solve any problem issues. In the event that the Software fails to comply with this -guarantee, Microsoft will either (a) repair or replace the Software or (b) return the price you -paid. This guarantee is void if failure of the Software results from accident, abuse or -misapplication. Any replacement Software will be guaranteed for the remainder of the original -guarantee period or 30 days, whichever period is longer. You agree that the above guarantee is -your sole guarantee in relation to the Software and any support services. - -Exclusion of All Other Terms -To the maximum extent permitted by applicable law and subject to -the guarantee above, Microsoft disclaims all warranties, conditions and other terms, either -express or implied (whether by statute, common law, collaterally or otherwise) including but -not limited to implied warranties of satisfactory quality and fitness for particular purpose with -respect to the Software and the written materials that accompany the Software. Any implied -warranties that cannot be excluded are limited to 90 days or to the shortest period permitted by -applicable law, whichever is greater. - -Limitation of Liability -To the maximum extent permitted by applicable law and except as -provided in the Microsoft Guarantee, Microsoft and its suppliers shall not be liable for any -damages whatsoever (including without limitation, damages for loss of business profits, -business interruption, loss of business information or other pecuniary loss) arising out of the -use or inability to use the Software, even if Microsoft has been advised of the possibility of such -damages. In any case Microsoft's entire liability under any provision of this Agreement shall be -limited to the amount actually paid by you for the Software. These limitations do not apply to -any liabilities that cannot be excluded or limited by applicable laws. - -Consumer rights -Consumers in Australia, New Zealand or Malaysia may have the benefit of -certain rights and remedies by reason of the Trade Practices Act and similar state and territory -laws in Australia, the Consumer Guarantees Act in New Zealand and the Consumer Protection -Act in Malaysia in respect of which liability cannot lawfully be modified or excluded. If you -acquired the Software in New Zealand for the purposes of a business, you confirm that the -Consumer Guarantees Act does not apply. If you acquired the Software in Australia and if -Microsoft breaches a condition or warranty implied under any law which cannot lawfully be -modified or excluded by this agreement then, to the extent permitted by law, Microsoft's -liability is limited, at Microsoft's option, to: (i) in the case of the Software: a) repairing or -replacing the Software; or b) the cost of such repair or replacement; and (ii) in the case of -support services: a) re-supply of the services; or b) the cost of having the services supplied -again. - -Everett VSPro 11 -Final 11.04.02 - - - -Should you have any questions concerning this EULA, or if you desire to contact Microsoft for -any reason, please use the address information enclosed in this Software to contact the -Microsoft subsidiary serving your country or visit Microsoft on the World Wide Web at -http://www.microsoft.com. - -Everett VSPro 12 -Final 11.04.02 - -%% The following software may be included in this product: zlib; Use of any of this software is governed by the terms of the license below: - -zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.3, July 9th, 1998 - - Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format - - -%% The following software may be included in this product: Mozilla Rhino. Use of any of this software is governed by the terms of the license below: - - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Rhino code, released - * May 6, 1999. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1997-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Kemal Bayram - * Patrick Beard - * Norris Boyd - * Igor Bukanov, igor@mir2.org - * Brendan Eich - * Ethan Hugg - * Roger Lawrence - * Terry Lucas - * Mike McCabe - * Milen Nankov - * Attila Szegedi, szegedia@freemail.hu - * Ian D. Stewart - * Andi Vajda - * Andrew Wason - */ - -%% The following software may be included in this product: Apache Derby. Use of any of this software is governed by the terms of the license below: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - diff --git a/rpms/legal/FOSS_licenses/postgresql/bsd_license.txt b/rpms/legal/FOSS_licenses/postgresql/bsd_license.txt deleted file mode 100644 index f50d0adc4a..0000000000 --- a/rpms/legal/FOSS_licenses/postgresql/bsd_license.txt +++ /dev/null @@ -1,15 +0,0 @@ -License -PostgreSQL is released under the BSD license. -PostgreSQL Database Management System -(formerly known as Postgres, then as Postgres95) - -Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group - -Portions Copyright (c) 1994, The Regents of the University of California - -Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies. - -IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -