diff options
author | Ryan D. Brooks | 2016-08-11 22:20:36 +0000 |
---|---|---|
committer | donald.g.dunne | 2016-08-11 22:20:36 +0000 |
commit | bd8b65d24a79137328eeb14a56ac1d132e0f3f4e (patch) | |
tree | 66267e0925cd13d009ac13853438e22f406f2004 /plugins/org.eclipse.osee.orcs.rest.model | |
parent | 437125c1c6bd65cf863d35cfc898c903cc38db9a (diff) | |
download | org.eclipse.osee-bd8b65d24a79137328eeb14a56ac1d132e0f3f4e.tar.gz org.eclipse.osee-bd8b65d24a79137328eeb14a56ac1d132e0f3f4e.tar.xz org.eclipse.osee-bd8b65d24a79137328eeb14a56ac1d132e0f3f4e.zip |
refactor: Use ArtifactId with branch operations
Change-Id: Icf06e12e787b60aef352bc0294d643089895a1b7
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.rest.model')
5 files changed, 40 insertions, 54 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Branch.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Branch.java index de3875fc5f4..d7406c461d8 100644 --- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Branch.java +++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Branch.java @@ -11,8 +11,8 @@ package org.eclipse.osee.orcs.rest.model; import javax.xml.bind.annotation.XmlRootElement; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.BranchId; -import org.eclipse.osee.framework.core.data.RelationalConstants; import org.eclipse.osee.framework.core.data.TransactionId; import org.eclipse.osee.framework.core.enums.BranchArchivedState; import org.eclipse.osee.framework.core.enums.BranchState; @@ -23,14 +23,11 @@ import org.eclipse.osee.framework.core.enums.BranchType; */ @XmlRootElement public class Branch { - - private static final int DEFAULT_INT = -1; - private long branchUuid; private String name; private BranchId parentBranch; - private int associatedArtifactId = DEFAULT_INT; + private ArtifactId associatedArtifact = ArtifactId.SENTINEL; private TransactionId baseTransaction = TransactionId.SENTINEL; private TransactionId sourceTransaction = TransactionId.SENTINEL; @@ -59,12 +56,12 @@ public class Branch { this.name = name; } - public int getAssociatedArtifactId() { - return associatedArtifactId; + public ArtifactId getAssociatedArtifact() { + return associatedArtifact; } - public void setAssociatedArtifactId(int artId) { - associatedArtifactId = artId; + public void setAssociatedArtifact(ArtifactId associatedArtifact) { + this.associatedArtifact = associatedArtifact; } public TransactionId getBaseTransactionId() { @@ -151,7 +148,7 @@ public class Branch { @Override public String toString() { - return "Branch [branchUuid=" + getBranchUuid() + ", name=" + name + ", parentBranchUuid=" + getParentBranch() + ", associatedArtifactId=" + associatedArtifactId + ", baseTransaction=" + baseTransaction + ", sourceTransaction=" + sourceTransaction + ", archiveState=" + archiveState + ", branchState=" + branchState + ", branchType=" + branchType + ", inheritAccessControl=" + inheritAccessControl + "]"; + return "Branch [branchUuid=" + getBranchUuid() + ", name=" + name + ", parentBranchUuid=" + getParentBranch() + ", associatedArtifactId=" + associatedArtifact + ", baseTransaction=" + baseTransaction + ", sourceTransaction=" + sourceTransaction + ", archiveState=" + archiveState + ", branchState=" + branchState + ", branchType=" + branchType + ", inheritAccessControl=" + inheritAccessControl + "]"; } } diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchCommitOptions.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchCommitOptions.java index e52653ec648..aee81000bbc 100644 --- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchCommitOptions.java +++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchCommitOptions.java @@ -11,24 +11,22 @@ package org.eclipse.osee.orcs.rest.model; import javax.xml.bind.annotation.XmlRootElement; +import org.eclipse.osee.framework.core.data.ArtifactId; /** * @author Roberto E. Escobar */ @XmlRootElement public class BranchCommitOptions { - - private static final int DEFAULT_COMMITTER_ID = -1; - - private int committerId = DEFAULT_COMMITTER_ID; + private ArtifactId committer = ArtifactId.SENTINEL; private boolean archive; - public int getCommitterId() { - return committerId; + public ArtifactId getCommitter() { + return committer; } - public void setCommitterId(int committerId) { - this.committerId = committerId; + public void setCommitter(ArtifactId committer) { + this.committer = committer; } public boolean isArchive() { @@ -38,5 +36,4 @@ public class BranchCommitOptions { public void setArchive(boolean archive) { this.archive = archive; } - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java index b43f0f61124..56b716cd19f 100644 --- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java +++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/BranchEndpoint.java @@ -23,6 +23,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.enums.BranchState; import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.model.change.CompareResults; @@ -155,7 +156,7 @@ public interface BranchEndpoint { @PUT @Path("{branch-uuid}/associated-artifact/{art-id}") - Response associateBranchToArtifact(@PathParam("branch-uuid") long branchUuid, @PathParam("art-id") int artifactId); + Response associateBranchToArtifact(@PathParam("branch-uuid") long branchUuid, @PathParam("art-id") ArtifactId artifact); @PUT @Path("{branch-uuid}/txs/{tx-id}/comment/{tx-comment}") diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/NewBranch.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/NewBranch.java index 51c8120082a..7d766270a15 100644 --- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/NewBranch.java +++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/NewBranch.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.osee.orcs.rest.model; -import javax.xml.bind.annotation.XmlRootElement; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.TransactionId; import org.eclipse.osee.framework.core.enums.BranchType; @@ -18,25 +18,18 @@ import org.eclipse.osee.framework.core.enums.BranchType; /** * @author Roberto E. Escobar */ -@XmlRootElement public class NewBranch { - private String branchName; private BranchId parentBranch; - private int associatedArtifactId; + private ArtifactId associatedArtifact; private BranchType branchType; - - private int authorId; + private ArtifactId author; private TransactionId sourceTransaction; private String creationComment; private int mergeAddressingQueryId; private long mergeDestinationBranchId; private boolean txCopyBranchType; - public NewBranch() { - super(); - } - public String getBranchName() { return branchName; } @@ -45,16 +38,16 @@ public class NewBranch { return parentBranch; } - public int getAssociatedArtifactId() { - return associatedArtifactId; + public ArtifactId getAssociatedArtifact() { + return associatedArtifact; } public BranchType getBranchType() { return branchType; } - public int getAuthorId() { - return authorId; + public ArtifactId getAuthor() { + return author; } public TransactionId getSourceTransaction() { @@ -85,16 +78,16 @@ public class NewBranch { this.parentBranch = parentBranch; } - public void setAssociatedArtifactId(int associatedArtifactId) { - this.associatedArtifactId = associatedArtifactId; + public void setAssociatedArtifact(ArtifactId associatedArtifact) { + this.associatedArtifact = associatedArtifact; } public void setBranchType(BranchType branchType) { this.branchType = branchType; } - public void setAuthorId(int authorId) { - this.authorId = authorId; + public void setAuthor(ArtifactId author) { + this.author = author; } public void setSourceTransactionId(TransactionId sourceTransaction) { @@ -119,7 +112,6 @@ public class NewBranch { @Override public String toString() { - return "NewBranch [branchName=" + branchName + ", parentBranchId=" + parentBranch + ", associatedArtifactId=" + associatedArtifactId + ", branchType=" + branchType + ", authorId=" + authorId + ", sourceTransactionId=" + sourceTransaction + ", creationComment=" + creationComment + ", mergeAddressingQueryId=" + mergeAddressingQueryId + ", mergeDestinationBranchId=" + mergeDestinationBranchId + ", txCopyBranchType=" + txCopyBranchType + "]"; + return "NewBranch [branchName=" + branchName + ", parentBranchId=" + parentBranch + ", associatedArtifactId=" + associatedArtifact + ", branchType=" + branchType + ", authorId=" + author + ", sourceTransactionId=" + sourceTransaction + ", creationComment=" + creationComment + ", mergeAddressingQueryId=" + mergeAddressingQueryId + ", mergeDestinationBranchId=" + mergeDestinationBranchId + ", txCopyBranchType=" + txCopyBranchType + "]"; } - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Transaction.java b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Transaction.java index 92f11450981..f4f90022a52 100644 --- a/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Transaction.java +++ b/plugins/org.eclipse.osee.orcs.rest.model/src/org/eclipse/osee/orcs/rest/model/Transaction.java @@ -10,9 +10,9 @@ *******************************************************************************/ package org.eclipse.osee.orcs.rest.model; -import static org.eclipse.osee.framework.core.data.TransactionId.SENTINEL; import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; +import org.eclipse.osee.framework.core.data.ArtifactId; import org.eclipse.osee.framework.core.data.TransactionId; import org.eclipse.osee.framework.core.enums.TransactionDetailsType; @@ -27,8 +27,8 @@ public class Transaction { private TransactionDetailsType txType; private String comment; private Date timestamp; - private int authorId; - private int commitArtId; + private ArtifactId author; + private ArtifactId commitArtId; public TransactionId getTxId() { return txId; @@ -70,25 +70,24 @@ public class Transaction { this.timestamp = timestamp; } - public int getAuthorId() { - return authorId; + public ArtifactId getAuthor() { + return author; } - public void setAuthorId(int authorId) { - this.authorId = authorId; + public void setAuthor(ArtifactId author) { + this.author = author; } - public int getCommitArtId() { + public ArtifactId getCommitArt() { return commitArtId; } - public void setCommitArtId(int commitArtId) { + public void setCommitArt(ArtifactId commitArtId) { this.commitArtId = commitArtId; } @Override public String toString() { - return "Transaction [txId=" + getTxId() + ", branchUuid=" + branchUuid + ", txType=" + txType + ", comment=" + comment + ", timestamp=" + timestamp + ", authorArtId=" + authorId + ", commitArtId=" + commitArtId + "]"; + return "Transaction [txId=" + getTxId() + ", branchUuid=" + branchUuid + ", txType=" + txType + ", comment=" + comment + ", timestamp=" + timestamp + ", authorArtId=" + author + ", commitArtId=" + commitArtId + "]"; } - -} +}
\ No newline at end of file |