From d0ba9178aa64a2216b7a00934a29940b8f8970d4 Mon Sep 17 00:00:00 2001 From: Ryan D. Brooks Date: Tue, 3 May 2011 14:11:11 -0700 Subject: refinement: Expose recursive purge operation to client through http --- .../osee/framework/core/message/PurgeBranchRequest.java | 8 +++++++- .../internal/translation/PurgeBranchRequestTranslator.java | 12 +++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'plugins/org.eclipse.osee.framework.core.message/src') diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java index 9495601f4e9..201bb393c63 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java @@ -16,13 +16,19 @@ package org.eclipse.osee.framework.core.message; */ public class PurgeBranchRequest { private final int branchId; + private final boolean recursive; - public PurgeBranchRequest(int branchId) { + public PurgeBranchRequest(int branchId, boolean recursive) { super(); this.branchId = branchId; + this.recursive = recursive; } public int getBranchId() { return branchId; } + + public boolean isRecursive() { + return recursive; + } } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/PurgeBranchRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/PurgeBranchRequestTranslator.java index f93dbc50e2e..068cc497b00 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/PurgeBranchRequestTranslator.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/PurgeBranchRequestTranslator.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.osee.framework.core.message.internal.translation; -import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.message.PurgeBranchRequest; import org.eclipse.osee.framework.core.translation.ITranslator; import org.eclipse.osee.framework.jdk.core.type.PropertyStore; @@ -21,20 +20,23 @@ import org.eclipse.osee.framework.jdk.core.type.PropertyStore; */ public class PurgeBranchRequestTranslator implements ITranslator { private static enum Entry { - BRANCH_ID + BRANCH_ID, + RECURSIVE } @Override - public PurgeBranchRequest convert(PropertyStore propertyStore) throws OseeCoreException { + public PurgeBranchRequest convert(PropertyStore propertyStore) { int branchId = propertyStore.getInt(Entry.BRANCH_ID.name()); - PurgeBranchRequest request = new PurgeBranchRequest(branchId); + boolean recursive = propertyStore.getBoolean(Entry.RECURSIVE.name()); + PurgeBranchRequest request = new PurgeBranchRequest(branchId, recursive); return request; } @Override - public PropertyStore convert(PurgeBranchRequest data) throws OseeCoreException { + public PropertyStore convert(PurgeBranchRequest data) { PropertyStore store = new PropertyStore(); store.put(Entry.BRANCH_ID.name(), data.getBranchId()); + store.put(Entry.RECURSIVE.name(), data.isRecursive()); return store; } } -- cgit v1.2.3