Issue #2485 Remove ncccfp

Change-Id: Ida05b2c7e1a3541603822b8b91bb635f9af3fa64

Former-commit-id: 3273b6fc5f [formerly 4639cd69f4] [formerly 5b53cb4c98] [formerly 3273b6fc5f [formerly 4639cd69f4] [formerly 5b53cb4c98] [formerly 1d35086e8d [formerly 5b53cb4c98 [formerly 619f054e44fe9689d178e9aa6fd6455915d7e99e]]]]
Former-commit-id: 1d35086e8d
Former-commit-id: 41a54ad666 [formerly b64221f27b] [formerly 5548cad8f6d7873bdd2beafefec42e2d00821e99 [formerly 8aefe5ff02]]
Former-commit-id: ba475ead914b07016d89a22aaa936b7307336535 [formerly a97ec9b8e5]
Former-commit-id: 5cf9a6ed01
This commit is contained in:
Ben Steffensmeier 2013-11-05 17:23:49 -06:00
parent f03196cb13
commit 74a25404a0
27 changed files with 11 additions and 1312 deletions

View file

@ -121,13 +121,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.ncccfp"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.ncscat"
download-size="0"

View file

@ -0,0 +1,11 @@
#!/bin/bash
# DR #2485 remove ncccfp from the database
PSQL="/awips2/psql/bin/psql"
SQL_COMMAND="
delete from plugin_info where name = 'ncccfp';
drop table if exists ncccfp;
drop sequence if exists ncccfpseq;
"
${PSQL} -U awips -d metadata -c "${SQL_COMMAND}"

View file

@ -88,7 +88,6 @@
<includeMode>excludeDpaAndOgc</includeMode>
<!-- ncep excludes until tested -->
<exclude>aww-ingest.xml</exclude>
<exclude>ncccfp-ingest.xml</exclude>
<exclude>ncep-util-on-edex-ingest</exclude>
<exclude>ncep-util-on-edex-ingestGrib</exclude>
<exclude>ncscd-ingest.xml</exclude>

View file

@ -73,13 +73,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.ncccfp"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.ncscat"
download-size="0"
@ -185,13 +178,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.edex.plugin.ncccfp"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.edex.plugin.ncgrib"
download-size="0"

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gov.noaa.nws.ncep.common.dataplugin.ncccfp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,7 +0,0 @@
#Wed May 26 11:01:26 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,16 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ncccfp Plug-in
Bundle-SymbolicName: gov.noaa.nws.ncep.common.dataplugin.ncccfp
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: NOAA/NWS/NCEP/NCO/SIB
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.31",
javax.persistence;bundle-version="1.0.0",
gov.noaa.nws.ncep.common;bundle-version="1.0.0"
Import-Package: com.vividsolutions.jts.geom,
gov.noaa.nws.ncep.edex.common.dao,
org.opengis.referencing.crs
Export-Package: gov.noaa.nws.ncep.common.dataplugin.ncccfp,
gov.noaa.nws.ncep.common.dataplugin.ncccfp.dao

View file

