Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-10-17 12:36:21 -0400
committerDonald Dunne2017-11-02 17:17:29 -0400
commit4b3f2bcedc6e3d757abfcd62d42cbc7ef3921ac1 (patch)
tree3dca03e42fd77407d6afddd5332d6da8f9b9ab8c
parent3507b790e025b6f92a47a31b22f4b282f3d9b963 (diff)
downloadorg.eclipse.osee-4b3f2bcedc6e3d757abfcd62d42cbc7ef3921ac1.tar.gz
org.eclipse.osee-4b3f2bcedc6e3d757abfcd62d42cbc7ef3921ac1.tar.xz
org.eclipse.osee-4b3f2bcedc6e3d757abfcd62d42cbc7ef3921ac1.zip
bug[ats_TW2861]: Add branch methods to IAtsClient
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java15
4 files changed, 22 insertions, 7 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
index 2790e5f778..97c8ea29bf 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
@@ -88,7 +88,10 @@ public interface IAtsBranchService {
BranchId getConfiguredBranchForWorkflow(IAtsTeamWorkflow teamWf);
/**
- * @return working branch or null if does not exist
+ * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
+ * with the cache being updated by local and remote events.
+ *
+ * @param force == true does not used cached value
*/
IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf, boolean force);
@@ -144,4 +147,6 @@ public interface IAtsBranchService {
CompareResults getChangeData(TransactionToken transaction);
+ BranchId getWorkingBranchInWork(IAtsTeamWorkflow teamWf);
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
index 97ee3b51ad..1378243756 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
@@ -113,4 +113,6 @@ public interface IAtsClient extends IAtsServices, IAtsNotifier, IAttributeResolv
OseeClient getOseeClient();
+ Artifact getArtifact(ArtifactId artifact, BranchId branch);
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 9182eb80d4..2c237fc7a1 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -525,4 +525,9 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
return agileService;
}
+ @Override
+ public Artifact getArtifact(ArtifactId artifact, BranchId branch) {
+ return ArtifactQuery.getArtifactFromId(artifact, branch);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
index eed0f66579..8817f11cf3 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
@@ -82,12 +82,6 @@ public abstract class AbstractAtsBranchService implements IAtsBranchService {
return branches;
}
- /**
- * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
- * with the cache being updated by local and remote events.
- *
- * @param force == true does not used cached value
- */
@Override
public IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf, boolean force) {
long now = new Date().getTime();
@@ -619,4 +613,13 @@ public abstract class AbstractAtsBranchService implements IAtsBranchService {
return defaultBranchName;
}
+ @Override
+ public BranchId getWorkingBranchInWork(IAtsTeamWorkflow teamWf) {
+ IOseeBranch branch = getWorkingBranch(teamWf);
+ if (branch != null && (getBranchState(branch).isCreated() || getBranchState(branch).isModified())) {
+ return branch;
+ }
+ return BranchId.SENTINEL;
+ }
+
}

Back to the top