From 557079ac9aee8e8a41ab7ebce05c6142d64dafb9 Mon Sep 17 00:00:00 2001 From: Ryan D. Brooks Date: Thu, 4 Feb 2016 15:07:07 -0700 Subject: refactor: Use BranchId were appropriate Change-Id: Ia1e98a547b09cdd283e5c288f8c2ad3ba7a23fa3 --- .../ote/define/artifacts/ArtifactTestRunOperator.java | 4 ++-- .../osee/ote/define/artifacts/OteArtifactFetcher.java | 18 +++++++++--------- .../osee/ote/define/jobs/OutfileToArtifactJob.java | 6 +++--- .../ote/define/operations/ImportOutfileOperation.java | 5 +++-- .../define/operations/OutfileToArtifactOperation.java | 6 +++--- 5 files changed, 20 insertions(+), 19 deletions(-) (limited to 'plugins/org.eclipse.osee.ote.define') diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java index 5a7b2333512..3b497272286 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java @@ -16,7 +16,7 @@ import java.net.URI; import java.util.Date; import java.util.List; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist; @@ -61,7 +61,7 @@ public class ArtifactTestRunOperator implements TestRunOperator { } } - public static ArtifactTestRunOperator getNewArtifactWithOperator(IOseeBranch branch) throws OseeCoreException { + public static ArtifactTestRunOperator getNewArtifactWithOperator(BranchId branch) throws OseeCoreException { return new ArtifactTestRunOperator(TEST_RUN_ARTIFACT_FETCHER.getNewArtifact(branch)); } diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java index daa1c390744..6e44fa7cbbb 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java @@ -16,9 +16,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.logging.Level; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; -import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -43,21 +43,21 @@ public class OteArtifactFetcher { * Creates a new Artifact in the specified branch */ @SuppressWarnings("unchecked") - public T getNewArtifact(IOseeBranch branch) throws OseeCoreException { + public T getNewArtifact(BranchId branch) throws OseeCoreException { checkForNull(branch); return (T) ArtifactTypeManager.addArtifact(oteArtifactType, branch); } /** * Retrieves a unique artifact matching input parameter - * + * * @param typeName Attribute type name * @param value attribute value to match * @param branch to search in * @return the unique artifact */ @SuppressWarnings("unchecked") - public T searchForUniqueArtifactMatching(IAttributeType attributeType, String attributeValue, IOseeBranch branch) throws OseeCoreException { + public T searchForUniqueArtifactMatching(IAttributeType attributeType, String attributeValue, BranchId branch) throws OseeCoreException { Conditions.checkNotNull(attributeType, "attributeType"); Conditions.checkNotNull(attributeValue, "attributeValue"); Conditions.checkNotNull(branch, "branch"); @@ -66,12 +66,12 @@ public class OteArtifactFetcher { /** * Returns all artifact instances found in branch matching the type T - * + * * @param branch to search in * @return artifact instances */ @SuppressWarnings("unchecked") - public Set getAllArtifacts(IOseeBranch branch) throws OseeArgumentException { + public Set getAllArtifacts(BranchId branch) throws OseeArgumentException { checkForNull(branch); Set toReturn = new HashSet<>(); try { @@ -80,8 +80,8 @@ public class OteArtifactFetcher { toReturn.add((T) artifact); } } catch (OseeCoreException ex) { - OseeLog.logf(OteDefinePlugin.class, Level.WARNING, ex, "Search for all artifacts failed [%s, %s]", - oteArtifactType.getName(), branch.getName()); + OseeLog.logf(OteDefinePlugin.class, Level.WARNING, ex, "Search for all artifacts failed [%s] on branch [%s]", + oteArtifactType.getName(), branch.getId()); } return toReturn; } @@ -89,7 +89,7 @@ public class OteArtifactFetcher { /** * Returns all artifact instances found in branch matching the type T Results are indexed by artifact * descriptive name. - * + * * @param branch to search in * @return artifact instances indexed by descriptive name */ diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java index 118bc1f417d..6fe27c72bae 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java @@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.ote.define.OteDefinePlugin; import org.eclipse.osee.ote.define.operations.LinkTestRunToTestScriptOperation; @@ -30,9 +30,9 @@ public class OutfileToArtifactJob extends Job { private final URI[] filesToImport; private Artifact[] results; private URI[] filesWithErrors; - private final IOseeBranch branch; + private final BranchId branch; - public OutfileToArtifactJob(IOseeBranch branch, URI... filesToImport) { + public OutfileToArtifactJob(BranchId branch, URI... filesToImport) { super(JOB_NAME); setUser(true); setPriority(Job.LONG); diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java index 08eceaa66e2..c1bf6403a7a 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java @@ -20,6 +20,7 @@ import java.util.Map; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IOseeBranch; import org.eclipse.osee.framework.core.model.Branch; import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException; @@ -120,7 +121,7 @@ public class ImportOutfileOperation { Map> branchMap = new HashMap<>(); for (Object object : items) { Artifact testRun = (Artifact) object; - IOseeBranch branch = testRun.getBranch(); + IOseeBranch branch = testRun.getBranchToken(); List artList = branchMap.get(branch); if (artList == null) { artList = new ArrayList<>(); @@ -131,7 +132,7 @@ public class ImportOutfileOperation { return branchMap; } - public static void commitTestRunTx(IProgressMonitor monitor, String commitComment, IOseeBranch branch, Artifact... artifacts) throws OseeCoreException { + public static void commitTestRunTx(IProgressMonitor monitor, String commitComment, BranchId branch, Artifact... artifacts) throws OseeCoreException { monitor.setTaskName("Persist Test Runs"); Date uploadDate = new Date(); for (Artifact artifact : artifacts) { diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java index 411ce734475..38162437d9c 100644 --- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java +++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java @@ -18,7 +18,7 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.osee.framework.core.data.IOseeBranch; +import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.model.Branch; @@ -38,12 +38,12 @@ import org.eclipse.osee.ote.define.utilities.OutfileParserExtensionManager; * @author Roberto E. Escobar */ public class OutfileToArtifactOperation { - private final IOseeBranch branch; + private final BranchId branch; private final List filesToImport; private final List results; private final List filesWithErrors; - public OutfileToArtifactOperation(IOseeBranch branch, URI... filesToImport) { + public OutfileToArtifactOperation(BranchId branch, URI... filesToImport) { this.branch = branch; this.filesToImport = Arrays.asList(filesToImport); this.results = new ArrayList<>(); -- cgit v1.2.3