@ -1 +0,0 @@
gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpRecord

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,117 +0,0 @@
package gov.noaa.nws.ncep.common.dataplugin.ncccfp;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.hibernate.annotations.Type;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.raytheon.uf.common.serialization.adapters.GeometryAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry;
/**
*
* NCCCFP Location
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 10/05/09 155 F. J. Yen From Raytheon's CCFP; mod for NCCCFP. Fix for LINESTRING:
* Change type of geometry from Polygon to Geometry.
* 12/14/09 155 F. J. Yen Updated from to11d3 to to11d6 (changed import of
* IspatialObject package to ...geospatial.ISpatialObject)
* 05/26/10 155 F. J. Yen Refactored from plugin for migration to to11dr11
* 07/16/13 2181 bsteffen Convert geometry types to use hibernate-spatial
*
* </pre>
*
* @author fjyen
* @version 1
*/
@Embeddable
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class NcccfpLocation implements ISpatialObject {
private static final long serialVersionUID = 8890315829188793187L;
@DataURI(position=0)
@Column(name = "location")
@Type(type = "org.hibernatespatial.GeometryUserType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Geometry geometry;
@Column(length=600)
@DynamicSerializeElement
@XmlElement
private String locationAll;
@Column
@DynamicSerializeElement
@XmlElement
private double boxLat;
@Column
@DynamicSerializeElement
@XmlElement
private double boxLong;
@Override
public CoordinateReferenceSystem getCrs() {
return null;
}
@Override
public Geometry getGeometry() {
return geometry;
}
@Override
public Integer getNx() {
return 0;
}
@Override
public Integer getNy() {
return 0;
}
public double getBoxLat() {
return boxLat;
}
public void setBoxLat(double boxLat) {
this.boxLat = boxLat;
}
public double getBoxLong() {
return boxLong;
}
public void setBoxLong(double boxLong) {
this.boxLong = boxLong;
}
public void setGeometry(Geometry geometry) {
this.geometry = geometry;
}
public void setLocationAll (String locationAll) {
this.locationAll = locationAll;
}
public String getLocationAll () {
return locationAll;
}
}

View file

@ -1,347 +0,0 @@
package gov.noaa.nws.ncep.common.dataplugin.ncccfp;
import java.util.Calendar;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
*
* NC_CCFP Record
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ -------- ----------- --------------------------
* Oct 05, 2009 155 F. J. Yen From Raytheon's CCFP; mod for NC_CCFP
* May 26, 2010 155 F. J. Yen Refactored to dataplugin for
* migration to to11dr11
* Apr 04, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 07, 2013 1869 bsteffen Remove dataURI column from
* PluginDataObject.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* </pre>
*
* @author F. J. Yen
* @version 1
*/
@Entity
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ncccfpseq")
@Table(name = "ncccfp", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
/*
* Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used.
*/
@org.hibernate.annotations.Table(appliesTo = "ncccfp", indexes = { @Index(name = "ncccfp_refTimeIndex", columnNames = {
"refTime", "forecastTime" }) })
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled {
private static final long serialVersionUID = 1L;
@DataURI(position = 2)
@Column
@XmlAttribute
@DynamicSerializeElement
private Calendar issuetime;
@DataURI(position = 1)
@Column
@XmlAttribute
@DynamicSerializeElement
private Calendar validtime;
@Column(length = 8)
@XmlAttribute
@DynamicSerializeElement
private String producttype;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer coverage;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer conf;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer growth;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer tops;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer speed;
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer direction;
@DataURI(position = 3)
@Column
@XmlAttribute
@DynamicSerializeElement
private Integer numPts;
@Column
@DynamicSerializeElement
@XmlElement
private Boolean canadaflag;
/*
* locationUri contains up to the first seven coordinates. This is for
* making the dataURI unique. (It was suggested that it was highly unlikely
* that 7 coordinates would not be unique enough. The number of coordinates
* was reduced due to the limited length of the string dataURI)
*/
@DataURI(position = 4)
@Column(length = 150)
@XmlElement
@DynamicSerializeElement
private String locationUri;
private NcccfpLocation location;
/**
* Default Constructor
*/
public NcccfpRecord() {
}
// /**
// * Constructor.
// *
// * @param message
// * The text of the message
// */
// public NcccfpRecord(String message) {
// super(message);
// }
/**
* Constructs an ncccfp record from a dataURI
*
* @param uri
* The dataURI
* @param tableDef
* The table definition associated with this class
*/
public NcccfpRecord(String uri) {
super(uri);
}
@Override
public IDecoderGettable getDecoderGettable() {
// TODO Auto-generated method stub
return null;
}
public java.util.Calendar getIssuetime() {
return issuetime;
}
public void setIssuetime(java.util.Calendar issuetime) {
this.issuetime = issuetime;
}
public java.util.Calendar getValidtime() {
return validtime;
}
public void setValidtime(java.util.Calendar validtime) {
this.validtime = validtime;
}
public java.lang.String getProducttype() {
return producttype;
}
public void setProducttype(java.lang.String producttype) {
this.producttype = producttype;
}
public double getBoxLat() {
return location.getBoxLat();
}
public double getBoxLong() {
return location.getBoxLong();
}
public Boolean getCanadaflag() {
return canadaflag;
}
public void setCanadaflag(Boolean canadaflag) {
this.canadaflag = canadaflag;
}
/**
* @return the coverage
*/
public Integer getCoverage() {
return coverage;
}
/**
* @param coverage
* the coverage to set
*/
public void setCoverage(Integer coverage) {
this.coverage = coverage;
}
/**
* @return the conf
*/
public Integer getConf() {
return conf;
}
/**
* @param conf
* the conf to set
*/
public void setConf(Integer conf) {
this.conf = conf;
}
/**
* @return the growth
*/
public Integer getGrowth() {
return growth;
}
/**
* @param growth
* the growth to set
*/
public void setGrowth(Integer growth) {
this.growth = growth;
}
/**
* @return the tops
*/
public Integer getTops() {
return tops;
}
/**
* @param tops
* the tops to set
*/
public void setTops(Integer tops) {
this.tops = tops;
}
/**
* @return the speed
*/
public Integer getSpeed() {
return speed;
}
/**
* @param speed
* the speed to set
*/
public void setSpeed(Integer speed) {
this.speed = speed;
}
/**
* @return the direction
*/
public Integer getDirection() {
return direction;
}
/**
* @param direction
* the direction to set
*/
public void setDirection(Integer direction) {
this.direction = direction;
}
/**
* @return the number of points
*/
public Integer getNumPts() {
return numPts;
}
/**
* @param numPts
* the number of points
*/
public void setNumPts(Integer numPts) {
this.numPts = numPts;
}
@Override
public NcccfpLocation getSpatialObject() {
return location;
}
public String getLocationUri() {
return locationUri;
}
public void setLocationUri(String locationUri) {
this.locationUri = locationUri;
}
public NcccfpLocation getLocation() {
return location;
}
public void setLocation(NcccfpLocation location) {
this.location = location;
}
@Override
@Column
@Access(AccessType.PROPERTY)
public String getDataURI() {
return super.getDataURI();
}
@Override
public String getPluginName() {
return "ncccfp";
}
}

View file

@ -1,75 +0,0 @@
/**
* Set of DAO methods for NCCCFP data.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ----------- ----------- --------------------------
* 26/05/10 155 F. J. Yen Initial Coding for to11dr11 (Following one of RTN's DAO to refactor)
* </pre>
*
* @author fjyen
* @version 1.0
**/
package gov.noaa.nws.ncep.common.dataplugin.ncccfp.dao;
import java.util.List;
import gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpRecord;
import gov.noaa.nws.ncep.edex.common.dao.NcepDefaultPluginDao;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.edex.database.DataAccessLayerException;
public class NcccfpDao extends NcepDefaultPluginDao {
/**
* Creates a new ReccoDao
* @throws PluginException
*/
public NcccfpDao(String pluginName) throws PluginException {
super(pluginName);
}
/**
* Retrieves a NCCCFP report using the datauri .
*
* @param dataURI
* The dataURI to match against.
* @return The report record if it exists.
*/
public NcccfpRecord queryByDataURI(String dataURI) {
NcccfpRecord report = null;
List<?> obs = null;
try {
obs = queryBySingleCriteria("dataURI", dataURI);
} catch (DataAccessLayerException e) {
e.printStackTrace();
}
if((obs != null)&&(obs.size() > 0)) {
report = (NcccfpRecord) obs.get(0);
}
return report;
}
/**
* Queries for to determine if a given data uri exists on the NCCCFP table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
String sql = "select datauri from awips.ncccfp where datauri='"
+ dataUri + "';";
Object[] results = executeSQLQuery(sql);
return results;
}
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gov.noaa.nws.ncep.edex.plugin.ncccfp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,7 +0,0 @@
#Thu Mar 26 10:17:30 CDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,18 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Nc_ccfp Plug-in
Bundle-SymbolicName: gov.noaa.nws.ncep.edex.plugin.ncccfp
Bundle-Version: 1.11.7.qualifier
Bundle-Vendor: AWIPS II Migration
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.edex.common
Require-Bundle: com.raytheon.edex.common,
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
org.geotools,
javax.persistence,
com.raytheon.uf.common.localization;bundle-version="1.11.7",
gov.noaa.nws.ncep.common.dataplugin.ncccfp;bundle-version="1.0.0",
gov.noaa.nws.ncep.edex.common;bundle-version="1.0.0",
gov.noaa.nws.ncep.common;bundle-version="1.0.0"
Export-Package: gov.noaa.nws.ncep.edex.plugin.ncccfp.decoder
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.commons.logging

View file

@ -1,2 +0,0 @@
gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpRecord
gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpLocation

View file

@ -1,5 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
res/

View file

@ -1,23 +0,0 @@
<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">
<bean id="ncccfpPluginName" class="java.lang.String">
<constructor-arg type="java.lang.String" value="ncccfp" />
</bean>
<bean id="ncccfpProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" ref="ncccfpPluginName" />
<property name="pluginFQN" value="gov.noaa.nws.ncep.common.dataplugin.ncccfp" />
<property name="dao" value="gov.noaa.nws.ncep.common.dataplugin.ncccfp.dao.NcccfpDao" />
<property name="record" value="gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpRecord" />
</bean>
<bean factory-bean="pluginRegistry" factory-method="register">
<constructor-arg ref="ncccfpPluginName"/>
<constructor-arg ref="ncccfpProperties"/>
</bean>
</beans>

View file

@ -1,68 +0,0 @@
<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">
<bean id="ncccfpDecoder" class="gov.noaa.nws.ncep.edex.plugin.ncccfp.decoder.NcccfpDecoder">
<constructor-arg ref="ncccfpPluginName"/>
</bean>
<bean id="ncccfpSeparator" class="gov.noaa.nws.ncep.edex.plugin.ncccfp.decoder.NcccfpSeparator" />
<bean id="ncccfpDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="ncccfp" />
<constructor-arg value="jms-dist:queue:Ingest.ncccfp" />
</bean>
<bean id="ncccfpCamelRegistered" factory-bean="contextManager"
factory-method="register" depends-on="persistCamelRegistered">
<constructor-arg ref="ncccfp-camel"/>
</bean>
<camelContext id="ncccfp-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup="false">
<endpoint id="ncccfpFileEndpoint" uri="file:${edex.home}/data/sbn/ncccfp?noop=true&amp;idempotent=false" />
<route id="ncccfpFileConsumerRoute">
<from ref="ncccfpFileEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>ncccfp</constant>
</setHeader>
<to uri="jms-durable:queue:Ingest.ncccfp" />
</route>
<!-- Begin Ncccfp routes -->
<route id="ncccfpIngestRoute">
<from uri="jms-durable:queue:Ingest.ncccfp" />
<setHeader headerName="pluginName">
<constant>ncccfp</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<split streaming="true">
<method bean="ncccfpSeparator" method="separate" />
<doTry>
<pipeline>
<bean ref="ncccfpDecoder" method="decode" />
<to uri="direct-vm:indexAlert" />
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:ncccfp?level=ERROR" />
</doCatch>
</doTry>
</split>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:ncccfp?level=ERROR" />
</doCatch>
</doTry>
</route>
</camelContext>
</beans>

View file

@ -1,314 +0,0 @@
package gov.noaa.nws.ncep.edex.plugin.ncccfp.decoder;
import gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpLocation;
import gov.noaa.nws.ncep.common.dataplugin.ncccfp.NcccfpRecord;
import java.util.Calendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.decodertools.time.TimeTools;
import com.vividsolutions.jts.io.WKTReader;
/**
*
* NCCCFP Decoder
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 05, 2009 155 F. J. Yen From Raytheon's CCFP. Fix AREA. Store
* 1 instead of 14-15 decimal places for
* lat/lon values and limit to 7 points in
* dataURI (length 255) to conserve space
* and to fit into field. Add number of
* points to dataURI. Modify for LINE to
* be decoded. Make decode synchronized.
* May 27, 2010 155 F. J. Yen Refactored for dataplugin for migration
* to to11dr11
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
*
* </pre>
*
* @author F. J. Yen
* @version 1
*/
public class NcccfpDecoder extends AbstractDecoder {
private static String pluginName;
private static final String PLUGIN_NAME = "ncccfp";
/** Record used for returning values */
NcccfpRecord record;
/** Pattern object for regex search */
Pattern pattern;
/** Regex matcher */
private Matcher matcher;
/** Match the product returned from separator */
private static final String PARSE_STRING = "[A-Z]{4}[0-9]{1,2} [A-Z]{4} [0-9]{6}(?: [A-Z]{3})?\n"
+ "CFP[\\p{Alnum} ]{3}\n" // awips header
+ "CCFP (\\d{4})(\\d{2})(\\d{2})_(\\d{2})\\d{2} (\\d{4})(\\d{2})(\\d{2})_(\\d{2})\\d{2}\n" // start/valid
// times
+ "(AREA|LINE).*\n" // SKIP AREA and LINE parsing
+ "(CANADA ON|CANADA OFF)";
/** Parse an AREA line */
private static final String PARSE_AREA = "AREA (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (.*) (\\d+) (\\d+)";
/** Parse a LINE line */
private static final String PARSE_LINE = "LINE (\\d+) (.*)";
/**
* Constructor
*
* @throws DecoderException
*/
public NcccfpDecoder() throws DecoderException {
}
public NcccfpDecoder(String name) throws DecoderException {
pluginName = name;
}
public synchronized PluginDataObject[] decode(String msg)
throws DecoderException, PluginException {
record = new NcccfpRecord();
record.setMessageData(msg);
NcccfpLocation location = new NcccfpLocation();
pattern = Pattern.compile(PARSE_STRING);
matcher = pattern.matcher(msg);
try {
WKTReader wktReader = new WKTReader();
if (matcher.find()) {
Calendar start = TimeTools.getBaseCalendar(
Integer.parseInt(matcher.group(1)),
Integer.parseInt(matcher.group(2)),
Integer.parseInt(matcher.group(3)));
start.set(Calendar.HOUR_OF_DAY,
Integer.parseInt(matcher.group(4)));
record.setIssuetime(start);
Calendar valid = TimeTools.getBaseCalendar(
Integer.parseInt(matcher.group(5)),
Integer.parseInt(matcher.group(6)),
Integer.parseInt(matcher.group(7)));
valid.set(Calendar.HOUR_OF_DAY,
Integer.parseInt(matcher.group(8)));
record.setValidtime(valid);
TimeRange range = new TimeRange(record.getIssuetime(),
record.getValidtime());
record.setDataTime(new DataTime(record.getIssuetime(), range));
record.setProducttype(matcher.group(9));
if (matcher.group(10).equals("CANADA ON")) {
record.setCanadaflag(Boolean.TRUE);
} else {
record.setCanadaflag(Boolean.FALSE);
}
record.setInsertTime(TimeTools.getSystemCalendar());
}
if (record.getProducttype().equals("AREA")) {
pattern = Pattern.compile(PARSE_AREA);
matcher = pattern.matcher(msg);
if (matcher.find()) {
record.setCoverage(Integer.parseInt(matcher.group(1)));
record.setConf(Integer.parseInt(matcher.group(2)));
record.setGrowth(Integer.parseInt(matcher.group(3)));
record.setTops(Integer.parseInt(matcher.group(4)));
record.setSpeed(Integer.parseInt(matcher.group(5)));
record.setDirection(Integer.parseInt(matcher.group(6)));
record.setNumPts(Integer.parseInt(matcher.group(7)));
location.setBoxLat(Double.parseDouble(matcher.group(9)) * 0.1);
location.setBoxLong(Double.parseDouble(matcher.group(10))
* -0.1);
String templatlonpairs = matcher.group(8);
pattern = Pattern.compile("(\\d+) (\\d+)");
matcher = pattern.matcher(templatlonpairs);
StringBuffer wtk = new StringBuffer();
wtk.append("POLYGON((");
StringBuffer wtka = new StringBuffer();
wtka.append("POLYGON((");
int i7CntPts = 0;
StringBuffer wtk7 = new StringBuffer();
wtk7.append("POLYGONU((");
if (matcher.find()) {
wtk.append(Double.toString(Integer.parseInt(matcher
.group(1)) * 0.1) + " ");
wtk.append(Double.toString(Integer.parseInt(matcher
.group(2)) * -0.1));
/*
* Reduce from 14-15 decimal places to 1 for dataURI
*/
int len = matcher.group(1).length();
String lat1deg = matcher.group(1).substring(0, len - 1);
String lat1tenth = matcher.group(1).substring(len - 1);
len = matcher.group(2).length();
String lon1deg = matcher.group(2).substring(0, len - 1);
if (!matcher.group(2).substring(0, 0).equals("-")) {
lon1deg = "-" + lon1deg;
}
String lon1tenth = matcher.group(2).substring(len - 1);
i7CntPts++;
wtk7.append(lat1deg + "." + lat1tenth + " " + lon1deg
+ "." + lon1tenth);
wtka.append(lat1deg + "." + lat1tenth + " " + lon1deg
+ "." + lon1tenth);
}
while (matcher.find()) {
wtk.append(", "
+ Double.toString(Integer.parseInt(matcher
.group(1)) * 0.1) + " ");
wtk.append(Double.toString(Integer.parseInt(matcher
.group(2)) * -0.1));
/*
* Reduce from 14-15 decimal places to 1 for dataURI
*/
int len = matcher.group(1).length();
String latdeg = matcher.group(1).substring(0, len - 1);
String lat10 = matcher.group(1).substring(len - 1);
len = matcher.group(2).length();
String londeg = matcher.group(2).substring(0, len - 1);
if (!matcher.group(2).substring(0, 0).equals("-")) {
londeg = "-" + londeg;
}
String lon10 = matcher.group(2).substring(len - 1);
if (i7CntPts < 7) {
/*
* Truncate the number of coordinates to 7 for
* dataURI
*/
i7CntPts++;
wtk7.append("," + latdeg + "." + lat10 + " "
+ londeg + "." + lon10);
}
wtka.append("," + latdeg + "." + lat10 + " " + londeg
+ "." + lon10);
}
wtk.append("))");
wtk7.append("))");
wtka.append("))");
location.setGeometry(wktReader.read(wtk.toString()));
record.setLocation(location);
/*
* Column LocationAll contains all the coordinates with 1
* decimal place. Column locationUri is locationAll
* truncated to 7 coordinates (or less).
*/
record.setLocationUri(wtk7.toString());
location.setLocationAll(wtka.toString());
}
} else if (record.getProducttype().equals("LINE")) {
pattern = Pattern.compile(PARSE_LINE);
matcher = pattern.matcher(msg);
if (matcher.find()) {
record.setCoverage(null);
record.setConf(null);
record.setGrowth(null);
record.setTops(null);
record.setSpeed(null);
record.setDirection(null);
location.setBoxLat(0);
location.setBoxLong(0);
record.setNumPts(Integer.parseInt(matcher.group(1)));
// String templatlonpairs = matcher.group(1);
String templatlonpairs = matcher.group(2);
pattern = Pattern.compile("(\\d+) (\\d+)");
matcher = pattern.matcher(templatlonpairs);
StringBuffer wtk = new StringBuffer();
wtk.append("LINESTRING(");
StringBuffer wtka = new StringBuffer();
wtka.append("LINESTRING(");
int i7CntPts = 0;
StringBuffer wtk7 = new StringBuffer();
wtk7.append("LINESTRINGU(");
if (matcher.find()) {
wtk.append(Double.toString(Integer.parseInt(matcher
.group(1)) * 0.1) + " ");
wtk.append(Double.toString(Integer.parseInt(matcher
.group(2)) * -0.1));
/*
* Reduce from 14-15 decimal places to 1 for dataURI
*/
int len = matcher.group(1).length();
String lat1deg = matcher.group(1).substring(0, len - 1);
String lat1tenth = matcher.group(1).substring(len - 1);
len = matcher.group(2).length();
String lon1deg = matcher.group(2).substring(0, len - 1);
if (!matcher.group(2).substring(0, 0).equals("-")) {
lon1deg = "-" + lon1deg;
}
String lon1tenth = matcher.group(2).substring(len - 1);
i7CntPts++;
wtk7.append(lat1deg + "." + lat1tenth + " " + lon1deg
+ "." + lon1tenth);
wtka.append(lat1deg + "." + lat1tenth + " " + lon1deg
+ "." + lon1tenth);
}
while (matcher.find()) {
wtk.append(", "
+ Double.toString(Integer.parseInt(matcher
.group(1)) * 0.1) + " ");
wtk.append(Double.toString(Integer.parseInt(matcher
.group(2)) * -0.1));
/*
* Reduce from 14-15 decimal places to 1 for dataURI
*/
int len = matcher.group(1).length();
String latdeg = matcher.group(1).substring(0, len - 1);
String lat10 = matcher.group(1).substring(len - 1);
len = matcher.group(2).length();
String londeg = matcher.group(2).substring(0, len - 1);
if (!matcher.group(2).substring(0, 0).equals("-")) {
londeg = "-" + londeg;
}
String lon10 = matcher.group(2).substring(len - 1);
/*
* Truncate the number of coordinates to 7 for dataURI
*/
if (i7CntPts < 7) {
i7CntPts++;
wtk7.append("," + latdeg + "." + lat10 + " "
+ londeg + "." + lon10);
}
wtka.append("," + latdeg + "." + lat10 + " " + londeg
+ "." + lon10);
}
wtk.append(")");
wtk7.append(")");
wtka.append(")");
location.setGeometry(wktReader.read(wtk.toString()));
record.setLocation(location);
/*
* Column locationAll contains all the coordinates with 1
* decimal place. Column locationUri is locationAll
* truncated to 7 coordinates (or less).
*/
record.setLocationUri(wtk7.toString());
location.setLocationAll(wtka.toString());
}
}
} catch (Exception e) {
throw new DecoderException("Unable to decode NCCCFP", e);
}
if (record != null) {
record.constructDataURI();
return new PluginDataObject[] { record };
} else {
return new PluginDataObject[0];
}
}
}

View file

@ -1,206 +0,0 @@
package gov.noaa.nws.ncep.edex.plugin.ncccfp.decoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.uf.common.util.StringUtil;
/**
*
* NCCCFP Separator
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 09/03/2009 155 F. J. Yen From Raytheon's CCFP; modify for NCCCFP
*
* </pre>
*
* @author F. J. Yen
* @version 1
*/
public class NcccfpSeparator extends AbstractRecordSeparator {
private final Log theLogger = LogFactory.getLog(getClass());
/** Regex used for separating multi-record files */
private static final String DATASET = "CCFP \\d{8}_\\d{4} \\d{8}_\\d{4}([\\r\\n]+(AREA|LINE).*)*";
/** Regex to pull AWIPS Header */
private static final String AWIPSHEADER = "[\\r\\n]+(TAF|MTR|CFP)([\\p{Alnum} ]{3})[\\r\\n]+";
/** Regex used for extracting the header */
private static final String HEADERREGEX = "[A-Z]{4}[0-9]{1,2} [A-Z]{4} [0-9]{6}(?: [A-Z]{3})?";
/** Regex used for extracting a line */
private static final String TIMEREGEX = "CCFP \\d{8}_\\d{4} \\d{8}_\\d{4}";
/** Regex used for extracting a line */
private static final String LINEREGEX = "AREA.*|LINE.*";
private static final String CANADA_FLAG = "CANADA ON|CANADA OFF";
/** Pattern object for regex search */
Pattern pattern;
/** Regex matcher */
private Matcher matcher;
/** The WMO header */
private String header;
/** The AWIPS header */
private String awipsheader;
private String canadaflag;
/** List of individual areas in file */
private List<String> splitAreas;
/** List of records contained in file */
private List<String> bodyRecords;
/** List of records contained in file */
private List<String> records;
private Iterator<String> iterator = null;
public static NcccfpSeparator separate(byte[] data, Headers headers) {
NcccfpSeparator sep = new NcccfpSeparator();
sep.setData(data, headers);
return sep;
}
public NcccfpSeparator() {
bodyRecords = new ArrayList<String>();
records = new ArrayList<String>();
}
@Override
public String next() {
try {
String temp = iterator.next();
if (StringUtil.isEmptyString(temp)) {
return "";
} else {
return temp;
}
} catch (NoSuchElementException e) {
return "";
}
}
@Override
public boolean hasNext() {
if (iterator == null) {
return false;
} else {
return iterator.hasNext();
}
}
@Override
public void setData(byte[] data, Headers headers) {
this.separate(new String(data));
iterator = records.iterator();
}
/**
*
* @param message
*/
private void separate(String message) {
message = message.replaceAll("=", "");
try {
// Extracts the header
pattern = Pattern.compile(HEADERREGEX);
matcher = pattern.matcher(message);
if (matcher.find()) {
header = matcher.group();
}
// Extracts the AWIPS header
pattern = Pattern.compile(AWIPSHEADER);
matcher = pattern.matcher(message);
if (matcher.find()) {
awipsheader = matcher.group(1) + matcher.group(2);
}
pattern = Pattern.compile(CANADA_FLAG);
matcher = pattern.matcher(message);
if (matcher.find()) {
canadaflag = matcher.group();
}
pattern = Pattern.compile(DATASET);
matcher = pattern.matcher(message);
// Extracts all the matches out of the message. Looks for ICAO/date
// pairs. Does not allow duplicate entries.
while (matcher.find()) {
if (!bodyRecords.contains(matcher.group())) {
bodyRecords.add(matcher.group());
}
}
// Assigns records
for (int i = 0; i < bodyRecords.size(); i++) {
String observation = null;
if (i < bodyRecords.size() - 1) {
observation = message
.substring(message.indexOf(bodyRecords.get(i)),
message.indexOf(bodyRecords.get(i + 1)))
.trim().replaceAll("\\r\\r\\n", "\n");
;
} else {
observation = bodyRecords.get(i).trim()
.replaceAll("\\r\\r\\n", "\n");
}
splitAreas = splitRecord(observation);
for (int j = 0; j < splitAreas.size(); j++) {
String record = header + "\n" + awipsheader + "\n"
+ splitAreas.get(j) + "\n" + canadaflag;
records.add(record);
}
}
} catch (Exception e) {
e.printStackTrace();
theLogger.warn("No valid NCCCFP records found.");
}
return;
}
private List<String> splitRecord(String obs) {
List<String> rval = new ArrayList<String>();
String timeline = null;
pattern = Pattern.compile(TIMEREGEX);
matcher = pattern.matcher(obs);
if (matcher.find()) {
timeline = matcher.group();
}
pattern = Pattern.compile(LINEREGEX);
matcher = pattern.matcher(obs);
while (matcher.find()) {
rval.add(timeline + "\n" + matcher.group());
}
return rval;
}
}

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<purgeRuleSet>
<defaultRule>
<period>02-00:00:00</period>
</defaultRule>
</purgeRuleSet>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestPatterns xmlns:ns2="group">
<regex>^FAUS2[789] KKCI.*</regex>
</requestPatterns>