Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-03-05 17:57:46 -0500
committerRyan D. Brooks2014-03-05 17:57:46 -0500
commite4971322c655d0104031c84d3374c68ab8ade65f (patch)
treed8a1eabb3d102b893351fd61ab244f495fd0c73f /plugins/org.eclipse.osee.framework.core.message/src/org
parentb0bec74eeab68382a089bb715ff09a863c077305 (diff)
downloadorg.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.tar.gz
org.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.tar.xz
org.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.zip
feature[ats_ATS19845]: Update branch creation to set uuid
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationRequest.java12
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCreationRequestTranslator.java5
4 files changed, 19 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
index 26a0658717..428686c92f 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCacheUpdateUtil.java
@@ -63,9 +63,9 @@ public final class BranchCacheUpdateUtil {
for (BranchRow srcItem : cacheMessage.getBranchRows()) {
long branchId = srcItem.getBranchId();
Branch updated =
- factory.createOrUpdate(cache, srcItem.getBranchId(), srcItem.getStorageState(), srcItem.getBranchGuid(),
- srcItem.getBranchName(), srcItem.getBranchType(), srcItem.getBranchState(),
- srcItem.getBranchArchived().isArchived());
+ factory.createOrUpdate(cache, srcItem.getBranchGuid(), srcItem.getBranchId(), srcItem.getBranchName(),
+ srcItem.getBranchType(), srcItem.getBranchState(), srcItem.getBranchArchived().isArchived(),
+ srcItem.getStorageState());
updatedItems.add(updated);
Integer artifactId = branchToAssocArt.get(branchId);
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationRequest.java
index b5a5ebb0fb..a9ae76618f 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationRequest.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationRequest.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.core.message;
import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
/**
* @author Roberto E. Escobar
@@ -30,10 +31,15 @@ public class BranchCreationRequest {
private final int mergeAddressingQueryId;
private final long mergeDestinationBranchId;
private boolean isTxCopyBranchType;
+ private final long branchUuid;
- public BranchCreationRequest(BranchType branchType, int sourceTransactionId, long parentBranchId, String branchGuid, String branchName, int associatedArtifactId, int authorId, String creationComment, int mergeAddressingQueryId, long destinationBranchId) {
+ public BranchCreationRequest(BranchType branchType, int sourceTransactionId, long parentBranchId, String branchGuid, String branchName, long branchUuid, int associatedArtifactId, int authorId, String creationComment, int mergeAddressingQueryId, long destinationBranchId) {
this.parentBranchId = parentBranchId;
this.branchName = branchName;
+ if (branchUuid <= 0) {
+ throw new OseeArgumentException("branchUuid [%d] uuid must be > 0", branchUuid);
+ }
+ this.branchUuid = branchUuid;
this.associatedArtifactId = associatedArtifactId;
this.branchType = branchType;
this.sourceTransactionId = sourceTransactionId;
@@ -97,4 +103,8 @@ public class BranchCreationRequest {
public String toString() {
return "Branch [associatedArtifactId=" + associatedArtifactId + ", branchGuid=" + branchGuid + ", branchType=" + branchType + ", name=" + branchName + ", parentBranchId=" + parentBranchId + ", parentTransactionId=" + sourceTransactionId + "]";
}
+
+ public long getBranchUuid() {
+ return branchUuid;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
index b44d5316fb..bd17e50eec 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchRow.java
@@ -82,7 +82,7 @@ public final class BranchRow {
public static BranchRow fromArray(String[] data) {
BranchArchivedState archived = BranchArchivedState.valueOf(data[0]);
String branchGuid = data[1];
- int branchId = Integer.valueOf(data[2]);
+ long branchId = Long.valueOf(data[2]);
String branchName = data[3];
BranchState branchState = BranchState.valueOf(data[4]);
BranchType branchType = BranchType.valueOf(data[5]);
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCreationRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCreationRequestTranslator.java
index 56429ae8a9..09d51cd337 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCreationRequestTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/BranchCreationRequestTranslator.java
@@ -28,6 +28,7 @@ public class BranchCreationRequestTranslator implements ITranslator<BranchCreati
BRANCH_TYPE,
SOURCE_TX_ID,
BRANCH_GUID,
+ BRANCH_UUID,
AUTHOR_ID,
@@ -55,9 +56,10 @@ public class BranchCreationRequestTranslator implements ITranslator<BranchCreati
int mergeAddressingQueryId = store.getInt(Fields.MERGE_ADDRESSING_QUERY_ID.name());
int destinationBranchId = store.getInt(Fields.MERGE_DESTINATION_BRANCH_ID.name());
+ long branchUuid = store.getLong(Fields.BRANCH_UUID.name());
BranchCreationRequest branchCreationRequest =
- new BranchCreationRequest(branchType, sourceTransactionId, parentBranchId, branchGuid, branchName,
+ new BranchCreationRequest(branchType, sourceTransactionId, parentBranchId, branchGuid, branchName, branchUuid,
associatedArtifactId, authorId, creationComment, mergeAddressingQueryId, destinationBranchId);
branchCreationRequest.setTxIsCopied(isTxCopy);
@@ -74,6 +76,7 @@ public class BranchCreationRequestTranslator implements ITranslator<BranchCreati
store.put(Fields.BRANCH_TYPE.name(), object.getBranchType().name());
store.put(Fields.SOURCE_TX_ID.name(), object.getSourceTransactionId());
store.put(Fields.BRANCH_GUID.name(), object.getBranchGuid());
+ store.put(Fields.BRANCH_UUID.name(), object.getBranchUuid());
store.put(Fields.AUTHOR_ID.name(), object.getAuthorId());
store.put(Fields.CREATION_COMMENT.name(), object.getCreationComment());

Back to the top