Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-19 14:03:13 -0400
committerRyan D. Brooks2016-08-31 12:18:41 -0400
commite1f534a4d5319783271b558626149f5342aab889 (patch)
treee833d24756a7c6c006bc12e50a73685979db8b98
parentaf415a81557f5c824fc68c22f02065f9e83925a6 (diff)
downloadorg.eclipse.osee-e1f534a4d5319783271b558626149f5342aab889.tar.gz
org.eclipse.osee-e1f534a4d5319783271b558626149f5342aab889.tar.xz
org.eclipse.osee-e1f534a4d5319783271b558626149f5342aab889.zip
bug[ats_ATS307497]: NR Alpha - ATS Navigator startup is slow
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java33
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ILazyTeamDefinitionProvider.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/OpenWorkflowsByTeamDefSearchItem.java23
3 files changed, 59 insertions, 20 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
index 10b9df4fb1..c82e20a5a1 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/DemoNavigateViewItems.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.client.demo.navigate;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
@@ -30,6 +31,7 @@ import org.eclipse.osee.ats.version.CreateNewVersionItem;
import org.eclipse.osee.ats.version.ReleaseVersionItem;
import org.eclipse.osee.ats.world.search.ArtifactTypeSearchItem;
import org.eclipse.osee.ats.world.search.ArtifactTypeWithInheritenceSearchItem;
+import org.eclipse.osee.ats.world.search.ILazyTeamDefinitionProvider;
import org.eclipse.osee.ats.world.search.NextVersionSearchItem;
import org.eclipse.osee.ats.world.search.OpenWorkflowsByTeamDefSearchItem;
import org.eclipse.osee.ats.world.search.VersionTargetedForTeamSearchItem;
@@ -60,8 +62,8 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
// Add check to keep exception from occurring for OSEE developers running against production
if (!ClientSessionManager.isProductionDataStore()) {
try {
- results = AtsClientService.get().getCache().getByUuid(team.getTeamDefToken().getUuid(),
- IAtsTeamDefinition.class);
+ results =
+ AtsClientService.get().getCache().getByUuid(team.getTeamDefToken().getUuid(), IAtsTeamDefinition.class);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
@@ -96,12 +98,13 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
try {
IAtsTeamDefinition teamDef = getTeamDef(team);
XNavigateItem teamItems = new XNavigateItemFolder(jhuItem, "JHU " + team.name().replaceAll("_", " "));
- new SearchNavigateItem(teamItems,
- new OpenWorkflowsByTeamDefSearchItem("Show Open " + teamDef + " Workflows", Arrays.asList(teamDef)));
+ new SearchNavigateItem(teamItems, new OpenWorkflowsByTeamDefSearchItem(
+ "Show Open " + teamDef + " Workflows", new SimpleTeamDefinitionProvider(Arrays.asList(teamDef))));
// Handle all children teams
for (IAtsTeamDefinition childTeamDef : TeamDefinitions.getChildren(teamDef, true)) {
- new SearchNavigateItem(teamItems, new OpenWorkflowsByTeamDefSearchItem(
- "Show Open " + childTeamDef + " Workflows", Arrays.asList(childTeamDef)));
+ new SearchNavigateItem(teamItems,
+ new OpenWorkflowsByTeamDefSearchItem("Show Open " + childTeamDef + " Workflows",
+ new SimpleTeamDefinitionProvider(Arrays.asList(childTeamDef))));
}
if (teamDef.isTeamUsesVersions()) {
if (team.name().contains("SAW")) {
@@ -114,7 +117,7 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
new SearchNavigateItem(teamItems,
new VersionTargetedForTeamSearchItem(teamDef, null, false, LoadView.WorldEditor));
new SearchNavigateItem(teamItems, new OpenWorkflowsByTeamDefSearchItem("Show Un-Released Team Workflows",
- Arrays.asList(teamDef), true, ReleasedOption.UnReleased));
+ new SimpleTeamDefinitionProvider(Arrays.asList(teamDef)), true, ReleasedOption.UnReleased));
new ReleaseVersionItem(teamItems, teamDef);
new CreateNewVersionItem(teamItems, teamDef);
}
@@ -144,4 +147,20 @@ public class DemoNavigateViewItems implements IAtsNavigateItem {
return items;
}
+
+ private class SimpleTeamDefinitionProvider implements ILazyTeamDefinitionProvider {
+
+ private final Collection<IAtsTeamDefinition> teamDefs;
+
+ public SimpleTeamDefinitionProvider(Collection<IAtsTeamDefinition> teamDefs) {
+ this.teamDefs = teamDefs;
+ }
+
+ @Override
+ public Collection<IAtsTeamDefinition> getTeamDefs() {
+ return teamDefs;
+ }
+
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ILazyTeamDefinitionProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ILazyTeamDefinitionProvider.java
new file mode 100644
index 0000000000..cc3abcc616
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ILazyTeamDefinitionProvider.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface ILazyTeamDefinitionProvider {
+
+ public Collection<IAtsTeamDefinition> getTeamDefs();
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/OpenWorkflowsByTeamDefSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/OpenWorkflowsByTeamDefSearchItem.java
index 5a6a3494f1..423a66f4b0 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/OpenWorkflowsByTeamDefSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/OpenWorkflowsByTeamDefSearchItem.java
@@ -11,13 +11,10 @@
package org.eclipse.osee.ats.world.search;
import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.query.AtsSearchData;
import org.eclipse.osee.ats.api.query.AtsSearchUserType;
import org.eclipse.osee.ats.api.query.ReleasedOption;
-import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.WorkItemType;
@@ -32,28 +29,28 @@ import org.eclipse.swt.graphics.Image;
*/
public class OpenWorkflowsByTeamDefSearchItem extends WorldSearchItem {
- private final List<Long> teamDefUuids;
private final IAtsUser assignee;
private final boolean includeCompletedCancelled;
private ReleasedOption releasedOption;
+ private final ILazyTeamDefinitionProvider teamDefProvider;
- public OpenWorkflowsByTeamDefSearchItem(String name, Collection<IAtsTeamDefinition> teamDefs) {
- this(name, teamDefs, null);
+ public OpenWorkflowsByTeamDefSearchItem(String name, ILazyTeamDefinitionProvider teamDefProvider) {
+ this(name, teamDefProvider, null);
}
- public OpenWorkflowsByTeamDefSearchItem(String name, Collection<IAtsTeamDefinition> teamDefs, IAtsUser assignee) {
- this(name, teamDefs, assignee, false);
+ public OpenWorkflowsByTeamDefSearchItem(String name, ILazyTeamDefinitionProvider teamDefProvider, IAtsUser assignee) {
+ this(name, teamDefProvider, assignee, false);
}
- public OpenWorkflowsByTeamDefSearchItem(String name, Collection<IAtsTeamDefinition> teamDefs, IAtsUser assignee, boolean includeCompletedCancelled) {
+ public OpenWorkflowsByTeamDefSearchItem(String name, ILazyTeamDefinitionProvider teamDefProvider, IAtsUser assignee, boolean includeCompletedCancelled) {
super(name);
+ this.teamDefProvider = teamDefProvider;
this.assignee = assignee;
this.includeCompletedCancelled = includeCompletedCancelled;
- this.teamDefUuids = AtsObjects.toUuids(teamDefs);
}
- public OpenWorkflowsByTeamDefSearchItem(String name, List<IAtsTeamDefinition> teamDefs, boolean includeCompletedCancelled, ReleasedOption releasedOption) {
- this(name, teamDefs, null, includeCompletedCancelled);
+ public OpenWorkflowsByTeamDefSearchItem(String name, ILazyTeamDefinitionProvider teamDefProvider, boolean includeCompletedCancelled, ReleasedOption releasedOption) {
+ this(name, teamDefProvider, null, includeCompletedCancelled);
this.releasedOption = releasedOption;
}
@@ -62,7 +59,7 @@ public class OpenWorkflowsByTeamDefSearchItem extends WorldSearchItem {
AtsSearchData data = getData();
if (!Strings.isValid(data.getUserId())) {
data.getWorkItemTypes().add(WorkItemType.TeamWorkflow);
- data.setTeamDefUuids(teamDefUuids);
+ data.setTeamDefUuids(AtsObjects.toUuids(teamDefProvider.getTeamDefs()));
if (!includeCompletedCancelled) {
data.setStateTypes(Arrays.asList(StateType.Working));
}

Back to the top