Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-02-04 22:07:07 +0000
committerRyan D. Brooks2016-02-04 22:07:07 +0000
commit557079ac9aee8e8a41ab7ebce05c6142d64dafb9 (patch)
treea5ba9cc7c98a0804884686c1aa8d84abc0c64b63 /plugins/org.eclipse.osee.ote.define
parent0d22cf094b4cb632a9b65a205e6c1f2b253fe61f (diff)
downloadorg.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.tar.gz
org.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.tar.xz
org.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.zip
refactor: Use BranchId were appropriate
Diffstat (limited to 'plugins/org.eclipse.osee.ote.define')
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java18
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/OutfileToArtifactJob.java6
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java5
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java6
5 files changed, 20 insertions, 19 deletions
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<T extends Artifact> {
* 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<T extends Artifact> {
/**
* Returns all artifact instances found in branch matching the type <b>T</b>
- *
+ *
* @param branch to search in
* @return artifact instances
*/
@SuppressWarnings("unchecked")
- public Set<T> getAllArtifacts(IOseeBranch branch) throws OseeArgumentException {
+ public Set<T> getAllArtifacts(BranchId branch) throws OseeArgumentException {
checkForNull(branch);
Set<T> toReturn = new HashSet<>();
try {
@@ -80,8 +80,8 @@ public class OteArtifactFetcher<T extends Artifact> {
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<T extends Artifact> {
/**
* Returns all artifact instances found in branch matching the type <b>T</b> 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<IOseeBranch, List<Artifact>> branchMap = new HashMap<>();
for (Object object : items) {
Artifact testRun = (Artifact) object;
- IOseeBranch branch = testRun.getBranch();
+ IOseeBranch branch = testRun.getBranchToken();
List<Artifact> 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<URI> filesToImport;
private final List<Artifact> results;
private final List<URI> 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<>();

Back to the top