Merge "Omaha #2975 optimize lookup of edit areas and gfe configs" into omaha_14.4.1

Former-commit-id: ed2b4e9bfb [formerly 8116a665a8] [formerly a9827b0545] [formerly ed2b4e9bfb [formerly 8116a665a8] [formerly a9827b0545] [formerly 245804a21a [formerly a9827b0545 [formerly 918dcb1b91fb45b84a82df42b7fe2d3fc2f86fa0]]]]
Former-commit-id: 245804a21a
Former-commit-id: 0d452f7961 [formerly d1ef4c7284] [formerly f644ea06f6a3769ab76168bd14a4459675cbc7ce [formerly 4ebb5b59df]]
Former-commit-id: 91b7bc7d29714ee5cd86f5d44c97d204d80245f3 [formerly 923aca6f7f]
Former-commit-id: 0e924a980f
This commit is contained in:
Ron Anderson 2014-09-29 16:10:37 -05:00 committed by Gerrit Code Review
commit 93fc56a9ca
2 changed files with 13 additions and 8 deletions

View file

@ -29,6 +29,7 @@ import java.util.Set;
import jep.JepException; import jep.JepException;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil; import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.python.PyUtil; import com.raytheon.uf.common.python.PyUtil;
@ -48,6 +49,7 @@ import com.raytheon.uf.common.util.FileUtil;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jan 21, 2010 randerso Initial creation * Jan 21, 2010 randerso Initial creation
* Jul 08, 2014 3361 njensen Consolidated code * Jul 08, 2014 3361 njensen Consolidated code
* Sep 29, 2014 2975 njensen Only look up files in CAVE_STATIC
* *
* </pre> * </pre>
* *
@ -122,8 +124,8 @@ public class ConfigCatalog {
*/ */
public LocalizationFile[] getFiles() { public LocalizationFile[] getFiles() {
LocalizationFile[] procFiles = PathManagerFactory.getPathManager() LocalizationFile[] procFiles = PathManagerFactory.getPathManager()
.listStaticFiles(GfePyIncludeUtil.CONFIG, .listStaticFiles(LocalizationType.CAVE_STATIC,
new String[] { EXTENSION }, GfePyIncludeUtil.CONFIG, new String[] { EXTENSION },
false, true); false, true);
return procFiles; return procFiles;
} }
@ -149,7 +151,7 @@ public class ConfigCatalog {
String fname = GfePyIncludeUtil.CONFIG + File.separator + scriptName String fname = GfePyIncludeUtil.CONFIG + File.separator + scriptName
+ EXTENSION; + EXTENSION;
LocalizationFile file = PathManagerFactory.getPathManager() LocalizationFile file = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(fname); .getStaticLocalizationFile(LocalizationType.CAVE_STATIC, fname);
return file; return file;
} }

View file

@ -109,7 +109,8 @@ import com.vividsolutions.jts.geom.Envelope;
* 06/21/2013 14983 ryu Added method for synchronous evaluation of query. * 06/21/2013 14983 ryu Added method for synchronous evaluation of query.
* 08/06/2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles() * 08/06/2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
* 09/30/2013 2361 njensen Use JAXBManager for XML * 09/30/2013 2361 njensen Use JAXBManager for XML
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles() * 09/08/2014 #3592 randerso Changed to use new pm listStaticFiles()
* 09/29/2014 2975 njensen Only lookup COMMON_STATIC for editAreas
* *
* </pre> * </pre>
* *
@ -776,7 +777,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
String filePath = FileUtil.join(EDIT_AREAS_DIR, refSetID.getName() String filePath = FileUtil.join(EDIT_AREAS_DIR, refSetID.getName()
+ ".xml"); + ".xml");
LocalizationFile lf = PathManagerFactory.getPathManager() LocalizationFile lf = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(filePath); .getStaticLocalizationFile(LocalizationType.COMMON_STATIC,
filePath);
if (lf != null) { if (lf != null) {
try { try {
@ -1666,7 +1668,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
String filePath = FileUtil.join(EDIT_AREAS_DIR, refId.getName() String filePath = FileUtil.join(EDIT_AREAS_DIR, refId.getName()
+ ".xml"); + ".xml");
LocalizationFile lf = PathManagerFactory.getPathManager() LocalizationFile lf = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(filePath); .getStaticLocalizationFile(LocalizationType.COMMON_STATIC,
filePath);
if ((lf != null) && lf.exists()) { if ((lf != null) && lf.exists()) {
changes.add(refId); changes.add(refId);
@ -1716,8 +1719,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
} }
// find the file anywhere in the hierarchy // find the file anywhere in the hierarchy
LocalizationFile lf = pm.getStaticLocalizationFile(message LocalizationFile lf = pm.getStaticLocalizationFile(
.getFileName()); LocalizationType.COMMON_STATIC, message.getFileName());
// if it exists, load it // if it exists, load it
if ((lf != null) && lf.exists()) { if ((lf != null) && lf.exists()) {