Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-12-12 22:55:15 +0000
committerDavid W. Miller2016-12-12 22:55:15 +0000
commit6820d6e4c76ea96eb25900d5e9a04d1fa2c7ed06 (patch)
treeffcd52053f2adfc5821ef9b698f5b4b327b2d448
parent27d23db481472a3326356fffe5f950720f128152 (diff)
downloadorg.eclipse.osee-6820d6e4c76ea96eb25900d5e9a04d1fa2c7ed06.tar.gz
org.eclipse.osee-6820d6e4c76ea96eb25900d5e9a04d1fa2c7ed06.tar.xz
org.eclipse.osee-6820d6e4c76ea96eb25900d5e9a04d1fa2c7ed06.zip
refactor: Remove IAttributeType usage from attribute validity
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java3
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java9
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java15
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/util/DuplicateWorkflowAsIsOperation.java8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java3
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java12
-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/AttributeTypeRestrictionHandlerTest.java53
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/mocks/MockArtifactProxy.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/ArtifactDataProvider.java4
-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.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollection.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeExceptionFactory.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeResultSet.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java16
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java3
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java5
29 files changed, 105 insertions, 121 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
index d1ffc403107..29bb0b9c66b 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -68,7 +69,7 @@ public interface IAtsChangeSet {
void deleteAttribute(IAtsObject atsObject, IAttributeType attributeType, Object value) throws OseeCoreException;
- boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType);
+ boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType);
ArtifactId createArtifact(IArtifactType artifactType, String name);
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
index be972ce435e..6673007334a 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -30,22 +31,20 @@ public interface IAtsStoreService {
String getGuid(IAtsObject atsObject);
- boolean isAttributeTypeValid(IAtsObject atsObject, IAttributeType attributeType);
+ boolean isAttributeTypeValid(IAtsObject atsObject, AttributeTypeId attributeType);
- boolean isAttributeTypeValid(ArtifactId artifact, IAttributeType attributeType);
+ boolean isAttributeTypeValid(ArtifactId artifact, AttributeTypeId attributeType);
/**
* Uses artifact type inheritance to retrieve all TeamWorkflow artifact types
*/
Set<IArtifactType> getTeamWorkflowArtifactTypes();
- IAttributeType getAttributeType(long attrTypeId);
-
IAttributeType getAttributeType(String attrTypeName);
IArtifactType getArtifactType(ArtifactId artifact);
- boolean isDateType(IAttributeType attributeType);
+ boolean isDateType(AttributeTypeId attributeType);
boolean isOfType(ArtifactId artifact, IArtifactType... artifactType);
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
index 198715622a8..ae85b271dea 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -36,9 +37,9 @@ public interface IAttributeResolver {
<T> T getSoleAttributeValue(IAtsObject atsObject, IAttributeType attributeType, T defaultReturnValue) throws OseeCoreException;
- Collection<String> getAttributesToStringList(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException;
+ Collection<String> getAttributesToStringList(IAtsObject atsObject, AttributeTypeId attributeType) throws OseeCoreException;
- boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException;
+ boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType) throws OseeCoreException;
String getSoleAttributeValueAsString(IAtsObject atsObject, IAttributeType attributeType, String defaultReturnValue) throws OseeCoreException;
@@ -88,7 +89,7 @@ public interface IAttributeResolver {
int getAttributeCount(IAtsWorkItem workItem, IAttributeType attributeType);
- default public String getAttributesToStringUniqueList(IAtsObject atsObject, IAttributeType attributeType, String separator) {
+ default public String getAttributesToStringUniqueList(IAtsObject atsObject, AttributeTypeId attributeType, String separator) {
Set<String> strs = new HashSet<>();
strs.addAll(getAttributesToStringList(atsObject, attributeType));
return org.eclipse.osee.framework.jdk.core.util.Collections.toString(separator, strs);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
index 4a64d14ffe4..c1843b4a070 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsStoreService;
import org.eclipse.osee.ats.core.client.internal.store.AtsChangeSet;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
@@ -106,21 +107,16 @@ public class AtsStoreService implements IAtsStoreService {
}
@Override
- public boolean isAttributeTypeValid(IAtsObject atsObject, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(IAtsObject atsObject, AttributeTypeId attributeType) {
return isAttributeTypeValid(atsObject.getStoreObject(), attributeType);
}
@Override
- public boolean isAttributeTypeValid(ArtifactId artifact, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(ArtifactId artifact, AttributeTypeId attributeType) {
return ((Artifact) artifact).isAttributeTypeValid(attributeType);
}
@Override
- public IAttributeType getAttributeType(long attrTypeId) {
- return AttributeTypeManager.getTypeByGuid(attrTypeId);
- }
-
- @Override
public IAttributeType getAttributeType(String attrTypeName) {
return AttributeTypeManager.getType(attrTypeName);
}
@@ -131,7 +127,7 @@ public class AtsStoreService implements IAtsStoreService {
}
@Override
- public boolean isDateType(IAttributeType attributeType) {
+ public boolean isDateType(AttributeTypeId attributeType) {
return AttributeTypeManager.isBaseTypeCompatible(DateAttribute.class, attributeType);
}
@@ -153,5 +149,4 @@ public class AtsStoreService implements IAtsStoreService {
}
changes.execute();
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
index fa4bae56b1a..c57f679f9df 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
@@ -37,6 +37,7 @@ import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -248,7 +249,7 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
@Override
- public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType) {
Artifact artifact = AtsClientService.get().getArtifact(workItem);
return artifact.getAttributeTypes().contains(attributeType);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
index 2fedf40aaa2..bd3d2a5f4c9 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.internal.workdef.AttributeWrapper;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -84,7 +85,7 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
}
@Override
- public Collection<String> getAttributesToStringList(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException {
+ public Collection<String> getAttributesToStringList(IAtsObject atsObject, AttributeTypeId attributeType) throws OseeCoreException {
return AtsClientService.get().getArtifact(atsObject).getAttributesToStringList(attributeType);
}
@@ -94,7 +95,7 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
}
@Override
- public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType) throws OseeCoreException {
return AtsClientService.get().getArtifact(workItem).isAttributeTypeValid(attributeType);
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
index bb539a78808..af22ed8fb06 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.ats.api.config.AtsAttributeValueColumn;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.internal.column.ev.AtsColumnService;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -62,7 +63,7 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
}
if (atsObject instanceof IAtsWorkItem) {
IAtsWorkItem workItem = (IAtsWorkItem) atsObject;
- IAttributeType attributeType = services.getStoreService().getAttributeType(attrTypeId);
+ AttributeTypeId attributeType = AttributeTypeId.valueOf(attrTypeId);
String result =
services.getAttributeResolver().getAttributesToStringUniqueList(workItem, attributeType, ";");
if (Strings.isValid(result)) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/util/DuplicateWorkflowAsIsOperation.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/util/DuplicateWorkflowAsIsOperation.java
index 5e324866e1b..6e05cf362dc 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/util/DuplicateWorkflowAsIsOperation.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/util/DuplicateWorkflowAsIsOperation.java
@@ -23,7 +23,7 @@ import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.LogType;
import org.eclipse.osee.ats.core.util.AtsCoreFactory;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -38,7 +38,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
public class DuplicateWorkflowAsIsOperation extends AbstractDuplicateWorkflowOperation {
private final boolean duplicateTasks;
- private List<IAttributeType> excludeTypes;
+ private List<AttributeTypeId> excludeTypes;
private static String ATS_CONFIG_EXCLUDE_DUPLICATE_TYPE_IDS_KEY =
"DuplicateWorkflowAsIsOperation_ExcludeAttrTypeIds";
@@ -121,7 +121,7 @@ public class DuplicateWorkflowAsIsOperation extends AbstractDuplicateWorkflowOpe
return services.getWorkItemFactory().getWorkItem(newWorkItemArt);
}
- private List<IAttributeType> getExcludeTypes() {
+ private List<AttributeTypeId> getExcludeTypes() {
if (excludeTypes == null) {
excludeTypes = new LinkedList<>();
excludeTypes.add(AtsAttributeTypes.AtsId);
@@ -130,7 +130,7 @@ public class DuplicateWorkflowAsIsOperation extends AbstractDuplicateWorkflowOpe
if (Strings.isValid(value)) {
for (String attrTypeId : value.split(";")) {
if (Strings.isNumeric(attrTypeId)) {
- IAttributeType attributeType = services.getStoreService().getAttributeType(Long.valueOf(attrTypeId));
+ AttributeTypeId attributeType = AttributeTypeId.valueOf(attrTypeId);
if (attributeType != null) {
excludeTypes.add(attributeType);
} else {
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
index 93b417e5c98..5ba3c85a96a 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
@@ -115,12 +116,12 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
}
@Override
- public Collection<String> getAttributesToStringList(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException {
+ public Collection<String> getAttributesToStringList(IAtsObject atsObject, AttributeTypeId attributeType) throws OseeCoreException {
return getArtifact(atsObject).getAttributeValues(attributeType);
}
@Override
- public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType) throws OseeCoreException {
return getArtifact(workItem).isAttributeTypeValid(attributeType);
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
index c041e63b572..1dc5cdeb36b 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -164,7 +165,7 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
@Override
- public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, AttributeTypeId attributeType) {
ArtifactReadable artifact = getArtifact(workItem);
return artifact.getValidAttributeTypes().contains(attributeType);
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
index cebeb83a029..855a94282e7 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
@@ -31,6 +31,7 @@ import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -96,21 +97,16 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
}
@Override
- public boolean isAttributeTypeValid(IAtsObject atsObject, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(IAtsObject atsObject, AttributeTypeId attributeType) {
return isAttributeTypeValid(atsObject.getStoreObject(), attributeType);
}
@Override
- public boolean isAttributeTypeValid(ArtifactId artifact, IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(ArtifactId artifact, AttributeTypeId attributeType) {
return ((ArtifactReadable) artifact).isAttributeTypeValid(attributeType);
}
@Override
- public IAttributeType getAttributeType(long attrTypeId) {
- return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().get(attrTypeId);
- }
-
- @Override
public IAttributeType getAttributeType(String attrTypeName) {
return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().getByName(attrTypeName);
}
@@ -121,7 +117,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
}
@Override
- public boolean isDateType(IAttributeType attributeType) {
+ public boolean isDateType(AttributeTypeId attributeType) {
return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().isDateType(attributeType);
}
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 cb38261b978..2abd73c4577 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
@@ -13,8 +13,8 @@ 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.AttributeTypeId;
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.ArtifactProxy;
import org.eclipse.osee.framework.core.dsl.integration.mocks.DslAsserts;
@@ -285,7 +285,7 @@ public class ArtifactMatchInterpreterTest {
}
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) {
return false;
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java
index 578e6fec92c..6ea3312c018 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration.test/src/org/eclipse/osee/framework/core/dsl/integration/internal/AttributeTypeRestrictionHandlerTest.java
@@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.dsl.integration.internal;
+import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
import java.util.HashSet;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IAttributeType;
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;
@@ -23,7 +24,6 @@ import org.eclipse.osee.framework.core.dsl.oseeDsl.AttributeTypeRestriction;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XArtifactType;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XAttributeType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.model.access.Scope;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
@@ -39,6 +39,7 @@ import org.junit.Test;
* @author Roberto E. Escobar
*/
public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerTest<AttributeTypeRestriction> {
+ private static final XAttributeType attributeTypeRef = MockModel.createXAttributeType(Name, Name.getName());
public AttributeTypeRestrictionHandlerTest() {
super(new AttributeTypeRestrictionHandler(), MockModel.createAttributeTypeRestriction(),
@@ -47,16 +48,12 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
@Test
public void testProcessDataAttributeTypeNotApplicable() throws OseeCoreException {
- IAttributeType attributeType = CoreAttributeTypes.Name;
-
- XAttributeType attributeTypeRef = MockModel.createXAttributeType(attributeType, attributeType.getName());
-
AttributeTypeRestriction restriction = MockModel.createAttributeTypeRestriction();
restriction.setPermission(AccessPermissionEnum.ALLOW);
restriction.setAttributeTypeRef(attributeTypeRef);
final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false);
- ArtifactProxy artifactProxy = createArtifactProxy(null, attributeType, wasIsAttributeTypeValidCalled, false);
+ ArtifactProxy artifactProxy = createArtifactProxy(null, Name, wasIsAttributeTypeValidCalled, false);
Scope expectedScope = new Scope().add("fail");
DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artifactProxy, expectedScope);
Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue());
@@ -64,28 +61,20 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
@Test
public void testProcessDataAttributeTypeIsApplicable() throws OseeCoreException {
- IAttributeType attributeType = CoreAttributeTypes.Name;
-
- XAttributeType attributeTypeRef = MockModel.createXAttributeType(attributeType, attributeType.getName());
-
AttributeTypeRestriction restriction = MockModel.createAttributeTypeRestriction();
restriction.setPermission(AccessPermissionEnum.ALLOW);
restriction.setAttributeTypeRef(attributeTypeRef);
final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false);
- ArtifactProxy artifactProxy = createArtifactProxy(null, attributeType, wasIsAttributeTypeValidCalled, true);
+ ArtifactProxy artifactProxy = createArtifactProxy(null, Name, wasIsAttributeTypeValidCalled, true);
Scope expectedScope = new Scope();
- DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType,
- PermissionEnum.WRITE, expectedScope);
+ DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, Name, PermissionEnum.WRITE,
+ expectedScope);
Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue());
}
@Test
public void testProcessDataAttributeTypeIsApplicableArtifactTypeBoundedNoMatch() throws OseeCoreException {
- IAttributeType attributeType = CoreAttributeTypes.Name;
-
- XAttributeType attributeTypeRef = MockModel.createXAttributeType(attributeType, attributeType.getName());
-
AttributeTypeRestriction restriction = MockModel.createAttributeTypeRestriction();
restriction.setPermission(AccessPermissionEnum.ALLOW);
restriction.setAttributeTypeRef(attributeTypeRef);
@@ -98,8 +87,7 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
ArtifactType artArtifactType = new ArtifactType(artifactType2.getGuid(), artifactType2.getName(), false);
final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false);
- ArtifactProxy artifactProxy =
- createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true);
+ ArtifactProxy artifactProxy = createArtifactProxy(artArtifactType, Name, wasIsAttributeTypeValidCalled, true);
Scope expectedScope = new Scope().add("fail");
DslAsserts.assertNullAccessDetail(getRestrictionHandler(), restriction, artifactProxy, expectedScope);
Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue());
@@ -107,9 +95,6 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
@Test
public void testProcessDataAttributeTypeIsApplicableArtifactTypeMatch() throws OseeCoreException {
- IAttributeType attributeType = CoreAttributeTypes.Name;
-
- XAttributeType attributeTypeRef = MockModel.createXAttributeType(attributeType, attributeType.getName());
AttributeTypeRestriction restriction = MockModel.createAttributeTypeRestriction();
restriction.setPermission(AccessPermissionEnum.ALLOW);
@@ -122,20 +107,15 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
ArtifactType artArtifactType = new ArtifactType(artifactType.getGuid(), artifactType.getName(), false);
final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false);
- ArtifactProxy artifactProxy =
- createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true);
+ ArtifactProxy artifactProxy = createArtifactProxy(artArtifactType, Name, wasIsAttributeTypeValidCalled, true);
Scope expectedScope = new Scope();
- DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType,
- PermissionEnum.WRITE, expectedScope);
+ DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, Name, PermissionEnum.WRITE,
+ expectedScope);
Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue());
}
@Test
public void testProcessDataAttributeTypeIsApplicableArtifactTypeMatchWithInheritance() throws OseeCoreException {
- IAttributeType attributeType = CoreAttributeTypes.Name;
-
- XAttributeType attributeTypeRef = MockModel.createXAttributeType(attributeType, attributeType.getName());
-
AttributeTypeRestriction restriction = MockModel.createAttributeTypeRestriction();
restriction.setPermission(AccessPermissionEnum.ALLOW);
restriction.setAttributeTypeRef(attributeTypeRef);
@@ -154,19 +134,18 @@ public class AttributeTypeRestrictionHandlerTest extends BaseRestrictionHandlerT
artArtifactType.setSuperTypes(superTypes);
final MutableBoolean wasIsAttributeTypeValidCalled = new MutableBoolean(false);
- ArtifactProxy artifactProxy =
- createArtifactProxy(artArtifactType, attributeType, wasIsAttributeTypeValidCalled, true);
+ ArtifactProxy artifactProxy = createArtifactProxy(artArtifactType, Name, wasIsAttributeTypeValidCalled, true);
Scope expectedScope = new Scope();
- DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, attributeType,
- PermissionEnum.WRITE, expectedScope);
+ DslAsserts.assertAccessDetail(getRestrictionHandler(), restriction, artifactProxy, Name, PermissionEnum.WRITE,
+ expectedScope);
Assert.assertTrue(wasIsAttributeTypeValidCalled.getValue());
}
- private static ArtifactProxy createArtifactProxy(ArtifactType artifactType, final IAttributeType expectedAttributeType, final MutableBoolean wasIsAttributeTypeValidCalled, final boolean isTypeValid) {
+ private static ArtifactProxy createArtifactProxy(ArtifactType artifactType, final AttributeTypeId expectedAttributeType, final MutableBoolean wasIsAttributeTypeValidCalled, final boolean isTypeValid) {
MockArtifactProxy artData = new MockArtifactProxy(GUID.create(), artifactType) {
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) {
wasIsAttributeTypeValidCalled.setValue(true);
Assert.assertEquals(expectedAttributeType, attributeType);
return isTypeValid;
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 d56144532e4..286e9021b39 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
@@ -13,8 +13,8 @@ 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.AttributeTypeId;
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.ArtifactProxy;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
@@ -59,7 +59,7 @@ public class MockArtifactProxy implements ArtifactProxy {
}
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) {
return false;
}
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 4ba22a18898..88d5a307d79 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
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.core.dsl.integration;
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.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.RelationType;
@@ -28,7 +28,7 @@ public interface ArtifactDataProvider {
@Override
ArtifactType getArtifactType();
- boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException;
+ boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException;
Collection<RelationType> getValidRelationTypes() throws OseeCoreException;
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 25b094059bf..fbc28184b81 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
@@ -15,8 +15,8 @@ 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.AttributeTypeId;
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.type.ArtifactType;
@@ -72,7 +72,7 @@ public final class ArtifactDataProviderImpl implements ArtifactDataProvider {
}
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException {
return self.isAttributeTypeValid(attributeType);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index 1160687696f..20f7887f14c 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.artifact;
import static org.eclipse.osee.framework.core.enums.DirtyState.APPLICABILITY_ONLY;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -145,7 +146,7 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
}
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException {
return artifactTypeCache.isValidAttributeType(getArtifactType(), getBranch(), attributeType);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollection.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollection.java
index f5f6533ff82..749d72d5c00 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollection.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeCollection.java
@@ -16,6 +16,7 @@ import static org.eclipse.osee.orcs.core.internal.util.OrcsPredicates.attributeV
import static org.eclipse.osee.orcs.core.internal.util.OrcsPredicates.deletionFlagEquals;
import com.google.common.base.Predicate;
import java.util.List;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -25,7 +26,7 @@ import org.eclipse.osee.orcs.core.internal.util.AbstractTypeCollection;
/**
* @author Roberto E. Escobar
*/
-public class AttributeCollection extends AbstractTypeCollection<IAttributeType, Attribute<?>, IAttributeType, Attribute<?>> {
+public class AttributeCollection extends AbstractTypeCollection<IAttributeType, Attribute<?>, AttributeTypeId, Attribute<?>> {
private final AttributeExceptionFactory exceptionFactory;
@@ -44,7 +45,7 @@ public class AttributeCollection extends AbstractTypeCollection<IAttributeType,
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
- protected <T extends Attribute<?>> ResultSet<T> createResultSet(IAttributeType attributeType, List<T> values) {
+ protected <T extends Attribute<?>> ResultSet<T> createResultSet(AttributeTypeId attributeType, List<T> values) {
return new AttributeResultSet(exceptionFactory, attributeType, values);
}
@@ -80,7 +81,7 @@ public class AttributeCollection extends AbstractTypeCollection<IAttributeType,
}
@SuppressWarnings({"unchecked", "rawtypes"})
- public <T> List<Attribute<T>> getList(IAttributeType attributeType, DeletionFlag includeDeleted) throws OseeCoreException {
+ public <T> List<Attribute<T>> getList(AttributeTypeId attributeType, DeletionFlag includeDeleted) throws OseeCoreException {
Predicate attributeDeletionFlagEquals = deletionFlagEquals(includeDeleted);
return getListByFilter(attributeType, attributeDeletionFlagEquals);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
index 381d5904153..6d3f13e4405 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeContainer.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.core.internal.attribute;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -49,7 +50,7 @@ public interface AttributeContainer extends Identifiable<String>, HasLocalId<Int
int getAttributeCount(IAttributeType type, DeletionFlag deletionFlag) throws OseeCoreException;
- boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException;
+ boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException;
Collection<? extends IAttributeType> getValidAttributeTypes() throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeExceptionFactory.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeExceptionFactory.java
index 4b93658eab9..10ea2b4081d 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeExceptionFactory.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeExceptionFactory.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.attribute;
-import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
import org.eclipse.osee.framework.core.exception.MultipleAttributesExist;
@@ -19,8 +19,8 @@ import org.eclipse.osee.framework.core.exception.MultipleAttributesExist;
*/
public interface AttributeExceptionFactory {
- MultipleAttributesExist createManyExistException(IAttributeType typeSearched, int count);
+ MultipleAttributesExist createManyExistException(AttributeTypeId typeSearched, int count);
- AttributeDoesNotExist createDoesNotExistException(IAttributeType typeSearched);
+ AttributeDoesNotExist createDoesNotExistException(AttributeTypeId typeSearched);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
index 88262d3a408..176aff4d2c4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.orcs.core.internal.attribute;
import java.io.InputStream;
import java.util.Collection;
import java.util.List;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -42,7 +43,7 @@ public interface AttributeManager extends AttributeContainer {
String getSoleAttributeAsString(IAttributeType attributeType, String defaultValue) throws OseeCoreException;
- <T> List<T> getAttributeValues(IAttributeType attributeType) throws OseeCoreException;
+ <T> List<T> getAttributeValues(AttributeTypeId attributeType) throws OseeCoreException;
<T> void setSoleAttributeValue(IAttributeType attributeType, T value) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
index 47b98c46ed0..78f099c098e 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
@@ -21,6 +21,7 @@ import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -165,7 +166,7 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
}
@Override
- public <T> List<T> getAttributeValues(IAttributeType attributeType) throws OseeCoreException {
+ public <T> List<T> getAttributeValues(AttributeTypeId attributeType) throws OseeCoreException {
List<Attribute<T>> attributes = getAttributesExcludeDeleted(attributeType);
List<T> values = new LinkedList<>();
@@ -414,7 +415,7 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
return getAttributesHelper(DeletionFlag.INCLUDE_DELETED);
}
- private <T> List<Attribute<T>> getAttributesExcludeDeleted(IAttributeType attributeType) throws OseeCoreException {
+ private <T> List<Attribute<T>> getAttributesExcludeDeleted(AttributeTypeId attributeType) throws OseeCoreException {
return getAttributesHelper(attributeType, DeletionFlag.EXCLUDE_DELETED);
}
@@ -427,7 +428,7 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
return Collections.castAll(attributes.getList(includeDeleted));
}
- private <T> List<Attribute<T>> getAttributesHelper(IAttributeType attributeType, DeletionFlag includeDeleted) throws OseeCoreException {
+ private <T> List<Attribute<T>> getAttributesHelper(AttributeTypeId attributeType, DeletionFlag includeDeleted) throws OseeCoreException {
ensureAttributesLoaded();
return attributes.getList(attributeType, includeDeleted);
}
@@ -548,12 +549,12 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
//////////////////////////////////////////////////////////////
@Override
- public MultipleAttributesExist createManyExistException(IAttributeType type, int count) {
+ public MultipleAttributesExist createManyExistException(AttributeTypeId type, int count) {
MultipleAttributesExist toReturn;
if (type != null) {
toReturn = new MultipleAttributesExist(
- "The attribute type [%s] has [%s] instances on [%s], but only [1] instance is allowed", type.getName(),
- count, getExceptionString());
+ "The attribute type [%s] has [%s] instances on [%s], but only [1] instance is allowed", type, count,
+ getExceptionString());
} else {
toReturn = new MultipleAttributesExist(
"Multiple items found - total instances [%s] on [%s], but only [1] instance is allowed", count,
@@ -563,11 +564,11 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
}
@Override
- public AttributeDoesNotExist createDoesNotExistException(IAttributeType type) {
+ public AttributeDoesNotExist createDoesNotExistException(AttributeTypeId type) {
AttributeDoesNotExist toReturn;
if (type != null) {
- toReturn = new AttributeDoesNotExist("Attribute of type [%s] could not be found on [%s]", type.getName(),
- getExceptionString());
+ toReturn =
+ new AttributeDoesNotExist("Attribute of type [%s] could not be found on [%s]", type, getExceptionString());
} else {
toReturn = new AttributeDoesNotExist("Attribute not be found on [%s]", getExceptionString());
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeResultSet.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeResultSet.java
index 36783d4a494..63eb5712930 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeResultSet.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeResultSet.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.core.internal.attribute;
import java.util.List;
-import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSetList;
@@ -20,14 +20,14 @@ import org.eclipse.osee.framework.jdk.core.type.ResultSetList;
*/
public class AttributeResultSet<T> extends ResultSetList<Attribute<T>> {
- private final IAttributeType wasSearched;
+ private final AttributeTypeId wasSearched;
private final AttributeExceptionFactory exceptionFactory;
public AttributeResultSet(AttributeExceptionFactory exceptionFactory, List<Attribute<T>> data) {
this(exceptionFactory, null, data);
}
- public AttributeResultSet(AttributeExceptionFactory exceptionFactory, IAttributeType wasSearched, List<Attribute<T>> data) {
+ public AttributeResultSet(AttributeExceptionFactory exceptionFactory, AttributeTypeId wasSearched, List<Attribute<T>> data) {
super(data);
this.exceptionFactory = exceptionFactory;
this.wasSearched = wasSearched;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index fa2fefb9035..44869bc06b2 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -16,6 +16,7 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -113,7 +114,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
+ public boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException {
return getProxiedObject().isAttributeTypeValid(attributeType);
}
@@ -158,7 +159,7 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
- public <T> List<T> getAttributeValues(IAttributeType attributeType) throws OseeCoreException {
+ public <T> List<T> getAttributeValues(AttributeTypeId attributeType) throws OseeCoreException {
return getProxiedObject().getAttributeValues(attributeType);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
index a92b9cf115d..d53446f9d3c 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
@@ -14,6 +14,7 @@ import com.google.common.collect.Sets;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Map;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -105,7 +106,7 @@ public class ArtifactTypesImpl implements ArtifactTypes {
}
@Override
- public boolean isValidAttributeType(IArtifactType artType, BranchId branch, IAttributeType attributeType) throws OseeCoreException {
+ public boolean isValidAttributeType(IArtifactType artType, BranchId branch, AttributeTypeId attributeType) throws OseeCoreException {
Collection<IAttributeType> attributes = getAttributeTypes(artType, branch);
return attributes.contains(attributeType);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
index 599a33ead9f..903caf8dfca 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
@@ -11,12 +11,12 @@
package org.eclipse.osee.orcs.core.internal.types.impl;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XAttributeType;
import org.eclipse.osee.framework.core.dsl.oseeDsl.XOseeEnumType;
import org.eclipse.osee.framework.jdk.core.type.Id;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.orcs.data.AttributeTypes;
import org.eclipse.osee.orcs.data.EnumType;
@@ -45,9 +45,8 @@ public class AttributeTypesImpl implements AttributeTypes {
this.enumTypeIndexProvider = enumTypeIndexProvider;
}
- private XAttributeType getType(IAttributeType attrType) throws OseeCoreException {
- Conditions.checkNotNull(attrType, "attributeType");
- return provider.getAttributeTypeIndex().getDslTypeByToken(attrType);
+ private XAttributeType getType(AttributeTypeId attributeType) throws OseeCoreException {
+ return provider.getAttributeTypeIndex().getDslTypeByToken(attributeType);
}
@Override
@@ -74,9 +73,8 @@ public class AttributeTypesImpl implements AttributeTypes {
}
@Override
- public String getBaseAttributeTypeId(IAttributeType attrType) throws OseeCoreException {
- XAttributeType type = getType(attrType);
- return getQualifiedTypeName(type.getBaseAttributeType());
+ public String getBaseAttributeTypeId(AttributeTypeId attributeType) throws OseeCoreException {
+ return getQualifiedTypeName(getType(attributeType).getBaseAttributeType());
}
@Override
@@ -214,8 +212,8 @@ public class AttributeTypesImpl implements AttributeTypes {
}
@Override
- public boolean isDateType(IAttributeType attrType) {
- String baseType = getBaseAttributeTypeId(attrType);
+ public boolean isDateType(AttributeTypeId attributeType) {
+ String baseType = getBaseAttributeTypeId(attributeType);
return baseType != null && baseType.toLowerCase().contains("date");
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 92a3408a677..0c8e6e607ad 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -14,6 +14,7 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -41,7 +42,7 @@ public interface ArtifactReadable extends ArtifactToken, HasLocalId<Integer>, Ha
int getAttributeCount(IAttributeType type, DeletionFlag deletionFlag) throws OseeCoreException;
- boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException;
+ boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException;
Collection<? extends IAttributeType> getValidAttributeTypes() throws OseeCoreException;
@@ -59,7 +60,7 @@ public interface ArtifactReadable extends ArtifactToken, HasLocalId<Integer>, Ha
Long getSoleAttributeId(IAttributeType attributeType);
- <T> List<T> getAttributeValues(IAttributeType attributeType) throws OseeCoreException;
+ <T> List<T> getAttributeValues(AttributeTypeId attributeType) throws OseeCoreException;
////////////////////
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
index 5e6e28e5541..24c9215484b 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.data;
import java.util.Collection;
import java.util.Map;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -28,7 +29,7 @@ public interface ArtifactTypes extends IdCollection<IArtifactType> {
Collection<? extends IArtifactType> getAllDescendantTypes(IArtifactType artType) throws OseeCoreException;
- boolean isValidAttributeType(IArtifactType artType, BranchId branch, IAttributeType attributeType) throws OseeCoreException;
+ boolean isValidAttributeType(IArtifactType artType, BranchId branch, AttributeTypeId attributeType) throws OseeCoreException;
Collection<IAttributeType> getAttributeTypes(IArtifactType artType, BranchId branch) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
index c6f43aabe97..f8fd509c485 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.data;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -23,7 +24,7 @@ public interface AttributeTypes extends IdCollection<IAttributeType> {
String getDescription(IAttributeType attrType) throws OseeCoreException;
- String getBaseAttributeTypeId(IAttributeType attrType) throws OseeCoreException;
+ String getBaseAttributeTypeId(AttributeTypeId attrType) throws OseeCoreException;
String getAttributeProviderId(IAttributeType attrType) throws OseeCoreException;
@@ -51,7 +52,7 @@ public interface AttributeTypes extends IdCollection<IAttributeType> {
boolean isIntegerType(IAttributeType attrType);
- boolean isDateType(IAttributeType attrType);
+ boolean isDateType(AttributeTypeId attrType);
boolean isFloatingType(IAttributeType attrType);

Back to the top