Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-03-20 16:34:04 -0400
committerRyan D. Brooks2016-03-20 16:34:04 -0400
commit25ba37ff17d9e35bd6dab4656b8b0a9be130c481 (patch)
tree4de6af4efa4a2225d88ce79d0e143e4d2267c130
parentd35b51fde59bbd43d59f0c7eff97ef4c6784cd01 (diff)
downloadorg.eclipse.osee-25ba37ff17d9e35bd6dab4656b8b0a9be130c481.tar.gz
org.eclipse.osee-25ba37ff17d9e35bd6dab4656b8b0a9be130c481.tar.xz
org.eclipse.osee-25ba37ff17d9e35bd6dab4656b8b0a9be130c481.zip
refinement: Consolidate OseeData constants
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeData.java30
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java4
-rw-r--r--plugins/org.eclipse.osee.jdbc/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/internal/JdbcSequenceProvider.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreMigrationResource.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java9
10 files changed, 54 insertions, 29 deletions
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
index 7338d8de8c..2d1ac2e3e7 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/ArtifactEventTest.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeHousekeepingRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -69,7 +70,7 @@ import org.junit.Test;
* @author Donald G. Dunne
*/
public class ArtifactEventTest {
- private static final String REL_LINK_ID_SEQ = "SKYNET_REL_LINK_ID_SEQ";
+
@Rule
public OseeClientIntegrationRule integration = new OseeClientIntegrationRule(OSEE_CLIENT_DEMO);
@@ -869,7 +870,7 @@ public class ArtifactEventTest {
* @throws OseeDataStoreException
*/
private int getIncrementingRelationId() throws OseeCoreException {
- return (int) ConnectionHandler.getNextSequence(REL_LINK_ID_SEQ, true);
+ return (int) ConnectionHandler.getNextSequence(OseeData.REL_LINK_ID_SEQ, true);
}
private static final class ArtifactEventListener implements IArtifactEventListener {
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeData.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeData.java
new file mode 100644
index 0000000000..5c2d88cbed
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeData.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.data;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OseeData {
+
+ public static final String ART_ID_SEQ = "SKYNET_ART_ID_SEQ";
+ public static final String ATTR_ID_SEQ = "SKYNET_ATTR_ID_SEQ";
+ public static final String REL_LINK_ID_SEQ = "SKYNET_REL_LINK_ID_SEQ";
+ public static final String GAMMA_ID_SEQ = "SKYNET_GAMMA_ID_SEQ";
+
+ public static final String BRANCH_ID_SEQ = "SKYNET_BRANCH_ID_SEQ";
+ public static final String TRANSACTION_ID_SEQ = "SKYNET_TRANSACTION_ID_SEQ";
+
+ private OseeData() {
+ // utility class
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java
index 832b305107..80b5f6e5e5 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactFactory.java
@@ -16,6 +16,7 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -29,7 +30,6 @@ import org.eclipse.osee.framework.skynet.core.utility.ConnectionHandler;
* @author Donald G. Dunne
*/
public abstract class ArtifactFactory {
- public static final String ART_ID_SEQ = "SKYNET_ART_ID_SEQ";
private final Set<IArtifactType> artifactTypeNames = new HashSet<>(5);
protected ArtifactFactory(IArtifactType... artifactTypes) {
@@ -77,7 +77,7 @@ public abstract class ArtifactFactory {
}
public static int getNextArtifactId(Long uuid) {
- return uuid == null ? (int) ConnectionHandler.getNextSequence(ART_ID_SEQ, true) : uuid.intValue();
+ return uuid == null ? (int) ConnectionHandler.getNextSequence(OseeData.ART_ID_SEQ, true) : uuid.intValue();
}
public synchronized Artifact reflectExisitingArtifact(int artId, String guid, IArtifactType artifactType, int gammaId, IOseeBranch branch, ModificationType modificationType) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.jdbc/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.jdbc/META-INF/MANIFEST.MF
index 30cbfe94b2..b2cb0e4731 100644
--- a/plugins/org.eclipse.osee.jdbc/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.jdbc/META-INF/MANIFEST.MF
@@ -8,6 +8,7 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Import-Package: org.apache.commons.dbcp,
org.apache.commons.pool,
org.apache.commons.pool.impl,
+ org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.jdk.core.util.network,
diff --git a/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/internal/JdbcSequenceProvider.java b/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/internal/JdbcSequenceProvider.java
index 1682b70d01..e56e1b4419 100644
--- a/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/internal/JdbcSequenceProvider.java
+++ b/plugins/org.eclipse.osee.jdbc/src/org/eclipse/osee/jdbc/internal/JdbcSequenceProvider.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.jdbc.internal;
import java.util.HashMap;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcConnection;
@@ -37,7 +38,6 @@ public class JdbcSequenceProvider {
private final class JdbcSequenceTx extends JdbcTransaction {
- private static final String ART_ID_SEQ = "SKYNET_ART_ID_SEQ";
private static final String QUERY_SEQUENCE = "SELECT last_sequence FROM osee_sequence WHERE sequence_name = ?";
public static final String INSERT_SEQUENCE =
"INSERT INTO osee_sequence (last_sequence, sequence_name) VALUES (?,?)";
@@ -104,7 +104,7 @@ public class JdbcSequenceProvider {
SequenceRange range = getRange(sequenceName);
range.lastAvailable = 0;
int initalValue = 0;
- if (sequenceName.equals(ART_ID_SEQ)) {
+ if (sequenceName.equals(OseeData.ART_ID_SEQ)) {
initalValue = 200000;
}
client.runPreparedUpdate(connection, INSERT_SEQUENCE, initalValue, sequenceName);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
index 7cde6c806d..fa94587a1f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
@@ -17,14 +17,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public interface IdentityManager extends IdentityLocator {
- public static final String ART_ID_SEQ = "SKYNET_ART_ID_SEQ";
- public static final String ATTR_ID_SEQ = "SKYNET_ATTR_ID_SEQ";
- public static final String REL_LINK_ID_SEQ = "SKYNET_REL_LINK_ID_SEQ";
- public static final String GAMMA_ID_SEQ = "SKYNET_GAMMA_ID_SEQ";
-
- public static final String BRANCH_ID_SEQ = "SKYNET_BRANCH_ID_SEQ";
- public static final String TRANSACTION_ID_SEQ = "SKYNET_TRANSACTION_ID_SEQ";
-
int getNextTransactionId();
int getNextArtifactId();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
index 9acb762d4f..752c20d56d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
@@ -15,8 +15,8 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.jdbc.JdbcClient;
-import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
/**
@@ -102,12 +102,12 @@ public final class ExchangeDb {
static List<IdTranslator> createTranslators(JdbcClient service) {
List<IdTranslator> translators = new ArrayList<>();
- translators.add(new IdTranslator(service, IdentityManager.GAMMA_ID_SEQ, GAMMA_ID_ALIASES));
- translators.add(new IdTranslator(service, IdentityManager.TRANSACTION_ID_SEQ, TRANSACTION_ID_ALIASES));
- translators.add(new IdTranslator(service, IdentityManager.BRANCH_ID_SEQ, BRANCH_ID_ALIASES));
- translators.add(new IdTranslator(service, IdentityManager.ART_ID_SEQ, ARTIFACT_ID_ALIASES));
- translators.add(new IdTranslator(service, IdentityManager.ATTR_ID_SEQ, ATTRIBUTE_ID));
- translators.add(new IdTranslator(service, IdentityManager.REL_LINK_ID_SEQ, RELATION_ID));
+ translators.add(new IdTranslator(service, OseeData.GAMMA_ID_SEQ, GAMMA_ID_ALIASES));
+ translators.add(new IdTranslator(service, OseeData.TRANSACTION_ID_SEQ, TRANSACTION_ID_ALIASES));
+ translators.add(new IdTranslator(service, OseeData.BRANCH_ID_SEQ, BRANCH_ID_ALIASES));
+ translators.add(new IdTranslator(service, OseeData.ART_ID_SEQ, ARTIFACT_ID_ALIASES));
+ translators.add(new IdTranslator(service, OseeData.ATTR_ID_SEQ, ATTRIBUTE_ID));
+ translators.add(new IdTranslator(service, OseeData.REL_LINK_ID_SEQ, RELATION_ID));
return translators;
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
index bb597d7a83..d0dc3d520b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.db.internal.exchange;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -23,7 +24,6 @@ import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.ExportOptions;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
-import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.exchange.export.AbstractExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.DbTableExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.ManifestExportItem;
@@ -33,7 +33,7 @@ import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
public class ExportItemFactory {
private static final String GET_MAX_TX =
- "SELECT last_sequence FROM osee_sequence WHERE sequence_name = '" + IdentityManager.TRANSACTION_ID_SEQ + "'";
+ "SELECT last_sequence FROM osee_sequence WHERE sequence_name = '" + OseeData.TRANSACTION_ID_SEQ + "'";
private static final String BRANCH_TABLE_QUERY =
"SELECT br.* FROM osee_join_export_import jex, osee_branch br WHERE jex.query_id=? AND jex.id1=br.branch_id ORDER BY br.branch_id";
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreMigrationResource.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreMigrationResource.java
index ef03fc9f91..ce1eb8fcc4 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreMigrationResource.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreMigrationResource.java
@@ -13,11 +13,11 @@ package org.eclipse.osee.orcs.db.internal.resource;
import static org.eclipse.osee.framework.core.enums.CoreBranches.SYSTEM_ROOT_ID;
import java.net.URL;
import java.util.Map;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.jdbc.AbstractJdbcMigrationResource;
-import org.eclipse.osee.orcs.db.internal.IdentityManager;
public class OseeDatastoreMigrationResource extends AbstractJdbcMigrationResource {
@@ -35,7 +35,7 @@ public class OseeDatastoreMigrationResource extends AbstractJdbcMigrationResourc
@Override
public void addPlaceholders(Map<String, String> placeholders) {
- placeholders.put(TX_SEQ_PLACEHOLDER, IdentityManager.TRANSACTION_ID_SEQ);
+ placeholders.put(TX_SEQ_PLACEHOLDER, OseeData.TRANSACTION_ID_SEQ);
placeholders.put(SYS_ROOT_TYPE_PLACEHOLDER, String.valueOf(BranchType.SYSTEM_ROOT.getValue()));
placeholders.put(SYS_ROOT_STATE_PLACEHOLDER, String.valueOf(BranchState.MODIFIED.getValue()));
placeholders.put(SYS_ROOT_NAME_PLACEHOLDER, CoreBranches.SYSTEM_ROOT.getName());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
index 8b4fe4bad5..ae1b9d1734 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.util;
+import org.eclipse.osee.framework.core.data.OseeData;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -33,7 +34,7 @@ public class IdentityManagerImpl implements IdentityManager {
@Override
public int getNextTransactionId() {
//keep transaction id's sequential in the face of concurrent transaction by multiple users
- return (int) client.getNextSequence(TRANSACTION_ID_SEQ, false);
+ return (int) client.getNextSequence(OseeData.TRANSACTION_ID_SEQ, false);
}
@Override
@@ -43,17 +44,17 @@ public class IdentityManagerImpl implements IdentityManager {
@Override
public int getNextAttributeId() {
- return (int) client.getNextSequence(ATTR_ID_SEQ, true);
+ return (int) client.getNextSequence(OseeData.ATTR_ID_SEQ, true);
}
@Override
public int getNextRelationId() {
- return (int) client.getNextSequence(REL_LINK_ID_SEQ, true);
+ return (int) client.getNextSequence(OseeData.REL_LINK_ID_SEQ, true);
}
@Override
public long getNextGammaId() {
- return (int) client.getNextSequence(GAMMA_ID_SEQ, true);
+ return (int) client.getNextSequence(OseeData.GAMMA_ID_SEQ, true);
}
@Override

Back to the top