Issue #828: Ensure all baseline PurgeRules files live in only COMMON_STATIC, modify

PluginDao.getPurgeRulesForPlugin to search just COMMON_STATIC.

Change-Id: If0e9b37d423a5cdfe317194f952bbfb9697b9581

Former-commit-id: abdcc32b2c [formerly 3fffc47ba5 [formerly 7cd8ebbf86bd1b6725e990fc2c36317e15cc1fc0]]
Former-commit-id: 3fffc47ba5
Former-commit-id: aa0ba41cf9
This commit is contained in:
David Gillingham 2012-06-29 13:01:42 -05:00
parent c4a50f8c5c
commit d54d8a51ff
5 changed files with 22 additions and 22 deletions

View file

@ -51,6 +51,11 @@ import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.StorageStatus;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
@ -79,6 +84,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/6/09 1990 bphillip Initial creation
* 6/29/12 #828 dgilling Force getPurgeRulesForPlugin()
* to search only COMMON_STATIC.
* </pre>
*
* @author bphillip
@ -1228,8 +1235,21 @@ public abstract class PluginDao extends CoreDao {
}
public static List<PurgeRule> getPurgeRulesForPlugin(String pluginName) {
File rulesFile = PathManagerFactory.getPathManager().getStaticFile(
"purge/" + pluginName + "PurgeRules.xml");
IPathManager pathMgr = PathManagerFactory.getPathManager();
Map<LocalizationLevel, LocalizationFile> tieredFile = pathMgr
.getTieredLocalizationFile(LocalizationType.COMMON_STATIC,
"purge/" + pluginName + "PurgeRules.xml");
LocalizationContext[] levelHierarchy = pathMgr
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC);
File rulesFile = null;
for (LocalizationContext ctx : levelHierarchy) {
LocalizationFile lFile = tieredFile.get(ctx.getLocalizationLevel());
if (lFile != null) {
rulesFile = lFile.getFile();
break;
}
}
if (rulesFile != null) {
try {
PurgeRuleSet purgeRules = (PurgeRuleSet) SerializationUtil

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<purgeRuleSet xmlns:ns2="group">
<rule>
<id>
<pluginName>airmet</pluginName>
<key>default</key>
</id>
<period>02-00:00:00</period>
</rule>
</purgeRuleSet>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<purgeRuleSet xmlns:ns2="group">
<rule>
<id>
<pluginName>convsigmet</pluginName>
<key>default</key>
</id>
<period>02-00:00:00</period>
</rule>
</purgeRuleSet>