Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-09-17 18:22:44 +0000
committerdonald.g.dunne2016-09-17 18:22:44 +0000
commitc812509191bfcab6fbdef2d7a1fc0c6e1a96a010 (patch)
treeb87782f14e517149ff2ec235a51625b146fd9d5d /plugins
parentcabbc7b4f78f370a035995636d1b2f398c2b26d0 (diff)
downloadorg.eclipse.osee-c812509191bfcab6fbdef2d7a1fc0c6e1a96a010.tar.gz
org.eclipse.osee-c812509191bfcab6fbdef2d7a1fc0c6e1a96a010.tar.xz
org.eclipse.osee-c812509191bfcab6fbdef2d7a1fc0c6e1a96a010.zip
refactor: Remove DefaultBasicArtifact
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessControlProviderTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessProviderTest.java3
-rw-r--r--plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/MockDataFactory.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchInterpreterTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandlerTest.java7
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java22
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java9
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParser.java30
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/AccessDataTest.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChainTest.java15
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java11
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/DefaultBasicArtifact.java52
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChain.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/ArtifactAccessFilter.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java12
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/BranchAccessFilter.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/IAccessFilter.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java7
24 files changed, 95 insertions, 169 deletions
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessControlProviderTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessControlProviderTest.java
index 0a1ca7effa5..5c8174964cc 100644
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessControlProviderTest.java
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessControlProviderTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.access.test.internal.cm;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.Collection;
import java.util.HashSet;
import org.eclipse.osee.framework.access.internal.cm.CmAccessControlProviderImpl;
@@ -35,7 +36,7 @@ public class CmAccessControlProviderTest {
@Before
public void setup() {
- user = MockDataFactory.createArtifact(4);
+ user = ArtifactToken.valueOf(1, null, COMMON);
objectToCheck = new Object();
}
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessProviderTest.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessProviderTest.java
index 8b5d7e75d38..94271eee592 100644
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessProviderTest.java
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/CmAccessProviderTest.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.access.test.internal.cm;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -40,7 +41,7 @@ public class CmAccessProviderTest {
@BeforeClass
public static void setup() {
- expectedUser = MockDataFactory.createArtifact(13);
+ expectedUser = ArtifactToken.valueOf(13, null, COMMON);
expectedObject = new Object();
contextId1 = MockDataFactory.createAccessContextId(GUID.create(), "context1");
}
diff --git a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/MockDataFactory.java b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/MockDataFactory.java
index 36de151921a..2bf2c5f0069 100644
--- a/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/MockDataFactory.java
+++ b/plugins/org.eclipse.osee.framework.access.test/src/org/eclipse/osee/framework/access/test/internal/cm/MockDataFactory.java
@@ -13,11 +13,8 @@ package org.eclipse.osee.framework.access.test.internal.cm;
import org.eclipse.osee.framework.core.data.IAccessContextId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.access.AccessDetail;
import org.eclipse.osee.framework.core.model.access.Scope;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.junit.Assert;
/**
@@ -45,9 +42,4 @@ public final class MockDataFactory {
}
return target;
}
-
- public static IBasicArtifact<?> createArtifact(int index) {
- return new DefaultBasicArtifact(index * 37, GUID.create(), "user_" + index);
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchInterpreterTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchInterpreterTest.java
index 307e9cfa418..c1e2eeca810 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchInterpreterTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchInterpreterTest.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.core.dsl.integration.internal;
import java.util.Collection;
import java.util.Iterator;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -26,7 +27,6 @@ import org.eclipse.osee.framework.core.dsl.oseeDsl.MatchField;
import org.eclipse.osee.framework.core.dsl.oseeDsl.SimpleCondition;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XLogicOperator;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -301,7 +301,7 @@ public class ArtifactMatchInterpreterTest {
}
@Override
- public IBasicArtifact<?> getObject() {
+ public ArtifactToken getObject() {
return null;
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandlerTest.java
index fb96de7468f..810106cacab 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandlerTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandlerTest.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.dsl.integration.internal;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts;
import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifactProxy;
@@ -18,7 +20,6 @@ import org.eclipse.osee.framework.core.dsl.oseeDsl.AccessPermissionEnum;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactMatchRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
import org.eclipse.osee.framework.core.model.access.Scope;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -27,7 +28,7 @@ import org.junit.Test;
/**
* Test Case for {@link ArtifactMatchRestrictionHandler}
- *
+ *
* @author Roberto E. Escobar
*/
public class ArtifactMatchRestrictionHandlerTest extends BaseRestrictionHandlerTest<ArtifactMatchRestriction> {
@@ -66,7 +67,7 @@ public class ArtifactMatchRestrictionHandlerTest extends BaseRestrictionHandlerT
restriction.setArtifactMatcherRef(artifactRef);
matcher.setMatchesResult(true);
- DefaultBasicArtifact expectedAccessObject = new DefaultBasicArtifact(1, GUID.create(), "Another Artifact");
+ ArtifactToken expectedAccessObject = ArtifactToken.valueOf(1, "Another Artifact", BranchId.SENTINEL);
MockArtifactProxy artData = new MockArtifactProxy(expectedAccessObject);
Scope expectedScope = new Scope();
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java
index 6cdecbd5fd8..ce879136c34 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/RelationTypeRestrictionHandlerTest.java
@@ -15,6 +15,8 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+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.IRelationType;
import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts;
@@ -35,8 +37,6 @@ import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.RelationTypeSide;
import org.eclipse.osee.framework.core.model.access.AccessDetail;
import org.eclipse.osee.framework.core.model.access.AccessDetailCollector;
@@ -50,7 +50,7 @@ import org.junit.Test;
/**
* Test Case for {@link RelationTypeRestrictionHandler}
- *
+ *
* @author Roberto E. Escobar
*/
public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTest<RelationTypeRestriction> {
@@ -300,7 +300,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe
CoreArtifactTypes.AbstractSoftwareRequirement.getName(), false));
artArtType.setSuperTypes(superTypes);
- DefaultBasicArtifact expectedAccessObject = new DefaultBasicArtifact(1, GUID.create(), "Another Artifact");
+ ArtifactToken expectedAccessObject = ArtifactToken.valueOf(1, "Another Artifact", BranchId.SENTINEL);
MockArtifactProxy artData = new MockArtifactProxy(expectedAccessObject.getGuid(), artArtType,
expectedAccessObject, null, Collections.singleton(testRelationType));
@@ -338,7 +338,7 @@ public class RelationTypeRestrictionHandlerTest extends BaseRestrictionHandlerTe
new ArtifactType(CoreArtifactTypes.Artifact.getGuid(), CoreArtifactTypes.Artifact.getName(), false));
artArtType.setSuperTypes(superTypes);
- IBasicArtifact<Object> dummy = new DefaultBasicArtifact(43, GUID.create(), artifactName);
+ ArtifactToken dummy = ArtifactToken.valueOf(43, artifactName, BranchId.SENTINEL);
MockArtifactProxy artData =
new MockArtifactProxy(GUID.create(), artArtType, dummy, null, Collections.singleton(testRelationType));
RelationTypeSide expectedObject = new RelationTypeSide(testRelationType, RelationSide.SIDE_B);
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java
index 1f0adb27986..d56144532e4 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java
@@ -12,12 +12,11 @@ package org.eclipse.osee.framework.core.dsl.integration.mocks;
import java.util.Collection;
import java.util.Collections;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
@@ -30,18 +29,18 @@ public class MockArtifactProxy implements ArtifactProxy {
private final ArtifactType artifactType;
private final Collection<ArtifactProxy> hierarchy;
private final Collection<RelationType> validRelationTypes;
- private final IBasicArtifact<?> artifactObject;
+ private final ArtifactToken artifactObject;
- public MockArtifactProxy(IBasicArtifact<?> artifactObject) {
- this(artifactObject.getGuid(), artifactObject.getArtifactType(), artifactObject,
- Collections.<ArtifactProxy> emptyList(), Collections.<RelationType> emptyList());
+ public MockArtifactProxy(ArtifactToken artifactObject) {
+ this(artifactObject.getGuid(), null, artifactObject, Collections.<ArtifactProxy> emptyList(),
+ Collections.<RelationType> emptyList());
}
public MockArtifactProxy(String guid, ArtifactType artifactType) {
this(guid, artifactType, null, Collections.<ArtifactProxy> emptyList(), Collections.<RelationType> emptyList());
}
- public MockArtifactProxy(String guid, ArtifactType artifactType, IBasicArtifact<?> artifactObject, Collection<ArtifactProxy> hierarchy, Collection<RelationType> validRelationTypes) {
+ public MockArtifactProxy(String guid, ArtifactType artifactType, ArtifactToken artifactObject, Collection<ArtifactProxy> hierarchy, Collection<RelationType> validRelationTypes) {
this.guid = guid;
this.artifactType = artifactType;
this.hierarchy = hierarchy;
@@ -75,18 +74,18 @@ public class MockArtifactProxy implements ArtifactProxy {
}
@Override
- public IBasicArtifact<?> getObject() {
+ public ArtifactToken getObject() {
return artifactObject;
}
@Override
public BranchId getBranch() {
- return getBranchToken();
+ return artifactObject.getBranch();
}
@Override
public IOseeBranch getBranchToken() {
- return TokenFactory.createBranch(getBranchId(), getClass().getName());
+ return IOseeBranch.create(getBranch(), getClass().getName());
}
@Override
@@ -96,6 +95,6 @@ public class MockArtifactProxy implements ArtifactProxy {
@Override
public Long getId() {
- return Long.valueOf(artifactObject.getArtId());
+ return Long.valueOf(artifactObject.getId());
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
index 31bab99aafa..e8725c21e4c 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParserTest.java
@@ -14,14 +14,11 @@ import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON_ID;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.dsl.integration.mocks.MockArtifact;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser.OseeDslSegment;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser.TagLocation;
-import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
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.OseeStateException;
@@ -51,7 +48,7 @@ public class OseeDslSegmentParserTest {
@Test(expected = OseeArgumentException.class)
public void testGetStartTagNullCheck2() throws OseeCoreException {
- IBasicArtifact<?> artifact = new DefaultBasicArtifact(45, "abc", "name");
+ ArtifactToken artifact = ArtifactToken.valueOf(45, "name", null);
parser.getStartTag(artifact, null);
}
@@ -62,28 +59,27 @@ public class OseeDslSegmentParserTest {
@Test(expected = OseeArgumentException.class)
public void testGetEndTagNullCheck2() throws OseeCoreException {
- IBasicArtifact<?> artifact = new DefaultBasicArtifact(45, "abc", "name");
+ ArtifactToken artifact = ArtifactToken.valueOf(45, "name", null);
parser.getEndTag(artifact, null);
}
@Test
public void testGetStartEndTag() throws OseeCoreException {
IOseeBranch branch = CoreBranches.COMMON;
- final String artifactGuid = GUID.create();
final String artifactName = "artifactTest";
final String branchName = branch.getName();
- final Long branchUuid = branch.getUuid();
+ final Long branchId = branch.getId();
- IBasicArtifact<?> artifact = new MockArtifact(artifactGuid, artifactName, branch, CoreArtifactTypes.Artifact, 45);
+ ArtifactToken artifact = ArtifactToken.valueOf(45, artifactName, branch);
String actual = parser.getStartTag(artifact, branch);
- String expected = String.format("//@start_artifact branch/%d/artifact/%s/ (%s:%s)", branchUuid, artifactGuid,
+ String expected = String.format("//@start_artifact branch/%d/artifact/%s/ (%s:%s)", branchId, artifact.getGuid(),
branchName, artifactName);
Assert.assertEquals(expected, actual);
actual = parser.getEndTag(artifact, branch);
- expected = String.format("//@end_artifact branch/%d/artifact/%s/ (%s:%s)", branchUuid, artifactGuid, branchName,
- artifactName);
+ expected = String.format("//@end_artifact branch/%d/artifact/%s/ (%s:%s)", branchId, artifact.getGuid(),
+ branchName, artifactName);
Assert.assertEquals(expected, actual);
}
@@ -204,7 +200,7 @@ public class OseeDslSegmentParserTest {
if (expected == null) {
Assert.assertNull(actual);
} else {
- Assert.assertEquals("branchguid - " + index, expected.getBranchUuid(), actual.getBranchUuid());
+ Assert.assertEquals("branchId - " + index, expected.getBranchId(), actual.getBranchId());
Assert.assertEquals("artguid - " + index, expected.getArtifactGuid(), actual.getArtifactGuid());
Assert.assertEquals("start - " + index, expected.start(), actual.start());
Assert.assertEquals("end - " + index, expected.end(), actual.end());
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java
index 5b65989c0ff..4ba22a18898 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java
@@ -14,7 +14,6 @@ import java.util.Collection;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -27,12 +26,6 @@ public interface ArtifactDataProvider {
public static interface ArtifactProxy extends ArtifactToken {
@Override
- String getName();
-
- @Override
- String getGuid();
-
- @Override
ArtifactType getArtifactType();
boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException;
@@ -41,7 +34,7 @@ public interface ArtifactDataProvider {
Collection<ArtifactProxy> getHierarchy();
- IBasicArtifact<?> getObject();
+ ArtifactToken getObject();
IOseeBranch getBranchToken();
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
index 7ab1c19ceaf..d268b8852dd 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/ArtifactMatchRestrictionHandler.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.dsl.integration.internal;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.RestrictionHandler;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ArtifactMatchRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.ObjectRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactMatcher;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.access.AccessDetail;
import org.eclipse.osee.framework.core.model.access.AccessDetailCollector;
import org.eclipse.osee.framework.core.model.access.Scope;
@@ -49,7 +49,7 @@ public class ArtifactMatchRestrictionHandler implements RestrictionHandler<Artif
XArtifactMatcher artifactMatcher = restriction.getArtifactMatcherRef();
if (matcherInterpreter.matches(artifactMatcher, artifactProxy)) {
PermissionEnum permission = OseeUtil.getPermission(restriction);
- collector.collect(new AccessDetail<IBasicArtifact<?>>(artifactProxy.getObject(), permission, scope));
+ collector.collect(new AccessDetail<ArtifactToken>(artifactProxy.getObject(), permission, scope));
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParser.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParser.java
index f88ad1c1774..f1d3b411543 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParser.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/util/OseeDslSegmentParser.java
@@ -15,8 +15,8 @@ import java.util.Collection;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -27,18 +27,18 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
*/
public class OseeDslSegmentParser {
- public String getStartTag(IBasicArtifact<?> artifact, IOseeBranch branch) throws OseeCoreException {
+ public String getStartTag(ArtifactToken artifact, IOseeBranch branch) throws OseeCoreException {
return getSegmentTag("start", artifact, branch);
}
- public String getEndTag(IBasicArtifact<?> artifact, IOseeBranch branch) throws OseeCoreException {
+ public String getEndTag(ArtifactToken artifact, IOseeBranch branch) throws OseeCoreException {
return getSegmentTag("end", artifact, branch);
}
- private static String getSegmentTag(String tagPrefix, IBasicArtifact<?> artifact, IOseeBranch branch) throws OseeCoreException {
+ private static String getSegmentTag(String tagPrefix, ArtifactToken artifact, IOseeBranch branch) throws OseeCoreException {
Conditions.checkNotNull(artifact, "artifact");
Conditions.checkNotNull(branch, "branch");
- return String.format("//@%s_artifact branch/%s/artifact/%s/ (%s:%s)", tagPrefix, branch.getUuid(),
+ return String.format("//@%s_artifact branch/%s/artifact/%s/ (%s:%s)", tagPrefix, branch.getId(),
artifact.getGuid(), branch.getName(), artifact.getName());
}
@@ -150,21 +150,21 @@ public class OseeDslSegmentParser {
public static final class OseeDslSegment {
- private final Long branchUuid;
+ private final Long branchId;
private final String artifactGuid;
private final int start;
private final int end;
- public OseeDslSegment(Long branchUuid, String artifactGuid, int start, int end) {
+ public OseeDslSegment(Long branchId, String artifactGuid, int start, int end) {
super();
- this.branchUuid = branchUuid;
+ this.branchId = branchId;
this.artifactGuid = artifactGuid;
this.start = start;
this.end = end;
}
- public Long getBranchUuid() {
- return branchUuid;
+ public Long getBranchId() {
+ return branchId;
}
public String getArtifactGuid() {
@@ -184,7 +184,7 @@ public class OseeDslSegmentParser {
final int prime = 31;
int result = 1;
result = prime * result + (artifactGuid == null ? 0 : artifactGuid.hashCode());
- result = prime * result + (branchUuid == null ? 0 : branchUuid.hashCode());
+ result = prime * result + (branchId == null ? 0 : branchId.hashCode());
result = prime * result + end;
result = prime * result + start;
return result;
@@ -209,11 +209,11 @@ public class OseeDslSegmentParser {
} else if (!artifactGuid.equals(other.artifactGuid)) {
return false;
}
- if (branchUuid == null) {
- if (other.branchUuid != null) {
+ if (branchId == null) {
+ if (other.branchId != null) {
return false;
}
- } else if (!branchUuid.equals(other.branchUuid)) {
+ } else if (!branchId.equals(other.branchId)) {
return false;
}
if (end != other.end) {
@@ -227,7 +227,7 @@ public class OseeDslSegmentParser {
@Override
public String toString() {
- return "OseeDslSegment [branchUuid=" + branchUuid + ", artifactUuid=" + artifactGuid + ", start=" + start + ", end=" + end + "]";
+ return "OseeDslSegment [branchId=" + branchId + ", artifactId=" + artifactGuid + ", start=" + start + ", end=" + end + "]";
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
index f9a756fcce0..25b094059bf 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
@@ -14,11 +14,11 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
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.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.Id;
@@ -82,7 +82,7 @@ public final class ArtifactDataProviderImpl implements ArtifactDataProvider {
}
@Override
- public IBasicArtifact<?> getObject() {
+ public ArtifactToken getObject() {
return self;
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
index bce02b89735..3989b2256e3 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
@@ -60,7 +60,7 @@ public class OseeDslArtifactUpdateOperation extends AbstractOperation {
int endAt = segment.end();
String data = source.substring(startAt, endAt);
- addChanges(transactionMap, segment.getBranchUuid(), segment.getArtifactGuid(), data);
+ addChanges(transactionMap, segment.getBranchId(), segment.getArtifactGuid(), data);
monitor.worked(workAmount);
}
monitor.setTaskName("Persist...");
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/AccessDataTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/AccessDataTest.java
index cffb9f9d799..1a348fadb6a 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/AccessDataTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/AccessDataTest.java
@@ -10,20 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
+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.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationSide;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.RelationTypeSide;
import org.eclipse.osee.framework.core.model.mocks.MockDataFactory;
import org.eclipse.osee.framework.core.model.mocks.ModelAsserts;
@@ -31,14 +31,13 @@ import org.eclipse.osee.framework.core.model.type.RelationType;
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.util.Compare;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Test Case for {@link AccessData}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccessDataTest {
@@ -52,7 +51,7 @@ public class AccessDataTest {
private RelationTypeSide relTypeSide1;
private RelationTypeSide relTypeSide2;
- private IBasicArtifact<?> artifactToCheck;
+ private ArtifactToken artifactToCheck;
@Before
public void setup() {
@@ -67,7 +66,7 @@ public class AccessDataTest {
relTypeSide1 = new RelationTypeSide(relType, RelationSide.SIDE_A);
relTypeSide2 = new RelationTypeSide(relType, RelationSide.SIDE_B);
- artifactToCheck = new DefaultBasicArtifact(12, GUID.create(), "Hello");
+ artifactToCheck = ArtifactToken.valueOf(12, "Hello", COMMON);
}
@Test
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChainTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChainTest.java
index c208d7b8f05..16e9511db7a 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChainTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChainTest.java
@@ -10,26 +10,27 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access.exp;
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.junit.Assert;
import org.junit.Test;
/**
* Test Case for {@link AccessFilterChain}
- *
+ *
* @author Jeff C. Phillips
*/
public class AccessFilterChainTest {
+ private final ArtifactToken basicArtifact = ArtifactToken.valueOf(1, "123", COMMON);
+
@Test
public void testUseCase() {
//Can we edit this attribute on an artifact
AccessFilterChain chain = new AccessFilterChain();
- IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "123");
IAttributeType attributeType = CoreAttributeTypes.WordTemplateContent;
BranchAccessFilter branchAccessFilter = new BranchAccessFilter(basicArtifact, PermissionEnum.READ);
@@ -49,8 +50,7 @@ public class AccessFilterChainTest {
@Test
public void testWrongArtifactUseCase() {
AccessFilterChain chain = new AccessFilterChain();
- IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "123");
- IBasicArtifact<?> basicArtifact2 = new DefaultBasicArtifact(2, "2", "456");
+ ArtifactToken basicArtifact2 = ArtifactToken.valueOf(2, "456", COMMON);
IAttributeType attributeType = CoreAttributeTypes.WordTemplateContent;
BranchAccessFilter branchAccessFilter = new BranchAccessFilter(basicArtifact, PermissionEnum.READ);
@@ -70,8 +70,6 @@ public class AccessFilterChainTest {
@Test
public void testChain() {
AccessFilterChain chain = new AccessFilterChain();
- IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "123");
-
BranchAccessFilter branchAccessFilter = new BranchAccessFilter(basicArtifact, PermissionEnum.READ);
ArtifactAccessFilter artifactAccessFilter = new ArtifactAccessFilter(basicArtifact, PermissionEnum.WRITE);
@@ -86,7 +84,6 @@ public class AccessFilterChainTest {
@Test
public void testChainDeny() {
AccessFilterChain chain = new AccessFilterChain();
- IBasicArtifact<?> basicArtifact = new DefaultBasicArtifact(1, "1", "123");
BranchAccessFilter branchAccessFilter = new BranchAccessFilter(basicArtifact, PermissionEnum.DENY);
ArtifactAccessFilter artifactAccessFilter = new ArtifactAccessFilter(basicArtifact, PermissionEnum.WRITE);
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
index 50b4c5e78ff..782c395c211 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
@@ -21,8 +21,6 @@ import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationOrderBaseTypes;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
-import org.eclipse.osee.framework.core.model.DefaultBasicArtifact;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
import org.eclipse.osee.framework.core.model.OseeEnumEntry;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.access.AccessDetail;
@@ -33,7 +31,6 @@ import org.eclipse.osee.framework.core.model.type.OseeEnumType;
import org.eclipse.osee.framework.core.model.type.OseeEnumTypeFactory;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.junit.Assert;
/**
@@ -57,17 +54,13 @@ public final class MockDataFactory {
public static <T> AccessDetail<T> createAccessDetails(T expAccessObject, PermissionEnum expPermission, String expReason, Scope scope) {
AccessDetail<T> target;
if (expReason != null) {
- target = new AccessDetail<>(expAccessObject, expPermission, scope, expReason);
+ target = new AccessDetail<T>(expAccessObject, expPermission, scope, expReason);
} else {
- target = new AccessDetail<>(expAccessObject, expPermission, scope);
+ target = new AccessDetail<T>(expAccessObject, expPermission, scope);
}
return target;
}
- public static IBasicArtifact<?> createArtifact(int index) {
- return new DefaultBasicArtifact(index * 37, GUID.create(), "user_" + index);
- }
-
public static AttributeType createAttributeType() throws OseeCoreException {
OseeEnumTypeFactory oseeEnumTypeFactory = new OseeEnumTypeFactory();
AttributeType attributeType = new AttributeType(random.nextLong(), "name", "baseType", "providerName", ".xml", "",
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
index 3ffc4bf33b4..3bd53ec2604 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
@@ -125,6 +125,7 @@ public class TransactionRecordTest {
tx2.setTimeStamp(new Date(11111111111L));
Assert.assertNotSame(tx1, tx2);
+
Assert.assertTrue(tx1.equals(tx2));
Assert.assertTrue(tx2.equals(tx1));
Assert.assertEquals(tx1.hashCode(), tx2.hashCode());
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/DefaultBasicArtifact.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/DefaultBasicArtifact.java
deleted file mode 100644
index 5cafb644a7a..00000000000
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/DefaultBasicArtifact.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.model;
-
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.jdk.core.type.NamedIdentity;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class DefaultBasicArtifact extends NamedIdentity<String> implements IBasicArtifact<Object> {
-
- private final Long artId;
-
- public DefaultBasicArtifact(long artId, String guid, String name) {
- super(guid, name);
- this.artId = artId;
- }
-
- @Override
- public int getArtId() {
- return artId.intValue();
- }
-
- @Override
- public Object getFullArtifact() {
- return null;
- }
-
- @Override
- public ArtifactType getArtifactType() {
- return null;
- }
-
- @Override
- public Branch getBranch() {
- return null;
- }
-
- @Override
- public Long getId() {
- return artId;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChain.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChain.java
index 1632d306d59..3a68f53e448 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChain.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AccessFilterChain.java
@@ -15,8 +15,8 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
public class AccessFilterChain {
private final List<IAccessFilter> filters;
@@ -35,7 +35,7 @@ public class AccessFilterChain {
filters.add(filter);
}
- public boolean doFilter(IBasicArtifact<?> artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission) {
+ public boolean doFilter(ArtifactToken artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission) {
Collections.sort(filters, new Comparator<IAccessFilter>() {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/ArtifactAccessFilter.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/ArtifactAccessFilter.java
index 86f9e538b16..52747b95425 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/ArtifactAccessFilter.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/ArtifactAccessFilter.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access.exp;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
public class ArtifactAccessFilter implements IAccessFilter {
private final PermissionEnum artifactPermission;
- private final IBasicArtifact<?> artifact;
+ private final ArtifactToken artifact;
- public ArtifactAccessFilter(IBasicArtifact<?> artifact, PermissionEnum artifactPermission) {
+ public ArtifactAccessFilter(ArtifactToken artifact, PermissionEnum artifactPermission) {
super();
this.artifactPermission = artifactPermission;
this.artifact = artifact;
@@ -31,7 +31,7 @@ public class ArtifactAccessFilter implements IAccessFilter {
}
@Override
- public PermissionEnum filter(IBasicArtifact<?> artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
+ public PermissionEnum filter(ArtifactToken artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
PermissionEnum toReturn = null;
if (this.artifact.equals(artifact)) {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java
index 7a101fa24d9..434aa3dad7e 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/AttributeTypeAccessFilter.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access.exp;
-import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
public class AttributeTypeAccessFilter implements IAccessFilter {
private final PermissionEnum permission;
- private final IBasicArtifact<?> artifact;
+ private final ArtifactToken artifact;
private final IAttributeType type;
- public AttributeTypeAccessFilter(PermissionEnum permission, IBasicArtifact<?> artifact, IAttributeType type) {
+ public AttributeTypeAccessFilter(PermissionEnum permission, ArtifactToken artifact, IAttributeType type) {
super();
this.permission = permission;
this.artifact = artifact;
@@ -35,11 +35,11 @@ public class AttributeTypeAccessFilter implements IAccessFilter {
@Override
public boolean acceptToObject(Object object) {
//Return false if the object to be checked is a branch or artifact.
- return !(object instanceof BranchId) && !(object instanceof IBasicArtifact<?>);
+ return !(object instanceof BranchId) && !(object instanceof ArtifactToken);
}
@Override
- public PermissionEnum filter(IBasicArtifact<?> artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
+ public PermissionEnum filter(ArtifactToken artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
PermissionEnum toReturn = agrPermission;
if (this.artifact.equals(artifact) && type.equals(object)) {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/BranchAccessFilter.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/BranchAccessFilter.java
index fc68fdbe979..fad611ed8a4 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/BranchAccessFilter.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/BranchAccessFilter.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access.exp;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
public class BranchAccessFilter implements IAccessFilter {
private final PermissionEnum branchPermission;
- private final IBasicArtifact<?> artifact;
+ private final ArtifactToken artifact;
- public BranchAccessFilter(IBasicArtifact<?> artifact, PermissionEnum branchPermission) {
+ public BranchAccessFilter(ArtifactToken artifact, PermissionEnum branchPermission) {
this.artifact = artifact;
this.branchPermission = branchPermission;
}
@@ -28,7 +28,7 @@ public class BranchAccessFilter implements IAccessFilter {
}
@Override
- public PermissionEnum filter(IBasicArtifact<?> artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
+ public PermissionEnum filter(ArtifactToken artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain) {
PermissionEnum toReturn = agrPermission;
if (this.artifact.equals(artifact)) {
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/IAccessFilter.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/IAccessFilter.java
index 12c708a88b4..d062d65e580 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/IAccessFilter.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/exp/IAccessFilter.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.model.access.exp;
+import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
public interface IAccessFilter {
int getPriority();
boolean acceptToObject(Object object);
- PermissionEnum filter(IBasicArtifact<?> artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain);
+ PermissionEnum filter(ArtifactToken artifact, Object object, PermissionEnum toPermission, PermissionEnum agrPermission, AccessFilterChain filterChain);
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
index f4ef5323f49..295a0be78ba 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.core.data;
import org.eclipse.osee.framework.jdk.core.type.Named;
import org.eclipse.osee.framework.jdk.core.type.NamedId;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
/**
* @author Ryan D. Brooks
@@ -22,8 +23,12 @@ public interface ArtifactToken extends ArtifactId, HasArtifactType, HasBranch, N
return null;
}
+ public static ArtifactToken valueOf(long id, String name, BranchId branch) {
+ return valueOf(id, GUID.create(), name, branch, null);
+ }
+
public static ArtifactToken valueOf(long id, String name, BranchId branch, IArtifactType artifactType) {
- return valueOf(id, null, name, branch, artifactType);
+ return valueOf(id, GUID.create(), name, branch, artifactType);
}
public static ArtifactToken valueOf(long id, String guid, String name, BranchId branch, IArtifactType artifactType) {

Back to the top