Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-07-20 20:24:14 +0000
committerRyan D. Brooks2016-08-31 16:17:41 +0000
commit5bdbd1b8b5eaf656c04f95310827679ae748bc6b (patch)
tree5bf140266b31c7979df373bf96cd75c1b3fdd2bc
parenta80e151affafda45336b6aec623953d1575d585b (diff)
downloadorg.eclipse.osee-5bdbd1b8b5eaf656c04f95310827679ae748bc6b.tar.gz
org.eclipse.osee-5bdbd1b8b5eaf656c04f95310827679ae748bc6b.tar.xz
org.eclipse.osee-5bdbd1b8b5eaf656c04f95310827679ae748bc6b.zip
bug[ats_ATS302825]: Remove IAtsStoreService.getUuidFromGuid and cache
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java12
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java4
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java38
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsStoreService.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/AbstractReviewArtifact.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/AtsTeamDefinitionService.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/ai/ActionableItemManager.java14
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/program/AtsProgramService.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImpl.java37
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java23
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsTeamDefinitionService.java5
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/TeamWorkflow.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java6
20 files changed, 92 insertions, 139 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
index 4a6e0e4bd5..cf880bfba6 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsServices.java
@@ -105,7 +105,7 @@ public interface IAtsServices {
ArtifactId getArtifactByName(IArtifactType artifactType, String name);
- ArtifactId getArtifactByGuid(String workPackageGuid);
+ ArtifactId getArtifactByGuid(String guid);
IAtsProgramService getProgramService();
@@ -120,9 +120,9 @@ public interface IAtsServices {
IAtsImplementerService getImplementerService();
IAtsColumnService getColumnService();
-
+
IAtsWorkDefinitionAdmin getWorkDefinitionAdmin();
-
+
IAtsCache getCache();
IAtsUtilService getUtilService();
@@ -135,4 +135,10 @@ public interface IAtsServices {
Log getLogger();
+ <T> T getConfigItem(IArtifactToken artifactToken);
+
+ <T> T getConfigItem(String guid);
+
+ <T> T getConfigItem(Long uuid);
+
}
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 226267e5d8..c5a219d133 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
@@ -28,8 +28,6 @@ public interface IAtsStoreService {
boolean isDeleted(IAtsObject atsObject);
- Long getUuidFromGuid(String guid);
-
String getTypeName(ArtifactId artifact);
String getGuid(IAtsObject atsObject);
@@ -48,7 +46,7 @@ public interface IAtsStoreService {
IAttributeType getAttributeType(String attrTypeName);
IArtifactType getArtifactType(ArtifactId artifact);
-
+
boolean isDateType(IAttributeType attributeType);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
index 179ef606d6..32e65973be 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
@@ -48,7 +48,7 @@ import org.junit.BeforeClass;
/**
* Test unit for {@link PopulateDemoActions}
- *
+ *
* @author Donald G. Dunne
*/
public class PopulateDemoActionsTest {
@@ -76,7 +76,6 @@ public class PopulateDemoActionsTest {
TeamWorkFlowArtifact codeTeamArt = null;
int numTested = 0;
for (TeamWorkFlowArtifact teamArt : action.getTeams()) {
- teamArt.getActionableItemsDam().getActionableItemUuids();
if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Code")) {
numTested++;
codeTeamArt = teamArt;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
index a0965593f8..7e1c4747e0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
@@ -189,4 +189,5 @@ public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolv
IAtsCache getCache();
void reloadConfigCache();
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java
index 5959e9ff96..cfb8e8c711 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java
@@ -12,19 +12,14 @@ package org.eclipse.osee.ats.core.client.config;
import java.util.Collection;
import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Set;
-import java.util.logging.Level;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
@@ -41,14 +36,10 @@ public class ActionableItemManager {
public Set<IAtsActionableItem> getActionableItems() throws OseeCoreException {
Set<IAtsActionableItem> ais = new HashSet<>();
if (!artifact.isDeleted()) {
- for (Long uuid : getActionableItemUuids()) {
- IAtsActionableItem aia = AtsClientService.get().getCache().getByUuid(uuid, IAtsActionableItem.class);
- if (aia == null && !artifact.isDeleted()) {
- OseeLog.logf(Activator.class, Level.SEVERE,
- "Actionable Item Uuid [%d] from [%s] doesn't match item in AtsConfigCache", uuid,
- artifact.toStringWithId());
- } else {
- ais.add(aia);
+ for (String guid : artifact.getAttributesToStringList(AtsAttributeTypes.ActionableItem)) {
+ IAtsActionableItem ai = AtsClientService.get().getConfigItem(guid);
+ if (ai != null) {
+ ais.add(ai);
}
}
}
@@ -59,23 +50,8 @@ public class ActionableItemManager {
return AtsObjects.toString("; ", getActionableItems());
}
- /**
- * Return cached guids stored in DB to uuids or query and fill cache. This cache will go away when ATS Team
- * Definitions and AIs are referenced by uuid instead of guid in DB Store.
- */
- public List<Long> getActionableItemUuids() throws OseeCoreException {
- List<Long> uuids = new LinkedList<>();
- for (String guid : artifact.getAttributesToStringList(AtsAttributeTypes.ActionableItem)) {
- Long uuid = AtsClientService.get().getStoreService().getUuidFromGuid(guid);
- if (uuid != null) {
- uuids.add(uuid);
- }
- }
- return uuids;
- }
-
public void addActionableItem(IAtsActionableItem aia) throws OseeCoreException {
- if (!getActionableItemUuids().contains(aia.getUuid())) {
+ if (!getActionableItems().contains(aia)) {
String guid = null;
if (aia.getStoreObject() instanceof Artifact) {
guid = ((Artifact) aia.getStoreObject()).getGuid();
@@ -111,4 +87,8 @@ public class ActionableItemManager {
return Result.TrueResult;
}
+ public boolean hasActionableItems() {
+ return artifact.getAttributeCount(AtsAttributeTypes.ActionableItem) > 0;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 9178b6d924..2656fc6fb4 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -234,7 +234,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
atsStoreService = new AtsStoreService(workItemFactory);
atsQueryService = new AtsQueryServiceImpl(this);
- actionableItemManager = new ActionableItemManager(atsQueryService, attributeResolverService, atsStoreService);
+ actionableItemManager = new ActionableItemManager(attributeResolverService, atsStoreService, this);
sequenceProvider = new ISequenceProvider() {
@Override
@@ -740,7 +740,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
}
return implementerService;
}
-
+
@Override
public IAtsCache getCache() {
return atsCache;
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 3fb318190d..039d466354 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
@@ -12,11 +12,9 @@ package org.eclipse.osee.ats.core.client.internal;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
@@ -26,7 +24,6 @@ import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsStoreService;
import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
-import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -42,7 +39,6 @@ import org.eclipse.osee.framework.skynet.core.attribute.DateAttribute;
* @author Donald G. Dunne
*/
public class AtsStoreService implements IAtsStoreService {
- private static Map<String, Long> guidToUuid;
private final IAtsWorkItemFactory workItemFactory;
public AtsStoreService(IAtsWorkItemFactory workItemFactory) {
@@ -84,26 +80,6 @@ public class AtsStoreService implements IAtsStoreService {
}
@Override
- public Long getUuidFromGuid(String guid) {
- Long result = AtsUtilCore.getUuidFromGuid(guid);
- if (result == null) {
- if (guidToUuid == null) {
- guidToUuid = new HashMap<>(200);
- }
- if (guidToUuid.containsKey(guid)) {
- result = guidToUuid.get(guid);
- } else {
- Artifact art = AtsClientService.get().getArtifactByGuid(guid);
- if (art != null) {
- result = art.getUuid();
- guidToUuid.put(guid, result);
- }
- }
- }
- return result;
- }
-
- @Override
public String getGuid(IAtsObject atsObject) {
return ((Artifact) atsObject.getStoreObject()).getGuid();
}
@@ -154,7 +130,7 @@ public class AtsStoreService implements IAtsStoreService {
public IArtifactType getArtifactType(ArtifactId artifact) {
return ((Artifact) artifact).getArtifactType();
}
-
+
@Override
public boolean isDateType(IAttributeType attributeType) {
return AttributeTypeManager.isBaseTypeCompatible(DateAttribute.class, attributeType);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/AbstractReviewArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/AbstractReviewArtifact.java
index 31e64ea14e..db0546315d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/AbstractReviewArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/AbstractReviewArtifact.java
@@ -29,8 +29,8 @@ import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.ActionableItems;
-import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -41,7 +41,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
public abstract class AbstractReviewArtifact extends AbstractWorkflowArtifact implements IAtsAbstractReview {
private ActionableItemManager actionableItemsDam;
- private Boolean standAlone = null;
public AbstractReviewArtifact(String guid, BranchId branch, IArtifactType artifactType) throws OseeCoreException {
super(guid, branch, artifactType);
@@ -161,10 +160,7 @@ public abstract class AbstractReviewArtifact extends AbstractWorkflowArtifact im
}
public boolean isStandAloneReview() throws OseeCoreException {
- if (standAlone == null) {
- standAlone = getActionableItemsDam().getActionableItemUuids().size() > 0;
- }
- return standAlone;
+ return getActionableItemsDam().hasActionableItems();
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/AtsTeamDefinitionService.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/AtsTeamDefinitionService.java
index 3a1b6402d0..5440f318a7 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/AtsTeamDefinitionService.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/AtsTeamDefinitionService.java
@@ -45,8 +45,7 @@ public class AtsTeamDefinitionService implements IAtsTeamDefinitionService {
String teamDefGuid =
((Artifact) workItem.getStoreObject()).getSoleAttributeValue(AtsAttributeTypes.TeamDefinition, "");
if (Strings.isValid(teamDefGuid)) {
- Long uuid = AtsClientService.get().getStoreService().getUuidFromGuid(teamDefGuid);
- teamDef = atsClient.getCache().getByUuid(uuid, IAtsTeamDefinition.class);
+ teamDef = atsClient.getConfigItem(teamDefGuid);
}
return teamDef;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
index b28fdb86d5..b10eb573ab 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
@@ -135,8 +135,7 @@ public class TeamWorkFlowArtifact extends AbstractWorkflowArtifact implements IA
if (!Strings.isValid(guid)) {
throw new OseeArgumentException("TeamWorkflow [%s] has no Team Definition associated.", getAtsId());
}
- Long uuid = AtsClientService.get().getStoreService().getUuidFromGuid(guid);
- IAtsTeamDefinition teamDef = AtsClientService.get().getCache().getByUuid(uuid, IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsClientService.get().getConfigItem(guid);
Conditions.checkNotNull(teamDef, String.format("TeamDef null for Team WF %s", toStringWithId()));
return teamDef;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/ai/ActionableItemManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/ai/ActionableItemManager.java
index 3077115deb..9125ff648a 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/ai/ActionableItemManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/ai/ActionableItemManager.java
@@ -15,10 +15,9 @@ import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.query.IAtsQueryService;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsStoreService;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
@@ -33,24 +32,21 @@ import org.eclipse.osee.framework.logging.OseeLog;
*/
public class ActionableItemManager {
- private final IAtsQueryService queryService;
private final IAttributeResolver attrResolver;
private final IAtsStoreService atsStoreService;
+ private final IAtsServices services;
- public ActionableItemManager(IAtsQueryService queryService, IAttributeResolver attrResolver, IAtsStoreService atsStoreService) {
- this.queryService = queryService;
+ public ActionableItemManager(IAttributeResolver attrResolver, IAtsStoreService atsStoreService, IAtsServices services) {
this.attrResolver = attrResolver;
this.atsStoreService = atsStoreService;
+ this.services = services;
}
public Set<IAtsActionableItem> getActionableItems(IAtsObject atsObject) throws OseeCoreException {
Set<IAtsActionableItem> ais = new HashSet<>();
if (!atsStoreService.isDeleted(atsObject)) {
for (String guid : getActionableItemGuids(atsObject)) {
- long uuid = atsStoreService.getUuidFromGuid(guid);
- IAtsActionableItem aia =
- queryService.createQuery(AtsArtifactTypes.ActionableItem).andUuids(uuid).getOneOrNull(
- IAtsActionableItem.class);
+ IAtsActionableItem aia = services.getConfigItem(guid);
if (aia == null) {
OseeLog.logf(ActionableItemManager.class, Level.SEVERE,
"Actionable Item Guid [%s] from [%s] doesn't match item in AtsConfigCache", guid,
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/program/AtsProgramService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/program/AtsProgramService.java
index 95a9789962..a42d25611b 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/program/AtsProgramService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/program/AtsProgramService.java
@@ -233,8 +233,7 @@ public class AtsProgramService implements IAtsProgramService {
String guid =
services.getAttributeResolver().getSoleAttributeValue(program, AtsAttributeTypes.TeamDefinition, "");
if (Strings.isValid(guid)) {
- Long uuid = services.getStoreService().getUuidFromGuid(guid);
- teamDefinition = services.getSoleByUuid(uuid, IAtsTeamDefinition.class);
+ teamDefinition = services.getConfigItem(guid);
}
return teamDefinition;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImpl.java
index be8cd10ed1..f645305242 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsCoreServiceImpl.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.util;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import java.util.concurrent.TimeUnit;
+import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.config.AtsConfigurations;
@@ -20,6 +21,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.IArtifactToken;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
/**
@@ -54,8 +56,8 @@ public abstract class AtsCoreServiceImpl implements IAtsServices {
public IAtsWorkDefinitionAdmin getWorkDefAdmin() {
return workDefAdmin;
- }
-
+ }
+
@Override
public AtsConfigurations getConfigurations() {
return configurationsCache.get();
@@ -78,4 +80,35 @@ public abstract class AtsCoreServiceImpl implements IAtsServices {
*/
abstract protected AtsConfigurations loadConfigurations();
+ @Override
+ public <T> T getConfigItem(IArtifactToken artifactToken) {
+ return getConfigItem(artifactToken.getUuid());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getConfigItem(String guid) {
+ T atsObject = getCache().getAtsObjectByGuid(guid);
+ if (atsObject == null) {
+ ArtifactId artifact = getArtifactByGuid(guid);
+ if (artifact != null && artifact instanceof IAtsConfigObject) {
+ atsObject = (T) getConfigItemFactory().getConfigObject(artifact);
+ }
+ }
+ return atsObject;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getConfigItem(Long uuid) {
+ T atsObject = getCache().getAtsObject(uuid);
+ if (atsObject == null) {
+ ArtifactId artifact = getArtifact(uuid);
+ if (artifact != null && artifact instanceof IAtsConfigObject) {
+ atsObject = (T) getConfigItemFactory().getConfigObject(artifact);
+ }
+ }
+ return atsObject;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
index 821c4bd7a4..a72b022ed8 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
@@ -242,7 +242,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
};
atsQueryService = new AtsQueryServiceImpl(this);
- actionableItemManager = new ActionableItemManager(getQueryService(), attributeResolverService, atsStoreService);
+ actionableItemManager = new ActionableItemManager(attributeResolverService, atsStoreService, this);
actionFactory = new ActionFactory(workItemFactory, utilService, sequenceProvider, actionableItemManager,
attributeResolverService, atsStateFactory, getServices());
atsProgramService = new AtsProgramService(this);
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 3047c015dd..cd85659c2f 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
@@ -12,11 +12,9 @@ package org.eclipse.osee.ats.rest.internal.util;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
@@ -47,7 +45,6 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
private final IAtsLogFactory logFactory;
private final IAtsNotifier notifier;
private final IAtsServer atsServer;
- private static Map<String, Long> guidToUuid;
public AtsStoreServiceImpl(IAttributeResolver attributeResolver, IAtsServer atsServer, IAtsStateFactory stateFactory, IAtsLogFactory logFactory, IAtsNotifier notifier) {
this.atsServer = atsServer;
@@ -82,24 +79,6 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
}
@Override
- public Long getUuidFromGuid(String guid) {
- if (guidToUuid == null) {
- guidToUuid = new HashMap<>(200);
- }
- Long result = null;
- if (guidToUuid.containsKey(guid)) {
- result = guidToUuid.get(guid);
- } else {
- ArtifactReadable art = atsServer.getArtifactByGuid(guid);
- if (art != null) {
- result = art.getUuid();
- guidToUuid.put(guid, result);
- }
- }
- return result;
- }
-
- @Override
public String getTypeName(ArtifactId artifact) {
return ((ArtifactReadable) artifact).getArtifactType().getName();
}
@@ -144,7 +123,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
public IArtifactType getArtifactType(ArtifactId artifact) {
return ((ArtifactReadable) artifact).getArtifactType();
}
-
+
@Override
public boolean isDateType(IAttributeType attributeType) {
return atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().isDateType(attributeType);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsTeamDefinitionService.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsTeamDefinitionService.java
index 2344896065..f4c0a78ca9 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsTeamDefinitionService.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsTeamDefinitionService.java
@@ -44,8 +44,7 @@ public class AtsTeamDefinitionService implements IAtsTeamDefinitionService {
String teamDefGuid =
((ArtifactReadable) workItem.getStoreObject()).getSoleAttributeAsString(AtsAttributeTypes.TeamDefinition, "");
if (Strings.isValid(teamDefGuid)) {
- Long uuid = atsServer.getStoreService().getUuidFromGuid(teamDefGuid);
- teamDef = atsServer.getCache().getByUuid(uuid, IAtsTeamDefinition.class);
+ teamDef = atsServer.getConfigItem(teamDefGuid);
}
return teamDef;
}
@@ -69,7 +68,7 @@ public class AtsTeamDefinitionService implements IAtsTeamDefinitionService {
public IAtsTeamDefinition getTeamDefHoldingVersions(IAtsProgram program) {
return atsServer.getProgramService().getTeamDefHoldingVersions(program);
}
-
+
@Override
public IAtsTeamDefinition getTeamDefinition(String name) {
IAtsTeamDefinition teamDef = null;
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/TeamWorkflow.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/TeamWorkflow.java
index a09b0e3f97..c91005d9e0 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/TeamWorkflow.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/TeamWorkflow.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.rest.IAtsServer;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -35,15 +36,12 @@ public class TeamWorkflow extends WorkItem implements IAtsTeamWorkflow {
Set<IAtsActionableItem> ais = new HashSet<>();
for (Object aiGuidObj : artifact.getAttributeValues(AtsAttributeTypes.ActionableItem)) {
String aiGuid = (String) aiGuidObj;
- Long uuid = getAtsServer().getStoreService().getUuidFromGuid(aiGuid);
- if (uuid != null) {
- IAtsActionableItem ai = getAtsServer().getCache().getByUuid(uuid, IAtsActionableItem.class);
- if (ai == null) {
- ArtifactReadable aiArt = getAtsServer().getArtifactByGuid(aiGuid);
- ai = getAtsServer().getConfigItemFactory().getActionableItem(aiArt);
- }
- ais.add(ai);
+ IAtsActionableItem ai = getAtsServer().getConfigItem(aiGuid);
+ if (ai == null) {
+ ArtifactReadable aiArt = getAtsServer().getArtifactByGuid(aiGuid);
+ ai = getAtsServer().getConfigItemFactory().getActionableItem(aiArt);
}
+ ais.add(ai);
}
return ais;
}
@@ -52,13 +50,8 @@ public class TeamWorkflow extends WorkItem implements IAtsTeamWorkflow {
public IAtsTeamDefinition getTeamDefinition() throws OseeCoreException {
IAtsTeamDefinition teamDef = null;
String teamDefGuid = artifact.getSoleAttributeValue(AtsAttributeTypes.TeamDefinition);
- Long uuid = getAtsServer().getStoreService().getUuidFromGuid(teamDefGuid);
- if (uuid != null) {
- teamDef = getAtsServer().getCache().getByUuid(uuid, IAtsTeamDefinition.class);
- if (teamDef == null) {
- ArtifactReadable teamDefArt = getAtsServer().getArtifactByGuid(teamDefGuid);
- teamDef = getAtsServer().getConfigItemFactory().getTeamDef(teamDefArt);
- }
+ if (Strings.isValid(teamDefGuid)) {
+ teamDef = getAtsServer().getConfigItem(teamDefGuid);
}
return teamDef;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
index 5424fb68eb..e6bb8a3cc6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
@@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.core.config.ActionableItems;
@@ -69,7 +70,6 @@ public class NewActionPage1 extends WizardPage {
private Text descriptionLabel;
private boolean debugPopulated = false;
private static IAtsActionableItem atsAi;
- private static final String ATS_Actionable_Item_Guid_For_Training_And_Demos = "AAABER+4zV8A8O7WAtxxaA";
protected static final String TITLE = "Title";
protected NewActionPage1(NewActionWizard actionWizard) {
@@ -190,9 +190,7 @@ public class NewActionPage1 extends WizardPage {
try {
((XText) getXWidget(TITLE)).set("tt");
if (atsAi == null) {
- Long uuid = AtsClientService.get().getStoreService().getUuidFromGuid(
- ATS_Actionable_Item_Guid_For_Training_And_Demos);
- atsAi = AtsClientService.get().getCache().getByUuid(uuid, IAtsActionableItem.class);
+ atsAi = AtsClientService.get().getConfigItem(AtsArtifactToken.TopActionableItem);
if (atsAi != null) {
treeViewer.getViewer().setSelection(new StructuredSelection(Arrays.asList(atsAi)));
treeViewer.setInitalChecked(Arrays.asList(atsAi));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
index 4f86b7477b..409996318b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
@@ -97,7 +97,7 @@ public class WfeRelationsHyperlinkComposite extends Composite {
return true;
}
}
- if (smaArt instanceof AbstractReviewArtifact && ((AbstractReviewArtifact) smaArt).getActionableItemsDam().getActionableItemUuids().size() > 0) {
+ if (smaArt instanceof AbstractReviewArtifact && ((AbstractReviewArtifact) smaArt).getActionableItemsDam().hasActionableItems()) {
return true;
}
return false;
@@ -158,7 +158,7 @@ public class WfeRelationsHyperlinkComposite extends Composite {
}
private void processReviewArtifact(final AbstractReviewArtifact reviewArt) throws OseeCoreException {
- if (reviewArt.getActionableItemsDam().getActionableItemUuids().isEmpty()) {
+ if (!reviewArt.getActionableItemsDam().hasActionableItems()) {
return;
}
actionableItemsLabel = editor.getToolkit().createLabel(this, "");
@@ -187,9 +187,9 @@ public class WfeRelationsHyperlinkComposite extends Composite {
if (actionableItemsLabel != null && awa instanceof AbstractReviewArtifact) {
actionableItemsLabel.setText("This \"" + ((AbstractReviewArtifact) awa).getArtifactTypeName() +
//
- "\" is review of Actionable Items \"" +
- //
- ((AbstractReviewArtifact) awa).getActionableItemsDam().getActionableItemsStr() + "\" ");
+ "\" is review of Actionable Items \"" +
+ //
+ ((AbstractReviewArtifact) awa).getActionableItemsDam().getActionableItemsStr() + "\" ");
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index 469099172e..8996c76c7e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -47,6 +47,7 @@ import org.eclipse.osee.ats.core.client.util.AtsTaskCache;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.core.config.Versions;
+import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.internal.Activator;
@@ -698,7 +699,8 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
results.log(artifact, "testTeamWorkflows",
"Error: TeamWorkflow " + XResultDataUI.getHyperlink(teamArt) + " has no TeamDefinition");
}
- List<Long> badUuids = getInvalidUuids(teamArt.getActionableItemsDam().getActionableItemUuids());
+ List<Long> badUuids =
+ getInvalidUuids(AtsObjects.toUuids(teamArt.getActionableItemsDam().getActionableItems()));
if (!badUuids.isEmpty()) {
results.log(artifact, "testTeamWorkflows", "Error: TeamWorkflow " + XResultDataUI.getHyperlink(
teamArt) + " has AI uuids that don't exisit " + badUuids);
@@ -1023,7 +1025,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
if (artifact instanceof AbstractReviewArtifact) {
AbstractReviewArtifact reviewArtifact = (AbstractReviewArtifact) artifact;
if (reviewArtifact.getRelatedArtifactsCount(
- AtsRelationTypes.TeamWorkflowToReview_Team) == 0 && reviewArtifact.getActionableItemsDam().getActionableItemUuids().isEmpty()) {
+ AtsRelationTypes.TeamWorkflowToReview_Team) == 0 && !reviewArtifact.getActionableItemsDam().hasActionableItems()) {
results.log(artifact, "testReviewsHaveParentWorkflowOrActionableItems",
"Error: Review " + XResultDataUI.getHyperlink(
reviewArtifact) + " has 0 related parents and 0 actionable items.");

Back to the top