diff --git a/deltaScripts/14.4.1/DR2536/moveSubscriptions.sh b/deltaScripts/14.4.1/DR2536/moveSubscriptions.sh new file mode 100755 index 0000000000..d26ad34567 --- /dev/null +++ b/deltaScripts/14.4.1/DR2536/moveSubscriptions.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +# moves subscriptions tables from metadata db to fxatext db + +function rowcount { + psql -U awips -d $1 -c "select count(*) from $2" +} + +function getSeqStart { + CURR_ID=$(psql -U awips metadata -Aqzt0 -c "select max(id) from $1") + if [[ -z $CURR_ID ]] + then + echo 1 + else + echo $(( $CURR_ID + 1 )) + fi +} + +BACKUPFILE=sub_dump.bak +MODIFIED_BACKUP=sub_modified.bak + +echo "Moving subscriptions tables from metadata to fxatext" + +OLD_SUB_COUNT=$(rowcount metadata subscription.subscriptions) +OLD_REP_COUNT=$(rowcount metadata subscription.replacements) + +SUB_SEQ_START=$(getSeqStart subscription.subscriptions) +REQ_SEQ_START=$(getSeqStart subscription.replacements) + +pg_dump -U awips -t subscription.subscriptions -t subscription.replacements metadata > $BACKUPFILE +if [[ $? != 0 ]] +then + echo "subscription tables backup failed, aborting" + exit 1 +fi + +sed 's/\(\(TABLE\s\+\)\|\(Schema:\s\+\)\|=\s\+\)subscription\([^s]\)/\1public\4/' $BACKUPFILE > $MODIFIED_BACKUP +if [[ $? != 0 ]] +then + echo "subscription tables backup editing failed, aborting" + exit 1 +fi + +psql -U awips fxatext < $MODIFIED_BACKUP +if [[ $? != 0 ]] +then + echo "Subscription tables restore failed, backup located at $BACKUPFILE" + exit 1 +fi + +NEW_SUB_COUNT=$(rowcount fxatext public.subscriptions) +NEW_REP_COUNT=$(rowcount fxatext public.replacements) + +if [[ $OLD_SUB_COUNT != $NEW_SUB_COUNT || $OLD_REP_COUNT != $NEW_REP_COUNT ]] +then + echo "Row counts do not match before and after table move" + echo "Subscriptions before: \n$OLD_SUB_COUNT" + echo "Subscriptions after: \n$NEW_SUB_COUNT" + echo "Replacements before: \n$OLD_REP_COUNT" + echo "Replacements after: \n$NEW_REP_COUNT" + echo "skipping old table cleanup, backup exists at $BACKUPFILE" + exit 1 +fi + +echo "Creating sequences" +psql -U awips -d fxatext -c "CREATE SEQUENCE subscriptionseq START WITH $SUB_SEQ_START" +psql -U awips -d fxatext -c "CREATE SEQUENCE replacementseq START WITH $REQ_SEQ_START" + +echo "Cleaning up old tables" +psql -U awips -d metadata -c 'DROP SCHEMA subscription CASCADE' +psql -U awips -d metadata -c "DELETE from awips.plugin_info WHERE name = 'com.raytheon.edex.autobldsrv'" + +rm $MODIFIED_BACKUP +rm $BACKUPFILE +echo "Done moving subscription tables" diff --git a/edexOsgi/build.edex/opt/db/ddl/setup/create_subscription_tables.sql b/edexOsgi/build.edex/opt/db/ddl/setup/create_subscription_tables.sql deleted file mode 100644 index 05a78cde18..0000000000 --- a/edexOsgi/build.edex/opt/db/ddl/setup/create_subscription_tables.sql +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ --- Contains SQL/DDL statements to create the tables used by the subscription service --- --- Database: metadata --- Schema: subscription --- Tables: subscriptions --- replacements --- --- File History: --- 08Dec2008 1709 MW Fegan replaced existing DDL with DDL for new --- subscription tables. - --- Create the SUBSCRIPTION schema -create schema subscription authorization awips; - diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/.classpath b/edexOsgi/com.raytheon.edex.autobldsrv/.classpath deleted file mode 100644 index 1fa3e6803d..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/.project b/edexOsgi/com.raytheon.edex.autobldsrv/.project deleted file mode 100644 index 3eae1a96b5..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - com.raytheon.edex.autobldsrv - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.edex.autobldsrv/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a3b5f85251..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Thu Mar 26 10:09:13 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 diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/MANIFEST.MF deleted file mode 100644 index 5cd1208449..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Autobldsrv Plug-in -Bundle-SymbolicName: com.raytheon.edex.autobldsrv -Bundle-Version: 1.12.1174.qualifier -Bundle-Vendor: RAYTHEON -Export-Package: com.raytheon.edex.services -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: com.raytheon.edex.uengine.runners, - com.raytheon.edex.util, - org.apache.commons.logging -Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174", - com.raytheon.uf.common.serialization;bundle-version="1.12.1174", - com.raytheon.uf.common.message;bundle-version="1.12.1174", - com.raytheon.uf.common.util;bundle-version="1.12.1174", - com.raytheon.uf.edex.core;bundle-version="1.12.1174", - com.raytheon.uf.common.status;bundle-version="1.12.1174", - com.raytheon.uf.edex.database;bundle-version="1.0.0", - com.raytheon.uf.common.dataquery;bundle-version="1.0.0", - org.quartz;bundle-version="1.8.6" diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 5383ccd3b6..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1,2 +0,0 @@ -com.raytheon.edex.autobldsrv.data.ReplacementRecord -com.raytheon.edex.autobldsrv.data.SubscriptionRecord \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/build.properties b/edexOsgi/com.raytheon.edex.autobldsrv/build.properties deleted file mode 100644 index ad8d78badb..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - res/,\ - resources/ diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/com.raytheon.edex.autobldsrv.ecl b/edexOsgi/com.raytheon.edex.autobldsrv/com.raytheon.edex.autobldsrv.ecl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-common.xml b/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-common.xml deleted file mode 100644 index 24d5dc5b41..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-common.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.Throwable - - - - - - - - - - - - java.lang.Throwable - - - - - - - diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-request.xml b/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-request.xml deleted file mode 100644 index c40e01ac60..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-request.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-spring.xml b/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-spring.xml deleted file mode 100644 index 9674008e75..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/res/spring/subscription-spring.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - java.lang.Throwable - - - - - - - - - - - - - - - java.lang.Throwable - - - - - - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/package-info.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/package-info.java deleted file mode 100644 index ff04e5067d..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -/** - * Contains classes mapped to tables in the subscription database - * schema. - */ -package com.raytheon.edex.autobldsrv.data; diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/package-info.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/package-info.java deleted file mode 100644 index 2de4dcbf74..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -/** - * Contains classes providing access to the subscription database schema. - * - */ -package com.raytheon.edex.subscription.dao; diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/package-info.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/package-info.java deleted file mode 100644 index 62538e2439..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -/** - * Contains classes implementing subscription service actions. - * Includes the interfaces and abstract base classes and a factory - * class for generating the appropriate actions. - */ -package com.raytheon.edex.subscription.runners; diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/package-info.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/package-info.java deleted file mode 100644 index 283e472f47..0000000000 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -/** - * Contains utility classes supporting the subscription service. - */ -package com.raytheon.edex.subscription.util; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.text/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.uf.common.dataplugin.text/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject index 89e261459a..cb921a40fb 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.text/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.text/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject @@ -13,4 +13,6 @@ com.raytheon.uf.common.dataplugin.text.db.StdTextProductId com.raytheon.uf.common.dataplugin.text.db.TextProductInfo com.raytheon.uf.common.dataplugin.text.db.TextProductInfoPK com.raytheon.uf.common.dataplugin.text.db.WatchWarn -com.raytheon.uf.common.dataplugin.text.db.WatchWarnPK \ No newline at end of file +com.raytheon.uf.common.dataplugin.text.db.WatchWarnPK +com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord +com.raytheon.uf.common.dataplugin.text.db.ReplacementRecord \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/ReplacementRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/ReplacementRecord.java similarity index 89% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/ReplacementRecord.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/ReplacementRecord.java index ef1911af5a..0a1a341e30 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/ReplacementRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/ReplacementRecord.java @@ -17,14 +17,16 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.autobldsrv.data; +package com.raytheon.uf.common.dataplugin.text.db; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -36,7 +38,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** - * TODO Add Description + * Data object for subscription record substitution attribute * *
  * 
