Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-09-28 22:23:05 -0400
committerRyan D. Brooks2010-09-28 22:23:05 -0400
commit936c81622a32fb4be316681d15583e2e636c33f1 (patch)
tree3d1b8134b9cb0a7067d952b16f42fa51f6655740 /plugins
parent82a1d6fe3db02b6879f9c50756520aa56740d2ec (diff)
downloadorg.eclipse.osee-936c81622a32fb4be316681d15583e2e636c33f1.tar.gz
org.eclipse.osee-936c81622a32fb4be316681d15583e2e636c33f1.tar.xz
org.eclipse.osee-936c81622a32fb4be316681d15583e2e636c33f1.zip
refactor: Convert DbUtil.dbInit flag into system property
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java10
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java7
3 files changed, 13 insertions, 7 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
index 10a6b70d96..5623a0e1ad 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
@@ -48,6 +48,8 @@ public class OseeClientProperties extends OseeProperties {
private static final String OSEE_PROMPT_ON_DB_INIT = "osee.prompt.on.db.init";
private static final String OSEE_CHOICE_ON_DB_INIT = "osee.choice.on.db.init";
+ private static final String OSEE_IS_IN_DB_INIT = "osee.is.in.db.init";
+
private enum InitializerFlag {
overwrite_settings,
client_defaults;
@@ -77,6 +79,14 @@ public class OseeClientProperties extends OseeProperties {
initialize();
}
+ public static boolean isInDbInit() {
+ return Boolean.valueOf(getProperty(OSEE_IS_IN_DB_INIT));
+ }
+
+ public static void setInDbInit(boolean value) {
+ System.setProperty(OSEE_IS_IN_DB_INIT, Boolean.toString(value));
+ }
+
// /**
// * Retrieves where table data should be imported from during OSEE database initialization. The default is to use the
// * database connection id specified in the schema.xml files.
diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
index 37f841d795..019b14efac 100644
--- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
+++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
@@ -33,7 +33,6 @@ import org.eclipse.osee.framework.core.util.HttpProcessor.AcquireResult;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.init.internal.DatabaseInitActivator;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.utility.DbUtil;
/**
* @author Andrew M. Finkbeiner
@@ -49,7 +48,7 @@ public class DbBootstrapTask implements IDbInitializationTask {
public void run() throws OseeCoreException {
Conditions.checkNotNull(configuration, "DbInitConfiguration Info");
- DbUtil.setDbInit(true);
+ OseeClientProperties.setInDbInit(true);
createOseeDatastore();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java
index 7194f0d37d..60298203fd 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/DbUtil.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.skynet.core.utility;
import java.util.Collection;
import java.util.Map;
+import org.eclipse.osee.framework.core.client.OseeClientProperties;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
@@ -19,7 +20,6 @@ import org.eclipse.osee.framework.database.core.ConnectionHandler;
* @author Donald G. Dunne
*/
public final class DbUtil {
- private static boolean isInDbInit;
private DbUtil() {
// Utility Class - class should only have static methods
@@ -36,10 +36,7 @@ public final class DbUtil {
}
public static boolean isDbInit() {
- return isInDbInit;
+ return OseeClientProperties.isInDbInit();
}
- public static void setDbInit(boolean isInDbInit) {
- DbUtil.isInDbInit = isInDbInit;
- }
}

Back to the top