Merge branch 'development' into development_on_RHEL6
Former-commit-id:777da949d7
[formerly1d321b3f2c
[formerly 0fd535fb95343956cda9e96ebb5aa5c56387da72]] Former-commit-id:1d321b3f2c
Former-commit-id:f2f25e0d24
This commit is contained in:
commit
d9e952066a
51 changed files with 745 additions and 384 deletions
|
@ -75,6 +75,11 @@
|
|||
class="com.raytheon.uf.common.datadelivery.registry.handlers.DataSetHandler">
|
||||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
|
||||
<bean name="AdhocSubscriptionHandler"
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.AdhocSubscriptionHandler">
|
||||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
|
||||
<!-- The actual registering of the handlers -->
|
||||
|
||||
|
@ -151,6 +156,11 @@
|
|||
value="com.raytheon.uf.common.datadelivery.registry.handlers.IDataSetHandler" />
|
||||
<constructor-arg ref="DataSetHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="registerAdhocSubscriptionHandler" factory-bean="registryObjectHandlerRegistry" factory-method="registerHandler">
|
||||
<constructor-arg value="com.raytheon.uf.common.datadelivery.registry.handlers.IAdhocSubscriptionHandler" />
|
||||
<constructor-arg ref="AdhocSubscriptionHandler" />
|
||||
</bean>
|
||||
|
||||
<!-- Used to consolidate the dependency clauses of beans that rely upon
|
||||
data delivery registry handlers -->
|
||||
|
@ -159,6 +169,6 @@
|
|||
registerGroupDefinitionHandler,
|
||||
registerProviderHandler,registerDataSetNameHandler,registerParameterHandler,
|
||||
registerParameterLevelHandler,registerDataSetMetaDataHandler,
|
||||
registerGriddedDataSetMetaDataHandler,registerDataSetHandler" />
|
||||
registerGriddedDataSetMetaDataHandler,registerDataSetHandler,registerAdhocSubscriptionHandler" />
|
||||
|
||||
</beans>
|
|
@ -28,9 +28,11 @@ import java.util.Map;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.raytheon.uf.common.comm.CommunicationException;
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IAdhocSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||
|
@ -66,6 +68,7 @@ import com.raytheon.viz.pointdata.util.PointDataInventory;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 17, 2013 2391 mpduff Initial creation
|
||||
* Sept 22, 2013 2246 dhladky Setup binoffset for time into +-5 min intervals
|
||||
* Oct 13, 2013 2460 dhladky Added display of Adhoc subscriptions
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -432,6 +435,20 @@ public class DataDeliveryProductBrowserDataDefinition
|
|||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
final IAdhocSubscriptionHandler adhochandler = RegistryObjectHandlers
|
||||
.get(IAdhocSubscriptionHandler.class);
|
||||
List<AdhocSubscription> adhocSubs = null;
|
||||
|
||||
try {
|
||||
adhocSubs = adhochandler.getAll();
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
if (adhocSubs != null) {
|
||||
subList.addAll(adhocSubs);
|
||||
}
|
||||
|
||||
return subList;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary.
|
||||
* Jul 26, 2013 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Sept 25, 2013 1797 dhladky separated time from gridded time
|
||||
* Oct 12, 2013 2460 dhladky restored adhoc subscriptions to registry storage.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -566,9 +567,9 @@ public class SubscriptionService implements ISubscriptionService {
|
|||
final String successMessage = "The query was successfully stored.";
|
||||
final ServiceInteraction action = new ServiceInteraction() {
|
||||
@Override
|
||||
public String call() {
|
||||
// Adhoc subscriptions don't interact with the registry any
|
||||
// longer, so it gets a blank implementation
|
||||
public String call() throws RegistryHandlerException {
|
||||
DataDeliveryHandlers.getSubscriptionHandler().store(
|
||||
sub);
|
||||
return successMessage;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -235,6 +235,7 @@
|
|||
<!-- Registry production mode -->
|
||||
<include>ebxml.*\.xml</include>
|
||||
<includeMode>dataDeliveryTemplate</includeMode>
|
||||
<include>adhoc-datadelivery-wfo.xml</include>
|
||||
<exclude>.*datadelivery-ncf.*</exclude>
|
||||
<exclude>harvester-*</exclude>
|
||||
<exclude>crawler-*</exclude>
|
||||
|
@ -299,6 +300,7 @@
|
|||
are for DEVELOPMENT purposes only -->
|
||||
<mode name="devRegistry">
|
||||
<include>ebxml.*\.xml</include>
|
||||
<include>adhoc-datadelivery-wfo.xml</include>
|
||||
<includeMode>dataDeliveryTemplate</includeMode>
|
||||
<exclude>.*datadelivery-ncf.*</exclude>
|
||||
</mode>
|
||||
|
|
|
@ -18,7 +18,6 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
com.raytheon.uf.edex.plugin.grid,
|
||||
com.raytheon.uf.edex.python.decoder,
|
||||
org.apache.camel,
|
||||
org.apache.commons.configuration,
|
||||
org.apache.commons.lang,
|
||||
org.apache.commons.logging,
|
||||
javax.measure,
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
com.raytheon.edex.plugin.grib.util.GenProcess
|
||||
com.raytheon.edex.plugin.grib.util.GribLevel
|
||||
com.raytheon.edex.plugin.grib.util.GribParameter
|
||||
com.raytheon.edex.plugin.grib.util.Grib1Parameter
|
||||
com.raytheon.edex.plugin.grib.util.Grib1ParameterSet
|
||||
com.raytheon.edex.util.grib.Grib1TableMap
|
||||
com.raytheon.edex.util.grib.CompositeModel
|
||||
com.raytheon.edex.plugin.grib.spatial.FileData
|
||||
com.raytheon.edex.plugin.grib.spatial.FileDataList
|
||||
com.raytheon.edex.plugin.grib.decoderpostprocessors.PostProcessedModelSet
|
||||
com.raytheon.edex.plugin.grib.decoderpostprocessors.PostProcessedModel
|
|
@ -55,7 +55,6 @@ import com.raytheon.edex.util.grib.Grib1TableMap;
|
|||
import com.raytheon.edex.util.grib.GribParamTranslator;
|
||||
import com.raytheon.edex.util.grib.GribTableLookup;
|
||||
import com.raytheon.uf.common.comm.CommunicationException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
|
||||
|
@ -92,12 +91,13 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 11, 2010 4758 bphillip Initial Creation
|
||||
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util
|
||||
* into ArraysUtil
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
|
||||
* files.
|
||||
* Mar 11, 2010 4758 bphillip Initial Creation
|
||||
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util
|
||||
* into ArraysUtil
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
|
||||
* files.
|
||||
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -320,7 +320,7 @@ public class Grib1Decoder extends AbstractDecoder {
|
|||
// Get the level information
|
||||
float[] levelMetadata = this.convertGrib1LevelInfo(
|
||||
pdsVars.getLevelType1(), (float) pdsVars.getLevelValue1(),
|
||||
pdsVars.getLevelType2(), (float) pdsVars.getLevelValue2());
|
||||
(float) pdsVars.getLevelValue2());
|
||||
retVal.setLevel(getLevelInfo(centerid, subcenterid, levelMetadata[0],
|
||||
levelMetadata[1], levelMetadata[2], levelMetadata[3],
|
||||
levelMetadata[4], levelMetadata[5]));
|
||||
|
@ -493,12 +493,6 @@ public class Grib1Decoder extends AbstractDecoder {
|
|||
// retVal.setResCompFlags(gridCoverage.getResolution());
|
||||
// }
|
||||
|
||||
try {
|
||||
retVal.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new GribException("Error constructing grib dataURI", e);
|
||||
}
|
||||
|
||||
// check if FLAG.FCST_USED needs to be removed
|
||||
checkForecastFlag(retVal.getDataTime(), centerid, subcenterid,
|
||||
genProcess, gridCoverage);
|
||||
|
@ -1018,7 +1012,7 @@ public class Grib1Decoder extends AbstractDecoder {
|
|||
* The value of the level
|
||||
* @return The converted level type information
|
||||
*/
|
||||
private float[] convertGrib1LevelInfo(int ltype1, float lval1, int ltype2,
|
||||
private float[] convertGrib1LevelInfo(int ltype1, float lval1,
|
||||
float lval2) {
|
||||
float level1Type = ltype1;
|
||||
float level1Scale = 0;
|
||||
|
|
|
@ -23,11 +23,7 @@ package com.raytheon.edex.plugin.grib.decoderpostprocessors;
|
|||
import java.util.Calendar;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
|
||||
/**
|
||||
|
@ -48,10 +44,11 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 09, 2011 4243 porricel Initial Creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 09, 2011 4243 porricel Initial Creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -59,8 +56,6 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* @version
|
||||
*/
|
||||
public class CPCoutlookGribPostProcessor implements IDecoderPostProcessor {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(CPCoutlookGribPostProcessor.class);
|
||||
|
||||
@Override
|
||||
public GridRecord[] process(GridRecord record) throws GribException {
|
||||
|
@ -83,12 +78,6 @@ public class CPCoutlookGribPostProcessor implements IDecoderPostProcessor {
|
|||
record.setDataTime(newDataTime);
|
||||
record.setDataURI(null);
|
||||
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error constructing dataURI!", e);
|
||||
}
|
||||
return new GridRecord[] { record };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,9 +40,10 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/18/2012 porricel Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jan 18, 2012 porricel Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -147,8 +148,7 @@ public class CanadianNHPostProcessor extends SixHrPrecipGridProcessor {
|
|||
.getDataTime().getFcstTime())) {
|
||||
// If the precipitation grid has not been produced, generate it
|
||||
List<GridRecord> generated6hrPrecips = generate6hrPrecip(
|
||||
precipInventory.get(i), precipInventory,
|
||||
precip6hrInventory);
|
||||
precipInventory.get(i), precipInventory);
|
||||
for (GridRecord newRecord : generated6hrPrecips) {
|
||||
// Add the generated grid to the current inventory
|
||||
if (newRecord != null) {
|
||||
|
|
|
@ -40,9 +40,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/18/2012 porricel Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jan 18, 2012 porricel Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -147,8 +149,7 @@ public class CanadianRegPostProcessor extends ThreeHrPrecipGridProcessor {
|
|||
.getDataTime().getFcstTime())) {
|
||||
// If the precipitation grid has not been produced, generate it
|
||||
List<GridRecord> generated3hrPrecips = generate3hrPrecip(
|
||||
precipInventory.get(i), precipInventory,
|
||||
precip3hrInventory);
|
||||
precipInventory.get(i), precipInventory);
|
||||
for (GridRecord newRecord : generated3hrPrecips) {
|
||||
// Add the generated grid to the current inventory
|
||||
if (newRecord != null) {
|
||||
|
|
|
@ -40,9 +40,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 8/30/10 5875 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Aug 30, 2010 5875 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Removed unused method argument.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -150,8 +152,7 @@ public class ECMWFHiResProcessor extends SixHrPrecipGridProcessor {
|
|||
.getDataTime().getFcstTime())) {
|
||||
// If the precipitation grid has not been produced, generate it
|
||||
List<GridRecord> generated6hrPrecips = generate6hrPrecip(
|
||||
precipInventory.get(i), precipInventory,
|
||||
precip6hrInventory);
|
||||
precipInventory.get(i), precipInventory);
|
||||
for (GridRecord newRecord : generated6hrPrecips) {
|
||||
// Add the generated grid to the current inventory
|
||||
if (newRecord != null) {
|
||||
|
|
|
@ -28,6 +28,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.edex.plugin.grib.spatial.GribSpatialCache;
|
||||
import com.raytheon.edex.util.Util;
|
||||
|
@ -44,7 +46,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -68,13 +70,15 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 09, 2010 4638 bphillip Initial Creation
|
||||
* Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List.
|
||||
* Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid
|
||||
* assembler.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 09, 2010 4638 bphillip Initial Creation
|
||||
* Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List.
|
||||
* Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid
|
||||
* assembler.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -116,11 +120,18 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
|
|||
List<File> thinnedModelFiles = FileUtil.listFiles(commonPath, filter,
|
||||
false);
|
||||
|
||||
SingleTypeJAXBManager<CompositeModel> jaxbManager;
|
||||
try {
|
||||
jaxbManager = new SingleTypeJAXBManager<CompositeModel>(
|
||||
CompositeModel.class);
|
||||
} catch (JAXBException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to load thinned model files.", e);
|
||||
return;
|
||||
}
|
||||
for (File file : thinnedModelFiles) {
|
||||
try {
|
||||
CompositeModel model = SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(CompositeModel.class,
|
||||
file.getPath());
|
||||
CompositeModel model = jaxbManager.unmarshalFromXmlFile(file);
|
||||
thinnedModels.put(model.getModelName(), model);
|
||||
} catch (SerializationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
|
@ -220,7 +231,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
|
|||
}
|
||||
|
||||
private GridRecord createAssembledRecord(GridRecord record,
|
||||
CompositeModel thinned) throws GribException {
|
||||
CompositeModel thinned) {
|
||||
GridRecord newRecord = new GridRecord();
|
||||
|
||||
GridCoverage coverage = GribSpatialCache.getInstance().getGridByName(
|
||||
|
@ -234,12 +245,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
|
|||
newRecord.setDataTime(record.getDataTime());
|
||||
newRecord.setDataURI(null);
|
||||
newRecord.setInsertTime(Calendar.getInstance());
|
||||
try {
|
||||
newRecord.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new GribException(
|
||||
"Error constructing DataURI for grib record", e);
|
||||
}
|
||||
|
||||
return newRecord;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 8/31/10 5875 bphillip Initial Creation
|
||||
* Mar 26, 2013 1821 bsteffen Optimize FFG version query.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Aug 31, 2010 5875 bphillip Initial Creation
|
||||
* Mar 26, 2013 1821 bsteffen Optimize FFG version query.
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,7 +59,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
|
|||
.getPluginDao(GridConstants.GRID);
|
||||
record.setSecondaryId("%");
|
||||
record.setDataURI(null);
|
||||
record.constructDataURI();
|
||||
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class);
|
||||
query.addReturnedField(GridConstants.SECONDARY_ID);
|
||||
|
@ -91,7 +91,6 @@ public class FFGGribPostProcessor implements IDecoderPostProcessor {
|
|||
record.setSecondaryId("Version" + (maxVersion + 1));
|
||||
record.getInfo().setId(null);
|
||||
record.setDataURI(null);
|
||||
record.constructDataURI();
|
||||
} catch (Exception e) {
|
||||
throw new GribException("Error decoding FFG grid", e);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,6 @@ import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
|||
import com.raytheon.uf.common.dataquery.db.QueryParam.QueryOperand;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
|
@ -50,10 +47,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 25, 2011 rgeorge Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 25, 2011 rgeorge Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,9 +61,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
public class GFSProcessor extends SixHrPrecipGridProcessor {
|
||||
private static final int SECONDS_IN_12_HRS = 43200;
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GFSProcessor.class);
|
||||
|
||||
@Override
|
||||
public GridRecord[] process(GridRecord record) throws GribException {
|
||||
// Post process the data if this is a Total Precipitation grid
|
||||
|
@ -227,11 +222,5 @@ public class GFSProcessor extends SixHrPrecipGridProcessor {
|
|||
// Reset the datauri since the datauri contains the DataTime
|
||||
record.setDataTime(newDataTime);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error constructing dataURI!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,12 +26,15 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.edex.plugin.grib.util.GribModelLookup;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
||||
|
@ -43,10 +46,13 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 8/30/10 5875 bphillip Initial Creation
|
||||
* 9/20/2012 1206 jkorman Added logging of postProcessedModels load.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Aug 30, 2010 5875 bphillip Initial Creation
|
||||
* Sep 20, 2012 1206 jkorman Added logging of postProcessedModels
|
||||
* load.
|
||||
* Oct 15, 2013 2473 bsteffen Rewrite deprecated and unused code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -56,13 +62,13 @@ public class GribPostProcessor {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GribPostProcessor.class);
|
||||
|
||||
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
|
||||
|
||||
/** The singleton instance */
|
||||
private static GribPostProcessor instance;
|
||||
|
||||
/** The map containing the currently registered grib post processors */
|
||||
private static Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>();
|
||||
|
||||
private static final String CLASS_PREFIX = "com.raytheon.edex.plugin.grib.decoderpostprocessors.";
|
||||
private final Map<String, List<IDecoderPostProcessor>> processorMap = new HashMap<String, List<IDecoderPostProcessor>>();
|
||||
|
||||
/**
|
||||
* Gets the singleton instance of GribPostProcessor
|
||||
|
@ -80,11 +86,11 @@ public class GribPostProcessor {
|
|||
* Creates a new GribPostProcessor instance
|
||||
*/
|
||||
private GribPostProcessor() {
|
||||
String processorFile = PathManagerFactory
|
||||
LocalizationFile processorFile = PathManagerFactory
|
||||
.getPathManager()
|
||||
.getStaticFile(
|
||||
.getStaticLocalizationFile(
|
||||
"/grib/postProcessModels/postProcessedModels.xml")
|
||||
.getPath();
|
||||
;
|
||||
|
||||
try {
|
||||
// Get the list of available model names
|
||||
|
@ -92,8 +98,9 @@ public class GribPostProcessor {
|
|||
.getModelNames();
|
||||
|
||||
// Unmarshal the post processed model file
|
||||
PostProcessedModelSet ppModelSet = (PostProcessedModelSet) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(processorFile);
|
||||
PostProcessedModelSet ppModelSet = processorFile.jaxbUnmarshal(
|
||||
PostProcessedModelSet.class, new JAXBManager(
|
||||
PostProcessedModelSet.class));
|
||||
|
||||
statusHandler.info(String.format("Using postProcessorFile [%s]", processorFile));
|
||||
|
||||
|
@ -152,7 +159,11 @@ public class GribPostProcessor {
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (SerializationException e) {
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.fatal(
|
||||
"Error unmarshalling post processed model list: "
|
||||
+ processorFile, e);
|
||||
} catch (JAXBException e) {
|
||||
statusHandler.fatal(
|
||||
"Error unmarshalling post processed model list: "
|
||||
+ processorFile, e);
|
||||
|
@ -212,24 +223,4 @@ public class GribPostProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
private IDecoderPostProcessor getPostProcessor(String modelName,
|
||||
String processorClassName) throws GribException {
|
||||
|
||||
for (List<IDecoderPostProcessor> processors : processorMap.values()) {
|
||||
for (IDecoderPostProcessor processor : processors) {
|
||||
if (processor.getClass().getCanonicalName()
|
||||
.equals(processorClassName)) {
|
||||
return processor;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
return (IDecoderPostProcessor) Class.forName(processorClassName)
|
||||
.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new GribException(
|
||||
"Error instantiating decoder post processor for "
|
||||
+ modelName + " model.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,9 +34,10 @@ import com.raytheon.uf.common.parameter.Parameter;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/2011 #6619 bphillip Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2011 6619 bphillip Initial creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,12 +79,6 @@ public class LapsPostProcessor implements IDecoderPostProcessor {
|
|||
if (modelInfoModified) {
|
||||
record.getInfo().setId(null);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (Exception e) {
|
||||
throw new GribException(
|
||||
"Error creating new dataURI for LAPS data!", e);
|
||||
}
|
||||
}
|
||||
|
||||
record.setOverwriteAllowed(true);
|
||||
|
|
|
@ -27,15 +27,17 @@ import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
|||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Post processor for the MSAS model.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 18, 2011 bphillip Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Aug 18, 2011 bphillip Initial creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -100,12 +102,6 @@ public class MSASPostProcessor implements IDecoderPostProcessor {
|
|||
if (modelInfoModified) {
|
||||
record.getInfo().setId(null);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (Exception e) {
|
||||
throw new GribException(
|
||||
"Error creating new dataURI for MSAS data!", e);
|
||||
}
|
||||
}
|
||||
|
||||
record.setOverwriteAllowed(true);
|
||||
|
|
|
@ -45,10 +45,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 17, 2011 bphillip Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Nov 17, 2011 bphillip Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -208,11 +209,6 @@ public class Nam80PostProcessor implements IDecoderPostProcessor {
|
|||
newRecord.setDataTime(newDataTime);
|
||||
newRecord.getInfo().setId(null);
|
||||
newRecord.setDataURI(null);
|
||||
try {
|
||||
newRecord.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new GribException("Error constructing dataURI!", e);
|
||||
}
|
||||
newRecord.setOverwriteAllowed(true);
|
||||
return newRecord;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* A container class to hold which post processors apply to a grib model
|
||||
*
|
||||
|
@ -36,9 +34,11 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/24/12 949 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jul 24, 2012 949 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement(name = "postProcessedModel")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class PostProcessedModel implements ISerializableObject {
|
||||
public class PostProcessedModel {
|
||||
|
||||
/**
|
||||
* The model name to which the processors apply. May be a regular expression
|
||||
|
|
|
@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* A container class to hold the list of models needing to be post processed
|
||||
*
|
||||
|
@ -37,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/24/12 949 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jul 24, 2012 949 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement(name = "postProcessedModels")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class PostProcessedModelSet implements ISerializableObject{
|
||||
public class PostProcessedModelSet {
|
||||
|
||||
/**
|
||||
* List of post processed modesl
|
||||
|
|
|
@ -35,9 +35,11 @@ import com.raytheon.uf.common.time.TimeRange;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 02/01/11 6320 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Feb 01, 2011 6320 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -59,12 +61,6 @@ public class RTMAGribPostProcessor implements IDecoderPostProcessor {
|
|||
newDataTime.setValidPeriod(new TimeRange(time, time));
|
||||
record.setDataTime(newDataTime);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (Exception e) {
|
||||
throw new GribException(
|
||||
"Error creating new dataURI for RTMA data!", e);
|
||||
}
|
||||
}
|
||||
return new GridRecord[] { record };
|
||||
}
|
||||
|
|
|
@ -29,9 +29,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
|||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
||||
|
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 25, 2011 rgeorge Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 25, 2011 rgeorge Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -55,8 +53,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
* @version 1.0
|
||||
*/
|
||||
public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SixHrPrecipGridProcessor.class);
|
||||
|
||||
/** The number of seconds in 6 hours */
|
||||
protected static final int SECONDS_IN_6_HRS = 21600;
|
||||
|
@ -87,13 +83,11 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
|
|||
* grid
|
||||
* @param precipInventory
|
||||
* The current run accumulated grid inventory
|
||||
* @param precip6hrInventory
|
||||
* The current 6hr precipitation inventory
|
||||
* @return The generated 6hr precipitation grid
|
||||
* @throws GribException
|
||||
*/
|
||||
protected List<GridRecord> generate6hrPrecip(GridRecord record,
|
||||
List<GridRecord> precipInventory, List<Integer> precip6hrInventory)
|
||||
List<GridRecord> precipInventory)
|
||||
throws GribException {
|
||||
List<GridRecord> tp6hrRecords = new ArrayList<GridRecord>();
|
||||
int currentFcstTime = record.getDataTime().getFcstTime();
|
||||
|
@ -216,11 +210,5 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor
|
|||
// Reset the datauri since the datauri contains the DataTime
|
||||
record.setDataTime(newDataTime);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error constructing dataURI!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,9 +29,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
|||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.parameter.Parameter;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
||||
|
@ -44,10 +41,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 24, 2012 14299 M. Porricelli Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ------------- --------------------------
|
||||
* Jan 24, 2012 14299 M. Porricelli Initial creation
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,8 +54,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
*/
|
||||
public abstract class ThreeHrPrecipGridProcessor implements
|
||||
IDecoderPostProcessor {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ThreeHrPrecipGridProcessor.class);
|
||||
|
||||
/** The number of seconds in 3 hours */
|
||||
protected static final int SECONDS_IN_3_HRS = 10800;
|
||||
|
@ -88,13 +84,11 @@ public abstract class ThreeHrPrecipGridProcessor implements
|
|||
* grid
|
||||
* @param precipInventory
|
||||
* The current run accumulated grid inventory
|
||||
* @param precip3hrInventory
|
||||
* The current 3hr precipitation inventory
|
||||
* @return The generated 3hr precipitation grid
|
||||
* @throws GribException
|
||||
*/
|
||||
protected List<GridRecord> generate3hrPrecip(GridRecord record,
|
||||
List<GridRecord> precipInventory, List<Integer> precip3hrInventory)
|
||||
List<GridRecord> precipInventory)
|
||||
throws GribException {
|
||||
List<GridRecord> tp3hrRecords = new ArrayList<GridRecord>();
|
||||
int currentFcstTime = record.getDataTime().getFcstTime();
|
||||
|
@ -218,11 +212,5 @@ public abstract class ThreeHrPrecipGridProcessor implements
|
|||
// Reset the datauri since the datauri contains the DataTime
|
||||
record.setDataTime(newDataTime);
|
||||
record.setDataURI(null);
|
||||
try {
|
||||
record.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error constructing dataURI!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* Default sub grid center point. If latitude/longitude may be null. This would
|
||||
|
@ -35,9 +34,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 25, 2012 977 rjpeter Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jul 25, 2012 977 rjpeter Initial creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +46,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class DefaultSubGridCenterPoint implements ISerializableObject {
|
||||
public class DefaultSubGridCenterPoint {
|
||||
private Double centerLatitude;
|
||||
|
||||
private Double centerLongitude;
|
||||
|
|
|
@ -27,10 +27,6 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.opengis.metadata.spatial.PixelOrientation;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
|
@ -47,10 +43,12 @@ import com.raytheon.uf.common.gridcoverage.subgrid.SubGrid;
|
|||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
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.serialization.JAXBManager;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.awipstools.GetWfoCenterHandler;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
||||
|
@ -69,13 +67,13 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Mar 07, 2013 1771 bsteffen make subgridding deterministic.
|
||||
*
|
||||
* 1/4/13 DR 15653 M.Porricelli Shift subgrid domain
|
||||
* westward like AWIPSI
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ------------ --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Mar 07, 2013 1771 bsteffen make subgridding deterministic.
|
||||
* Jan 04, 2013 15653 M.Porricelli Shift subgrid domain westward like
|
||||
* AWIPSI
|
||||
* Oct 15, 2013 2473 bsteffen Rewrite deprecated code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,7 +83,17 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
public class GribSpatialCache {
|
||||
|
||||
/** The logger */
|
||||
protected transient Log logger = LogFactory.getLog(getClass());
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GribSpatialCache.class);
|
||||
|
||||
private static final SingleTypeJAXBManager<GridCoverage> GRID_COVERAGE_JAXB = SingleTypeJAXBManager
|
||||
.createWithoutException(GridCoverage.class);
|
||||
|
||||
private static final SingleTypeJAXBManager<SubGridDef> SUB_GRID_DEF_JAXB = SingleTypeJAXBManager
|
||||
.createWithoutException(SubGridDef.class);
|
||||
|
||||
private static final SingleTypeJAXBManager<DefaultSubGridCenterPoint> SUB_GRID_CENTER_JAXB = SingleTypeJAXBManager
|
||||
.createWithoutException(DefaultSubGridCenterPoint.class);
|
||||
|
||||
/** The singleton instance */
|
||||
private static GribSpatialCache instance;
|
||||
|
@ -285,7 +293,8 @@ public class GribSpatialCache {
|
|||
.getModelByName(subGridDef.getReferenceModel())
|
||||
.getGrid();
|
||||
if (referenceGrid == null) {
|
||||
logger.error("Failed to generate sub grid, Unable to determine coverage for referenceModel ["
|
||||
statusHandler
|
||||
.error("Failed to generate sub grid, Unable to determine coverage for referenceModel ["
|
||||
+ subGridDef.getReferenceModel() + "]");
|
||||
return false;
|
||||
}
|
||||
|
@ -294,7 +303,8 @@ public class GribSpatialCache {
|
|||
GridCoverage referenceCoverage = getGridByName(referenceGrid
|
||||
.toString());
|
||||
if (referenceCoverage == null) {
|
||||
logger.error("Failed to generate sub grid, Unable to determine coverage for referenceGrid ["
|
||||
statusHandler
|
||||
.error("Failed to generate sub grid, Unable to determine coverage for referenceGrid ["
|
||||
+ referenceGrid + "]");
|
||||
return false;
|
||||
}
|
||||
|
@ -365,7 +375,7 @@ public class GribSpatialCache {
|
|||
return trim(modelName, coverage, lowerLeftPosition,
|
||||
upperRightPosition);
|
||||
} catch (GridCoverageException e) {
|
||||
logger.error(
|
||||
statusHandler.error(
|
||||
"Failed to generate sub grid for world wide grid: "
|
||||
+ modelName, e);
|
||||
return false;
|
||||
|
@ -405,7 +415,7 @@ public class GribSpatialCache {
|
|||
try {
|
||||
subGridCoverage = insert(subGridCoverage);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
return false;
|
||||
}
|
||||
subGridCoverageMap.put(subGridKey(modelName, coverage),
|
||||
|
@ -429,8 +439,7 @@ public class GribSpatialCache {
|
|||
|
||||
if (f.length() > 0) {
|
||||
try {
|
||||
JAXBManager manager = new JAXBManager(SubGridDef.class);
|
||||
rval = (SubGridDef) manager.unmarshalFromXmlFile(f);
|
||||
rval = SUB_GRID_DEF_JAXB.unmarshalFromXmlFile(f);
|
||||
if ((rval.getReferenceModel() == null && rval
|
||||
.getReferenceGrid() == null)
|
||||
|| (rval.getModelNames() == null)
|
||||
|
@ -449,9 +458,8 @@ public class GribSpatialCache {
|
|||
}
|
||||
}
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Failed reading sub grid file: " + filePath, e);
|
||||
} catch (JAXBException e) {
|
||||
logger.error("Failed reading sub grid file: " + filePath, e);
|
||||
statusHandler.error(
|
||||
"Failed reading sub grid file: " + filePath, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -484,7 +492,7 @@ public class GribSpatialCache {
|
|||
}
|
||||
|
||||
private void initializeGrids(FileDataList fdl) {
|
||||
logger.info("Initializing grib grid coverages");
|
||||
statusHandler.info("Initializing grib grid coverages");
|
||||
long startTime = System.currentTimeMillis();
|
||||
ClusterTask ct = null;
|
||||
Map<Integer, Set<String>> gridNameMap = new HashMap<Integer, Set<String>>();
|
||||
|
@ -497,8 +505,8 @@ public class GribSpatialCache {
|
|||
try {
|
||||
for (FileData fd : fdl.getCoverageFileList()) {
|
||||
try {
|
||||
GridCoverage grid = (GridCoverage) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(fd.getFilePath());
|
||||
GridCoverage grid = GRID_COVERAGE_JAXB
|
||||
.unmarshalFromXmlFile(fd.getFilePath());
|
||||
String name = grid.getName();
|
||||
grid = insert(grid);
|
||||
spatialNameMap.put(name, grid);
|
||||
|
@ -510,7 +518,7 @@ public class GribSpatialCache {
|
|||
names.add(name);
|
||||
} catch (Exception e) {
|
||||
// Log error but do not throw exception
|
||||
logger.error(
|
||||
statusHandler.error(
|
||||
"Unable to read default grids file: "
|
||||
+ fd.getFilePath(), e);
|
||||
}
|
||||
|
@ -520,7 +528,8 @@ public class GribSpatialCache {
|
|||
try {
|
||||
defaultCenterPoint = getDefaultSubGridCenterPoint();
|
||||
} catch (Exception e) {
|
||||
logger.error(
|
||||
statusHandler
|
||||
.error(
|
||||
"Failed to generate sub grid definitions. Unable to lookup WFO Center Point",
|
||||
e);
|
||||
}
|
||||
|
@ -536,7 +545,7 @@ public class GribSpatialCache {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
// Log error but do not throw exception
|
||||
logger.error(
|
||||
statusHandler.error(
|
||||
"Unable to read default grids file: "
|
||||
+ fd.getFilePath(), e);
|
||||
}
|
||||
|
@ -551,7 +560,8 @@ public class GribSpatialCache {
|
|||
ClusterLockUtils.unlock(ct, false);
|
||||
}
|
||||
long endTime = System.currentTimeMillis();
|
||||
logger.info("Grib grid coverages initialized: " + (endTime - startTime)
|
||||
statusHandler.info("Grib grid coverages initialized: "
|
||||
+ (endTime - startTime)
|
||||
+ "ms");
|
||||
}
|
||||
|
||||
|
@ -587,30 +597,30 @@ public class GribSpatialCache {
|
|||
private Coordinate getDefaultSubGridCenterPoint() throws Exception {
|
||||
Coordinate defaultCenterPoint = null;
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
File defaultSubGridLocationFile = pm
|
||||
.getStaticFile("/grib/defaultSubGridCenterPoint.xml");
|
||||
LocalizationFile defaultSubGridLocationFile = pm
|
||||
.getStaticLocalizationFile("/grib/defaultSubGridCenterPoint.xml");
|
||||
if ((defaultSubGridLocationFile != null)
|
||||
&& defaultSubGridLocationFile.exists()) {
|
||||
try {
|
||||
// only used here, just create own manager
|
||||
JAXBManager mgr = new JAXBManager(
|
||||
DefaultSubGridCenterPoint.class);
|
||||
DefaultSubGridCenterPoint defaultSubGridLocation = (DefaultSubGridCenterPoint) mgr
|
||||
.unmarshalFromXmlFile(defaultSubGridLocationFile);
|
||||
DefaultSubGridCenterPoint defaultSubGridLocation = defaultSubGridLocationFile
|
||||
.jaxbUnmarshal(DefaultSubGridCenterPoint.class,
|
||||
SUB_GRID_CENTER_JAXB);
|
||||
if ((defaultSubGridLocation != null)
|
||||
&& (defaultSubGridLocation.getCenterLatitude() != null)
|
||||
&& (defaultSubGridLocation.getCenterLongitude() != null)) {
|
||||
defaultCenterPoint = new Coordinate(
|
||||
defaultSubGridLocation.getCenterLongitude(),
|
||||
defaultSubGridLocation.getCenterLatitude());
|
||||
logger.info("Default sub grid location is overriden as ["
|
||||
statusHandler
|
||||
.info("Default sub grid location is overriden as ["
|
||||
+ defaultCenterPoint.y + "/" + defaultCenterPoint.x
|
||||
+ "]");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(
|
||||
statusHandler.error(
|
||||
"Unable to load default sub grid location from file: "
|
||||
+ defaultSubGridLocationFile.getAbsolutePath(),
|
||||
+ defaultSubGridLocationFile.getFile()
|
||||
.getAbsolutePath(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
@ -621,7 +631,8 @@ public class GribSpatialCache {
|
|||
GetWfoCenterPoint centerPointRequest = new GetWfoCenterPoint(wfo);
|
||||
defaultCenterPoint = new GetWfoCenterHandler()
|
||||
.handleRequest(centerPointRequest);
|
||||
logger.info("Default sub grid location is wfo center point ["
|
||||
statusHandler
|
||||
.info("Default sub grid location is wfo center point ["
|
||||
+ defaultCenterPoint.y + "/" + defaultCenterPoint.x + "]");
|
||||
/* If we are getting the WFO center as the center point, it means that
|
||||
// the site has not defined its own center in the site file
|
||||
|
|
|
@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlList;
|
|||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* A sub grid definition
|
||||
|
@ -36,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 25, 2010 rjpeter Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jun 25, 2010 rjpeter Initial creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SubGridDef implements ISerializableObject {
|
||||
public class SubGridDef {
|
||||
/** The model names this sub grid applies to */
|
||||
@XmlElement(required = true)
|
||||
@XmlList
|
||||
|
|
|
@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -37,9 +36,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class GenProcess implements ISerializableObject {
|
||||
public class GenProcess {
|
||||
|
||||
/**
|
||||
* A generated identification number to uniquely identify this generating
|
||||
|
|
|
@ -27,7 +27,6 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/9/10 4758 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 09, 2010 4758 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@XmlRootElement
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class Grib1Parameter implements ISerializableObject {
|
||||
public class Grib1Parameter {
|
||||
|
||||
/** The id assigned from the hashcode of this object */
|
||||
private int id;
|
||||
|
|
|
@ -30,8 +30,10 @@ import org.apache.commons.logging.LogFactory;
|
|||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
|
||||
/**
|
||||
* Utility class for looking up Grib 1 Parameters
|
||||
|
@ -40,9 +42,10 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/9/10 4758 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 09, 2010 4758 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -117,23 +120,25 @@ public class Grib1ParameterLookup {
|
|||
LocalizationContext commonStaticSite = pathManager.getContext(
|
||||
LocalizationContext.LocalizationType.COMMON_STATIC,
|
||||
LocalizationContext.LocalizationLevel.SITE);
|
||||
File baseParameterFile = pathManager.getFile(commonStaticBase,
|
||||
grib1ParamPath);
|
||||
File siteParameterFile = pathManager.getFile(commonStaticSite,
|
||||
grib1ParamPath);
|
||||
LocalizationFile baseParameterFile = pathManager.getLocalizationFile(
|
||||
commonStaticBase, grib1ParamPath);
|
||||
LocalizationFile siteParameterFile = pathManager.getLocalizationFile(
|
||||
commonStaticSite, grib1ParamPath);
|
||||
|
||||
try {
|
||||
JAXBManager jaxbManager = new SingleTypeJAXBManager<Grib1ParameterSet>(
|
||||
Grib1ParameterSet.class);
|
||||
if (baseParameterFile.exists()) {
|
||||
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(baseParameterFile);
|
||||
Grib1ParameterSet parameterSet = baseParameterFile
|
||||
.jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
|
||||
for (Grib1Parameter param : parameterSet.getParameters()) {
|
||||
parameterMap.put(getGrib1Hash(param), param);
|
||||
param.generateId();
|
||||
}
|
||||
}
|
||||
if (siteParameterFile.exists()) {
|
||||
Grib1ParameterSet parameterSet = (Grib1ParameterSet) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(siteParameterFile);
|
||||
Grib1ParameterSet parameterSet = siteParameterFile
|
||||
.jaxbUnmarshal(Grib1ParameterSet.class, jaxbManager);
|
||||
for (Grib1Parameter param : parameterSet.getParameters()) {
|
||||
parameterMap.put(getGrib1Hash(param), param);
|
||||
param.generateId();
|
||||
|
|
|
@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* The class used for unmarshalling the grib1 parameter conversion XML file.
|
||||
* grib1ParameterConvTable.xml
|
||||
|
@ -38,9 +36,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/9/10 4758 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 09, 2010 4758 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,7 +48,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement(name = "grib1ParameterSet")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class Grib1ParameterSet implements ISerializableObject {
|
||||
public class Grib1ParameterSet {
|
||||
|
||||
/** The unmarshalled grib 1 parameters */
|
||||
@XmlElements( { @XmlElement(name = "grib1Parameter", type = Grib1Parameter.class) })
|
||||
|
|
|
@ -27,7 +27,6 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -38,9 +37,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class GribLevel implements ISerializableObject {
|
||||
public class GribLevel {
|
||||
|
||||
/** The id generated from the hashcode of this object */
|
||||
private int id;
|
||||
|
|
|
@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -36,9 +35,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,7 +48,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class GribParameter implements ISerializableObject {
|
||||
public class GribParameter {
|
||||
|
||||
/** No subcenter id number */
|
||||
public static final int NO_SUBCENTER = -1;
|
||||
|
|
|
@ -27,10 +27,26 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contains the grib fields that map to a specific grid dataset.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
* @see GribModelLookup
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class GridModel implements ISerializableObject {
|
||||
public class GridModel {
|
||||
|
||||
/** The title of the model */
|
||||
@XmlElement
|
||||
|
|
|
@ -28,11 +28,26 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* A JAXBable set of {@link GridModel}s.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlRootElement(name = "gribModelSet")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class GridModelSet implements ISerializableObject {
|
||||
public class GridModelSet {
|
||||
|
||||
/**
|
||||
* List of models for/from the XML.
|
||||
|
|
|
@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* Container class defining composite models.
|
||||
*
|
||||
|
@ -37,9 +35,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/09/10 4638 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 09, 2010 4638 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,7 +47,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement(name = "compositeModel")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class CompositeModel implements ISerializableObject {
|
||||
public class CompositeModel {
|
||||
|
||||
/** The composite model name */
|
||||
@XmlElement
|
||||
|
|
|
@ -23,24 +23,28 @@ package com.raytheon.edex.util.grib;
|
|||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
|
||||
/**
|
||||
* Contains a map grib 1 table aliases
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/19/10 #4634 bphillip Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 19, 2010 4634 bphillip Initial creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -49,12 +53,12 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "gribTableMap")
|
||||
public class Grib1TableMap implements ISerializableObject {
|
||||
public class Grib1TableMap {
|
||||
private HashMap<String, String> map = new HashMap<String, String>();
|
||||
|
||||
private static Grib1TableMap instance;
|
||||
|
||||
public static synchronized Grib1TableMap getInstance() {
|
||||
public static synchronized Grib1TableMap getInstance() throws GribException {
|
||||
if (instance == null) {
|
||||
initInstance();
|
||||
}
|
||||
|
@ -64,26 +68,24 @@ public class Grib1TableMap implements ISerializableObject {
|
|||
private Grib1TableMap() {
|
||||
}
|
||||
|
||||
private static void initInstance() {
|
||||
private static void initInstance() throws GribException {
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext commonStaticBase = pathMgr.getContext(
|
||||
LocalizationContext.LocalizationType.COMMON_STATIC,
|
||||
LocalizationContext.LocalizationLevel.BASE);
|
||||
|
||||
String path = "";
|
||||
try {
|
||||
path = pathMgr.getFile(commonStaticBase,
|
||||
"grid" + File.separator + "grib1ParamTableMap.xml")
|
||||
.getCanonicalPath();
|
||||
|
||||
File tableFile = new File(path);
|
||||
|
||||
LocalizationFile tableFile = pathMgr.getLocalizationFile(
|
||||
commonStaticBase, "grid" + File.separator
|
||||
+ "grib1ParamTableMap.xml");
|
||||
if (tableFile.exists()) {
|
||||
instance = (Grib1TableMap) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(tableFile.getPath());
|
||||
instance = tableFile.jaxbUnmarshal(Grib1TableMap.class,
|
||||
new JAXBManager(Grib1TableMap.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (LocalizationException e) {
|
||||
throw new GribException("Unable to load table map from file.", e);
|
||||
} catch (JAXBException e) {
|
||||
throw new GribException("Unable to load table map from file.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,9 +44,10 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/15/10 4553 bphillip Initial Creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 15, 2010 4553 bphillip Initial Creation
|
||||
* Oct 15, 2013 2473 bsteffen Remove e.printStackTrace()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,8 +72,10 @@ public class GribParamTranslator {
|
|||
* Gets the singleton instance
|
||||
*
|
||||
* @return The singleton instance
|
||||
* @throws GribException
|
||||
*/
|
||||
public static synchronized GribParamTranslator getInstance() {
|
||||
public static synchronized GribParamTranslator getInstance()
|
||||
throws GribException {
|
||||
if (instance == null) {
|
||||
instance = new GribParamTranslator();
|
||||
}
|
||||
|
@ -81,25 +84,13 @@ public class GribParamTranslator {
|
|||
|
||||
/**
|
||||
* Creates the singleton instance
|
||||
*
|
||||
* @throws GribException
|
||||
*/
|
||||
private GribParamTranslator() {
|
||||
try {
|
||||
initGrib1Lookup();
|
||||
} catch (GribException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
initGrib2Lookup();
|
||||
} catch (GribException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
initParameterAliases();
|
||||
} catch (GribException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
private GribParamTranslator() throws GribException {
|
||||
initGrib1Lookup();
|
||||
initGrib2Lookup();
|
||||
initParameterAliases();
|
||||
}
|
||||
|
||||
public void getParameterNameAlias(String modelName, Parameter parameter) {
|
||||
|
|
|
@ -29,9 +29,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.plugin.grib.exception.GribException;
|
||||
import com.raytheon.edex.plugin.grib.util.GenProcess;
|
||||
import com.raytheon.edex.plugin.grib.util.Grib1Parameter;
|
||||
|
@ -44,6 +41,8 @@ import com.raytheon.uf.common.localization.IPathManager;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.common.util.file.FilenameFilters;
|
||||
|
||||
|
@ -54,10 +53,11 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
|
||||
* Oct 15, 2013 2473 bsteffen Switch logging to use UFStatus
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,7 +67,8 @@ import com.raytheon.uf.common.util.file.FilenameFilters;
|
|||
public class GribTableLookup {
|
||||
|
||||
/** The logger */
|
||||
protected transient Log logger = LogFactory.getLog(getClass());
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GribTableLookup.class);
|
||||
|
||||
/** No center number */
|
||||
private static final int NO_CENTER = -1;
|
||||
|
@ -250,7 +251,7 @@ public class GribTableLookup {
|
|||
try {
|
||||
createTable(table, center, subcenter, tableName);
|
||||
} catch (GribException e) {
|
||||
logger.error("Unable to create table: "
|
||||
statusHandler.error("Unable to create table: "
|
||||
+ tableName + " for Center: " + center
|
||||
+ " Subcenter: " + subcenter);
|
||||
continue;
|
||||
|
@ -380,7 +381,7 @@ public class GribTableLookup {
|
|||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to close file: " + file, e);
|
||||
statusHandler.error("Unable to close file: " + file, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.registry.annotations.RegistryObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Oct 2, 2013 1797 dhladky Generics start
|
||||
* Oct 11, 2013 2460 dhladky Restored Adhoc's to registryObject store, WFO only
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -54,6 +56,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
@XmlRootElement(name = "AdhocSubscription")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
@RegistryObject({ Subscription.PROVIDER_NAME_SLOT, Subscription.NAME_SLOT,
|
||||
Subscription.DATA_SET_SLOT, Subscription.OWNER_SLOT })
|
||||
public class AdhocSubscription<T extends Time, C extends Coverage> extends SiteSubscription<T, C> {
|
||||
|
||||
private static final long serialVersionUID = -2200080380095632486L;
|
||||
|
|
|
@ -33,6 +33,7 @@ import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
|||
* Oct 5, 2012 0726 djohnson Initial creation
|
||||
* Dec 11, 2012 1403 djohnson Adhoc subscriptions no longer go to the registry.
|
||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||
* Oct 11, 2013 2460 dhladky Restored Adhoc to registry store, WFO only.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -55,6 +56,9 @@ public final class DataDeliveryRegistryObjectTypes {
|
|||
|
||||
public static final String SHARED_SUBSCRIPTION = RegistryUtil
|
||||
.getObjectType(SharedSubscription.class);
|
||||
|
||||
public static final String ADHOC_SUBSCRIPTION = RegistryUtil
|
||||
.getObjectType(AdhocSubscription.class);
|
||||
|
||||
public static final String DATASET = RegistryUtil
|
||||
.getObjectType(DataSet.class);
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
/**
|
||||
* 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.datadelivery.registry.handlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.AdhocSubscriptionQuery;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.SubscriptionFilterableQuery;
|
||||
|
||||
import com.raytheon.uf.common.registry.RegistryQueryResponse;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
||||
/**
|
||||
* {@link IRegistryObjectHandler} implementation for {@link AdhocSubscription}.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 05, 2012 1241 djohnson Initial creation.
|
||||
* Oct 12, 2013 2460 dhladky restored.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AdhocSubscriptionHandler extends
|
||||
BaseSubscriptionHandler<AdhocSubscription, AdhocSubscriptionQuery>
|
||||
implements IAdhocSubscriptionHandler {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
@Override
|
||||
|
||||
protected AdhocSubscriptionQuery getQuery() {
|
||||
return new AdhocSubscriptionQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
* {@inheritDoc}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
|
||||
protected Class<AdhocSubscription> getRegistryObjectClass() {
|
||||
return AdhocSubscription.class;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -34,6 +34,7 @@ import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 3, 2012 1241 djohnson Initial creation
|
||||
* Dec 11, 2012 1403 djohnson Adhoc subscriptions no longer go to the registry.
|
||||
* Oct 12, 2013 2046 dhladky Restored Adhoc's at WFO level
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -137,4 +138,15 @@ public final class DataDeliveryHandlers {
|
|||
public static IDataSetHandler getDataSetHandler() {
|
||||
return RegistryObjectHandlers.get(IDataSetHandler.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the {@link IAdhocSubscriptionHandler}.
|
||||
*
|
||||
* @return the handler
|
||||
*/
|
||||
|
||||
public static IAdhocSubscriptionHandler getAdhocSubscriptionHandler() {
|
||||
return RegistryObjectHandlers.get(IAdhocSubscriptionHandler.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* 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.datadelivery.registry.handlers;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
* The {@link IRegistryObjectHandler} interface for {@link AdhocSubscription}s.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 05, 2012 1241 djohnson Initial creation
|
||||
* Oct 12, 2013 2460 dhladky restored.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IAdhocSubscriptionHandler extends
|
||||
IBaseSubscriptionHandler<AdhocSubscription> {
|
||||
}
|
|
@ -38,6 +38,7 @@ import javax.persistence.Transient;
|
|||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
@ -66,14 +67,16 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Sep 07, 2012 1102 djohnson Add missing JAXB annotations.
|
||||
* Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling.
|
||||
* Nov 02, 2012 1302 djohnson Remove commented out code.
|
||||
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
|
||||
* spatial
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Apr 07, 2009 1994 bphillip Initial Creation
|
||||
* Sep 07, 2012 1102 djohnson Add missing JAXB annotations.
|
||||
* Sep 10, 2012 15270 D. Friedman Fix subgrid model name handling.
|
||||
* Nov 02, 2012 1302 djohnson Remove commented out code.
|
||||
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
|
||||
* spatial
|
||||
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
|
||||
* context.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,6 +88,9 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||
@SequenceGenerator(name = "GRIDCOVERAGE_GENERATOR", sequenceName = "gridcoverage_seq", allocationSize = 1)
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlSeeAlso({ LambertConformalGridCoverage.class, LatLonGridCoverage.class,
|
||||
MercatorGridCoverage.class, PolarStereoGridCoverage.class,
|
||||
StereographicGridCoverage.class })
|
||||
@DynamicSerialize
|
||||
public abstract class GridCoverage extends PersistableDataObject<Integer>
|
||||
implements ISpatialObject {
|
||||
|
|
|
@ -44,6 +44,7 @@ Export-Package: com.raytheon.uf.edex.datadelivery.retrieval;
|
|||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.datadelivery.registry",
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.adapters;uses:="com.raytheon.uf.edex.datadelivery.retrieval.interfaces,com.raytheon.uf.common.datadelivery.retrieval.xml,com.raytheon.uf.edex.datadelivery.retrieval.response",
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.adhoc,
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.db;uses:="com.raytheon.uf.common.dataplugin.persist,com.raytheon.uf.edex.database.dao,com.raytheon.uf.common.serialization",
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.handlers;uses:="com.raytheon.uf.edex.datadelivery.retrieval.interfaces,com.raytheon.uf.common.datadelivery.retrieval.xml,com.raytheon.uf.edex.datadelivery.retrieval.db",
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.interfaces;
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<!-- Cleans up old Adhoc subscriptions in the registry when the data for
|
||||
them expires This only runs within the WFO registry mode (Adhoc subscriptions
|
||||
are only allowed there) -->
|
||||
|
||||
<bean id="AdhocSubscriptionCleaner"
|
||||
class="com.raytheon.uf.edex.datadelivery.retrieval.adhoc.AdhocSubscriptionCleaner" />
|
||||
|
||||
<camelContext id="adhocsubscription-cleanup" xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler">
|
||||
<endpoint id="processAdhocSubscriptions"
|
||||
uri="clusteredquartz://registry/processAdhocSubscriptions/?cron=${adhocsubscription-process.cron}" />
|
||||
<route id="processSubscriptionsFromQuartz">
|
||||
<from uri="processAdhocSubscriptions" />
|
||||
<bean ref="AdhocSubscriptionCleaner" method="processSubscriptions" />
|
||||
</route>
|
||||
</camelContext>
|
||||
</beans>
|
|
@ -0,0 +1,188 @@
|
|||
package com.raytheon.uf.edex.datadelivery.retrieval.adhoc;
|
||||
|
||||
/**
|
||||
* 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 java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ProviderType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IAdhocSubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IProviderHandler;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
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.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
||||
import com.raytheon.uf.edex.database.purge.PurgeRule;
|
||||
import com.raytheon.uf.edex.database.purge.PurgeRuleSet;
|
||||
|
||||
/**
|
||||
* Dumps expired Adhoc Subscriptions based on diff between end and expiration
|
||||
* time in purge rules.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 11, 2013 2460 dhladky Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AdhocSubscriptionCleaner {
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AdhocSubscriptionCleaner.class);
|
||||
|
||||
public AdhocSubscriptionCleaner() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans old adhoc subscriptions from the WFO registry.
|
||||
* Compares the end() time on the sub to the expiration period in
|
||||
* associated purge rules derived from the plugin each subs data
|
||||
* is stored too. Runs on every 20 minutes.
|
||||
*/
|
||||
public void processSubscriptions() {
|
||||
|
||||
statusHandler.handle(Priority.INFO, "Processing Adhoc Subscriptions for expiration...");
|
||||
List<AdhocSubscription> adhocs = null;
|
||||
final IAdhocSubscriptionHandler adhocSubHandler = DataDeliveryHandlers.getAdhocSubscriptionHandler();
|
||||
|
||||
try {
|
||||
adhocs = adhocSubHandler.getAll();
|
||||
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.ERROR, "Can't load list of adhoc subscriptions from registry!", e);
|
||||
}
|
||||
|
||||
if (adhocs != null && !adhocs.isEmpty()) {
|
||||
|
||||
Map<String, Provider> providers = new HashMap<String, Provider>();
|
||||
Map<String, PurgeRuleSet> purgeRules = new HashMap<String, PurgeRuleSet>();
|
||||
List<AdhocSubscription> subsToDelete = new ArrayList<AdhocSubscription>();
|
||||
|
||||
// loop over the adhoc subscriptions we have
|
||||
for (AdhocSubscription adhoc: adhocs) {
|
||||
|
||||
String providerName = adhoc.getProvider();
|
||||
Provider provider = null;
|
||||
|
||||
// speed, only has to lookup each provider once
|
||||
if (!providers.containsKey(providerName)) {
|
||||
|
||||
final IProviderHandler providerHandler = DataDeliveryHandlers.getProviderHandler();
|
||||
|
||||
try {
|
||||
provider = providerHandler.getByName(providerName);
|
||||
providers.put(providerName, provider);
|
||||
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.ERROR, "Can't load provider from registry! "+providerName, e);
|
||||
}
|
||||
} else {
|
||||
// pull a cached provider
|
||||
if (providerName != null) {
|
||||
provider = providers.get(providerName);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> plugins = new ArrayList<String>();
|
||||
|
||||
if (provider != null) {
|
||||
// find the actual plugin
|
||||
for (ProviderType type : provider.getProviderType()) {
|
||||
plugins.add(type.getPlugin());
|
||||
}
|
||||
}
|
||||
|
||||
// extract the purge rules from localization, place in map for speed
|
||||
PurgeRuleSet purgeRuleSet = null;
|
||||
|
||||
if (plugins != null && !plugins.isEmpty()) {
|
||||
// multiple plugins for providers on occasion
|
||||
for (String plugin : plugins) {
|
||||
|
||||
if (!purgeRules.containsKey(plugin)) {
|
||||
|
||||
purgeRuleSet = PluginDao
|
||||
.getPurgeRulesForPlugin(plugin);
|
||||
purgeRules.put(plugin, purgeRuleSet);
|
||||
|
||||
} else {
|
||||
// pull a cached purgeRuleSet
|
||||
if (plugin != null) {
|
||||
purgeRuleSet = purgeRules.get(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
if (purgeRuleSet != null) {
|
||||
|
||||
List<PurgeRule> rules = purgeRuleSet.getRules();
|
||||
|
||||
// Go over all of the purge rules for each sub
|
||||
for (PurgeRule rule: rules) {
|
||||
// use current system date/time
|
||||
long timeCheck = TimeUtil.newDate().getTime();
|
||||
Date expireDate = new Date(timeCheck + rule.getPeriodInMillis());
|
||||
|
||||
// check rule against creation time of this sub
|
||||
if (adhoc.getTime().getEnd().before(expireDate)) {
|
||||
if (!subsToDelete.contains(adhoc)) {
|
||||
subsToDelete.add(adhoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get rid of old subscriptions
|
||||
if (subsToDelete != null && !subsToDelete.isEmpty()) {
|
||||
|
||||
try {
|
||||
adhocSubHandler.delete(subsToDelete);
|
||||
statusHandler.handle(Priority.INFO, "Deleted "
|
||||
+ subsToDelete.size()
|
||||
+ " expired adhocSubscriptions.");
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Failed to delete expired adhoc subscriptions.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -82,5 +82,9 @@
|
|||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
|
||||
<bean name="AdhocSubscriptionHandler"
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.AdhocSubscriptionHandler">
|
||||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -57,12 +57,17 @@
|
|||
<constructor-arg ref="DataSetHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="registerAdhocSubscriptionHandler" factory-bean="registryObjectHandlerRegistry" factory-method="registerHandler">
|
||||
<constructor-arg value="com.raytheon.uf.common.datadelivery.registry.handlers.IAdhocSubscriptionHandler" />
|
||||
<constructor-arg ref="AdhocSubscriptionHandler" />
|
||||
</bean>
|
||||
|
||||
<!-- Used to consolidate the dependency clauses of beans that rely upon data delivery registry handlers -->
|
||||
<bean id="registerDataDeliveryHandlers" class="java.lang.String"
|
||||
depends-on="registerSubscriptionHandler,registerPendingSubscriptionHandler,
|
||||
registerGroupDefinitionHandler,
|
||||
registerProviderHandler,registerDataSetNameHandler,registerParameterHandler,
|
||||
registerParameterLevelHandler,registerDataSetMetaDataHandler,
|
||||
registerGriddedDataSetMetaDataHandler,registerDataSetHandler" />
|
||||
registerGriddedDataSetMetaDataHandler,registerDataSetHandler, registerAdhocSubscriptionHandler" />
|
||||
|
||||
</beans>
|
|
@ -2,6 +2,8 @@
|
|||
ebxml-subscription-process.cron=0+0/1+*+*+*+?
|
||||
# The period which the registry runs the garbage collection
|
||||
ebxml-garbage-collect-process.cron=0/10+*+*+*+*+?
|
||||
# The period which adhoc subscriptions are cleaned, every 20 mins
|
||||
adhocsubscription-process.cron=0+0/20+*+*+*+?
|
||||
# When a federation synchonization is necessary, this is the number of threads
|
||||
# that will be used for synchronization
|
||||
ebxml-federation-sync-threads=3
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<camelContext id="ncgrib-file-endpoint" xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler"
|
||||
autoStartup=false>
|
||||
autoStartup="false">
|
||||
|
||||
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&idempotent=false" />
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue