Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-08-12 14:29:45 -0400
committerddunne2010-08-12 14:29:45 -0400
commit28334f8b5905e75303aec8af9cdfc67aea299541 (patch)
tree9726798b5af2ac3601f5b909546abc327e3f4ee8 /plugins/org.eclipse.osee.framework.database
parente109f14b02681b2a0d007a38f2a4b1617c116caf (diff)
downloadorg.eclipse.osee-28334f8b5905e75303aec8af9cdfc67aea299541.tar.gz
org.eclipse.osee-28334f8b5905e75303aec8af9cdfc67aea299541.tar.xz
org.eclipse.osee-28334f8b5905e75303aec8af9cdfc67aea299541.zip
turn off ats cm access provider
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
index c0e5b0a55e1..e267f046082 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.database.core;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Donald G. Dunne
@@ -45,6 +46,39 @@ public class OseeInfo {
return cacheValue;
}
+ /**
+ * Return true if key is set in osee_info table and value = "true". Return false if key is either not in osee_info
+ * table OR value != "true".<br>
+ * <br>
+ * Note: This call will hit the database every time, so shouldn't be used for often repeated calls. use
+ * isCacheEnabled that will cache the value
+ */
+ public static boolean isEnabled(String key) throws OseeDataStoreException {
+ String dbProperty = OseeInfo.getValue(key);
+ if (Strings.isValid(dbProperty)) {
+ return dbProperty.equals("true");
+ }
+ return false;
+ }
+
+ /**
+ * Return true if key is set in osee_info table and value = "true". Return false if key is either not in osee_info
+ * table OR value != "true".<br>
+ * <br>
+ * Return cached value (value only loaded once per session. Restart will reset value if changed in osee_info
+ */
+ public static boolean isCacheEnabled(String key) throws OseeDataStoreException {
+ String dbProperty = OseeInfo.getCachedValue(key);
+ if (Strings.isValid(dbProperty)) {
+ return dbProperty.equals("true");
+ }
+ return false;
+ }
+
+ public static void setEnabled(String key, boolean enabled) throws OseeDataStoreException {
+ putValue(key, String.valueOf(enabled));
+ }
+
public static void putValue(String key, String value) throws OseeDataStoreException {
ConnectionHandler.runPreparedUpdate(DELETE_KEY_SQL, key);
ConnectionHandler.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value);

Back to the top