@@ -44,7 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
  * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * 
+ * May 22, 2014 2536       bclement    moved from autobldsrv to common.dataplugin.text
  * 
  * 
* @@ -53,7 +55,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; */ @Entity -@Table(name = "replacements", schema = "subscription") +@SequenceGenerator(initialValue = 1, name = ReplacementRecord.SEQ_GEN_NAME, sequenceName = "replacementseq") +@Table(name = "replacements") @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -61,10 +64,12 @@ public class ReplacementRecord extends PersistableDataObject { private static final long serialVersionUID = 1L; + public static final String SEQ_GEN_NAME = "REPLACEMENT_GENERATOR"; + @XmlAttribute @DynamicSerializeElement @Id - @GeneratedValue + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQ_GEN_NAME) private long id; @ManyToOne diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/SubscriptionRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/SubscriptionRecord.java similarity index 78% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/SubscriptionRecord.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/SubscriptionRecord.java index ffa43cc560..528c29fb85 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/autobldsrv/data/SubscriptionRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.text/src/com/raytheon/uf/common/dataplugin/text/db/SubscriptionRecord.java @@ -17,9 +17,8 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.autobldsrv.data; +package com.raytheon.uf.common.dataplugin.text.db; -import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -30,8 +29,10 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.xml.bind.annotation.XmlAccessType; @@ -40,8 +41,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.quartz.CronExpression; - import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @@ -58,6 +57,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 18Nov2008 1709 MW Fegan Initial creation + * May 22, 2014 2536 bclement moved from autobldsrv to common.dataplugin.text + * moved matchesTrigger() to TriggerMatcher class * * * @@ -65,7 +66,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * @version 1.0 */ @Entity -@Table(name = "subscriptions", schema = "subscription", uniqueConstraints = @UniqueConstraint(columnNames = { +@SequenceGenerator(initialValue = 1, name = SubscriptionRecord.SEQ_GEN_NAME, sequenceName = "subscriptionseq") +@Table(name = "subscriptions", uniqueConstraints = @UniqueConstraint(columnNames = { "type", "trigger", "runner", "script", "filepath", "arguments" })) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @@ -75,10 +77,12 @@ public class SubscriptionRecord extends PersistableDataObject implements private static final long serialVersionUID = 1L; + public static final String SEQ_GEN_NAME = "SUBSCRIPTION_GENERATOR"; + @XmlAttribute @DynamicSerializeElement @Id - @GeneratedValue + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SEQ_GEN_NAME) private long id; @XmlAttribute @@ -273,58 +277,6 @@ public class SubscriptionRecord extends PersistableDataObject implements } } - /** - * Determines if the specified trigger value matches the trigger value of - * this SubscriptionRecord. - * - * @param trigger - * the trigger value to compare - * - * @return true if the trigger matches, false otherwise - */ - public boolean matchesTrigger(String trigger) { - boolean retVal = false; - if ("timer".equalsIgnoreCase(this.type)) { - try { - long date = Long.parseLong(trigger); - CronExpression cexp = new CronExpression(this.trigger); - retVal = cexp.isSatisfiedBy(new Date(date)); - } catch (Exception e) { - retVal = false; - } - } else if ("ldad".equalsIgnoreCase(this.type)) { - /* - * Legacy code has these patterns: TextString patterns[] = { - * productId, productId.left(6) + "XXX", "CCC" + productId.mid(3,3) - * + "XXX", productId.left(3) + "NNNXXX", productId.left(3) + "NNN" - * + productId.right(productId.length() - 6) }; - */ - // System.out.println("matching trigger=" + trigger + - // " -- this.trigger="+ this.trigger + - // " -- trigger.substr(0,6)+\"XXX\"="+trigger.substring(0,6)+"XXX" + - // " -- \"CCC\"+trigger.substring(3,6)+\"XXX\"="+"CCC"+trigger.substring(3, - // 6)+"XXX" + - // " -- trigger.substring(0,3)+\"NNNXXX\"=" + trigger.substring(0, - // 3)+"NNNXXX" + - // " -- trigger.substring(0, 3)+\"NNN\"+trigger.substring(6)="+trigger.substring(0, - // 3)+"NNN"+trigger.substring(6)); - retVal = (trigger.equalsIgnoreCase(this.trigger)) - || ((trigger.substring(0, 6) + "XXX") - .equalsIgnoreCase(this.trigger)) - || (("CCC" + trigger.substring(3, 6) + "XXX") - .equalsIgnoreCase(this.trigger)) - || ((trigger.substring(0, 3) + "NNNXXX") - .equalsIgnoreCase(this.trigger)) - || ((trigger.substring(0, 3) + "NNN" + trigger.substring(6)) - .equalsIgnoreCase(this.trigger) || (this.trigger - .startsWith(trigger))); - } else { - String pattern = this.trigger.replaceAll("\\*", ".+"); - retVal = trigger.matches(pattern); - } - return retVal; - } - /** * * @param name diff --git a/edexOsgi/com.raytheon.uf.edex.core.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.core.feature/feature.xml index 407c7eab4c..0261d31be8 100644 --- a/edexOsgi/com.raytheon.uf.edex.core.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.core.feature/feature.xml @@ -28,13 +28,6 @@ version="0.0.0" unpack="false"/> - - - + + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.text/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.text/META-INF/MANIFEST.MF index 667915fff0..47ef065069 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.text/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/META-INF/MANIFEST.MF @@ -20,7 +20,8 @@ Export-Package: com.raytheon.uf.edex.plugin.text, com.raytheon.uf.edex.plugin.text.db, com.raytheon.uf.edex.plugin.text.dbsrv Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: com.raytheon.uf.common.dataplugin.text, +Import-Package: com.raytheon.edex.uengine.runners, + com.raytheon.uf.common.dataplugin.text, com.raytheon.uf.common.dataplugin.text.alarms, com.raytheon.uf.common.dataplugin.text.db, com.raytheon.uf.common.dataplugin.text.dbsrv, @@ -28,4 +29,5 @@ Import-Package: com.raytheon.uf.common.dataplugin.text, com.raytheon.uf.common.dataplugin.text.util, com.raytheon.uf.common.message, com.raytheon.uf.common.wmo, - org.apache.commons.logging + org.apache.commons.logging, + org.quartz diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/res/conf/subscription.xml b/edexOsgi/com.raytheon.uf.edex.plugin.text/res/conf/subscription.xml similarity index 100% rename from edexOsgi/com.raytheon.edex.autobldsrv/res/conf/subscription.xml rename to edexOsgi/com.raytheon.uf.edex.plugin.text/res/conf/subscription.xml diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-common.xml b/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-common.xml index 3b68a133d6..e1e9fa9ad3 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-common.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-common.xml @@ -43,7 +43,18 @@ + + + + + + + + + + + @@ -64,6 +75,29 @@ + + + + + + + java.lang.Throwable + + + + + + + + + + + + java.lang.Throwable + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-ingest.xml b/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-ingest.xml index 44b3a91a75..4a2d8c7c56 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-ingest.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/res/spring/text-ingest.xml @@ -112,6 +112,13 @@ + + + + + + + @@ -127,6 +134,9 @@ --> + + + + + + + + + java.lang.Throwable + + + + + + + + + + + + java.lang.Throwable + + + + + + + + @@ -144,5 +149,12 @@ + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/resources/autobldsrv.properties b/edexOsgi/com.raytheon.uf.edex.plugin.text/resources/autobldsrv.properties similarity index 100% rename from edexOsgi/com.raytheon.edex.autobldsrv/resources/autobldsrv.properties rename to edexOsgi/com.raytheon.uf.edex.plugin.text/resources/autobldsrv.properties diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/SubscriptionDAO.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/dao/SubscriptionDAO.java similarity index 96% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/SubscriptionDAO.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/dao/SubscriptionDAO.java index 2250d99aea..da084c5741 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/dao/SubscriptionDAO.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/dao/SubscriptionDAO.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.dao; +package com.raytheon.uf.edex.plugin.text.dao; import java.util.ArrayList; import java.util.Collection; @@ -27,8 +27,8 @@ import java.util.Map; import org.hibernate.Query; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.dataquery.db.QueryParam; import com.raytheon.uf.common.message.Property; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -52,6 +52,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * 14Apr2011 5163 cjeanbap NWRWAVES Setting AFOS text triggers in AWIPS II * 04/24/13 1949 rjpeter Removed @Override on delete. * Nov 08, 2013 2361 njensen Chaged method signature of saveOrUpdate(Object) + * May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text * * * @author mfegan @@ -82,7 +83,7 @@ public class SubscriptionDAO extends CoreDao { private static boolean dirtyMap = true; public SubscriptionDAO() { - this(DaoConfig.forClass(SubscriptionRecord.class)); + this(DaoConfig.forClass("fxa", SubscriptionRecord.class)); } /** diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ASubscribeRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ASubscribeRunner.java similarity index 84% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ASubscribeRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ASubscribeRunner.java index 1726e04514..919ed60bd8 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ASubscribeRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ASubscribeRunner.java @@ -17,32 +17,31 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.ArrayList; -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.util.Util; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; -import com.raytheon.uf.edex.core.EdexException; /** * Abstract base class for all subscription runners. Extending classes must - * implement the {@link #execute()} method. Default implementations of other methods - * specified in {@link ISubscribeRunner} are provided. + * implement the {@link #execute()} method. Default implementations of other + * methods specified in {@link ISubscribeRunner} are provided. *

- * Also provided are two factory methods ({@link ASubscribeRunner#getInstance(String)} - * and {@link ASubscribeRunner#getInstance(String, Message)}) may be used to instantiate - * the known concrete implementations. + * Also provided are two factory methods ( + * {@link ASubscribeRunner#getInstance(String)} and + * {@link ASubscribeRunner#getInstance(String, Message)}) may be used to + * instantiate the known concrete implementations. *

* Expected usage: - *


+ * 
+ * 
+ * 
  *     String type = "...";  // name of an appropriate runner action
  *     Message message = null;  // initialized later...
  *     
@@ -56,20 +55,22 @@ import com.raytheon.uf.edex.core.EdexException;
  *     } catch (EdexException e) {
  *        // handle the exception
  *     }
- * 
+ *
+ *
* *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public abstract class ASubscribeRunner implements ISubscribeRunner { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ISubscribeRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ISubscribeRunner.java similarity index 90% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ISubscribeRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ISubscribeRunner.java index 053488e3b3..df6f5c5af5 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/ISubscribeRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/ISubscribeRunner.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.List; @@ -31,21 +31,22 @@ import com.raytheon.uf.common.message.Property; * no-arg constructor; they should also define a constructor that takes a * {@link Message} instance as its sole argument. *

- * Each implementation of this class should ensure the {@link #getResults()} returns - * a valid, though possibly empty, List. + * Each implementation of this class should ensure the {@link #getResults()} + * returns a valid, though possibly empty, List. * *

- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public interface ISubscribeRunner { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeAddRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeAddRunner.java similarity index 91% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeAddRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeAddRunner.java index 1c985d6c7c..cad348abe9 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeAddRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeAddRunner.java @@ -17,17 +17,15 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.dao.SubscriptionDAO; -import com.raytheon.edex.subscription.util.Tools; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; +import com.raytheon.uf.edex.plugin.text.dao.SubscriptionDAO; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** * Implements a subscription request runner that performs an insert into the @@ -44,6 +42,7 @@ import com.raytheon.uf.common.message.Property; * 14Sep2010 3944 cjeanbap Trim property values. * 25May2011 8686 cjeanbap Updated if-statement to check for filepath * 26May2011 8686 cjeanbap fixed a punctuation bug + * May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text * * * @author mfegan diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeDeleteRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeDeleteRunner.java similarity index 85% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeDeleteRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeDeleteRunner.java index 6abc51cdc2..672c34464b 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeDeleteRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeDeleteRunner.java @@ -17,32 +17,34 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.ArrayList; import java.util.List; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.dao.SubscriptionDAO; -import com.raytheon.edex.subscription.util.Tools; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; +import com.raytheon.uf.edex.plugin.text.dao.SubscriptionDAO; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** - * Implements a subscription request runner that performs a delete operation - * in the subscription database. + * Implements a subscription request runner that performs a delete operation in + * the subscription database. + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public class SubscribeDeleteRunner extends ASubscribeRunner { @@ -61,8 +63,12 @@ public class SubscribeDeleteRunner extends ASubscribeRunner { super(message); } - /* (non-Javadoc) - * @see com.raytheon.edex.subscription.runners.ASubscribeRunner#execute() + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.edex.plugin.text.subscription.runners.ASubscribeRunner + * #execute() */ @Override public boolean execute() { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeQueryRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeQueryRunner.java similarity index 84% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeQueryRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeQueryRunner.java index 7af1ec4a92..bc6bed0f9c 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeQueryRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeQueryRunner.java @@ -17,25 +17,28 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.ArrayList; import java.util.List; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.dao.SubscriptionDAO; -import com.raytheon.edex.subscription.util.Tools; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.edex.plugin.text.dao.SubscriptionDAO; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; +import com.raytheon.uf.edex.plugin.text.subscription.util.TriggerMatcher; /** * Implements a subscription request runner that performs a query to determine - * if there are currently any subscriptions for a specific trigger value. If there - * are subscriptions, they are placed into the response list. + * if there are currently any subscriptions for a specific trigger value. If + * there are subscriptions, they are placed into the response list. *

- * This runner expects a message similar to - *


+ * This runner expects a message similar to
+ * 
+ * 
+ * 
  *     
  *        
* @@ -43,10 +46,14 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * *
*
- *
- * The response following execution is a list of Property objects that can be used - * to form a Message similar to - *

+ * 
+ * 
+ * + * The response following execution is a list of Property objects that can be + * used to form a Message similar to + * + *
+ * 
  *     
  *        
* @@ -54,21 +61,25 @@ import com.raytheon.uf.common.serialization.SerializationUtil; * *
*
- *
- * In the response, the value of each subscription property is the XML serialization - * of the subscription from the database. + *
+ *
+ * + * In the response, the value of each subscription property is the XML + * serialization of the subscription from the database. + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public class SubscribeQueryRunner extends ASubscribeRunner { @@ -88,8 +99,12 @@ public class SubscribeQueryRunner extends ASubscribeRunner { super(message); } - /* (non-Javadoc) - * @see com.raytheon.edex.subscription.runners.ASubscribeRunner#execute() + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.edex.plugin.text.subscription.runners.ASubscribeRunner + * #execute() */ @Override public boolean execute() { @@ -118,7 +133,7 @@ public class SubscribeQueryRunner extends ASubscribeRunner { private List filterRecords(List records) { List retVal = new ArrayList(); for (SubscriptionRecord record : records) { - if (record.matchesTrigger(this.trigger)) { + if (TriggerMatcher.matches(record, this.trigger)) { retVal.add(record); } } diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeReadRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeReadRunner.java similarity index 91% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeReadRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeReadRunner.java index 6f3f93d33c..5acdbd6dd5 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeReadRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeReadRunner.java @@ -17,17 +17,17 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.ArrayList; import java.util.List; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.dao.SubscriptionDAO; -import com.raytheon.edex.subscription.util.Tools; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Header; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; +import com.raytheon.uf.edex.plugin.text.dao.SubscriptionDAO; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** * Implements a subscription request runner that performs a read operation in @@ -73,6 +73,7 @@ import com.raytheon.uf.common.message.Property; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 14Nov2008 1709 MW Fegan Initial creation. + * May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text * * * @@ -84,7 +85,7 @@ public class SubscribeReadRunner extends ASubscribeRunner { /** * Constructor. Creates an empty Runner object. This is the constructor * called by the {@link RunnerFactory}'s - * {@link RunnerFactory#getWorker(com.raytheon.edex.subscription.util.SubscribeAction) + * {@link RunnerFactory#getWorker(com.raytheon.uf.edex.plugin.text.subscription.util.SubscribeAction) * getWorker(...)} method. The {@link #initialize(Message)} method must be * called prior to using the worker. */ @@ -105,7 +106,9 @@ public class SubscribeReadRunner extends ASubscribeRunner { /* * (non-Javadoc) * - * @see com.raytheon.edex.subscription.runners.ASubscribeRunner#execute() + * @see + * com.raytheon.uf.edex.plugin.text.subscription.runners.ASubscribeRunner + * #execute() */ @Override public boolean execute() { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeRunner.java similarity index 63% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeRunner.java index 32b8feb3e2..8062b7a90a 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeRunner.java @@ -17,10 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; - -import java.util.HashMap; -import java.util.Map; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -28,16 +25,19 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; +import com.raytheon.uf.edex.plugin.text.subscription.util.SubscribeAction; /** * Factory class for creating Subscription Runner objects. *

- * Two factory methods ({@link ASubscribeRunner#getInstance(String)} - * and {@link ASubscribeRunner#getInstance(String, Message)}) are used to instantiate - * the known concrete implementations. + * Two factory methods ({@link ASubscribeRunner#getInstance(String)} and + * {@link ASubscribeRunner#getInstance(String, Message)}) are used to + * instantiate the known concrete implementations. *

* Expected usage: - *


+ * 
+ * 
+ * 
  *     String type = "...";  // name of an appropriate runner action
  *     Message message = null;  // initialized later...
  *     
@@ -50,20 +50,23 @@ import com.raytheon.uf.edex.core.EdexException;
  *     } catch (EdexException e) {
  *        // handle the exception
  *     }
- * 
+ *
+ *
* *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 18Nov2008    1709       MW Fegan    Initial creation
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
+ *                                      removed duplicate SubscribeAction enum
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public class SubscribeRunner { @@ -143,63 +146,4 @@ public class SubscribeRunner { return retVal; } - /** - * - * An enumeration of Subscription Actions. This enumeration is used by the factory methods - * ({@link ASubscribeRunner#getInstance(String, Message)} and - * {@link ASubscribeRunner#getInstance(String)}) to determine the correct class to - * instantiate to create a worker. - * - * @author mfegan - * @version 1.0 - */ - public enum SubscribeAction { - ACTION_ADD,ACTION_READ,ACTION_DELETE,ACTION_UPDATE,ACTION_QUERY; - /** - * A mapping of action names to SubscribeAction objects. - */ - private static final Map actions = new HashMap() { - private static final long serialVersionUID = 1L; - { - put("add",ACTION_ADD); - put("read",ACTION_READ); - put("delete",ACTION_DELETE); - put("update",ACTION_UPDATE); - put("query",ACTION_QUERY); - } - }; - /** - * A mapping of SubscribeAction objects to implementation class names. - */ - private static final Map runners = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(ACTION_ADD,"com.raytheon.edex.subscription.runners.SubscribeAddRunner"); - put(ACTION_READ,"com.raytheon.edex.subscription.runners.SubscribeReadRunner"); - put(ACTION_DELETE,"com.raytheon.edex.subscription.runners.SubscribeDeleteRunner"); - put(ACTION_UPDATE,"com.raytheon.edex.subscription.runners.SubscribeUpdateRunner"); - put(ACTION_QUERY,"com.raytheon.edex.subscription.runners.SubscribeQueryRunner"); - } - }; - /** - * Constructor. - */ - private SubscribeAction(){} - /** - * Factory method that gets the SubscribeAction object for an action name. - * - * @param action name of the requested action - * - * @return the corresponding action - */ - public static final SubscribeAction translate(String action) { - return actions.get(action.toLowerCase()); - } - /** - * Returns the class name of the runner associated with the action. - */ - public final String getRunner() { - return runners.get(this); - } - } } diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeUpdateRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeUpdateRunner.java similarity index 87% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeUpdateRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeUpdateRunner.java index 6a10be4aad..144dda1fd2 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/runners/SubscribeUpdateRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/runners/SubscribeUpdateRunner.java @@ -17,24 +17,26 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.runners; +package com.raytheon.uf.edex.plugin.text.subscription.runners; import java.util.ArrayList; import java.util.List; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.dao.SubscriptionDAO; -import com.raytheon.edex.subscription.util.Tools; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Header; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; +import com.raytheon.uf.edex.plugin.text.dao.SubscriptionDAO; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** - * Implements a subscription request runner that performs an update of the - * data in the subscription table. + * Implements a subscription request runner that performs an update of the data + * in the subscription table. *

* Typical Usage: - *


+ * 
+ * 
+ * 
  *     List results = null;
  *     SubscribeAction action = SubscribeAction.ACTION_UPDATE;
  *     ISubscribeRunner runner = RunnerFactory.getInstance().getWorker(action);
@@ -43,19 +45,22 @@ import com.raytheon.uf.common.message.Property;
  *        runner.execute();
  *        results = runner.getResults();
  *     }
- * 
+ *
+ *
+ * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 05Dec2008    1709       MW Fegan    Initial creation.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public class SubscribeUpdateRunner extends ASubscribeRunner { @@ -74,8 +79,12 @@ public class SubscribeUpdateRunner extends ASubscribeRunner { super(message); } - /* (non-Javadoc) - * @see com.raytheon.edex.subscription.runners.ASubscribeRunner#execute() + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.edex.plugin.text.subscription.runners.ASubscribeRunner + * #execute() */ @Override public boolean execute() { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/ScriptRunner.java similarity index 96% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/ScriptRunner.java index 0c753ec662..c2af3e88cc 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/ScriptRunner.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.services; +package com.raytheon.uf.edex.plugin.text.subscription.services; import java.io.File; import java.util.ArrayList; @@ -31,15 +31,12 @@ import javax.xml.bind.JAXBException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.edex.autobldsrv.data.ReplacementRecord; -import com.raytheon.edex.autobldsrv.data.SubscriptionRecord; -import com.raytheon.edex.subscription.runners.ISubscribeRunner; -import com.raytheon.edex.subscription.runners.SubscribeRunner; -import com.raytheon.edex.subscription.util.Tools; import com.raytheon.edex.uengine.runners.IMicroEngine; import com.raytheon.edex.uengine.runners.MicroEngine; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; +import com.raytheon.uf.common.dataplugin.text.db.ReplacementRecord; +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; import com.raytheon.uf.common.message.Header; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; @@ -47,6 +44,9 @@ import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.util.ReflectionUtil; import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.edex.core.EdexException; +import com.raytheon.uf.edex.plugin.text.subscription.runners.ISubscribeRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeRunner; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** * Main class of the EDEX Script Runner. @@ -72,6 +72,7 @@ import com.raytheon.uf.edex.core.EdexException; * 30Aug2011 10581 rferrel executeScript now sending proper trigger * argument to the engine. * Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin + * May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text * * * diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/SubscribeManager.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/SubscribeManager.java similarity index 88% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/SubscribeManager.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/SubscribeManager.java index 5484eaf5a1..b789968209 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/SubscribeManager.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/services/SubscribeManager.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.services; +package com.raytheon.uf.edex.plugin.text.subscription.services; import java.util.ArrayList; import java.util.List; @@ -25,30 +25,32 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.edex.subscription.runners.ISubscribeRunner; -import com.raytheon.edex.subscription.runners.SubscribeRunner; -import com.raytheon.edex.subscription.util.Tools; import com.raytheon.uf.common.message.Header; import com.raytheon.uf.common.message.Message; import com.raytheon.uf.common.message.Property; import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.edex.plugin.text.subscription.runners.ISubscribeRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeRunner; +import com.raytheon.uf.edex.plugin.text.subscription.util.Tools; /** - * The main class of the Subscription Manager. Receives and processes subscription - * requests from a client. Returns a response based on the result of processing the - * request. + * The main class of the Subscription Manager. Receives and processes + * subscription requests from a client. Returns a response based on the result + * of processing the request. + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 15Dec2008    1709       MW Fegan    Initial Creation. Replaces SubscribeSrv.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public class SubscribeManager { diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/SubscribeAction.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/SubscribeAction.java similarity index 63% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/SubscribeAction.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/SubscribeAction.java index 9d05b9e20e..9306d5a09a 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/SubscribeAction.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/SubscribeAction.java @@ -17,25 +17,39 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.util; +package com.raytheon.uf.edex.plugin.text.subscription.util; import java.util.HashMap; import java.util.Map; +import com.raytheon.uf.common.message.Message; +import com.raytheon.uf.edex.plugin.text.subscription.runners.ASubscribeRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeAddRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeDeleteRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeQueryRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeReadRunner; +import com.raytheon.uf.edex.plugin.text.subscription.runners.SubscribeUpdateRunner; + /** - * An enumeration of Subscription Actions. + * An enumeration of Subscription Actions. This enumeration is used by the + * factory methods ({@link ASubscribeRunner#getInstance(String, Message)} and + * {@link ASubscribeRunner#getInstance(String)}) to determine the correct class + * to instantiate to create a worker. + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
+ *                                      removed hard coded class names
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public enum SubscribeAction { @@ -59,11 +73,11 @@ public enum SubscribeAction { private static final Map runners = new HashMap() { private static final long serialVersionUID = 1L; { - put(ACTION_ADD,"com.raytheon.edex.subscription.runners.SubscribeAddRunner"); - put(ACTION_READ,"com.raytheon.edex.subscription.runners.SubscribeReadRunner"); - put(ACTION_DELETE,"com.raytheon.edex.subscription.runners.SubscribeDeleteRunner"); - put(ACTION_UPDATE,"com.raytheon.edex.subscription.runners.SubscribeUpdateRunner"); - put(ACTION_QUERY,"com.raytheon.edex.subscription.runners.SubscribeQueryRunner"); + put(ACTION_ADD, SubscribeAddRunner.class.getName()); + put(ACTION_READ, SubscribeReadRunner.class.getName()); + put(ACTION_DELETE, SubscribeDeleteRunner.class.getName()); + put(ACTION_UPDATE, SubscribeUpdateRunner.class.getName()); + put(ACTION_QUERY, SubscribeQueryRunner.class.getName()); } }; /** diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/Tools.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/Tools.java similarity index 93% rename from edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/Tools.java rename to edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/Tools.java index 84c8b6c2f7..ce26ab817c 100644 --- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/subscription/util/Tools.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/Tools.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.edex.subscription.util; +package com.raytheon.uf.edex.plugin.text.subscription.util; import java.util.ArrayList; import java.util.List; @@ -28,19 +28,21 @@ import com.raytheon.uf.common.message.Property; /** * Utility class for the subscription manager. + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * 14Nov2008    1709       MW Fegan    Initial creation.
  * 14Sep2010    3944       cjeanbap    Trim the newline char from value.
+ * May 22, 2014 2536       bclement    moved from autobldsrv to edex.plugin.text
  * 
  * 
- * + * * @author mfegan - * @version 1.0 + * @version 1.0 */ public final class Tools { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/TriggerMatcher.java b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/TriggerMatcher.java new file mode 100644 index 0000000000..8e38d49829 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.plugin.text/src/com/raytheon/uf/edex/plugin/text/subscription/util/TriggerMatcher.java @@ -0,0 +1,101 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.edex.plugin.text.subscription.util; + +import java.util.Date; + +import org.quartz.CronExpression; + +import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord; + +/** + * Utility for matching stored subscriptions to query triggers + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * May 22, 2014 2536       bclement     Initial creation
+ * 
+ * 
+ * + * @author bclement + * @version 1.0 + */ +public class TriggerMatcher { + + /** + * Determines if the specified trigger value matches the trigger value of + * the provided SubscriptionRecord. + * + * @param record + * @param trigger + * the trigger value to compare + * + * @return true if the trigger matches, false otherwise + */ + public static boolean matches(SubscriptionRecord record, String trigger) { + String type = record.getType(); + String recordTrigger = record.getTrigger(); + boolean retVal = false; + if ("timer".equalsIgnoreCase(type)) { + try { + long date = Long.parseLong(trigger); + CronExpression cexp = new CronExpression(recordTrigger); + retVal = cexp.isSatisfiedBy(new Date(date)); + } catch (Exception e) { + retVal = false; + } + } else if ("ldad".equalsIgnoreCase(type)) { + /* + * Legacy code has these patterns: TextString patterns[] = { + * productId, productId.left(6) + "XXX", "CCC" + productId.mid(3,3) + * + "XXX", productId.left(3) + "NNNXXX", productId.left(3) + "NNN" + * + productId.right(productId.length() - 6) }; + */ + // System.out.println("matching trigger=" + trigger + + // " -- this.trigger="+ this.trigger + + // " -- trigger.substr(0,6)+\"XXX\"="+trigger.substring(0,6)+"XXX" + + // " -- \"CCC\"+trigger.substring(3,6)+\"XXX\"="+"CCC"+trigger.substring(3, + // 6)+"XXX" + + // " -- trigger.substring(0,3)+\"NNNXXX\"=" + trigger.substring(0, + // 3)+"NNNXXX" + + // " -- trigger.substring(0, 3)+\"NNN\"+trigger.substring(6)="+trigger.substring(0, + // 3)+"NNN"+trigger.substring(6)); + retVal = (trigger.equalsIgnoreCase(recordTrigger)) + || ((trigger.substring(0, 6) + "XXX") + .equalsIgnoreCase(recordTrigger)) + || (("CCC" + trigger.substring(3, 6) + "XXX") + .equalsIgnoreCase(recordTrigger)) + || ((trigger.substring(0, 3) + "NNNXXX") + .equalsIgnoreCase(recordTrigger)) + || ((trigger.substring(0, 3) + "NNN" + trigger.substring(6)) + .equalsIgnoreCase(recordTrigger) || (recordTrigger + .startsWith(trigger))); + } else { + String pattern = recordTrigger.replaceAll("\\*", ".+"); + retVal = trigger.matches(pattern); + } + return retVal; + } + +} diff --git a/rpms/awips2.core/Installer.database/component.spec b/rpms/awips2.core/Installer.database/component.spec index 33fb773e8e..d579f4f976 100644 --- a/rpms/awips2.core/Installer.database/component.spec +++ b/rpms/awips2.core/Installer.database/component.spec @@ -273,7 +273,6 @@ execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/spatial_ref execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/rtpostgis.sql metadata execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/legacy.sql metadata execute_psql_sql_script ${SQL_SHARE_DIR}/permissions.sql metadata -execute_psql_sql_script ${SQL_SHARE_DIR}/create_subscription_tables.sql metadata execute_psql_sql_script ${SQL_SHARE_DIR}/fxatext.sql metadata # create the events schema