Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2012-08-28 18:31:07 +0000
committerRoberto E. Escobar2012-08-28 18:31:07 +0000
commit67971f3c500828160268cc292a3a7b20e678feb5 (patch)
tree3e8af864ba85d70cd0d1c8bce6805ce67aa5ab1b
parentf3debc382599d73d4c80d3e243e8e4304e7da88c (diff)
downloadorg.eclipse.osee-67971f3c500828160268cc292a3a7b20e678feb5.tar.gz
org.eclipse.osee-67971f3c500828160268cc292a3a7b20e678feb5.tar.xz
org.eclipse.osee-67971f3c500828160268cc292a3a7b20e678feb5.zip
bug[ats_RPP7X]: ATS configuration load inefficient
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java2
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateSawBuild2Actions.java8
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AtsTestUtil.java44
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/config/AtsActionableItemToTeamDefinitionTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/ActionableItemManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsBulkLoad.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigCacheLoaderClient.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigManagerClient.java)22
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsLoadConfigArtifactsOperation.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsObjectsClient.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/ActionableItemArtifactStore.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/TeamDefinitionArtifactStore.java24
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/VersionArtifactStore.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsCacheManagerUpdateListener.java46
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/version/AtsVersionStoreImpl.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItemFactory.java37
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItems.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsConfigCache.java58
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IActionableItemFactory.java16
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ITeamDefinitionFactory.java16
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IVersionFactory.java18
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionFactory.java38
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitions.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/VersionFactory.java40
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItem.java (renamed from plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/ActionableItem.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItemFactory.java46
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinition.java (renamed from plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/TeamDefinition.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinitionFactory.java46
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/Version.java (renamed from plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/Version.java)4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/VersionFactory.java47
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java18
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperationTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/navigate/AtsNavigateItemsToWorldViewTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigManager.java16
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java14
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ClearAtsConfigCache.java49
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/PublishFullVersionReportItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewWorldSearchItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/GenerateFullVersionReportItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/MassEditTeamVersionItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java2
58 files changed, 479 insertions, 275 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java
index 4ed9cff1b88..da311a2d598 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateDemoActions.java
@@ -335,7 +335,7 @@ public class PopulateDemoActions extends XNavigateItemAction {
teamWf.persist(transaction);
if (Strings.isValid(versionStr)) {
- IAtsVersion version = AtsConfigCache.getSoleByName(versionStr, IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(versionStr, IAtsVersion.class);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
teamWf.persist(transaction);
}
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateSawBuild2Actions.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateSawBuild2Actions.java
index 0ce7b4064c1..b5233b6bc90 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateSawBuild2Actions.java
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/PopulateSawBuild2Actions.java
@@ -126,7 +126,7 @@ public class PopulateSawBuild2Actions {
teamWf.persist(transaction);
- IAtsVersion version = AtsConfigCache.getSoleByName(versionStr, IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(versionStr, IAtsVersion.class);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
teamWf.persist(transaction);
}
@@ -202,7 +202,7 @@ public class PopulateSawBuild2Actions {
teamWf.persist(transaction);
- IAtsVersion version = AtsConfigCache.getSoleByName(versionStr, IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(versionStr, IAtsVersion.class);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
teamWf.persist(transaction);
}
@@ -280,7 +280,7 @@ public class PopulateSawBuild2Actions {
teamWf.persist(transaction);
- IAtsVersion version = AtsConfigCache.getSoleByName(versionStr, IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(versionStr, IAtsVersion.class);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
teamWf.persist(transaction);
}
@@ -338,7 +338,7 @@ public class PopulateSawBuild2Actions {
}
teamWf.persist(transaction);
- IAtsVersion version = AtsConfigCache.getSoleByName(versionStr, IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(versionStr, IAtsVersion.class);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
teamWf.persist(transaction);
}
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
index a42bca3049f..f9148acdafd 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/navigate/DemoNavigateViewItems.java
@@ -61,7 +61,7 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
}
try {
String name = team.name().replaceAll("_", " ");
- return AtsConfigCache.getSoleByName(name, IAtsTeamDefinition.class);
+ return AtsConfigCache.instance.getSoleByName(name, IAtsTeamDefinition.class);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AtsTestUtil.java
index 14348e36417..2a1153b34b8 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/AtsTestUtil.java
@@ -50,11 +50,8 @@ import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.config.ActionableItemFactory;
import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
-import org.eclipse.osee.ats.core.config.TeamDefinitionFactory;
-import org.eclipse.osee.ats.core.config.VersionFactory;
import org.eclipse.osee.ats.core.workdef.SimpleDecisionReviewOption;
import org.eclipse.osee.ats.core.workflow.StateTypeAdapter;
import org.eclipse.osee.ats.mocks.MockStateDefinition;
@@ -221,19 +218,19 @@ public class AtsTestUtil {
verArt4 = null;
decRevArt = null;
peerRevArt = null;
- for (IAtsActionableItem aia : AtsConfigCache.get(IAtsActionableItem.class)) {
+ for (IAtsActionableItem aia : AtsConfigCache.instance.get(IAtsActionableItem.class)) {
if (aia.getName().contains("AtsTestUtil")) {
- AtsConfigCache.decache(aia);
+ AtsConfigCache.instance.decache(aia);
}
}
- for (IAtsTeamDefinition aia : AtsConfigCache.get(IAtsTeamDefinition.class)) {
+ for (IAtsTeamDefinition aia : AtsConfigCache.instance.get(IAtsTeamDefinition.class)) {
if (aia.getName().contains("AtsTestUtil")) {
- AtsConfigCache.decache(aia);
+ AtsConfigCache.instance.decache(aia);
}
}
- for (IAtsVersion ver : AtsConfigCache.get(IAtsVersion.class)) {
+ for (IAtsVersion ver : AtsConfigCache.instance.get(IAtsVersion.class)) {
if (ver.getName().contains("AtsTestUtil")) {
- AtsConfigCache.decache(ver);
+ AtsConfigCache.instance.decache(ver);
}
}
}
@@ -302,23 +299,33 @@ public class AtsTestUtil {
WorkDefinitionFactory.addWorkDefinition(workDef);
- testAi = ActionableItemFactory.createActionableItem(GUID.create(), getTitle("AI", postFixName));
+ testAi =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(),
+ getTitle("AI", postFixName));
testAi.setActive(true);
testAi.setActionable(true);
- testAi2 = ActionableItemFactory.createActionableItem(GUID.create(), getTitle("AI2", postFixName));
+ testAi2 =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(),
+ getTitle("AI2", postFixName));
testAi2.setActive(true);
testAi2.setActionable(true);
- testAi3 = ActionableItemFactory.createActionableItem(GUID.create(), getTitle("AI3", postFixName));
+ testAi3 =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(),
+ getTitle("AI3", postFixName));
testAi3.setActive(true);
testAi3.setActionable(true);
- testAi4 = ActionableItemFactory.createActionableItem(GUID.create(), getTitle("AI4", postFixName));
+ testAi4 =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(),
+ getTitle("AI4", postFixName));
testAi4.setActive(true);
testAi4.setActionable(true);
- teamDef = TeamDefinitionFactory.createTeamDefinition(GUID.create(), getTitle("Team Def", postFixName));
+ teamDef =
+ AtsConfigCache.instance.getTeamDefinitionFactory().createTeamDefinition(GUID.create(),
+ getTitle("Team Def", postFixName));
teamDef.setWorkflowDefinition(WORK_DEF_NAME);
teamDef.setActive(true);
teamDef.setTeamUsesVersions(true);
@@ -330,16 +337,17 @@ public class AtsTestUtil {
testAi4.setTeamDefinition(teamDef);
verArt1 =
- VersionFactory.createVersion(getTitle("ver 1.0", postFixName), GUID.create(), HumanReadableId.generate());
+ AtsConfigCache.instance.getVersionFactory().createVersion(getTitle("ver 1.0", postFixName), GUID.create(),
+ HumanReadableId.generate());
teamDef.getVersions().add(verArt1);
- verArt2 = VersionFactory.createVersion(getTitle("ver 2.0", postFixName));
+ verArt2 = AtsConfigCache.instance.getVersionFactory().createVersion(getTitle("ver 2.0", postFixName));
teamDef.getVersions().add(verArt2);
- verArt3 = VersionFactory.createVersion(getTitle("ver 3.0", postFixName));
+ verArt3 = AtsConfigCache.instance.getVersionFactory().createVersion(getTitle("ver 3.0", postFixName));
teamDef.getVersions().add(verArt3);
- verArt4 = VersionFactory.createVersion(getTitle("ver 4.0", postFixName));
+ verArt4 = AtsConfigCache.instance.getVersionFactory().createVersion(getTitle("ver 4.0", postFixName));
teamDef.getVersions().add(verArt4);
actionArt =
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/config/AtsActionableItemToTeamDefinitionTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/config/AtsActionableItemToTeamDefinitionTest.java
index d4eb6521a26..9a1332a0177 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/config/AtsActionableItemToTeamDefinitionTest.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/config/AtsActionableItemToTeamDefinitionTest.java
@@ -28,13 +28,13 @@ public class AtsActionableItemToTeamDefinitionTest {
boolean error = false;
StringBuffer sb = new StringBuffer("Actionable Actionable Items with no Team Def associated:\n");
AtsBulkLoad.reloadConfig(true);
- for (IAtsActionableItem aia : AtsConfigCache.get(IAtsActionableItem.class)) {
+ for (IAtsActionableItem aia : AtsConfigCache.instance.get(IAtsActionableItem.class)) {
if (aia.isActionable()) {
Collection<IAtsTeamDefinition> impactedTeamDefs = TeamDefinitions.getImpactedTeamDefs(Arrays.asList(aia));
if (impactedTeamDefs.isEmpty()) {
System.out.println(" ");
sb.append("[" + aia + "]");
- AtsConfigCache.get(IAtsTeamDefinition.class);
+ AtsConfigCache.instance.get(IAtsTeamDefinition.class);
error = true;
}
}
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 018c3e5e43e..1a8849fcb09 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
@@ -36,7 +36,7 @@ public class ActionableItemManager {
public Set<IAtsActionableItem> getActionableItems() throws OseeCoreException {
Set<IAtsActionableItem> ais = new HashSet<IAtsActionableItem>();
for (String guid : getActionableItemGuids()) {
- IAtsActionableItem aia = AtsConfigCache.getSoleByGuid(guid, IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByGuid(guid, IAtsActionableItem.class);
ais.add(aia);
}
return ais;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsBulkLoad.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsBulkLoad.java
index 41f26e1a3f9..1ef3c746d25 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsBulkLoad.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsBulkLoad.java
@@ -46,7 +46,6 @@ public class AtsBulkLoad {
}
public static void reloadConfig(boolean pend) {
- System.err.println("ATS Reload Config...");
List<IOperation> ops = new ArrayList<IOperation>();
ops.add(new AtsLoadConfigArtifactsOperation(true));
ops.add(new AtsLoadWorkDefinitionsOperation(true));
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigManagerClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigCacheLoaderClient.java
index 9520ceea09e..7af531e2963 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigManagerClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsConfigCacheLoaderClient.java
@@ -20,32 +20,38 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Donald G. Dunne
*/
-public class AtsConfigManagerClient {
+public class AtsConfigCacheLoaderClient {
- public static void cacheConfigArtifact(Artifact artifact) throws OseeCoreException {
+ private final AtsConfigCache cache;
+
+ public AtsConfigCacheLoaderClient(AtsConfigCache cache) {
+ this.cache = cache;
+ }
+
+ public void cacheConfigArtifact(Artifact artifact) throws OseeCoreException {
// cache
if (artifact.isOfType(AtsArtifactTypes.TeamDefinition)) {
- TeamDefinitionArtifactStore store = new TeamDefinitionArtifactStore(artifact);
+ TeamDefinitionArtifactStore store = new TeamDefinitionArtifactStore(artifact, cache);
IAtsTeamDefinition teamDef = store.getTeamDefinition();
for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) {
- AtsConfigCache.cacheByTag(staticId, teamDef);
+ cache.cacheByTag(staticId, teamDef);
}
}
if (artifact.isOfType(AtsArtifactTypes.ActionableItem)) {
- ActionableItemArtifactStore store = new ActionableItemArtifactStore(artifact);
+ ActionableItemArtifactStore store = new ActionableItemArtifactStore(artifact, cache);
IAtsActionableItem ai = store.getActionableItem();
for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) {
- AtsConfigCache.cacheByTag(staticId, ai);
+ cache.cacheByTag(staticId, ai);
}
}
if (artifact.isOfType(AtsArtifactTypes.Version)) {
- VersionArtifactStore store = new VersionArtifactStore(artifact);
+ VersionArtifactStore store = new VersionArtifactStore(artifact, cache);
IAtsVersion version = store.getVersion();
for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) {
- AtsConfigCache.cacheByTag(staticId, version);
+ cache.cacheByTag(staticId, version);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsLoadConfigArtifactsOperation.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsLoadConfigArtifactsOperation.java
index 115d7ecf899..a6d655b1233 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsLoadConfigArtifactsOperation.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsLoadConfigArtifactsOperation.java
@@ -63,15 +63,17 @@ public class AtsLoadConfigArtifactsOperation extends AbstractOperation {
private void loadAtsConfig() throws OseeCoreException {
// ElapsedTime time = new ElapsedTime("Loading ATS Teams, AIs and Versions");
- AtsConfigCache.clearCaches();
+ AtsConfigCache newInstance = new AtsConfigCache();
+ AtsConfigCacheLoaderClient loader = new AtsConfigCacheLoaderClient(newInstance);
List<Artifact> artifactListFromType =
ArtifactQuery.getArtifactListFromType(
Arrays.asList(AtsArtifactTypes.TeamDefinition, AtsArtifactTypes.ActionableItem, AtsArtifactTypes.Version),
AtsUtilCore.getAtsBranchToken(), DeletionFlag.EXCLUDE_DELETED);
for (Artifact artifact : artifactListFromType) {
- AtsConfigManagerClient.cacheConfigArtifact(artifact);
+ loader.cacheConfigArtifact(artifact);
}
+ AtsConfigCache.setCurrent(newInstance);
// time.end();
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsObjectsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsObjectsClient.java
index 6396113df50..328ef9cbcbf 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsObjectsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/AtsObjectsClient.java
@@ -32,7 +32,7 @@ public class AtsObjectsClient {
public static <A extends IAtsConfigObject> Collection<A> getConfigObjects(Collection<? extends Artifact> artifacts, Class<A> clazz) {
List<A> objects = new ArrayList<A>();
for (Artifact art : artifacts) {
- objects.addAll(AtsConfigCache.getByTag(art.getGuid(), clazz));
+ objects.addAll(AtsConfigCache.instance.getByTag(art.getGuid(), clazz));
}
return objects;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/ActionableItemArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/ActionableItemArtifactStore.java
index d030f2cc435..dfa89c94ac6 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/ActionableItemArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/ActionableItemArtifactStore.java
@@ -16,10 +16,8 @@ import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.core.client.config.AtsObjectsClient;
import org.eclipse.osee.ats.core.client.util.AtsUsersClient;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.config.ActionableItemFactory;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.AtsConfigCache;
-import org.eclipse.osee.ats.core.config.TeamDefinitionFactory;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -37,14 +35,18 @@ import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
* @author Donald G. Dunne
*/
public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
+ AtsConfigCache cache = AtsConfigCache.instance;
public ActionableItemArtifactStore(IAtsActionableItem teamDef) {
super(teamDef, AtsArtifactTypes.ActionableItem, AtsUtilCore.getAtsBranchToken());
}
- public ActionableItemArtifactStore(Artifact artifact) throws OseeCoreException {
+ public ActionableItemArtifactStore(Artifact artifact, AtsConfigCache atsConfigCache) throws OseeCoreException {
super(null, AtsArtifactTypes.ActionableItem, AtsUtilCore.getAtsBranchToken());
this.artifact = artifact;
+ if (atsConfigCache != null) {
+ cache = atsConfigCache;
+ }
load();
}
@@ -91,7 +93,7 @@ public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
for (String newGuid : newGuids) {
if (!currGuids.contains(newGuid)) {
Artifact newArt = null;
- IAtsActionableItem newAi = AtsConfigCache.getSoleByGuid(newGuid, IAtsActionableItem.class);
+ IAtsActionableItem newAi = cache.getSoleByGuid(newGuid, IAtsActionableItem.class);
if (newAi != null) {
newArt = AtsObjectsClient.getSoleArtifact(newAi);
}
@@ -140,7 +142,7 @@ public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
public void load() throws OseeCoreException {
Artifact aiArt = getArtifact();
if (aiArt != null) {
- IAtsActionableItem aia = ActionableItemFactory.getOrCreate(aiArt.getGuid(), aiArt.getName());
+ IAtsActionableItem aia = cache.getActionableItemFactory().getOrCreate(aiArt.getGuid(), aiArt.getName());
aia.setHumanReadableId(aiArt.getHumanReadableId());
aia.setName(aiArt.getName());
atsObject = aia;
@@ -150,7 +152,8 @@ public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
Collection<Artifact> teamDefArts = aiArt.getRelatedArtifacts(AtsRelationTypes.TeamActionableItem_Team);
if (!teamDefArts.isEmpty()) {
Artifact teamDefArt = teamDefArts.iterator().next();
- IAtsTeamDefinition teamDef = TeamDefinitionFactory.getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
+ IAtsTeamDefinition teamDef =
+ cache.getTeamDefinitionFactory().getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
aia.setTeamDefinition(teamDef);
if (!teamDef.getActionableItems().contains(aia)) {
teamDef.getActionableItems().add(aia);
@@ -162,7 +165,7 @@ public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
Artifact parentAiArt = aiArt.getParent();
if (parentAiArt != null && parentAiArt.isOfType(AtsArtifactTypes.ActionableItem)) {
IAtsActionableItem parentAi =
- ActionableItemFactory.getOrCreate(parentAiArt.getGuid(), parentAiArt.getName());
+ cache.getActionableItemFactory().getOrCreate(parentAiArt.getGuid(), parentAiArt.getName());
aia.setParentActionableItem(parentAi);
parentAi.getChildrenActionableItems().add(aia);
}
@@ -177,7 +180,7 @@ public class ActionableItemArtifactStore extends ArtifactAtsObjectStore {
for (Artifact childAiArt : aiArt.getChildren()) {
if (childAiArt.isOfType(AtsArtifactTypes.ActionableItem)) {
IAtsActionableItem childAi =
- ActionableItemFactory.getOrCreate(childAiArt.getGuid(), childAiArt.getName());
+ cache.getActionableItemFactory().getOrCreate(childAiArt.getGuid(), childAiArt.getName());
aia.getChildrenActionableItems().add(childAi);
childAi.setParentActionableItem(aia);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/TeamDefinitionArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/TeamDefinitionArtifactStore.java
index 3270a16e0b7..cb72c044e01 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/TeamDefinitionArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/TeamDefinitionArtifactStore.java
@@ -16,12 +16,9 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.config.AtsObjectsClient;
import org.eclipse.osee.ats.core.client.util.AtsUsersClient;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.config.ActionableItemFactory;
import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
-import org.eclipse.osee.ats.core.config.TeamDefinitionFactory;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
-import org.eclipse.osee.ats.core.config.VersionFactory;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -40,13 +37,18 @@ import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
*/
public class TeamDefinitionArtifactStore extends ArtifactAtsObjectStore {
+ AtsConfigCache cache = AtsConfigCache.instance;
+
public TeamDefinitionArtifactStore(IAtsTeamDefinition teamDef) {
super(teamDef, AtsArtifactTypes.TeamDefinition, AtsUtilCore.getAtsBranchToken());
}
- public TeamDefinitionArtifactStore(Artifact artifact) throws OseeCoreException {
+ public TeamDefinitionArtifactStore(Artifact artifact, AtsConfigCache atsConfigCache) throws OseeCoreException {
super(null, AtsArtifactTypes.TeamDefinition, AtsUtilCore.getAtsBranchToken());
this.artifact = artifact;
+ if (atsConfigCache != null) {
+ cache = atsConfigCache;
+ }
load();
}
@@ -114,7 +116,7 @@ public class TeamDefinitionArtifactStore extends ArtifactAtsObjectStore {
for (String newGuid : newGuids) {
if (!currGuids.contains(newGuid)) {
Artifact newArt = null;
- IAtsTeamDefinition newTeamDef = AtsConfigCache.getSoleByGuid(newGuid, IAtsTeamDefinition.class);
+ IAtsTeamDefinition newTeamDef = cache.getSoleByGuid(newGuid, IAtsTeamDefinition.class);
if (newTeamDef != null) {
newArt = AtsObjectsClient.getSoleArtifact(newTeamDef);
}
@@ -176,7 +178,8 @@ public class TeamDefinitionArtifactStore extends ArtifactAtsObjectStore {
public void load() throws OseeCoreException {
Artifact teamDefArt = getArtifact();
if (teamDefArt != null) {
- IAtsTeamDefinition teamDef = TeamDefinitionFactory.getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
+ IAtsTeamDefinition teamDef =
+ cache.getTeamDefinitionFactory().getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
teamDef.setHumanReadableId(teamDefArt.getHumanReadableId());
teamDef.setName(teamDefArt.getName());
atsObject = teamDef;
@@ -201,19 +204,20 @@ public class TeamDefinitionArtifactStore extends ArtifactAtsObjectStore {
teamDef.setDescription(teamDefArt.getSoleAttributeValue(AtsAttributeTypes.Description, ""));
teamDef.setFullName(teamDefArt.getSoleAttributeValue(AtsAttributeTypes.FullName, ""));
for (Artifact aiArt : teamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamActionableItem_ActionableItem)) {
- IAtsActionableItem ai = ActionableItemFactory.getOrCreate(aiArt.getGuid(), aiArt.getName());
+ IAtsActionableItem ai = cache.getActionableItemFactory().getOrCreate(aiArt.getGuid(), aiArt.getName());
teamDef.getActionableItems().add(ai);
ai.setTeamDefinition(teamDef);
}
for (Artifact child : teamDefArt.getChildren()) {
if (child.isOfType(AtsArtifactTypes.TeamDefinition)) {
- IAtsTeamDefinition childTeamDef = TeamDefinitionFactory.getOrCreate(child.getGuid(), child.getName());
+ IAtsTeamDefinition childTeamDef =
+ cache.getTeamDefinitionFactory().getOrCreate(child.getGuid(), child.getName());
teamDef.getChildrenTeamDefinitions().add(childTeamDef);
childTeamDef.setParentTeamDef(teamDef);
}
}
for (Artifact verArt : teamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamDefinitionToVersion_Version)) {
- IAtsVersion version = VersionFactory.getOrCreate(verArt.getGuid(), verArt.getName());
+ IAtsVersion version = cache.getVersionFactory().getOrCreate(verArt.getGuid(), verArt.getName());
teamDef.getVersions().add(version);
AtsVersionService.get().setTeamDefinition(version, teamDef);
}
@@ -242,7 +246,7 @@ public class TeamDefinitionArtifactStore extends ArtifactAtsObjectStore {
Artifact parentTeamDefArt = teamDefArt.getParent();
if (parentTeamDefArt != null && parentTeamDefArt.isOfType(AtsArtifactTypes.TeamDefinition)) {
IAtsTeamDefinition parentTeamDef =
- TeamDefinitionFactory.getOrCreate(parentTeamDefArt.getGuid(), parentTeamDefArt.getName());
+ cache.getTeamDefinitionFactory().getOrCreate(parentTeamDefArt.getGuid(), parentTeamDefArt.getName());
teamDef.setParentTeamDef(parentTeamDef);
parentTeamDef.getChildrenTeamDefinitions().add(teamDef);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/VersionArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/VersionArtifactStore.java
index 50a7525282b..299d0bd3961 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/VersionArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/config/store/VersionArtifactStore.java
@@ -15,8 +15,6 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
-import org.eclipse.osee.ats.core.config.TeamDefinitionFactory;
-import org.eclipse.osee.ats.core.config.VersionFactory;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -30,13 +28,18 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
*/
public class VersionArtifactStore extends ArtifactAtsObjectStore {
+ AtsConfigCache cache = AtsConfigCache.instance;
+
public VersionArtifactStore(IAtsVersion version) {
super(version, AtsArtifactTypes.Version, AtsUtilCore.getAtsBranchToken());
}
- public VersionArtifactStore(Artifact artifact) throws OseeCoreException {
+ public VersionArtifactStore(Artifact artifact, AtsConfigCache atsConfigCache) throws OseeCoreException {
super(null, AtsArtifactTypes.Version, AtsUtilCore.getAtsBranchToken());
this.artifact = artifact;
+ if (atsConfigCache != null) {
+ cache = atsConfigCache;
+ }
loadFromArtifact();
}
@@ -96,10 +99,11 @@ public class VersionArtifactStore extends ArtifactAtsObjectStore {
public void loadFromArtifact() throws OseeCoreException {
Artifact artifact = getArtifact();
if (artifact != null) {
- IAtsVersion version = AtsConfigCache.getSoleByGuid(artifact.getGuid(), IAtsVersion.class);
+ IAtsVersion version = cache.getSoleByGuid(artifact.getGuid(), IAtsVersion.class);
if (version == null) {
version =
- VersionFactory.createVersion(artifact.getName(), artifact.getGuid(), artifact.getHumanReadableId());
+ cache.getVersionFactory().createVersion(artifact.getName(), artifact.getGuid(),
+ artifact.getHumanReadableId());
} else {
version.setHumanReadableId(artifact.getHumanReadableId());
version.setName(artifact.getName());
@@ -121,14 +125,16 @@ public class VersionArtifactStore extends ArtifactAtsObjectStore {
artifact.getRelatedArtifacts(AtsRelationTypes.TeamDefinitionToVersion_TeamDefinition);
if (!teamDefArts.isEmpty()) {
Artifact teamDefArt = teamDefArts.iterator().next();
- IAtsTeamDefinition teamDef = TeamDefinitionFactory.getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
+ IAtsTeamDefinition teamDef =
+ cache.getTeamDefinitionFactory().getOrCreate(teamDefArt.getGuid(), teamDefArt.getName());
AtsVersionService.get().setTeamDefinition(version, teamDef);
}
for (String staticId : artifact.getAttributesToStringList(CoreAttributeTypes.StaticId)) {
version.getStaticIds().add(staticId);
}
for (Artifact parallelVerArt : artifact.getRelatedArtifacts(AtsRelationTypes.ParallelVersion_Child)) {
- IAtsVersion parallelVer = VersionFactory.getOrCreate(parallelVerArt.getGuid(), parallelVerArt.getName());
+ IAtsVersion parallelVer =
+ cache.getVersionFactory().getOrCreate(parallelVerArt.getGuid(), parallelVerArt.getName());
version.getParallelVersions().add(parallelVer);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsCacheManagerUpdateListener.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsCacheManagerUpdateListener.java
index abbb16f4d79..5cb0a08fd1a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsCacheManagerUpdateListener.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsCacheManagerUpdateListener.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
@@ -36,6 +37,7 @@ import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact
import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidRelation;
import org.eclipse.osee.framework.skynet.core.event.model.EventModType;
import org.eclipse.osee.framework.skynet.core.event.model.Sender;
+import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.skynet.core.utility.DbUtil;
/**
@@ -45,6 +47,13 @@ import org.eclipse.osee.framework.skynet.core.utility.DbUtil;
*/
public class AtsCacheManagerUpdateListener implements IArtifactEventListener {
+ private static List<Long> configReloadRelationTypeGuids = Arrays.asList(
+ AtsRelationTypes.ActionableItemLead_Lead.getGuid(), AtsRelationTypes.TeamDefinitionToVersion_Version.getGuid(),
+ AtsRelationTypes.TeamActionableItem_Team.getGuid(), AtsRelationTypes.PrivilegedMember_Team.getGuid(),
+ AtsRelationTypes.TeamLead_Team.getGuid());
+ private static List<Long> configReloadArtifactTypeGuids = Arrays.asList(AtsArtifactTypes.Version.getGuid(),
+ AtsArtifactTypes.TeamDefinition.getGuid(), AtsArtifactTypes.ActionableItem.getGuid());
+
@Override
public List<? extends IEventFilter> getEventFilters() {
return Arrays.asList(EventUtil.getCommonBranchFilter());
@@ -53,13 +62,27 @@ public class AtsCacheManagerUpdateListener implements IArtifactEventListener {
@Override
public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
if (!DbUtil.isDbInit()) {
- processArtifacts(artifactEvent);
- processRelations(artifactEvent);
+ boolean handledConfigReload = processArtifacts(artifactEvent);
+ processRelations(artifactEvent, handledConfigReload);
}
}
- private void processRelations(ArtifactEvent artifactEvent) {
- // TODO AtsBulkLoad.reloadConfig(false) if config relation modified
+ private void processRelations(ArtifactEvent artifactEvent, boolean handledConfigReload) {
+ if (!handledConfigReload) {
+ // update cache
+ for (EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
+ try {
+ RelationType typeByGuid = RelationTypeManager.getTypeByGuid(guidRel.getRelTypeGuid());
+ if (configReloadRelationTypeGuids.contains(typeByGuid.getGuid())) {
+ AtsBulkLoad.reloadConfig(false);
+ break;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+
+ }
+ }
for (EventBasicGuidRelation guidRel : artifactEvent.getRelations()) {
try {
if (guidRel.is(AtsRelationTypes.TeamWorkflowTargetedForVersion_Workflow)) {
@@ -73,7 +96,7 @@ public class AtsCacheManagerUpdateListener implements IArtifactEventListener {
if (verArt == null) {
AtsVersionService.get().removeTargetedVersion(teamArt);
} else {
- IAtsVersion version = AtsConfigCache.getSoleByGuid(verArt.getGuid(), IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByGuid(verArt.getGuid(), IAtsVersion.class);
AtsVersionService.get().setTargetedVersion(teamArt, version);
}
}
@@ -94,10 +117,12 @@ public class AtsCacheManagerUpdateListener implements IArtifactEventListener {
}
}
- private void processArtifacts(ArtifactEvent artifactEvent) {
+ private boolean processArtifacts(ArtifactEvent artifactEvent) {
+ boolean handledConfigReload = false;
for (EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
- if (isConfigArtifactType(guidArt)) {
+ if (configReloadArtifactTypeGuids.contains(guidArt.getArtTypeGuid())) {
AtsBulkLoad.reloadConfig(false);
+ handledConfigReload = true;
break;
}
}
@@ -113,12 +138,7 @@ public class AtsCacheManagerUpdateListener implements IArtifactEventListener {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
- }
-
- private boolean isConfigArtifactType(EventBasicGuidArtifact guidArt) {
- return guidArt.getArtTypeGuid().equals(AtsArtifactTypes.Version.getGuid()) || guidArt.getArtTypeGuid().equals(
- AtsArtifactTypes.TeamDefinition.getGuid()) || guidArt.getArtTypeGuid().equals(
- AtsArtifactTypes.ActionableItem.getGuid());
+ return handledConfigReload;
}
private void handleTaskCacheForAddedModified(EventBasicGuidArtifact guidArt) throws OseeCoreException {
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 0778d950910..d23c6820429 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
@@ -133,7 +133,7 @@ public class TeamWorkFlowArtifact extends AbstractTaskableArtifact implements IA
throw new OseeArgumentException("TeamWorkflow [%s] has no IAtsTeamDefinition associated.",
getHumanReadableId());
}
- return AtsConfigCache.getSoleByGuid(guid, IAtsTeamDefinition.class);
+ return AtsConfigCache.instance.getSoleByGuid(guid, IAtsTeamDefinition.class);
}
public String getTeamName() {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/version/AtsVersionStoreImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/version/AtsVersionStoreImpl.java
index bb3acda0e05..84063ae7e9f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/version/AtsVersionStoreImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/version/AtsVersionStoreImpl.java
@@ -73,9 +73,9 @@ public class AtsVersionStoreImpl implements IAtsVersionStore {
if (verArts.size() > 1) {
OseeLog.log(Activator.class, Level.SEVERE,
"Multiple targeted versions for artifact " + teamArt.toStringWithId());
- version = AtsConfigCache.getSoleByGuid(verArts.iterator().next().getGuid(), IAtsVersion.class);
+ version = AtsConfigCache.instance.getSoleByGuid(verArts.iterator().next().getGuid(), IAtsVersion.class);
} else {
- version = AtsConfigCache.getSoleByGuid(verArts.iterator().next().getGuid(), IAtsVersion.class);
+ version = AtsConfigCache.instance.getSoleByGuid(verArts.iterator().next().getGuid(), IAtsVersion.class);
}
}
}
@@ -109,7 +109,7 @@ public class AtsVersionStoreImpl implements IAtsVersionStore {
throw new OseeStateException("Team Definition [%s] does not exist.", teamDef);
}
for (Artifact verArt : teamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamDefinitionToVersion_Version)) {
- IAtsVersion version = AtsConfigCache.getSoleByGuid(verArt.getGuid(), IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByGuid(verArt.getGuid(), IAtsVersion.class);
versions.add(version);
}
return versions;
@@ -128,7 +128,7 @@ public class AtsVersionStoreImpl implements IAtsVersionStore {
// do nothing
}
if (teamDefArt != null) {
- result = AtsConfigCache.getSoleByGuid(teamDefArt.getGuid(), IAtsTeamDefinition.class);
+ result = AtsConfigCache.instance.getSoleByGuid(teamDefArt.getGuid(), IAtsTeamDefinition.class);
}
}
return result;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItemFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItemFactory.java
deleted file mode 100644
index 2a763d81d69..00000000000
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItemFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Created on Jun 6, 2012
- *
- * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
- */
-package org.eclipse.osee.ats.core.config;
-
-import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
-import org.eclipse.osee.ats.core.config.impl.ActionableItem;
-import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
-
-/**
- * @author Donald G. Dunne
- */
-public class ActionableItemFactory {
-
- public static IAtsActionableItem createActionableItem(String guid, String title) {
- return createActionableItem(title, guid, HumanReadableId.generate());
- }
-
- public static IAtsActionableItem createActionableItem(String title, String guid, String humanReadableId) {
- if (guid == null) {
- throw new IllegalArgumentException("guid can not be null");
- }
- IAtsActionableItem ai = new ActionableItem(title, guid, humanReadableId);
- AtsConfigCache.cache(ai);
- return ai;
- }
-
- public static IAtsActionableItem getOrCreate(String guid, String name) {
- IAtsActionableItem ai = AtsConfigCache.getSoleByGuid(guid, IAtsActionableItem.class);
- if (ai == null) {
- ai = createActionableItem(guid, name);
- }
- return ai;
- }
-}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItems.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItems.java
index 7a5b153acfd..008420f7a42 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItems.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItems.java
@@ -86,7 +86,7 @@ public class ActionableItems {
public static Set<IAtsActionableItem> getActionableItems(Collection<String> actionableItemNames) {
Set<IAtsActionableItem> aias = new HashSet<IAtsActionableItem>();
for (String actionableItemName : actionableItemNames) {
- for (IAtsActionableItem aia : AtsConfigCache.get(IAtsActionableItem.class)) {
+ for (IAtsActionableItem aia : AtsConfigCache.instance.get(IAtsActionableItem.class)) {
if (aia.getName().equals(actionableItemName)) {
aias.add(aia);
}
@@ -100,7 +100,7 @@ public class ActionableItems {
}
public static List<IAtsActionableItem> getActionableItems(Active active) {
- return Collections.castAll(getActive(AtsConfigCache.get(IAtsActionableItem.class), active));
+ return Collections.castAll(getActive(AtsConfigCache.instance.get(IAtsActionableItem.class), active));
}
public static String getNotActionableItemError(IAtsConfigObject configObject) {
@@ -108,7 +108,7 @@ public class ActionableItems {
}
public static IAtsActionableItem getTopActionableItem() {
- return AtsConfigCache.getSoleByGuid(TopActionableItemGuid, IAtsActionableItem.class);
+ return AtsConfigCache.instance.getSoleByGuid(TopActionableItemGuid, IAtsActionableItem.class);
}
public static List<IAtsActionableItem> getActionableItemsAll() {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsConfigCache.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsConfigCache.java
index 734196564be..6fc0ae4799d 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsConfigCache.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/AtsConfigCache.java
@@ -12,6 +12,10 @@ import java.util.Map.Entry;
import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.config.internal.ActionableItemFactory;
+import org.eclipse.osee.ats.core.config.internal.TeamDefinitionFactory;
+import org.eclipse.osee.ats.core.config.internal.VersionFactory;
+import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
/**
@@ -19,22 +23,31 @@ import org.eclipse.osee.framework.jdk.core.type.HashCollection;
*/
public class AtsConfigCache {
+ public static AtsConfigCache instance = new AtsConfigCache();
+
+ /***
+ * Allows cache to be loaded and quick swapped
+ */
+ public static synchronized void setCurrent(AtsConfigCache newInstance) {
+ instance = newInstance;
+ }
+
// cache by guid and any other cachgeByTag item (like static id)
- private static final List<IAtsConfigObject> configObjects = new CopyOnWriteArrayList<IAtsConfigObject>();
- private static final HashCollection<String, IAtsConfigObject> tagToConfigObject =
+ private final List<IAtsConfigObject> configObjects = new CopyOnWriteArrayList<IAtsConfigObject>();
+ private final HashCollection<String, IAtsConfigObject> tagToConfigObject =
new HashCollection<String, IAtsConfigObject>(true, CopyOnWriteArrayList.class);
- public static void cache(IAtsConfigObject configObject) {
+ public void cache(IAtsConfigObject configObject) {
configObjects.add(configObject);
cacheByTag(configObject.getGuid(), configObject);
}
- public static void cacheByTag(String tag, IAtsConfigObject configObject) {
+ public void cacheByTag(String tag, IAtsConfigObject configObject) {
tagToConfigObject.put(tag, configObject);
}
@SuppressWarnings("unchecked")
- public static final <A extends IAtsConfigObject> List<A> getByTag(String tag, Class<A> clazz) {
+ public final <A extends IAtsConfigObject> List<A> getByTag(String tag, Class<A> clazz) {
List<A> objs = new ArrayList<A>();
Collection<IAtsConfigObject> values = tagToConfigObject.getValues(tag);
if (values != null) {
@@ -48,7 +61,7 @@ public class AtsConfigCache {
}
@SuppressWarnings("unchecked")
- public static final <A extends IAtsConfigObject> A getSoleByTag(String tag, Class<A> clazz) {
+ public final <A extends IAtsConfigObject> A getSoleByTag(String tag, Class<A> clazz) {
Collection<IAtsConfigObject> values = tagToConfigObject.getValues(tag);
if (values != null) {
for (IAtsConfigObject obj : values) {
@@ -61,7 +74,7 @@ public class AtsConfigCache {
}
@SuppressWarnings("unchecked")
- public static final <A extends IAtsConfigObject> A getSoleByName(String name, Class<A> clazz) {
+ public final <A extends IAtsConfigObject> A getSoleByName(String name, Class<A> clazz) {
for (IAtsConfigObject obj : get(clazz)) {
if (obj.getName().equals(name)) {
return (A) obj;
@@ -71,7 +84,7 @@ public class AtsConfigCache {
}
@SuppressWarnings("unchecked")
- public static final <A extends IAtsConfigObject> List<A> get(Class<A> clazz) {
+ public final <A extends IAtsConfigObject> List<A> get(Class<A> clazz) {
List<A> objs = new ArrayList<A>();
for (IAtsConfigObject obj : configObjects) {
if (clazz.isInstance(obj)) {
@@ -81,7 +94,7 @@ public class AtsConfigCache {
return objs;
}
- public static final <A extends IAtsConfigObject> A getSoleByGuid(String guid, Class<A> clazz) {
+ public final <A extends IAtsConfigObject> A getSoleByGuid(String guid, Class<A> clazz) {
if (guid.equals("BKbckZfNIkcx2wIVGkAA")) {
System.out.println("where");
}
@@ -92,16 +105,16 @@ public class AtsConfigCache {
return list.iterator().next();
}
- public static final IAtsConfigObject getSoleByGuid(String guid) {
+ public final IAtsConfigObject getSoleByGuid(String guid) {
return getSoleByGuid(guid, IAtsConfigObject.class);
}
- public static IAtsTeamDefinition getSoleByName(String teamDefName) {
+ public IAtsTeamDefinition getSoleByName(String teamDefName) {
return null;
}
@SuppressWarnings("unchecked")
- public static final <A extends IAtsConfigObject> List<A> getByName(String name, Class<A> clazz) {
+ public final <A extends IAtsConfigObject> List<A> getByName(String name, Class<A> clazz) {
List<A> objs = new ArrayList<A>();
for (IAtsConfigObject obj : configObjects) {
if (clazz.isInstance(obj) && obj.getName().equals(name)) {
@@ -111,7 +124,7 @@ public class AtsConfigCache {
return objs;
}
- public static void decache(IAtsConfigObject atsObject) {
+ public void decache(IAtsConfigObject atsObject) {
configObjects.remove(atsObject);
List<String> keysToRemove = new ArrayList<String>();
for (Entry<String, Collection<IAtsConfigObject>> entry : tagToConfigObject.entrySet()) {
@@ -124,9 +137,26 @@ public class AtsConfigCache {
}
}
- public static void clearCaches() {
+ public void clearCaches() {
tagToConfigObject.clear();
configObjects.clear();
}
+ public IActionableItemFactory getActionableItemFactory() {
+ return new ActionableItemFactory(this);
+ }
+
+ public ITeamDefinitionFactory getTeamDefinitionFactory() {
+ return new TeamDefinitionFactory(this);
+ }
+
+ public IVersionFactory getVersionFactory() {
+ return new VersionFactory(this);
+ }
+
+ public void getReport(XResultData rd) {
+ rd.logWithFormat("AtsConfigCache id %s\n", AtsConfigCache.instance);
+ rd.logWithFormat("TagToConfigObject size %d\n", tagToConfigObject.keySet().size());
+ rd.logWithFormat("ConfigObjects size %d\n", configObjects.size());
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IActionableItemFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IActionableItemFactory.java
new file mode 100644
index 00000000000..8f8d21e946d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IActionableItemFactory.java
@@ -0,0 +1,16 @@
+/*
+ * Created on Aug 27, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config;
+
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+
+public interface IActionableItemFactory {
+
+ IAtsActionableItem createActionableItem(String create, String teamDefName);
+
+ IAtsActionableItem getOrCreate(String guid, String name);
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ITeamDefinitionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ITeamDefinitionFactory.java
new file mode 100644
index 00000000000..169c1ab3829
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ITeamDefinitionFactory.java
@@ -0,0 +1,16 @@
+/*
+ * Created on Aug 27, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config;
+
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+
+public interface ITeamDefinitionFactory {
+
+ IAtsTeamDefinition createTeamDefinition(String create, String title);
+
+ IAtsTeamDefinition getOrCreate(String guid, String name);
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IVersionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IVersionFactory.java
new file mode 100644
index 00000000000..6e4b29d06f8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/IVersionFactory.java
@@ -0,0 +1,18 @@
+/*
+ * Created on Aug 27, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config;
+
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+
+public interface IVersionFactory {
+
+ IAtsVersion createVersion(String title, String create, String generate);
+
+ IAtsVersion getOrCreate(String guid, String name);
+
+ IAtsVersion createVersion(String name);
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionFactory.java
deleted file mode 100644
index f2ec006857e..00000000000
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Created on Jun 6, 2012
- *
- * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
- */
-package org.eclipse.osee.ats.core.config;
-
-import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
-import org.eclipse.osee.ats.core.config.impl.TeamDefinition;
-import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
-
-/**
- * @author Donald G. Dunne
- */
-public class TeamDefinitionFactory {
-
- public static IAtsTeamDefinition createTeamDefinition(String guid, String name) {
- return createTeamDefinition(name, guid, HumanReadableId.generate());
- }
-
- public static IAtsTeamDefinition createTeamDefinition(String name, String guid, String humanReadableId) {
- if (guid == null) {
- throw new IllegalArgumentException("guid can not be null");
- }
- IAtsTeamDefinition teamDef = new TeamDefinition(name, guid, humanReadableId);
- AtsConfigCache.cache(teamDef);
- return teamDef;
- }
-
- public static IAtsTeamDefinition getOrCreate(String guid, String name) {
- IAtsTeamDefinition teamDef = AtsConfigCache.getSoleByGuid(guid, IAtsTeamDefinition.class);
- if (teamDef == null) {
- teamDef = createTeamDefinition(guid, name);
- }
- return teamDef;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitions.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitions.java
index 0659860abdc..d2b9bdc49a8 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitions.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitions.java
@@ -76,7 +76,7 @@ public class TeamDefinitions {
}
public static List<IAtsTeamDefinition> getTeamDefinitions(Active active) {
- return Collections.castAll(getActive(AtsConfigCache.get(IAtsTeamDefinition.class), active));
+ return Collections.castAll(getActive(AtsConfigCache.instance.get(IAtsTeamDefinition.class), active));
}
public static List<IAtsTeamDefinition> getTeamTopLevelDefinitions(Active active) throws OseeCoreException {
@@ -88,7 +88,7 @@ public class TeamDefinitions {
}
public static IAtsTeamDefinition getTopTeamDefinition() {
- return AtsConfigCache.getSoleByGuid(TopTeamDefinitionGuid, IAtsTeamDefinition.class);
+ return AtsConfigCache.instance.getSoleByGuid(TopTeamDefinitionGuid, IAtsTeamDefinition.class);
}
public static Set<IAtsTeamDefinition> getTeamReleaseableDefinitions(Active active) {
@@ -126,7 +126,7 @@ public class TeamDefinitions {
public static Set<IAtsTeamDefinition> getTeamDefinitions(Collection<String> teamDefNames) {
Set<IAtsTeamDefinition> teamDefs = new HashSet<IAtsTeamDefinition>();
- for (IAtsTeamDefinition teamDef : AtsConfigCache.get(IAtsTeamDefinition.class)) {
+ for (IAtsTeamDefinition teamDef : AtsConfigCache.instance.get(IAtsTeamDefinition.class)) {
if (teamDefNames.contains(teamDef.getName())) {
teamDefs.add(teamDef);
}
@@ -136,7 +136,7 @@ public class TeamDefinitions {
public static Set<IAtsTeamDefinition> getTeamDefinitionsNameStartsWith(String prefix) {
Set<IAtsTeamDefinition> teamDefs = new HashSet<IAtsTeamDefinition>();
- for (IAtsTeamDefinition teamDef : AtsConfigCache.get(IAtsTeamDefinition.class)) {
+ for (IAtsTeamDefinition teamDef : AtsConfigCache.instance.get(IAtsTeamDefinition.class)) {
if (teamDef.getName().startsWith(prefix)) {
teamDefs.add(teamDef);
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/VersionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/VersionFactory.java
deleted file mode 100644
index e4272894a17..00000000000
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/VersionFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Created on Jun 6, 2012
- *
- * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
- */
-package org.eclipse.osee.ats.core.config;
-
-import org.eclipse.osee.ats.api.version.IAtsVersion;
-import org.eclipse.osee.ats.core.config.impl.Version;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
-
-/**
- * @author Donald G. Dunne
- */
-public class VersionFactory {
-
- public static IAtsVersion createVersion(String title) {
- return createVersion(title, GUID.create(), HumanReadableId.generate());
- }
-
- public static IAtsVersion createVersion(String guid, String title) {
- return createVersion(title, guid, HumanReadableId.generate());
- }
-
- public static IAtsVersion createVersion(String title, String guid, String humanReadableId) {
- IAtsVersion version = new Version(title, guid, humanReadableId);
- AtsConfigCache.cache(version);
- return version;
- }
-
- public static IAtsVersion getOrCreate(String guid, String name) {
- IAtsVersion version = AtsConfigCache.getSoleByGuid(guid, IAtsVersion.class);
- if (version == null) {
- version = createVersion(guid, name);
- }
- return version;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/ActionableItem.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItem.java
index 0cc9378c268..7e48f4f4818 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/ActionableItem.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItem.java
@@ -3,7 +3,7 @@
*
* PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
*/
-package org.eclipse.osee.ats.core.config.impl;
+package org.eclipse.osee.ats.core.config.internal;
import java.util.Collection;
import java.util.HashSet;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItemFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItemFactory.java
new file mode 100644
index 00000000000..3ddca203675
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/ActionableItemFactory.java
@@ -0,0 +1,46 @@
+/*
+ * Created on Jun 6, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config.internal;
+
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.ats.core.config.IActionableItemFactory;
+import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemFactory implements IActionableItemFactory {
+
+ private final AtsConfigCache cache;
+
+ public ActionableItemFactory(AtsConfigCache cache) {
+ this.cache = cache;
+ }
+
+ @Override
+ public IAtsActionableItem createActionableItem(String guid, String title) {
+ return createActionableItem(title, guid, HumanReadableId.generate());
+ }
+
+ public IAtsActionableItem createActionableItem(String title, String guid, String humanReadableId) {
+ if (guid == null) {
+ throw new IllegalArgumentException("guid can not be null");
+ }
+ IAtsActionableItem ai = new ActionableItem(title, guid, humanReadableId);
+ cache.cache(ai);
+ return ai;
+ }
+
+ @Override
+ public IAtsActionableItem getOrCreate(String guid, String name) {
+ IAtsActionableItem ai = cache.getSoleByGuid(guid, IAtsActionableItem.class);
+ if (ai == null) {
+ ai = createActionableItem(guid, name);
+ }
+ return ai;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/TeamDefinition.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinition.java
index 64b56268db7..c51698ac550 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/TeamDefinition.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinition.java
@@ -1,4 +1,4 @@
-package org.eclipse.osee.ats.core.config.impl;
+package org.eclipse.osee.ats.core.config.internal;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinitionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinitionFactory.java
new file mode 100644
index 00000000000..178a76a923a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/TeamDefinitionFactory.java
@@ -0,0 +1,46 @@
+/*
+ * Created on Jun 6, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config.internal;
+
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
+import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionFactory implements ITeamDefinitionFactory {
+ private final AtsConfigCache cache;
+
+ public TeamDefinitionFactory(AtsConfigCache cache) {
+ this.cache = cache;
+ }
+
+ @Override
+ public IAtsTeamDefinition createTeamDefinition(String guid, String name) {
+ return createTeamDefinition(name, guid, HumanReadableId.generate());
+ }
+
+ public IAtsTeamDefinition createTeamDefinition(String name, String guid, String humanReadableId) {
+ if (guid == null) {
+ throw new IllegalArgumentException("guid can not be null");
+ }
+ IAtsTeamDefinition teamDef = new TeamDefinition(name, guid, humanReadableId);
+ cache.cache(teamDef);
+ return teamDef;
+ }
+
+ @Override
+ public IAtsTeamDefinition getOrCreate(String guid, String name) {
+ IAtsTeamDefinition teamDef = cache.getSoleByGuid(guid, IAtsTeamDefinition.class);
+ if (teamDef == null) {
+ teamDef = createTeamDefinition(guid, name);
+ }
+ return teamDef;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/Version.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/Version.java
index a53ea4a0ca9..a6baa1ea74b 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/impl/Version.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/Version.java
@@ -1,4 +1,4 @@
-package org.eclipse.osee.ats.core.config.impl;
+package org.eclipse.osee.ats.core.config.internal;
import java.util.ArrayList;
import java.util.Collection;
@@ -41,8 +41,6 @@ public class Version extends AtsObject implements IAtsVersion {
private List<IAtsVersion> parallelVersions = new ArrayList<IAtsVersion>();
private final Set<String> staticIds = new HashSet<String>();
- private final IAtsTeamDefinition teamDefinition = null;
-
public Version(String name, String guid, String humanReadableId) {
super(name, guid, humanReadableId);
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/VersionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/VersionFactory.java
new file mode 100644
index 00000000000..5ebc823a8cd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/internal/VersionFactory.java
@@ -0,0 +1,47 @@
+/*
+ * Created on Jun 6, 2012
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.core.config.internal;
+
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.ats.core.config.IVersionFactory;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionFactory implements IVersionFactory {
+
+ private final AtsConfigCache cache;
+
+ public VersionFactory(AtsConfigCache cache) {
+ this.cache = cache;
+ }
+
+ public IAtsVersion createVersion(String title) {
+ return createVersion(title, GUID.create(), HumanReadableId.generate());
+ }
+
+ public IAtsVersion createVersion(String guid, String title) {
+ return createVersion(title, guid, HumanReadableId.generate());
+ }
+
+ public IAtsVersion createVersion(String title, String guid, String humanReadableId) {
+ IAtsVersion version = new Version(title, guid, humanReadableId);
+ cache.cache(version);
+ return version;
+ }
+
+ public IAtsVersion getOrCreate(String guid, String name) {
+ IAtsVersion version = cache.getSoleByGuid(guid, IAtsVersion.class);
+ if (version == null) {
+ version = createVersion(guid, name);
+ }
+ return version;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java
index 019d237383c..e0e6ed1906a 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/AtsBranchConfigurationTest.java
@@ -136,7 +136,7 @@ public class AtsBranchConfigurationTest {
OseeLog.log(Activator.class, Level.INFO, "Configuring version to use branch and allow create/commit");
}
IAtsTeamDefinition teamDef =
- AtsConfigCache.getSoleByName(BRANCH_VIA_VERSIONS.getName(), IAtsTeamDefinition.class);
+ AtsConfigCache.instance.getSoleByName(BRANCH_VIA_VERSIONS.getName(), IAtsTeamDefinition.class);
IAtsVersion versionToTarget = null;
for (IAtsVersion vArt : teamDef.getVersions()) {
if (vArt.getName().contains("Ver1")) {
@@ -252,7 +252,7 @@ public class AtsBranchConfigurationTest {
OseeLog.log(Activator.class, Level.INFO, "Configuring team def to use branch and allow create/commit");
}
IAtsTeamDefinition teamDef =
- AtsConfigCache.getSoleByName(BRANCH_VIA_TEAM_DEFINITION.getName(), IAtsTeamDefinition.class);
+ AtsConfigCache.instance.getSoleByName(BRANCH_VIA_TEAM_DEFINITION.getName(), IAtsTeamDefinition.class);
teamDef.setBaselineBranchGuid(viaTeamDefBranch.getGuid());
// setup team def to allow create/commit of branch
teamDef.setAllowCommitBranch(true);
@@ -337,19 +337,19 @@ public class AtsBranchConfigurationTest {
// Delete VersionArtifacts
SkynetTransaction transaction =
TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test");
- for (IAtsVersion version : AtsConfigCache.get(IAtsVersion.class)) {
+ for (IAtsVersion version : AtsConfigCache.instance.get(IAtsVersion.class)) {
if (version.getName().contains(branch.getName())) {
Artifact artifact = new VersionArtifactStore(version).getArtifact();
if (artifact != null) {
artifact.deleteAndPersist(transaction);
}
}
- AtsConfigCache.decache(version);
+ AtsConfigCache.instance.decache(version);
}
transaction.execute();
// Delete Team Definitions
- IAtsTeamDefinition teamDef = AtsConfigCache.getSoleByName(branch.getName(), IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsConfigCache.instance.getSoleByName(branch.getName(), IAtsTeamDefinition.class);
if (teamDef != null) {
TeamDefinitionArtifactStore teamDefStore = new TeamDefinitionArtifactStore(teamDef);
if (teamDefStore.getArtifact() != null && teamDefStore.getArtifact().isInDb()) {
@@ -357,19 +357,19 @@ public class AtsBranchConfigurationTest {
teamDefStore.getArtifact().deleteAndPersist(transaction, false);
transaction.execute();
}
- AtsConfigCache.decache(teamDef);
+ AtsConfigCache.instance.decache(teamDef);
}
// Delete AIs
- IAtsActionableItem aia = AtsConfigCache.getSoleByName(branch.getName(), IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByName(branch.getName(), IAtsActionableItem.class);
if (aia != null) {
transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test");
for (IAtsActionableItem childAi : aia.getChildrenActionableItems()) {
new ActionableItemArtifactStore(childAi).getArtifact().deleteAndPersist(transaction, false);
- AtsConfigCache.decache(childAi);
+ AtsConfigCache.instance.decache(childAi);
}
new ActionableItemArtifactStore(aia).getArtifact().deleteAndPersist(transaction, false);
- AtsConfigCache.decache(aia);
+ AtsConfigCache.instance.decache(aia);
transaction.execute();
}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperationTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperationTest.java
index ef6e2e4edcb..5623b466820 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperationTest.java
@@ -64,7 +64,7 @@ public class CopyAtsConfigurationOperationTest {
public static Set<IAtsActionableItem> getActionableItemsNameStartsWith(String prefix) {
Set<IAtsActionableItem> artifacts = new HashSet<IAtsActionableItem>();
- for (IAtsActionableItem aia : AtsConfigCache.get(IAtsActionableItem.class)) {
+ for (IAtsActionableItem aia : AtsConfigCache.instance.get(IAtsActionableItem.class)) {
if (aia.getName().startsWith(prefix)) {
artifacts.add(aia);
}
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/navigate/AtsNavigateItemsToWorldViewTest.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/navigate/AtsNavigateItemsToWorldViewTest.java
index 1483dc859c7..9320281acdd 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/navigate/AtsNavigateItemsToWorldViewTest.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/navigate/AtsNavigateItemsToWorldViewTest.java
@@ -503,7 +503,7 @@ public class AtsNavigateItemsToWorldViewTest {
// First one is the global one
XNavigateItem item = items.iterator().next();
assertTrue(((SearchNavigateItem) item).getWorldSearchItem() instanceof VersionTargetedForTeamSearchItem);
- IAtsVersion version = AtsConfigCache.getSoleByName(DemoSawBuilds.SAW_Bld_2.getName(), IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByName(DemoSawBuilds.SAW_Bld_2.getName(), IAtsVersion.class);
((VersionTargetedForTeamSearchItem) ((SearchNavigateItem) item).getWorldSearchItem()).setSelectedVersionArt(version);
runGeneralLoadingTest(item, AtsArtifactTypes.TeamWorkflow, 14, null, TableLoadOption.DontCopySearchItem);
TestUtil.severeLoggingEnd(monitor);
diff --git a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java
index edd26177f2b..46120fcd4bf 100644
--- a/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.test/src/org/eclipse/osee/ats/util/DemoTestUtil.java
@@ -224,7 +224,7 @@ public class DemoTestUtil {
}
try {
String name = team.name().replaceAll("_", " ");
- return AtsConfigCache.getSoleByName(name, IAtsTeamDefinition.class);
+ return AtsConfigCache.instance.getSoleByName(name, IAtsTeamDefinition.class);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
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 69bbf39a85e..9fe7386e711 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
@@ -172,7 +172,7 @@ public class NewActionPage1 extends WizardPage {
try {
((XText) getXWidget("Title")).set("tt");
if (atsAi == null) {
- atsAi = AtsConfigCache.getSoleByName("ATS", IAtsActionableItem.class);
+ atsAi = AtsConfigCache.instance.getSoleByName("ATS", IAtsActionableItem.class);
}
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/config/AtsConfigManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigManager.java
index eebea4ae120..3e9a9ca01d6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigManager.java
@@ -31,12 +31,9 @@ import org.eclipse.osee.ats.core.client.util.AtsUsersClient;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workdef.AtsWorkDefinitionStore;
import org.eclipse.osee.ats.core.client.workdef.WorkDefinitionFactory;
-import org.eclipse.osee.ats.core.config.ActionableItemFactory;
import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
-import org.eclipse.osee.ats.core.config.TeamDefinitionFactory;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
-import org.eclipse.osee.ats.core.config.VersionFactory;
import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionService;
import org.eclipse.osee.ats.core.workdef.WorkDefinitionMatch;
import org.eclipse.osee.ats.internal.Activator;
@@ -130,7 +127,8 @@ public class AtsConfigManager extends AbstractOperation {
}
private IAtsTeamDefinition createTeamDefinition(SkynetTransaction transaction) throws OseeCoreException {
- IAtsTeamDefinition teamDef = TeamDefinitionFactory.createTeamDefinition(GUID.create(), teamDefName);
+ IAtsTeamDefinition teamDef =
+ AtsConfigCache.instance.getTeamDefinitionFactory().createTeamDefinition(GUID.create(), teamDefName);
if (versionNames == null || versionNames.size() > 0) {
teamDef.setTeamUsesVersions(true);
}
@@ -140,7 +138,7 @@ public class AtsConfigManager extends AbstractOperation {
TeamDefinitionArtifactStore teamDefStore = new TeamDefinitionArtifactStore(teamDef);
teamDefStore.getArtifactOrCreate(transaction);
teamDefStore.saveToArtifact(transaction);
- AtsConfigCache.cache(teamDef);
+ AtsConfigCache.instance.cache(teamDef);
return teamDef;
}
@@ -148,7 +146,8 @@ public class AtsConfigManager extends AbstractOperation {
Collection<IAtsActionableItem> aias = new ArrayList<IAtsActionableItem>();
// Create top actionable item
- IAtsActionableItem topAia = ActionableItemFactory.createActionableItem(GUID.create(), teamDefName);
+ IAtsActionableItem topAia =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(), teamDefName);
topAia.setActionable(false);
topAia.setTeamDefinition(teamDef);
ActionableItemArtifactStore topAiaStore = new ActionableItemArtifactStore(topAia);
@@ -162,7 +161,8 @@ public class AtsConfigManager extends AbstractOperation {
// Create children actionable item
for (String name : actionableItems) {
- IAtsActionableItem childAi = ActionableItemFactory.createActionableItem(GUID.create(), name);
+ IAtsActionableItem childAi =
+ AtsConfigCache.instance.getActionableItemFactory().createActionableItem(GUID.create(), name);
childAi.setActionable(true);
topAia.getChildrenActionableItems().add(childAi);
childAi.setParentActionableItem(topAia);
@@ -178,7 +178,7 @@ public class AtsConfigManager extends AbstractOperation {
private void createVersions(SkynetTransaction transaction, IAtsTeamDefinition teamDef) throws OseeCoreException {
if (versionNames != null) {
for (String name : versionNames) {
- IAtsVersion version = VersionFactory.createVersion(name);
+ IAtsVersion version = AtsConfigCache.instance.getVersionFactory().createVersion(name);
teamDef.getVersions().add(version);
VersionArtifactStore verStore = new VersionArtifactStore(version);
verStore.getArtifactOrCreate(transaction);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
index bdc81fccc9a..d02e7108c40 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.core.client.config.store.ActionableItemArtifactStore
import org.eclipse.osee.ats.core.client.config.store.TeamDefinitionArtifactStore;
import org.eclipse.osee.ats.core.client.util.AtsGroup;
import org.eclipse.osee.ats.core.client.workdef.WorkDefinitionFactory;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.workdef.AtsWorkDefinitionSheetProviders;
import org.eclipse.osee.framework.core.data.IArtifactToken;
@@ -43,7 +44,8 @@ public class AtsDatabaseConfig implements IDbInitializationTask {
// load top team into cache
Artifact topTeamDefArt =
ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopTeamDefinition, AtsUtil.getAtsBranchToken());
- TeamDefinitionArtifactStore teamDefStore = new TeamDefinitionArtifactStore(topTeamDefArt);
+ TeamDefinitionArtifactStore teamDefStore =
+ new TeamDefinitionArtifactStore(topTeamDefArt, AtsConfigCache.instance);
IAtsTeamDefinition teamDef = teamDefStore.getTeamDefinition();
teamDef.setWorkflowDefinition(WorkDefinitionFactory.TeamWorkflowDefaultDefinitionId);
teamDefStore.save("Set Top Team Work Definition");
@@ -51,7 +53,7 @@ public class AtsDatabaseConfig implements IDbInitializationTask {
// load top ai into cache
Artifact topAiArt =
ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopActionableItem, AtsUtil.getAtsBranchToken());
- ActionableItemArtifactStore aiStore = new ActionableItemArtifactStore(topAiArt);
+ ActionableItemArtifactStore aiStore = new ActionableItemArtifactStore(topAiArt, AtsConfigCache.instance);
IAtsActionableItem aia = aiStore.getActionableItem();
aia.setActionable(false);
aiStore.save("Set Top AI to Non Actionable");
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 86aad516cd4..42bb3e0945b 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
@@ -129,7 +129,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
// Get or create new team definition
Artifact newAiArt = duplicateTeamDefinitionOrActionableItem(fromAiArt);
- IAtsActionableItem newAi = new ActionableItemArtifactStore(newAiArt).getActionableItem();
+ IAtsActionableItem newAi = new ActionableItemArtifactStore(newAiArt, AtsConfigCache.instance).getActionableItem();
newAi.setParentActionableItem(parentAi);
parentAi.getChildrenActionableItems().add(newAi);
@@ -140,7 +140,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact fromTeamDefArt : fromAiArt.getRelatedArtifacts(AtsRelationTypes.TeamActionableItem_Team,
Artifact.class)) {
IAtsConfigObject fromTeamDef =
- AtsConfigCache.getSoleByGuid(fromTeamDefArt.getGuid(), IAtsTeamDefinition.class);
+ AtsConfigCache.instance.getSoleByGuid(fromTeamDefArt.getGuid(), IAtsTeamDefinition.class);
IAtsTeamDefinition newTeamDef = fromTeamDefToNewTeamDefMap.get(fromTeamDef);
Artifact newTeamDefArt = new TeamDefinitionArtifactStore(newTeamDef).getArtifact();
@@ -155,10 +155,10 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
}
}
// Handle all children
- ActionableItemArtifactStore newAiArtStore = new ActionableItemArtifactStore(newAiArt);
+ ActionableItemArtifactStore newAiArtStore = new ActionableItemArtifactStore(newAiArt, AtsConfigCache.instance);
for (Artifact childFromAiArt : fromAiArt.getChildren()) {
if (childFromAiArt.isOfType(AtsArtifactTypes.ActionableItem)) {
- ActionableItemArtifactStore childFromAiArtStore = new ActionableItemArtifactStore(childFromAiArt);
+ ActionableItemArtifactStore childFromAiArtStore = new ActionableItemArtifactStore(childFromAiArt, AtsConfigCache.instance);
createActionableItems(transaction, childFromAiArtStore.getActionableItem(),
newAiArtStore.getActionableItem());
}
@@ -172,7 +172,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
Artifact fromTeamDefArt = new TeamDefinitionArtifactStore(fromTeamDef).getArtifact();
Artifact newTeamDefArt = duplicateTeamDefinitionOrActionableItem(fromTeamDefArt);
- TeamDefinitionArtifactStore newTeamDefStore = new TeamDefinitionArtifactStore(newTeamDefArt);
+ TeamDefinitionArtifactStore newTeamDefStore = new TeamDefinitionArtifactStore(newTeamDefArt, AtsConfigCache.instance);
IAtsTeamDefinition newTeamDef = newTeamDefStore.getTeamDefinition();
parentTeamDefArt.addChild(newTeamDefArt);
@@ -186,8 +186,8 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact childFromTeamDefArt : fromTeamDefArt.getChildren()) {
if (childFromTeamDefArt.isOfType(AtsArtifactTypes.TeamDefinition)) {
IAtsTeamDefinition childFromTeamDef =
- new TeamDefinitionArtifactStore(childFromTeamDefArt).getTeamDefinition();
- AtsConfigCache.getSoleByGuid(childFromTeamDefArt.getGuid(), IAtsTeamDefinition.class);
+ new TeamDefinitionArtifactStore(childFromTeamDefArt, AtsConfigCache.instance).getTeamDefinition();
+ AtsConfigCache.instance.getSoleByGuid(childFromTeamDefArt.getGuid(), IAtsTeamDefinition.class);
createTeamDefinitions(transaction, 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 35c9e56a822..1ecd4c1a0bb 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
@@ -578,7 +578,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
continue;
}
if (artifact.isOfType(AtsArtifactTypes.Version)) {
- IAtsVersion version = AtsConfigCache.getSoleByGuid(artifact.getGuid(), IAtsVersion.class);
+ IAtsVersion version = AtsConfigCache.instance.getSoleByGuid(artifact.getGuid(), IAtsVersion.class);
if (version != null) {
try {
String parentBranchGuid = version.getBaslineBranchGuid();
@@ -603,7 +603,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
continue;
}
if (art.isOfType(AtsArtifactTypes.TeamDefinition)) {
- IAtsTeamDefinition teamDef = AtsConfigCache.getSoleByGuid(art.getGuid(), IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsConfigCache.instance.getSoleByGuid(art.getGuid(), IAtsTeamDefinition.class);
try {
String parentBranchGuid = teamDef.getBaslineBranchGuid();
if (Strings.isValid(parentBranchGuid)) {
@@ -933,7 +933,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
}
try {
if (artifact.isOfType(AtsArtifactTypes.ActionableItem)) {
- IAtsActionableItem aia = AtsConfigCache.getSoleByGuid(artifact.getGuid(), IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByGuid(artifact.getGuid(), IAtsActionableItem.class);
if (aia.isActionable() && TeamDefinitions.getImpactedTeamDefs(Arrays.asList(aia)).isEmpty()) {
testNameToResultsMap.put(
"testActionableItemToTeamDefinition",
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
index f7f77dadaa2..02cf23eb834 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
@@ -241,6 +241,7 @@ public final class AtsNavigateViewItems implements XNavigateViewItems, IXNavigat
new XNavigateItemOperation(utilItems, FrameworkImage.ARTIFACT_MASS_EDITOR, MassEditDirtyArtifactOperation.NAME,
new MassEditDirtyArtifactOperation());
new ClearAtsWorkDefinitionCache(utilItems);
+ new ClearAtsConfigCache(utilItems);
new XNavigateItemBlam(utilItems, new MoveTeamWorkflowsBlam(), AtsImage.TEAM_WORKFLOW);
new AtsConfigResultsEditorNavigateItem(utilItems);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
index d95379cd6ae..7002e8831b4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
@@ -228,15 +228,15 @@ public class AtsRemoteEventTestItem extends WorldXNavigateItemAction {
}
private IAtsVersion getVersion256() {
- return AtsConfigCache.getSoleByName("2.5.6", IAtsVersion.class);
+ return AtsConfigCache.instance.getSoleByName("2.5.6", IAtsVersion.class);
}
private IAtsVersion getVersion257() {
- return AtsConfigCache.getSoleByName("2.5.7", IAtsVersion.class);
+ return AtsConfigCache.instance.getSoleByName("2.5.7", IAtsVersion.class);
}
private IAtsVersion getVersion258() {
- return AtsConfigCache.getSoleByName("2.5.8", IAtsVersion.class);
+ return AtsConfigCache.instance.getSoleByName("2.5.8", IAtsVersion.class);
}
private void validateActionAtStart(Artifact actionArt) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ClearAtsConfigCache.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ClearAtsConfigCache.java
new file mode 100644
index 00000000000..1d0870a3106
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ClearAtsConfigCache.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osee.ats.navigate;
+
+import org.eclipse.osee.ats.core.client.config.AtsLoadConfigArtifactsOperation;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.framework.core.util.XResultData;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ClearAtsConfigCache extends XNavigateItemAction {
+
+ public ClearAtsConfigCache(XNavigateItem parent) {
+ super(parent, "Clear ATS Config Cache", FrameworkImage.GEAR);
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ XResultData rd = new XResultData(false);
+
+ rd.log("Pre-reload");
+ AtsConfigCache.instance.getReport(rd);
+
+ AtsConfigCache.instance.clearCaches();
+
+ AtsLoadConfigArtifactsOperation opt = new AtsLoadConfigArtifactsOperation(true);
+ opt.run(null);
+
+ rd.log("\n\nPost-reload");
+ AtsConfigCache.instance.getReport(rd);
+
+ XResultDataUI.report(rd, getName());
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java
index 1c71b054bef..13c2aecef4a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java
@@ -70,7 +70,7 @@ public class FirstTimeQualityMetricReportItem extends XNavigateItemAction {
public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
IAtsTeamDefinition useTeamDef = teamDef;
if (useTeamDef == null && teamDefName != null) {
- useTeamDef = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ useTeamDef = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
}
if (useTeamDef == null) {
TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/PublishFullVersionReportItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/PublishFullVersionReportItem.java
index 064f3e15d15..3764761bf13 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/PublishFullVersionReportItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/PublishFullVersionReportItem.java
@@ -73,7 +73,7 @@ public class PublishFullVersionReportItem extends XNavigateItemAction {
}
IAtsTeamDefinition useTeamDef = teamDef;
if (useTeamDef == null && teamDefName != null) {
- useTeamDef = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ useTeamDef = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
}
if (useTeamDef == null) {
TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
index 1341d260534..acd89aa3ad8 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
@@ -43,6 +43,7 @@ import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamState;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.PercentCompleteTotalUtil;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.util.VersionList;
@@ -230,7 +231,7 @@ public class DetailedTestStatusOld extends AbstractBlam {
File scriptDir = new File(variableMap.getString("Script Root Directory"));
versions = new ArrayList<IAtsVersion>();
for (Artifact art : variableMap.getCollection(Artifact.class, "Versions")) {
- VersionArtifactStore store = new VersionArtifactStore(art);
+ VersionArtifactStore store = new VersionArtifactStore(art, AtsConfigCache.instance);
versions.add(store.getVersion());
}
init();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewWorldSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewWorldSearchItem.java
index 05ca58cb492..a7f5ea9b9da 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewWorldSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/ReviewWorldSearchItem.java
@@ -124,7 +124,7 @@ public class ReviewWorldSearchItem extends WorldUISearchItem {
if (aiNames != null && aias == null) {
aias = new HashSet<IAtsActionableItem>();
for (String teamDefName : aiNames) {
- IAtsActionableItem aia = AtsConfigCache.getSoleByName(teamDefName, IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsActionableItem.class);
if (aia != null) {
aias.add(aia);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java
index 3ff6b9d896d..8d455704061 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java
@@ -72,7 +72,7 @@ public class AtsArtifactChecks extends ArtifactCheck {
Set<IAtsActionableItem> aias = new HashSet<IAtsActionableItem>();
for (Artifact art : artifacts) {
if (art.isOfType(AtsArtifactTypes.ActionableItem)) {
- IAtsActionableItem aia = AtsConfigCache.getSoleByGuid(art.getGuid(), IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByGuid(art.getGuid(), IAtsActionableItem.class);
if (aia != null) {
aias.add(aia);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
index fcf00cb1586..25bf13bdf85 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsUtil.java
@@ -232,7 +232,7 @@ public final class AtsUtil {
public static void createATSAction(String initialDescription, String actionableItemName) {
// Ensure actionable item is configured for ATS before continuing
try {
- IAtsActionableItem aia = AtsConfigCache.getSoleByName(actionableItemName, IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByName(actionableItemName, IAtsActionableItem.class);
if (aia == null) {
AWorkbench.popup(
"Configuration Error",
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
index 25e5a10bb24..cad6d8e9c5e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
@@ -96,7 +96,7 @@ public class ExcelAtsActionArtifactExtractor {
for (String actionableItemName : aData.actionableItems) {
try {
Collection<IAtsActionableItem> aias =
- AtsConfigCache.getByName(actionableItemName, IAtsActionableItem.class);
+ AtsConfigCache.instance.getByName(actionableItemName, IAtsActionableItem.class);
if (aias.isEmpty()) {
rd.logError("Row " + rowNum + ": Couldn't find actionable item for \"" + actionableItemName + "\"");
} else if (aias.size() > 1) {
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 2bb6dbfc9fd..b3d9c3edb07 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
try {
Collection<IAtsTeamDefinition> teams = new ArrayList<IAtsTeamDefinition>();
for (Artifact art : AtsUsersClient.getOseeUser(user).getRelatedArtifacts(AtsRelationTypes.TeamMember_Team)) {
- teams.add(AtsConfigCache.getSoleByGuid(art.getGuid(), IAtsTeamDefinition.class));
+ teams.add(AtsConfigCache.instance.getSoleByGuid(art.getGuid(), IAtsTeamDefinition.class));
}
Collection<Branch> branches = new LinkedList<Branch>();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
index 3870ea0c3ce..99482e17696 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
@@ -21,9 +21,9 @@ import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.config.AtsObjectsClient;
import org.eclipse.osee.ats.core.client.config.store.VersionArtifactStore;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
-import org.eclipse.osee.ats.core.config.VersionFactory;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
@@ -122,7 +122,7 @@ public class CreateNewVersionItem extends XNavigateItemAction {
if (!resultData.isErrors()) {
try {
for (String newVer : newVersionNames) {
- IAtsVersion version = VersionFactory.createVersion(newVer);
+ IAtsVersion version = AtsConfigCache.instance.getVersionFactory().createVersion(newVer);
AtsVersionService.get().setTeamDefinition(version, teamDefHoldingVersions);
new VersionArtifactStore(version).saveToArtifact(transaction);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/GenerateFullVersionReportItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/GenerateFullVersionReportItem.java
index 7700733c7a7..115640c64ff 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/GenerateFullVersionReportItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/GenerateFullVersionReportItem.java
@@ -80,7 +80,7 @@ public class GenerateFullVersionReportItem extends XNavigateItemAction {
return teamDef;
}
if (Strings.isValid(teamDefName)) {
- IAtsTeamDefinition teamDef = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
if (teamDef != null) {
return teamDef;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/MassEditTeamVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/MassEditTeamVersionItem.java
index 650f9a3d094..5ed44a6dde9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/MassEditTeamVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/MassEditTeamVersionItem.java
@@ -66,7 +66,7 @@ public class MassEditTeamVersionItem extends XNavigateItemAction {
return teamDef;
}
if (Strings.isValid(teamDefName)) {
- IAtsTeamDefinition teamDef = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ IAtsTeamDefinition teamDef = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
if (teamDef != null) {
return teamDef;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
index 1dd36092dc8..38c2de9f5f6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.core.client.config.store.ActionableItemArtifactStore
import org.eclipse.osee.ats.core.client.config.store.TeamDefinitionArtifactStore;
import org.eclipse.osee.ats.core.client.workdef.UserRefUtilClient;
import org.eclipse.osee.ats.core.config.ActionableItems;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.dsl.BooleanDefUtil;
import org.eclipse.osee.ats.dsl.atsDsl.ActionableItemDef;
@@ -155,7 +156,7 @@ public class ImportAIsAndTeamDefinitionsToDb {
// System.out.println(" - Importing Version " + dslVerName);
Artifact newVer =
ArtifactTypeManager.addArtifact(AtsArtifactTypes.Version, AtsUtil.getAtsBranch(), dslVerName);
- Artifact teamDefArt = new TeamDefinitionArtifactStore(teamDef).getArtifact();
+ Artifact teamDefArt = new TeamDefinitionArtifactStore(teamDef, AtsConfigCache.instance).getArtifact();
teamDefArt.addRelation(AtsRelationTypes.TeamDefinitionToVersion_Version, newVer);
nameToVerArt.put(newVer.getName(), newVer);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
index 9f1fffb23ef..220d24dcffc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
@@ -96,7 +96,7 @@ public class ActionableItemWorldSearchItem extends WorldUISearchItem {
if (actionItemNames != null && actionItems == null) {
actionItems = new HashSet<IAtsActionableItem>();
for (String actionItemName : actionItemNames) {
- IAtsActionableItem aia = AtsConfigCache.getSoleByName(actionItemName, IAtsActionableItem.class);
+ IAtsActionableItem aia = AtsConfigCache.instance.getSoleByName(actionItemName, IAtsActionableItem.class);
if (aia != null) {
actionItems.add(aia);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
index 86afbebb88d..559cb0add33 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GoalSearchItem.java
@@ -91,7 +91,7 @@ public class GoalSearchItem extends WorldUISearchItem {
if (teamDefNames != null && teamDefs == null) {
teamDefs = new HashSet<IAtsTeamDefinition>();
for (String teamDefName : teamDefNames) {
- IAtsTeamDefinition aia = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ IAtsTeamDefinition aia = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
if (aia != null) {
teamDefs.add(aia);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
index 4ab053dbf9a..e430afc0f84 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
@@ -136,7 +136,7 @@ public class TeamWorldSearchItem extends WorldUISearchItem {
if (teamDefNames != null && teamDefs == null) {
teamDefs = new HashSet<IAtsTeamDefinition>();
for (String teamDefName : teamDefNames) {
- IAtsTeamDefinition aia = AtsConfigCache.getSoleByName(teamDefName, IAtsTeamDefinition.class);
+ IAtsTeamDefinition aia = AtsConfigCache.instance.getSoleByName(teamDefName, IAtsTeamDefinition.class);
if (aia != null) {
teamDefs.add(aia);
}

Back to the top