diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java index d703e39306..949baffe4c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefData.java @@ -25,6 +25,7 @@ import java.util.regex.Pattern; import com.raytheon.edex.plugin.shef.util.SHEFDate; import com.raytheon.edex.plugin.shef.util.ShefParm; +import com.raytheon.uf.common.dataplugin.shef.tables.IngestfilterId; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode.Duration; import com.raytheon.uf.common.dataplugin.shef.util.ParameterCode.Extremum; @@ -47,6 +48,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * 03/19/08 387 M. Duff Initial creation. * 10/16/2008 1548 jelkins Integrated ParameterCode Types * 04/29/2014 3088 mpduff cleanup. + * 06/26/2014 3321 mpduff Added ingestfilter primary key getter. * * */ @@ -805,14 +807,30 @@ public class ShefData implements ISerializableObject { * * @return */ - public String getPeTsE() { + public String getPeDTsE() { StringBuilder sb = new StringBuilder(); sb.append(this.getPhysicalElement().getCode()); sb.append(this.getTypeSource().getCode()); sb.append(this.getExtremum().getCode()); + sb.append(this.getDurationCodeVariable()); return sb.toString(); } + /** + * Get the ingest filter table primary key value for this data object. + * + * @return The primary key object + */ + public IngestfilterId getIngestFilterKey() { + IngestfilterId id = new IngestfilterId(); + id.setLid(this.getLocationId()); + id.setDur(this.getDurationValue()); + id.setExtremum(this.getExtremum().getCode()); + id.setPe(this.getPhysicalElement().getCode()); + id.setTs(this.getTypeSource().getCode()); + return id; + } + /** * * @param element @@ -885,5 +903,4 @@ public class ShefData implements ISerializableObject { } } - } diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index ea8957b8bf..ceafe1d177 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -122,7 +122,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Updated with more performance fixes. * 05/28/2014 3222 mpduff Fix posting time to be processed time so db doesn't show all post times the same * 06/02/2014 mpduff Fix for caching of range checks. - * + * 06/26/2014 3321 mpduff Fix ingestSwitchMap checks * * * @author mduff @@ -228,7 +228,7 @@ public class PostShef { private Map adjustmentMap = new HashMap(); /** Map of location identifier to IngestSwitch */ - private Map ingestSwitchMap = new HashMap(); + private Map ingestSwitchMap = new HashMap(); // AppsDefaults tokens private String undefStation; @@ -529,7 +529,7 @@ public class PostShef { if (dataLog) { log.info(LOG_SEP); log.info("Posting process started for LID [" + locId - + "] PEDTSEP [" + data.getPeTsE() + "] value [" + + "] PEDTSEP [" + data.getPeDTsE() + "] value [" + dataValue + "]"); } @@ -650,7 +650,7 @@ public class PostShef { if (Location.LOC_LOCATION.equals(postLocData) || (Location.LOC_GEOAREA.equals(postLocData))) { if (!DataType.CONTINGENCY.equals(dataType)) { - ingestSwitch = checkIngest(locId, data, ingestSwitch); + ingestSwitch = checkIngest(locId, data); } if (ShefConstants.IngestSwitch.POST_PE_OFF .equals(ingestSwitch)) { @@ -2123,8 +2123,7 @@ public class PostShef { * ingest switch setting * @return */ - private IngestSwitch checkIngest(String locId, ShefData data, - ShefConstants.IngestSwitch ingestSwitch) { + private IngestSwitch checkIngest(String locId, ShefData data) { StringBuilder errorMsg = new StringBuilder(); boolean matchFound = false; int hNum = 0; @@ -2150,7 +2149,12 @@ public class PostShef { String telem = null; String sql = null; Object[] oa = null; - String key = locId + data.getPeTsE(); + + IngestfilterId key = data.getIngestFilterKey();// .getPeDTsE(); + + // Default to off + ShefConstants.IngestSwitch ingestSwitch = IngestSwitch.POST_PE_OFF; + try { if (!ingestSwitchMap.containsKey(key)) { errorMsg.append("Error getting connection to IHFS Database"); @@ -2192,7 +2196,6 @@ public class PostShef { ingestSwitchMap.put(key, ingestSwitch); } - matchFound = ingestSwitchMap.containsKey(key); ingestSwitch = ingestSwitchMap.get(key); /*