Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-23 22:42:17 -0400
committerRyan D. Brooks2010-09-23 22:42:17 -0400
commit8885710c96fd5a85058b3103cfd081169dfeea76 (patch)
tree89ee31e3336b77d248a20ad1f64d4850857704a1 /plugins/org.eclipse.osee.framework.core.datastore
parent47b4411c167982b9818e5f337a46ab02ad5f5708 (diff)
downloadorg.eclipse.osee-8885710c96fd5a85058b3103cfd081169dfeea76.tar.gz
org.eclipse.osee-8885710c96fd5a85058b3103cfd081169dfeea76.tar.xz
org.eclipse.osee-8885710c96fd5a85058b3103cfd081169dfeea76.zip
refactor: Make service accessor methods in server admin Activator static
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.datastore')
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/BranchMoveOperation.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/BranchStoreOperation.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseBranchAccessor.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/CreateSchemaOperation.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/OperationFactory.java9
5 files changed, 13 insertions, 29 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/BranchMoveOperation.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/BranchMoveOperation.java
index d285bced22..86311c27bb 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/BranchMoveOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/BranchMoveOperation.java
@@ -14,7 +14,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.datastore.internal.Activator;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.OseeConnection;
@@ -30,8 +30,8 @@ public class BranchMoveOperation extends AbstractDbTxOperation {
private final boolean archive;
private final Branch branch;
- public BranchMoveOperation(IOseeDatabaseServiceProvider provider, boolean archive, Branch branch) {
- super(provider, "Branch Move", Activator.PLUGIN_ID);
+ public BranchMoveOperation(IOseeDatabaseService databaseService, boolean archive, Branch branch) {
+ super(databaseService, "Branch Move", Activator.PLUGIN_ID);
this.archive = archive;
this.branch = branch;
}
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/BranchStoreOperation.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/BranchStoreOperation.java
index 5275a3fb7e..142ee213b4 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/BranchStoreOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/BranchStoreOperation.java
@@ -23,7 +23,7 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.BranchField;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -45,8 +45,8 @@ public class BranchStoreOperation extends AbstractDbTxOperation {
private final IBranchUpdateEvent eventSender;
private final Collection<Branch> branches;
- public BranchStoreOperation(IOseeDatabaseServiceProvider provider, IBranchUpdateEvent eventSender, Collection<Branch> branches) {
- super(provider, "Branch Archive Operation", Activator.PLUGIN_ID);
+ public BranchStoreOperation(IOseeDatabaseService databaseService, IBranchUpdateEvent eventSender, Collection<Branch> branches) {
+ super(databaseService, "Branch Archive Operation", Activator.PLUGIN_ID);
this.eventSender = eventSender;
this.branches = branches;
}
@@ -115,7 +115,7 @@ public class BranchStoreOperation extends AbstractDbTxOperation {
}
}
if (branch.isFieldDirty(BranchField.BRANCH_ARCHIVED_STATE_FIELD_KEY)) {
- Operations.executeAsJob(new BranchMoveOperation(getDatabaseServiceProvider(),
+ Operations.executeAsJob(new BranchMoveOperation(getDatabaseService(),
branch.getArchiveState().isArchived(), branch), false);
}
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseBranchAccessor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseBranchAccessor.java
index bf74fa70cb..60550051c6 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseBranchAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseBranchAccessor.java
@@ -33,7 +33,6 @@ import org.eclipse.osee.framework.core.model.cache.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -174,14 +173,6 @@ public class DatabaseBranchAccessor extends AbstractDatabaseAccessor<Branch> {
@Override
public void store(Collection<Branch> branches) throws OseeCoreException {
- IOseeDatabaseServiceProvider dbServiceProvider = new IOseeDatabaseServiceProvider() {
-
- @Override
- public IOseeDatabaseService getOseeDatabaseService() {
- return getDatabaseService();
- }
- };
- Operations.executeWorkAndCheckStatus(new BranchStoreOperation(dbServiceProvider, eventSender, branches));
+ Operations.executeWorkAndCheckStatus(new BranchStoreOperation(getDatabaseService(), eventSender, branches));
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/CreateSchemaOperation.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/CreateSchemaOperation.java
index 8dbd7b0cef..211a1add07 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/CreateSchemaOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/CreateSchemaOperation.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.datastore.schema.sql.SchemaSqlUtil;
import org.eclipse.osee.framework.core.datastore.schema.sql.SqlFactory;
import org.eclipse.osee.framework.core.datastore.schema.sql.SqlManager;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.database.core.SupportedDatabase;
@@ -32,8 +32,8 @@ public class CreateSchemaOperation extends AbstractDbTxOperation {
private final Map<String, SchemaData> userSchema;
private final Map<String, SchemaData> dbSchema;
- public CreateSchemaOperation(IOseeDatabaseServiceProvider provider, Map<String, SchemaData> userSchema, Map<String, SchemaData> dbSchema) {
- super(provider, "Create Schema", Activator.PLUGIN_ID);
+ public CreateSchemaOperation(IOseeDatabaseService databaseService, Map<String, SchemaData> userSchema, Map<String, SchemaData> dbSchema) {
+ super(databaseService, "Create Schema", Activator.PLUGIN_ID);
this.userSchema = userSchema;
this.dbSchema = dbSchema;
}
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/OperationFactory.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/OperationFactory.java
index dac751cd43..7debb510aa 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/OperationFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/OperationFactory.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.framework.core.datastore.schema.data.SchemaData;
import org.eclipse.osee.framework.core.operation.CompositeOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
/**
* @author Roberto E. Escobar
@@ -39,13 +38,7 @@ public final class OperationFactory {
List<IOperation> ops = new ArrayList<IOperation>();
ops.add(new LoadUserSchemasOperation(userSpecifiedConfig, schemaProvider, options));
ops.add(new ExtractDatabaseSchemaOperation(databaseService, userSpecifiedConfig.keySet(), currentDatabaseConfig));
- ops.add(new CreateSchemaOperation(new IOseeDatabaseServiceProvider() {
-
- @Override
- public IOseeDatabaseService getOseeDatabaseService() {
- return databaseService;
- }
- }, userSpecifiedConfig, currentDatabaseConfig));
+ ops.add(new CreateSchemaOperation(databaseService, userSpecifiedConfig, currentDatabaseConfig));
return new CompositeOperation("Create OSEE Schema", Activator.PLUGIN_ID, ops);
}

Back to the top