Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-10-20 19:10:58 -0400
committerdonald.g.dunne2016-10-20 19:10:58 -0400
commit38437532280db829e658d7814693659cecb7fb56 (patch)
tree44487fa09c3b904b219614ac532d739fa4051381
parentb71eeab7ade5d94fb6eb44326e5e4c6c6e5c06ee (diff)
downloadorg.eclipse.osee-38437532280db829e658d7814693659cecb7fb56.tar.gz
org.eclipse.osee-38437532280db829e658d7814693659cecb7fb56.tar.xz
org.eclipse.osee-38437532280db829e658d7814693659cecb7fb56.zip
refactor: Remove more IArtifact usage
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java.orig67
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactPasteOperationTest.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java13
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java9
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java5
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java12
15 files changed, 111 insertions, 47 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java
index a914c58ce2..4022f713e6 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java
@@ -41,15 +41,15 @@ public class AtsCoreServiceImplTest {
@Test
public void testGetAtsId() {
- ArtifactToken artifact = ArtifactToken.valueOf(0, "guid", null, COMMON, null);
+ ArtifactToken artifact = ArtifactToken.valueOf(0, null, COMMON);
when(attrResolver.getSoleAttributeValue(artifact, AtsAttributeTypes.AtsId, null)).thenReturn(null);
String result = AtsCoreServiceImpl.getAtsId(attrResolver, artifact);
- assertEquals(result, "guid");
+ assertEquals(result, artifact.getGuid());
when(attrResolver.getSoleAttributeValue(atsObject, AtsAttributeTypes.AtsId, null)).thenReturn(null);
when(atsObject.getStoreObject()).thenReturn(artifact);
result = AtsCoreServiceImpl.getAtsId(attrResolver, atsObject);
- assertEquals(result, "guid");
+ assertEquals(result, artifact.getGuid());
when(attrResolver.getSoleAttributeValue(artifact, AtsAttributeTypes.AtsId, null)).thenReturn("ATS23");
result = AtsCoreServiceImpl.getAtsId(attrResolver, artifact);
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java.orig b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java.orig
new file mode 100644
index 0000000000..b7ffdc7462
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImplTest.java.orig
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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.ats.core.util;
+
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Test Case for {@link AtsCoreServiceImpl}
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsCoreServiceImplTest {
+
+ // @formatter:off
+ @Mock private IAtsObject atsObject;
+ @Mock private IAttributeResolver attrResolver;
+ // @formatter:on
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void testGetAtsId() {
+<<<<<<< HEAD
+ ArtifactToken artifact = ArtifactToken.valueOf(0, "guid", null, COMMON, null);
+||||||| parent of be5246f... refactor: Remove more IArtifact usage
+ ArtifactToken artifact = ArtifactToken.valueOf(0, "guid", null, null, null);
+=======
+ ArtifactToken artifact = ArtifactToken.valueOf(0, null, null);
+>>>>>>> be5246f... refactor: Remove more IArtifact usage
+ when(attrResolver.getSoleAttributeValue(artifact, AtsAttributeTypes.AtsId, null)).thenReturn(null);
+ String result = AtsCoreServiceImpl.getAtsId(attrResolver, artifact);
+ assertEquals(result, artifact.getGuid());
+
+ when(attrResolver.getSoleAttributeValue(atsObject, AtsAttributeTypes.AtsId, null)).thenReturn(null);
+ when(atsObject.getStoreObject()).thenReturn(artifact);
+ result = AtsCoreServiceImpl.getAtsId(attrResolver, atsObject);
+ assertEquals(result, artifact.getGuid());
+
+ when(attrResolver.getSoleAttributeValue(artifact, AtsAttributeTypes.AtsId, null)).thenReturn("ATS23");
+ result = AtsCoreServiceImpl.getAtsId(attrResolver, artifact);
+ assertEquals(result, "ATS23");
+
+ when(attrResolver.getSoleAttributeValue(artifact, AtsAttributeTypes.AtsId, null)).thenReturn("ATS23");
+ assertEquals(result, "ATS23");
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactPasteOperationTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactPasteOperationTest.java
index 124d7d97a5..e5810da8de 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactPasteOperationTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ArtifactPasteOperationTest.java
@@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map.Entry;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
@@ -33,7 +34,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderFactory;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactNameConflictHandler;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPasteOperation;
@@ -221,18 +221,18 @@ public class ArtifactPasteOperationTest {
private final static class MockArtifactNameConflictHandler extends ArtifactNameConflictHandler {
private String resolveWith;
- private IArtifact conflictedArtifact;
+ private ArtifactToken conflictedArtifact;
public MockArtifactNameConflictHandler() {
resolveWith = null;
conflictedArtifact = null;
}
- public void setConflictedArtifact(IArtifact conflictedArtifact) {
+ public void setConflictedArtifact(ArtifactToken conflictedArtifact) {
this.conflictedArtifact = conflictedArtifact;
}
- public IArtifact getConflictedArtifact() {
+ public ArtifactToken getConflictedArtifact() {
return conflictedArtifact;
}
@@ -245,7 +245,7 @@ public class ArtifactPasteOperationTest {
}
@Override
- public String resolve(IArtifact artifact) {
+ public String resolve(ArtifactToken artifact) {
Assert.assertNotNull(artifact);
Assert.assertEquals(getConflictedArtifact(), artifact);
return getResolveWith();
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java
index 25f8616724..7c5faf9a02 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java
@@ -11,9 +11,10 @@
package org.eclipse.osee.framework.core.model.access;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.model.IBasicArtifact;
@@ -49,7 +50,7 @@ public class AccessDataQuery {
}
}
- public void artifactTypeMatches(PermissionEnum permissionToMatch, IBasicArtifact<?> artifact, PermissionStatus permissionStatus) throws OseeCoreException {
+ public void artifactTypeMatches(PermissionEnum permissionToMatch, ArtifactToken artifact, PermissionStatus permissionStatus) throws OseeCoreException {
IArtifactType typeToMatch = artifact.getArtifactType();
BranchId branchToMatch = artifact.getBranch();
branchArtifactTypeMatches(permissionToMatch, branchToMatch, typeToMatch, permissionStatus);
@@ -59,7 +60,7 @@ public class AccessDataQuery {
}
}
- public void artifactMatches(PermissionEnum permissionToMatch, final IBasicArtifact<?> artifact, PermissionStatus permissionStatus) throws OseeCoreException {
+ public void artifactMatches(PermissionEnum permissionToMatch, ArtifactToken artifact, PermissionStatus permissionStatus) throws OseeCoreException {
BranchId branchToMatch = artifact.getBranch();
branchMatches(permissionToMatch, branchToMatch, permissionStatus);
if (permissionStatus.matched()) {
@@ -107,7 +108,7 @@ public class AccessDataQuery {
}
}
- public void attributeTypeMatches(PermissionEnum permissionToMatch, IBasicArtifact<?> artifact, final IAttributeType attributeType, PermissionStatus permissionStatus) throws OseeCoreException {
+ public void attributeTypeMatches(PermissionEnum permissionToMatch, ArtifactToken artifact, final IAttributeType attributeType, PermissionStatus permissionStatus) throws OseeCoreException {
artifactMatches(permissionToMatch, artifact, permissionStatus);
if (permissionStatus.matched()) {
Collection<AccessDetail<?>> branchAccessDetails = accessData.getAccess(artifact.getBranch());
@@ -137,8 +138,8 @@ public class AccessDataQuery {
public boolean matchesAll(PermissionEnum permissionToMatch) throws OseeCoreException {
PermissionStatus permissionStatus = new PermissionStatus();
for (Object objectKey : accessData.keySet()) {
- if (objectKey instanceof IBasicArtifact<?>) {
- artifactMatches(permissionToMatch, (IBasicArtifact<?>) objectKey, permissionStatus);
+ if (objectKey instanceof ArtifactToken) {
+ artifactMatches(permissionToMatch, (ArtifactToken) objectKey, permissionStatus);
} else if (objectKey instanceof BranchId) {
branchMatches(permissionToMatch, (BranchId) objectKey, permissionStatus);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
index 2b9f2754f7..9e34b1699e 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderDataTest.java
@@ -183,7 +183,7 @@ public class RelationOrderDataTest {
accessor.clearStoreCalled();
// No Change -- Current Sorter Id
- List<IArtifact> emptyList = java.util.Collections.emptyList();
+ List<Artifact> emptyList = java.util.Collections.emptyList();
data.store(relationType1, RelationSide.SIDE_A, LEXICOGRAPHICAL_ASC, emptyList);
Assert.assertFalse(accessor.wasStoreCalled());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
index 01023eafa2..0d7fac35dd 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java
@@ -145,7 +145,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A
* (or similar variant)
*/
@Deprecated
- public final List<? extends IArtifact> getRelatedArtifacts(RelationType relationType) throws OseeCoreException {
+ public final List<Artifact> getRelatedArtifacts(RelationType relationType) throws OseeCoreException {
return RelationManager.getRelatedArtifacts(this, new RelationTypeSide(relationType, RelationSide.SIDE_B));
}
@@ -1285,7 +1285,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A
setRelationOrder(relationEnumeration, targetArtifact, insertAfterTarget, itemToAdd);
}
- public final void setRelationOrder(RelationTypeSide relationSide, List<? extends Artifact> artifactsInNewOrder) throws OseeCoreException {
+ public final void setRelationOrder(RelationTypeSide relationSide, List<Artifact> artifactsInNewOrder) throws OseeCoreException {
RelationManager.setRelationOrder(this, relationSide, relationSide.getSide(), USER_DEFINED, artifactsInNewOrder);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java
index 88f0282523..594319ab12 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java
@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -46,7 +47,7 @@ public class RelationCache {
private final CompositeKeyHashMap<ArtifactKey, IRelationType, List<RelationLink>> relationsByType =
new CompositeKeyHashMap<ArtifactKey, IRelationType, List<RelationLink>>(1024, true);
- private ArtifactKey getKey(IArtifact artifact) {
+ private ArtifactKey getKey(ArtifactToken artifact) {
ArtifactKey key = THREAD_SHARED_KEY.get();
return key.setKey(artifact);
}
@@ -99,7 +100,7 @@ public class RelationCache {
selectedRelations.add(newRelation);
}
- public List<RelationLink> getAll(IArtifact artifact) {
+ public List<RelationLink> getAll(ArtifactToken artifact) {
return getRelations(artifact, DeletionFlag.INCLUDE_DELETED);
}
@@ -108,7 +109,7 @@ public class RelationCache {
return relationsByType.get(key, relationType);
}
- public List<RelationLink> getRelations(IArtifact artifact, DeletionFlag deletionFlag) {
+ public List<RelationLink> getRelations(ArtifactToken artifact, DeletionFlag deletionFlag) {
ArtifactKey key = getKey(artifact);
List<RelationLink> linksFound = new ArrayList<>();
RelationMatcher matcher = RelationFilterUtil.createMatcher(deletionFlag);
@@ -184,7 +185,7 @@ public class RelationCache {
return size != 0 ? relations.iterator().next() : null;
}
- public RelationLink getLoadedRelation(IRelationType relationType, final int aArtifactId, final int bArtifactId, BranchId branch) {
+ public RelationLink getLoadedRelation(IRelationType relationType, int aArtifactId, int bArtifactId, BranchId branch) {
RelationMatcher bArtIdMatcher =
RelationFilterUtil.createFindFirstRelatedArtIdMatcher(bArtifactId, RelationSide.SIDE_B);
List<RelationLink> links = new ArrayList<>();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
index 4ebfab89cc..23562633d1 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
@@ -565,7 +565,7 @@ public class RelationManager {
return relationOrderFactory.createRelationOrderData(artifact);
}
- public static void setRelationOrder(Artifact artifact, IRelationType relationType, RelationSide side, RelationSorter orderId, List<? extends Artifact> relatives) throws OseeCoreException {
+ public static void setRelationOrder(Artifact artifact, IRelationType relationType, RelationSide side, RelationSorter orderId, List<Artifact> relatives) throws OseeCoreException {
RelationTypeSideSorter sorter = createTypeSideSorter(artifact, relationType, side);
sorter.setOrder(relatives, orderId);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
index a2836486c1..5414606315 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeSideSorter.java
@@ -16,6 +16,7 @@ import static org.eclipse.osee.framework.core.enums.RelationSorter.USER_DEFINED;
import java.util.Collections;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.enums.RelationSorter;
@@ -25,7 +26,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.relation.order.IRelationSorter;
import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderData;
import org.eclipse.osee.framework.skynet.core.relation.order.RelationSorterProvider;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
/**
* @author Andrew M. Finkbeiner
@@ -69,7 +69,7 @@ public class RelationTypeSideSorter extends RelationTypeSide {
return orderData.getCurrentSorterGuid(relationType, getSide());
}
- public void sort(List<? extends IArtifact> listToOrder) throws OseeCoreException {
+ public void sort(List<? extends ArtifactToken> listToOrder) throws OseeCoreException {
IRelationSorter order = sorterProvider.getRelationOrder(getSorterId());
List<String> relativeOrder = orderData.getOrderList(getRelationType(), getSide());
order.sort(listToOrder, relativeOrder);
@@ -104,7 +104,7 @@ public class RelationTypeSideSorter extends RelationTypeSide {
setOrder(relatives, getSorterId());
}
- public void setOrder(List<? extends IArtifact> relatives, RelationSorter sorterId) throws OseeCoreException {
+ public void setOrder(List<Artifact> relatives, RelationSorter sorterId) {
orderData.store(relationType, getSide(), sorterId, relatives);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
index 950049f564..17189063e4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderData.java
@@ -18,7 +18,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map.Entry;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.RelationSide;
@@ -105,7 +104,7 @@ public class RelationOrderData {
return lists.size();
}
- public void store(RelationType type, RelationSide side, RelationSorter requestedSorterId, List<? extends ArtifactId> relativeSequence) {
+ public void store(RelationType type, RelationSide side, RelationSorter requestedSorterId, List<Artifact> relativeSequence) {
storeFromGuids(type, side, requestedSorterId, Artifacts.toGuids(relativeSequence));
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
index 5b936ff22d..d9c47abf40 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.data.TransactionId;
@@ -57,7 +58,6 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.eclipse.osee.framework.skynet.core.relation.RelationTransactionData;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.skynet.core.transaction.TxMonitorImpl.TxState;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.skynet.core.utility.ConnectionHandler;
/**
@@ -123,7 +123,7 @@ public final class SkynetTransaction extends TransactionOperation<BranchId> {
getAccess().hasArtifactPermission(Collections.singleton(artifact), PermissionEnum.WRITE, Level.FINE);
}
- private void checkBranch(IArtifact artifact) throws OseeCoreException {
+ private void checkBranch(ArtifactToken artifact) throws OseeCoreException {
if (!isBranchWritable(artifact.getBranch())) {
throw new OseeStateException("The artifact [%s] is on a non-editable branch [%s] ", artifact,
artifact.getBranch());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
index c95a53dcc4..3e49c6dea8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
@@ -44,7 +44,6 @@ import org.eclipse.osee.framework.skynet.core.attribute.AttributeRow;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.attribute.RelationRow;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.skynet.core.utility.ConnectionHandler;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcConnection;
@@ -148,11 +147,11 @@ public final class TransactionManager {
* cache the next time it's accessed. This is provided for remote event commits. All other updates to cache should be
* performed through cacheCommittedArtifactTransaction.
*/
- public static void clearCommitArtifactCacheForAssociatedArtifact(IArtifact associatedArtifact) {
+ public static void clearCommitArtifactCacheForAssociatedArtifact(ArtifactId associatedArtifact) {
commitArtifactIdMap.removeValues(associatedArtifact);
}
- public synchronized static void cacheCommittedArtifactTransaction(IArtifact artifact, TransactionToken transactionId) throws OseeCoreException {
+ public synchronized static void cacheCommittedArtifactTransaction(ArtifactId artifact, TransactionToken transactionId) throws OseeCoreException {
commitArtifactIdMap.put(artifact, getTransactionRecord(transactionId.getId()));
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
index 98d8e812a8..13e69ab341 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/Artifacts.java
@@ -34,7 +34,6 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
/**
* Utility methods for common tasks performed on Artifact's.
@@ -48,10 +47,10 @@ public final class Artifacts {
// This constructor is private because there is no reason to instantiate this class
}
- public static Collection<Integer> toIds(Collection<? extends IArtifact> artifacts) {
+ public static Collection<Integer> toIds(Collection<? extends ArtifactId> artifacts) {
Set<Integer> toReturn = new HashSet<>(artifacts.size());
- for (IArtifact artifact : artifacts) {
- toReturn.add(artifact.getArtId());
+ for (ArtifactId artifact : artifacts) {
+ toReturn.add(artifact.getId().intValue());
}
return toReturn;
}
@@ -262,8 +261,8 @@ public final class Artifacts {
public static Collection<Long> toUuids(Set<Artifact> artifacts) {
List<Long> uuids = new ArrayList<>(artifacts.size());
- for (IArtifact artifact : artifacts) {
- uuids.add(artifact.getUuid());
+ for (ArtifactId artifact : artifacts) {
+ uuids.add(artifact.getId());
}
return uuids;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
index 259ad6b92f..2136df2eb4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameConflictHandler.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.framework.ui.skynet.artifact;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.jdk.core.type.Pair;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.ui.swt.Displays;
/**
@@ -21,7 +21,7 @@ import org.eclipse.osee.framework.ui.swt.Displays;
*/
public class ArtifactNameConflictHandler {
- public String resolve(IArtifact source) {
+ public String resolve(ArtifactToken source) {
final Pair<String, String> beforeAfterNames = new Pair<>("", "");
String startingName = source.getName();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
index a454e9934b..a4040a67a1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
@@ -53,9 +52,9 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider
if (obj instanceof RelationType) {
RelationType relationType = (RelationType) obj;
if (options.isValidRelationType(relationType)) {
- for (IArtifact art : artifact.getRelatedArtifacts(relationType)) {
+ for (Artifact art : artifact.getRelatedArtifacts(relationType)) {
if (options.isValidArtifactType(art.getArtifactType()) && displayArtifacts.contains(art)) {
- otherItems.add(art.getFullArtifact());
+ otherItems.add(art);
}
}
}
@@ -101,11 +100,10 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider
if (obj instanceof RelationType) {
RelationType relationType = (RelationType) obj;
if (options.isValidRelationType(relationType)) {
- for (IArtifact art : artifact.getRelatedArtifacts(relationType)) {
+ for (Artifact art : artifact.getRelatedArtifacts(relationType)) {
if (options.isValidArtifactType(art.getArtifactType())) {
- Artifact relatedArt = art.getFullArtifact();
- displayArtifacts.add(relatedArt);
- getDescendants(displayArtifacts, relatedArt, level - 1);
+ displayArtifacts.add(art);
+ getDescendants(displayArtifacts, art, level - 1);
}
}
}

Back to the top