Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-08-08 19:42:55 +0000
committerAngel Avila2016-08-08 19:42:55 +0000
commitc052e7d91e13ca1e060ad774f98f0add8a97138a (patch)
tree0562a618f30902c03a1430509975df5f24ccd9ab
parent35302aad21da8b27f932710105b220a8a83f0ef3 (diff)
downloadorg.eclipse.osee-c052e7d91e13ca1e060ad774f98f0add8a97138a.tar.gz
org.eclipse.osee-c052e7d91e13ca1e060ad774f98f0add8a97138a.tar.xz
org.eclipse.osee-c052e7d91e13ca1e060ad774f98f0add8a97138a.zip
refactor: Use ArtifactId with IAtsCache
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/IAtsCache.java26
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java109
-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/workitem/AtsActionEndpointImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsRuleEndpointImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/ActionableItemSearchWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/TeamDefinitionSearchWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/VersionSearchWidget.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java2
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java6
22 files changed, 47 insertions, 161 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/IAtsCache.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/IAtsCache.java
index f3bc3f966b..8b72a35265 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/IAtsCache.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/IAtsCache.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ats.api.config;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.IArtifactToken;
/**
* @author Donald G. Dunne
@@ -21,23 +20,9 @@ public interface IAtsCache {
public <T extends IAtsObject> T getAtsObject(Long uuid);
- public <T extends IAtsObject> T getAtsObjectByGuid(String guid);
-
- public <T extends IAtsObject> T getAtsObjectByTag(String tag);
-
- public <T extends IAtsObject> T getAtsObjectByTag(String tag, Class<T> clazz);
-
- public void cacheAtsObjectByTag(String tag, IAtsObject atsObject);
-
- public <T extends ArtifactId> T getArtifact(Long uuid);
-
- public <T extends ArtifactId> T getArtifactByGuid(String guid);
+ public <T extends IAtsObject> T getAtsObject(ArtifactId artifact);
- public <T extends ArtifactId> T getArtifactByTag(String tag);
-
- public void cacheArtifactByTag(String tag, ArtifactId artifact);
-
- public <T extends IAtsObject> T getByUuid(Long uuid, Class<T> clazz);
+ public <T extends IAtsObject> T getAtsObjectByGuid(String guid);
public void cacheAtsObject(IAtsObject atsObject);
@@ -46,9 +31,4 @@ public interface IAtsCache {
public void invalidate();
public void deCacheAtsObject(IAtsObject atsObject);
-
- public ArtifactId getArtifact(IAtsObject atsObject);
-
- public <T extends IAtsObject> T getAtsObjectByToken(IArtifactToken token, Class<T> clazz);
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
index 59258e7d2c..5576b8917e 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
@@ -62,8 +62,7 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
// Add check to keep exception from occurring for OSEE developers running against production
if (!ClientSessionManager.isProductionDataStore()) {
try {
- results = AtsClientService.get().getCache().getByUuid(team.getTeamDefToken().getId(),
- IAtsTeamDefinition.class);
+ results = AtsClientService.get().getCache().getAtsObject(team.getTeamDefToken());
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
index f137f34e19..d7e109e5a3 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
@@ -356,7 +356,7 @@ public class AtsBranchConfigurationTest {
branch.getName(), AtsUtilCore.getAtsBranch())) {
teamDefArt.deleteAndPersist(transaction, false);
IAtsTeamDefinition soleByUuid =
- AtsClientService.get().getCache().getByUuid(teamDefArt.getId(), IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(teamDefArt.getId());
if (soleByUuid != null) {
AtsClientService.get().getCache().deCacheAtsObject(soleByUuid);
}
@@ -370,7 +370,7 @@ public class AtsBranchConfigurationTest {
for (Artifact childArt : aiaArt.getChildren()) {
childArt.deleteAndPersist(transaction, false);
IAtsActionableItem soleByUuid =
- AtsClientService.get().getCache().getByUuid(childArt.getId(), IAtsActionableItem.class);
+ AtsClientService.get().getCache().getAtsObject(childArt.getId());
if (soleByUuid != null) {
AtsClientService.get().getCache().deCacheAtsObject(soleByUuid);
}
@@ -379,7 +379,7 @@ public class AtsBranchConfigurationTest {
aiaArt.deleteAndPersist(transaction, false);
IAtsActionableItem ai =
- AtsClientService.get().getCache().getByUuid(aiaArt.getId(), IAtsActionableItem.class);
+ AtsClientService.get().getCache().getAtsObject(aiaArt.getId());
if (ai != null) {
AtsClientService.get().getCache().deCacheAtsObject(ai);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java
index 33ecb37f12..f65493676b 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/EarnedValueReportOperationTest.java
@@ -38,8 +38,7 @@ public class EarnedValueReportOperationTest {
@Test
public void testReport() throws OseeCoreException {
List<IAtsTeamDefinition> teamDefs = new ArrayList<>();
- IAtsTeamDefinition teamDef =
- AtsClientService.get().getCache().getByUuid(DemoArtifactToken.SAW_SW.getId(), IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsClientService.get().getCache().getAtsObject(DemoArtifactToken.SAW_SW);
teamDefs.add(teamDef);
SearchWorkPackageOperation srch = new SearchWorkPackageOperation("srch", teamDefs, true,
new ArrayList<IAtsActionableItem>(), false, Active.Both);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
index 713671a9dd..b9aaa8f860 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/ev/SearchWorkPackageOperationTest.java
@@ -101,13 +101,13 @@ public class SearchWorkPackageOperationTest {
List<IAtsTeamDefinition> teamDefs = new ArrayList<>();
for (Long teamDefUuid : teamDefUuids) {
IAtsTeamDefinition teamDef =
- AtsClientService.get().getCache().getByUuid(teamDefUuid, IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(teamDefUuid);
teamDefs.add(teamDef);
}
List<IAtsActionableItem> ais = new ArrayList<>();
for (Long aiUuid : aiUuids) {
- IAtsActionableItem ai = AtsClientService.get().getCache().getByUuid(aiUuid, IAtsActionableItem.class);
+ IAtsActionableItem ai = AtsClientService.get().getCache().getAtsObject(aiUuid);
ais.add(ai);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java
index 08de7da5c2..a06b7c37c4 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/DemoTeamWorkflowTest.java
@@ -50,8 +50,7 @@ public class DemoTeamWorkflowTest {
@Test
public void testCreateSawTestWf() throws Exception {
Collection<IAtsActionableItem> aias = new HashSet<>();
- aias.add(AtsClientService.get().getCache().getByUuid(DemoArtifactToken.SAW_Test_AI.getId(),
- IAtsActionableItem.class));
+ aias.add(AtsClientService.get().getCache().getAtsObject(DemoArtifactToken.SAW_Test_AI));
String title = getClass().getSimpleName() + " testCreateSawTestWf";
AtsChangeSet changes = new AtsChangeSet("Create SAW Test Action title: " + title);
@@ -78,8 +77,7 @@ public class DemoTeamWorkflowTest {
results = transitionMgr.handleAllAndPersist();
assertTrue("Transition Error - " + results.toString(), results.isEmpty());
- IAtsVersion sawBuild2Version =
- AtsClientService.get().getCache().getByUuid(DemoArtifactToken.SAW_Bld_2.getId(), IAtsVersion.class);
+ IAtsVersion sawBuild2Version = AtsClientService.get().getCache().getAtsObject(DemoArtifactToken.SAW_Bld_2);
assertNotNull(sawBuild2Version);
AtsClientService.get().getVersionService().setTargetedVersionAndStore(teamWf, sawBuild2Version);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
index ea3ce86c0c..9c6f24e16a 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
@@ -232,8 +232,7 @@ public class DemoTestUtil {
// Add check to keep exception from occurring for OSEE developers running against production
if (!ClientSessionManager.isProductionDataStore()) {
try {
- results = AtsClientService.get().getCache().getByUuid(team.getTeamDefToken().getId(),
- IAtsTeamDefinition.class);
+ results = AtsClientService.get().getCache().getAtsObject(team.getTeamDefToken());
} catch (Exception ex) {
OseeLog.log(DemoTestUtil.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
index c159d8553c..aeb8b6eb2f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AtsArtifactChecks.java
@@ -177,7 +177,7 @@ public class AtsArtifactChecks extends ArtifactCheck {
for (Artifact art : artifacts) {
if (art.isOfType(AtsArtifactTypes.ActionableItem)) {
IAtsActionableItem aia =
- AtsClientService.get().getCache().getByUuid(art.getId(), IAtsActionableItem.class);
+ AtsClientService.get().getCache().getAtsObject(art.getId());
if (aia != null) {
aiaGuids.add(AtsUtilCore.getGuid(aia));
Collection<Artifact> childArts = art.getChildren();
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 2b32faca41..b8451cf5ed 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
@@ -699,7 +699,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz) throws OseeCoreException {
- return getCache().getByUuid(uuid, clazz);
+ return getCache().getAtsObject(uuid);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
index a93a890235..30e06f9e5c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
@@ -57,9 +57,9 @@ public class AtsVersionServiceImpl extends AbstractAtsVersionServiceImpl impleme
if (verArts.size() > 1) {
OseeLog.log(Activator.class, Level.SEVERE,
"Multiple targeted versions for artifact " + teamWf.toStringWithId());
- version = cache.getByUuid(verArts.iterator().next().getId(), IAtsVersion.class);
+ version = cache.getAtsObject(verArts.iterator().next().getId());
} else {
- version = cache.getByUuid(verArts.iterator().next().getId(), IAtsVersion.class);
+ version = cache.getAtsObject(verArts.iterator().next().getId());
}
}
return version;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
index 1e025fe95d..1ab0da54f5 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsCache.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.config.IAtsCache;
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;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -37,12 +36,9 @@ public class AtsCache implements IAtsCache {
private final LoadingCache<Long, ArtifactId> uuidToArtifactIdCache = CacheBuilder.newBuilder() //
.expireAfterWrite(15, TimeUnit.MINUTES) //
.build(uuidToArtifactIdCacheLoader);
- private final LoadingCache<String, IAtsObject> tagToAtsObjectCache = CacheBuilder.newBuilder() //
+ private final LoadingCache<String, IAtsObject> guidToAtsObjectCache = CacheBuilder.newBuilder() //
.expireAfterWrite(15, TimeUnit.MINUTES) //
.build(tagToAtsObjectCacheLoader);
- private final LoadingCache<String, ArtifactId> tagToArtifactIdCache = CacheBuilder.newBuilder() //
- .expireAfterWrite(15, TimeUnit.MINUTES) //
- .build(tagToArtifactIdCacheLoader);
public AtsCache(IAtsServices services) {
AtsCache.services = services;
@@ -60,95 +56,34 @@ public class AtsCache implements IAtsCache {
}
@Override
- @SuppressWarnings("unchecked")
- public <T extends IAtsObject> T getAtsObjectByGuid(String guid) {
- Conditions.checkNotNullOrEmpty(guid, "guid");
- try {
- return (T) tagToAtsObjectCache.get(guid);
- } catch (Exception ex) {
- return null;
- }
+ public <T extends IAtsObject> T getAtsObject(ArtifactId artifact) {
+ return getAtsObject(artifact.getId());
}
@Override
@SuppressWarnings("unchecked")
- public <T extends IAtsObject> T getAtsObjectByTag(String tag) {
- Conditions.checkNotNullOrEmpty(tag, "tag");
+ public <T extends IAtsObject> T getAtsObjectByGuid(String guid) {
+ Conditions.checkNotNullOrEmpty(guid, "guid");
try {
- return (T) tagToAtsObjectCache.get(tag);
+ return (T) guidToAtsObjectCache.get(guid);
} catch (Exception ex) {
return null;
}
}
@Override
- public <T extends IAtsObject> T getAtsObjectByTag(String tag, Class<T> clazz) {
- Conditions.checkNotNullOrEmpty(tag, "tag");
- return getAtsObjectByTag(tag);
- }
-
- @Override
public void cacheAtsObject(IAtsObject atsObject) {
Conditions.checkNotNull(atsObject, "atsObject");
if (atsObject.getStoreObject() != null) {
- tagToAtsObjectCache.put(atsObject.getStoreObject().getGuid(), atsObject);
- tagToArtifactIdCache.put(atsObject.getStoreObject().getGuid(), atsObject.getStoreObject());
+ guidToAtsObjectCache.put(atsObject.getStoreObject().getGuid(), atsObject);
uuidToArtifactIdCache.put(atsObject.getId(), atsObject.getStoreObject());
}
uuidToAtsObjectCache.put(atsObject.getId(), atsObject);
}
@Override
- public void cacheAtsObjectByTag(String tag, IAtsObject atsObject) {
- Conditions.checkNotNullOrEmpty(tag, "tag");
- Conditions.checkNotNull(atsObject, "atsObject");
- tagToAtsObjectCache.put(tag, atsObject);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T extends ArtifactId> T getArtifact(Long uuid) {
- Conditions.checkNotNull(uuid, "uuid");
- try {
- return (T) uuidToArtifactIdCache.get(uuid);
- } catch (Exception ex) {
- return null;
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T extends ArtifactId> T getArtifactByGuid(String guid) {
- Conditions.checkNotNullOrEmpty(guid, "guid");
- try {
- return (T) tagToArtifactIdCache.get(guid);
- } catch (Exception ex) {
- return null;
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T extends ArtifactId> T getArtifactByTag(String tag) {
- Conditions.checkNotNullOrEmpty(tag, "tag");
- try {
- return (T) tagToArtifactIdCache.get(tag);
- } catch (Exception ex) {
- return null;
- }
- }
-
- @Override
- public void cacheArtifactByTag(String tag, ArtifactId artifact) {
- Conditions.checkNotNullOrEmpty(tag, "tag");
- Conditions.checkNotNull(artifact, "artifact");
- tagToArtifactIdCache.put(tag, artifact);
- }
-
- @Override
public void cacheArtifact(ArtifactId artifact) {
Conditions.checkNotNull(artifact, "artifact");
- tagToArtifactIdCache.put(artifact.getGuid(), artifact);
uuidToArtifactIdCache.put(artifact.getId(), artifact);
}
@@ -187,16 +122,9 @@ public class AtsCache implements IAtsCache {
};
@Override
- public <T extends IAtsObject> T getByUuid(Long uuid, Class<T> clazz) {
- Conditions.checkNotNull(uuid, "uuid");
- return getAtsObject(uuid);
- }
-
- @Override
public void invalidate() {
- tagToAtsObjectCache.invalidateAll();
+ guidToAtsObjectCache.invalidateAll();
uuidToAtsObjectCache.invalidateAll();
- tagToArtifactIdCache.invalidateAll();
uuidToArtifactIdCache.invalidateAll();
}
@@ -204,25 +132,10 @@ public class AtsCache implements IAtsCache {
public void deCacheAtsObject(IAtsObject atsObject) {
Conditions.checkNotNull(atsObject, "atsObject");
if (atsObject.getStoreObject() != null) {
- tagToAtsObjectCache.invalidate(atsObject.getStoreObject().getGuid());
- tagToArtifactIdCache.invalidate(atsObject.getStoreObject().getGuid());
+ guidToAtsObjectCache.invalidate(atsObject.getStoreObject().getGuid());
}
+
uuidToAtsObjectCache.invalidate(atsObject.getId());
uuidToArtifactIdCache.invalidate(atsObject.getId());
}
-
- @Override
- public ArtifactId getArtifact(IAtsObject atsObject) {
- if (atsObject.getStoreObject() != null) {
- return atsObject.getStoreObject();
- }
- return getArtifact(atsObject.getId());
- }
-
- @Override
- public <T extends IAtsObject> T getAtsObjectByToken(IArtifactToken token, Class<T> clazz) {
- Conditions.checkNotNull(token, "token");
- return getAtsObject(token.getId());
- }
-
-}
+} \ No newline at end of file
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 368c5d1865..39768d1dac 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
@@ -575,7 +575,7 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
@Override
public <A extends IAtsConfigObject> A getSoleByUuid(long uuid, Class<A> clazz) throws OseeCoreException {
- return getCache().getByUuid(uuid, clazz);
+ return getCache().getAtsObject(uuid);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
index 1162f92b4d..da01ee7a49 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
@@ -170,7 +170,7 @@ public final class AtsActionEndpointImpl implements AtsActionEndpointApi {
if (aiArt == null) {
return RestUtil.returnBadRequest(String.format("actionableItems [%s] is not valid", actionableItems));
}
- IAtsActionableItem aia = atsServer.getCache().getByUuid(aiArt.getId(), IAtsActionableItem.class);
+ IAtsActionableItem aia = atsServer.getCache().getAtsObject(aiArt.getId());
aias.add(aia);
// validate userId
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsRuleEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsRuleEndpointImpl.java
index 1831661493..647b1b7de3 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsRuleEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsRuleEndpointImpl.java
@@ -95,7 +95,7 @@ public class AtsRuleEndpointImpl implements AtsRuleEndpointApi {
AtsAttributeTypes.RuleDefinition, setRuleData.getRuleName());
changes.execute();
IAtsConfigObject atsObject =
- atsServer.getCache().getByUuid(setRuleData.getConfigItemUuid(), IAtsConfigObject.class);
+ atsServer.getCache().getAtsObject(setRuleData.getConfigItemUuid());
atsServer.getCache().deCacheAtsObject(atsObject);
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
index c13f9e83ed..6ae95b8db1 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ConfigItemFactory.java
@@ -236,8 +236,8 @@ public class ConfigItemFactory extends AbstractConfigItemFactory {
public IAtsInsertion updateInsertion(JaxInsertion updatedInsertion) {
AtsChangeSet changes = (AtsChangeSet) atsServer.getStoreService().createAtsChangeSet("Update Insertion",
atsServer.getUserService().getCurrentUser());
- ArtifactId artifact = atsServer.getCache().getArtifact(updatedInsertion.getUuid());
- changes.setSoleAttributeValue(artifact, CoreAttributeTypes.Name, updatedInsertion.getName());
+ changes.setSoleAttributeValue(ArtifactId.valueOf(updatedInsertion.getUuid()), CoreAttributeTypes.Name,
+ updatedInsertion.getName());
changes.execute();
return getInsertion(atsServer.getQuery().andUuid(updatedInsertion.getUuid()).getResults().getExactlyOne());
}
@@ -274,8 +274,8 @@ public class ConfigItemFactory extends AbstractConfigItemFactory {
changes.getTransaction().setSoleAttributeValue(insertionActivityArt, CoreAttributeTypes.Name,
updatedActivity.getName());
- ArtifactId artifact = atsServer.getCache().getArtifact(updatedActivity.getUuid());
- changes.setSoleAttributeValue(artifact, CoreAttributeTypes.Name, updatedActivity.getName());
+ changes.setSoleAttributeValue(ArtifactId.valueOf(updatedActivity.getUuid()), CoreAttributeTypes.Name,
+ updatedActivity.getName());
changes.execute();
return getInsertionActivity(atsServer.getQuery().andUuid(updatedActivity.getUuid()).getResults().getExactlyOne());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
index 0778790a83..98034d6de9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
@@ -136,7 +136,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact fromTeamDefArt : fromAiArt.getRelatedArtifacts(AtsRelationTypes.TeamActionableItem_Team,
Artifact.class)) {
IAtsConfigObject fromTeamDef =
- AtsClientService.get().getCache().getByUuid(fromTeamDefArt.getId(), IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(fromTeamDefArt.getId());
IAtsTeamDefinition newTeamDef = fromTeamDefToNewTeamDefMap.get(fromTeamDef);
if (newTeamDef == null) {
@@ -181,7 +181,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact childFromTeamDefArt : fromTeamDefArt.getChildren()) {
if (childFromTeamDefArt.isOfType(AtsArtifactTypes.TeamDefinition)) {
IAtsTeamDefinition childFromTeamDef = AtsClientService.get().getConfigItem(childFromTeamDefArt);
- AtsClientService.get().getCache().getByUuid(childFromTeamDefArt.getId(), IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(childFromTeamDefArt.getId());
createTeamDefinitions(changes, childFromTeamDef, newTeamDef);
}
}
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 891b5ac6a9..256013defb 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
@@ -609,7 +609,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
continue;
}
if (artifact.isOfType(AtsArtifactTypes.Version)) {
- IAtsVersion version = AtsClientService.get().getCache().getByUuid(artifact.getId(), IAtsVersion.class);
+ IAtsVersion version = AtsClientService.get().getCache().getAtsObject(artifact.getId());
if (version != null) {
try {
long parentBranchUuid = version.getBaselineBranchUuid();
@@ -638,7 +638,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
continue;
}
if (artifact.isOfType(AtsArtifactTypes.Version)) {
- IAtsVersion version = AtsClientService.get().getCache().getByUuid(artifact.getId(), IAtsVersion.class);
+ IAtsVersion version = AtsClientService.get().getCache().getAtsObject(artifact.getId());
if (version != null) {
for (IAtsVersion parallelVersion : Versions.getParallelVersions(version, AtsClientService.get())) {
if (parallelVersion != null) {
@@ -667,7 +667,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
}
if (art.isOfType(AtsArtifactTypes.TeamDefinition)) {
IAtsTeamDefinition teamDef =
- AtsClientService.get().getCache().getByUuid(art.getId(), IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(art.getId());
try {
long parentBranchUuid = teamDef.getBaselineBranchUuid();
if (parentBranchUuid > 0) {
@@ -1000,7 +1000,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
try {
if (artifact.isOfType(AtsArtifactTypes.ActionableItem)) {
IAtsActionableItem aia =
- AtsClientService.get().getCache().getByUuid(artifact.getId(), IAtsActionableItem.class);
+ AtsClientService.get().getCache().getAtsObject(artifact.getId());
if (aia.isActionable() && TeamDefinitions.getImpactedTeamDefs(Arrays.asList(aia)).isEmpty()) {
results.log(artifact, "testActionableItemToTeamDefinition",
"Error: ActionableItem " + XResultDataUI.getHyperlink(artifact.getName(),
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/ActionableItemSearchWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/ActionableItemSearchWidget.java
index d7611e87b5..ca4d205d82 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/ActionableItemSearchWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/ActionableItemSearchWidget.java
@@ -67,7 +67,7 @@ public class ActionableItemSearchWidget {
public void set(AtsSearchData data) {
List<IAtsActionableItem> ais = new LinkedList<>();
for (Long uuid : data.getAiUuids()) {
- IAtsActionableItem ai = AtsClientService.get().getCache().getByUuid(uuid, IAtsActionableItem.class);
+ IAtsActionableItem ai = AtsClientService.get().getCache().getAtsObject(uuid);
if (ai != null) {
ais.add(ai);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/TeamDefinitionSearchWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/TeamDefinitionSearchWidget.java
index 1be431430d..50cfc19e56 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/TeamDefinitionSearchWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/TeamDefinitionSearchWidget.java
@@ -69,7 +69,7 @@ public class TeamDefinitionSearchWidget {
List<IAtsTeamDefinition> teamDefs = new LinkedList<>();
for (Long uuid : data.getTeamDefUuids()) {
IAtsTeamDefinition teamDef =
- AtsClientService.get().getCache().getByUuid(uuid, IAtsTeamDefinition.class);
+ AtsClientService.get().getCache().getAtsObject(uuid);
if (teamDef != null) {
teamDefs.add(teamDef);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/VersionSearchWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/VersionSearchWidget.java
index 415caca56d..9c047d136b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/VersionSearchWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/search/widget/VersionSearchWidget.java
@@ -45,7 +45,7 @@ public class VersionSearchWidget extends AbstractXComboViewerSearchWidget<IAtsVe
setup(getWidget());
if (data.getVersionUuid() > 0) {
IAtsVersion version =
- AtsClientService.get().getCache().getByUuid(data.getVersionUuid(), IAtsVersion.class);
+ AtsClientService.get().getCache().getAtsObject(data.getVersionUuid());
if (version != null) {
getWidget().setSelected(Arrays.asList(version));
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java
index e42b7ea10c..444cad743c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java
@@ -38,7 +38,7 @@ public class TeamBasedDefaultBranchProvider implements IDefaultInitialBranchesPr
Collection<IAtsTeamDefinition> teams = new ArrayList<>();
for (Artifact art : AtsClientService.get().getUserServiceClient().getOseeUser(user).getRelatedArtifacts(
AtsRelationTypes.TeamMember_Team)) {
- teams.add(AtsClientService.get().getCache().getByUuid(art.getId(), IAtsTeamDefinition.class));
+ teams.add(AtsClientService.get().getCache().getAtsObject(art.getId()));
}
Collection<BranchId> branches = new LinkedList<>();
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
index c6472fe09f..a743e30ff9 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
@@ -129,13 +129,11 @@ public class SafetyWorkflowEventHandler implements EventHandler {
private IAtsTeamWorkflow createSafetyAction(IAtsTeamWorkflow teamWf, ArtifactReadable userArt) {
IAtsTeamWorkflow teamWorkflow = null;
try {
- IAtsActionableItem ai =
- atsServer.getCache().getByUuid(AtsArtifactToken.SafetyActionableItem.getId(), IAtsActionableItem.class);
+ IAtsActionableItem ai = atsServer.getCache().getAtsObject(AtsArtifactToken.SafetyActionableItem);
if (ai == null) {
throw new OseeCoreException("Safety Actionable Item not configured");
}
- IAtsTeamDefinition teamDef =
- atsServer.getCache().getByUuid(AtsArtifactToken.SafetyTeamDefinition.getId(), IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = atsServer.getCache().getAtsObject(AtsArtifactToken.SafetyTeamDefinition);
if (teamDef == null) {
throw new OseeCoreException("Safety Team Definition not configured");
}

Back to the top