diff options
author | donald.g.dunne | 2017-01-25 22:45:34 +0000 |
---|---|---|
committer | David W. Miller | 2017-01-25 22:45:34 +0000 |
commit | 6c5746c18407c7d416bf011fa8dea16ce87d37e8 (patch) | |
tree | 399f0be8032c9e4733b9b91d6a450519b81ea572 /plugins/org.eclipse.osee.ats.core.client | |
parent | 3d66f39802c8bf4557d4db95233f904cd0efe17b (diff) | |
download | org.eclipse.osee-6c5746c18407c7d416bf011fa8dea16ce87d37e8.tar.gz org.eclipse.osee-6c5746c18407c7d416bf011fa8dea16ce87d37e8.tar.xz org.eclipse.osee-6c5746c18407c7d416bf011fa8dea16ce87d37e8.zip |
refactor: Consolidate AtsWorkItemFactory to ats.core
Change-Id: Id64d03c76c0b3fb8e10edb563d74fa42148f27d5
Diffstat (limited to 'plugins/org.eclipse.osee.ats.core.client')
-rw-r--r-- | plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/WorkItemFactory.java | 69 |
1 files changed, 3 insertions, 66 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/WorkItemFactory.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/WorkItemFactory.java index 54534363e2f..6b65fac41c6 100644 --- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/WorkItemFactory.java +++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/WorkItemFactory.java @@ -10,38 +10,24 @@ *******************************************************************************/ package org.eclipse.osee.ats.core.client.internal; -import org.eclipse.osee.ats.api.IAtsWorkItem; -import org.eclipse.osee.ats.api.agile.IAgileBacklog; -import org.eclipse.osee.ats.api.agile.IAgileItem; -import org.eclipse.osee.ats.api.agile.IAgileSprint; -import org.eclipse.osee.ats.api.data.AtsAttributeTypes; +import org.eclipse.osee.ats.api.IAtsServices; import org.eclipse.osee.ats.api.review.IAtsAbstractReview; import org.eclipse.osee.ats.api.workflow.IAtsAction; import org.eclipse.osee.ats.api.workflow.IAtsGoal; import org.eclipse.osee.ats.api.workflow.IAtsTask; import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow; -import org.eclipse.osee.ats.core.agile.AgileBacklog; -import org.eclipse.osee.ats.core.agile.AgileItem; -import org.eclipse.osee.ats.core.agile.AgileSprint; -import org.eclipse.osee.ats.core.client.IAtsClient; import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact; -import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact; import org.eclipse.osee.ats.core.workflow.AbstractWorkItemFactory; import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; -import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; /** * @author Donald G. Dunne */ public class WorkItemFactory extends AbstractWorkItemFactory { - private final IAtsClient atsClient; - - public WorkItemFactory(IAtsClient atsClient) { - super(); - this.atsClient = atsClient; + public WorkItemFactory(IAtsServices services) { + super(services); } @Override @@ -54,15 +40,6 @@ public class WorkItemFactory extends AbstractWorkItemFactory { } @Override - public IAtsWorkItem getWorkItem(ArtifactId artifact) throws OseeCoreException { - IAtsWorkItem workItem = null; - if (artifact instanceof AbstractWorkflowArtifact) { - workItem = (AbstractWorkflowArtifact) artifact; - } - return workItem; - } - - @Override public IAtsTask getTask(ArtifactId artifact) throws OseeCoreException { IAtsTask task = null; if (artifact instanceof IAtsTask) { @@ -90,28 +67,6 @@ public class WorkItemFactory extends AbstractWorkItemFactory { } @Override - public IAgileSprint getAgileSprint(ArtifactId artifact) throws OseeCoreException { - IAgileSprint sprint = null; - if (artifact instanceof IAgileSprint) { - sprint = (IAgileSprint) artifact; - } else { - sprint = new AgileSprint(atsClient.getLogger(), atsClient, (Artifact) artifact); - } - return sprint; - } - - @Override - public IAgileBacklog getAgileBacklog(ArtifactId artifact) throws OseeCoreException { - IAgileBacklog backlog = null; - if (artifact instanceof IAgileBacklog) { - backlog = (IAgileBacklog) artifact; - } else { - backlog = new AgileBacklog(atsClient.getLogger(), atsClient, (Artifact) artifact); - } - return backlog; - } - - @Override public IAtsAction getAction(ArtifactId artifact) { IAtsAction action = null; if (artifact instanceof IAtsAction) { @@ -120,22 +75,4 @@ public class WorkItemFactory extends AbstractWorkItemFactory { return action; } - @Override - public IAtsWorkItem getWorkItemByAtsId(String atsId) { - Artifact artifact = - ArtifactQuery.getArtifactFromAttribute(AtsAttributeTypes.AtsId, atsId, AtsClientService.get().getAtsBranch()); - return getWorkItem(artifact); - } - - @Override - public IAgileItem getAgileItem(ArtifactId artifact) { - IAgileItem item = null; - if (artifact instanceof AgileItem) { - item = (IAgileItem) artifact; - } else { - item = new AgileItem(atsClient.getLogger(), atsClient, (Artifact) artifact); - } - return item; - } - } |