Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java20
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java7
2 files changed, 6 insertions, 21 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
index b9ca98a451e..1a835f25caa 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/BranchManager.java
@@ -225,24 +225,8 @@ public class BranchManager {
return Operations.executeAsJob(operation, true);
}
- public static void purgeBranchPending(Branch branch) throws OseeCoreException {
- Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(branch));
- }
-
- public static void purgeBranch(final Branch branch) {
- purgeBranch(Arrays.asList(branch));
- }
-
- /**
- * Purges branches from the system. (sets branch state to purged. operation is undo-able)
- */
- public static Job purgeBranch(final List<Branch> branches) {
- List<IOperation> ops = new ArrayList<IOperation>();
- for (Branch branch : branches) {
- ops.add(new PurgeBranchHttpRequestOperation(branch)); //can this be done in one http request?
- }
- return Operations.executeAsJob(new CompositeOperation("Purging multiple branches...", Activator.PLUGIN_ID, ops),
- true);
+ public static void purgeBranch(final Branch branch) throws OseeCoreException {
+ Operations.executeWorkAndCheckStatus(new PurgeBranchHttpRequestOperation(branch, false));
}
public static void updateBranchType(IProgressMonitor monitor, final int branchId, String branchGuid, final BranchType type) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
index 97fd55eb217..a4db8839840 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/PurgeBranchHttpRequestOperation.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.framework.skynet.core.httpRequests;
import java.util.HashMap;
import java.util.Map;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.OseeServerContext;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
@@ -37,15 +36,17 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator;
*/
public final class PurgeBranchHttpRequestOperation extends AbstractOperation {
private final Branch branch;
+ private final boolean recursive;
- public PurgeBranchHttpRequestOperation(Branch branch) {
+ public PurgeBranchHttpRequestOperation(Branch branch, boolean recursive) {
super("Purge " + branch, Activator.PLUGIN_ID);
this.branch = branch;
+ this.recursive = recursive;
}
@Override
protected void doWork(IProgressMonitor monitor) throws OseeCoreException {
- PurgeBranchRequest requestData = new PurgeBranchRequest(branch.getId());
+ PurgeBranchRequest requestData = new PurgeBranchRequest(branch.getId(), recursive);
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("function", Function.PURGE_BRANCH.name());

Back to the top