Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-08-15 23:54:14 -0400
committerRyan D. Brooks2017-08-16 11:16:48 -0400
commit835e22ee35906b25687ad43e9c07784911c3e6ef (patch)
tree0e59b9d8b8aeb56b788ea423eeeb2b3dac370f1e
parent77caf6710e37c86faccb6e5f1acbfb8fb5f07e1b (diff)
downloadorg.eclipse.osee-835e22ee35906b25687ad43e9c07784911c3e6ef.tar.gz
org.eclipse.osee-835e22ee35906b25687ad43e9c07784911c3e6ef.tar.xz
org.eclipse.osee-835e22ee35906b25687ad43e9c07784911c3e6ef.zip
refactor: Use ArtifactId in TransactionRecord
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/column/AuthorColumn.java6
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java17
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java22
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/TransactionRecord.java19
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/StubBranchModel.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java4
16 files changed, 58 insertions, 54 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
index 523b918914..5dd20454b0 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
@@ -115,7 +115,7 @@ public class AtsBranchServiceImplTest {
changes.execute();
//Test TxRecords
TransactionRecord txRecord = new TransactionRecord(1234L, SAW_Bld_1, "comment", new Date(0),
- UserManager.getUser().getArtId(), UserManager.getUser().getArtId(), TransactionDetailsType.Baselined);
+ UserManager.getUser(), UserManager.getUser().getArtId(), TransactionDetailsType.Baselined);
Collection<TransactionRecord> commitTxs = new ArrayList<>();
Collection<ICommitConfigItem> configArtSet = new HashSet<>();
commitTxs.add(txRecord);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
index 078479f5c9..533af8f241 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
@@ -134,7 +134,7 @@ public class AtsBranchServiceImpl extends AbstractAtsBranchService {
txQuery.andCommitIds(teamWf.getId().intValue());
txQuery.getResults().forEach(
tx -> commitArtifactIdMap.put(artId, new TransactionRecord(tx.getId(), tx.getBranch(), tx.getComment(),
- tx.getDate(), tx.getAuthor().getId().intValue(), tx.getCommitArt().getId().intValue(), tx.getTxType())));
+ tx.getDate(), tx.getAuthor(), tx.getCommitArt().getId().intValue(), tx.getTxType())));
}
Collection<TransactionRecord> transactions = commitArtifactIdMap.getValues(artId);
return transactions == null ? Collections.emptyList() : transactions;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/column/AuthorColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/column/AuthorColumn.java
index 551f086deb..ea01f20d19 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/column/AuthorColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/history/column/AuthorColumn.java
@@ -19,6 +19,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -32,7 +33,7 @@ import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
*/
public class AuthorColumn extends XViewerValueColumn {
private static AuthorColumn instance = new AuthorColumn();
- private final Map<Integer, String> artIdToName = new HashMap<>(40);
+ private final Map<ArtifactId, String> artIdToName = new HashMap<>(40);
public static AuthorColumn getInstance() {
return instance;
@@ -59,13 +60,14 @@ public class AuthorColumn extends XViewerValueColumn {
if (element instanceof Change) {
try {
TransactionRecord endTx = TransactionManager.getTransaction(((Change) element).getTxDelta().getEndTx());
- int author = endTx.getAuthor();
+ ArtifactId author = endTx.getAuthor();
name = artIdToName.get(author);
if (name == null) {
Artifact art = ArtifactQuery.getArtifactFromId(author, AtsClientService.get().getAtsBranch(),
DeletionFlag.EXCLUDE_DELETED);
if (art != null) {
name = art.getName();
+ artIdToName.put(author, name);
} else {
name = "unknown for " + author;
}
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
index c051027864..e33deb0213 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/ui/skynet/ReplaceWithBaselineTest.java
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.client.test.framework.OseeClientIntegrationRule;
import org.eclipse.osee.client.test.framework.OseeLogMonitorRule;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
@@ -226,7 +227,7 @@ public final class ReplaceWithBaselineTest {
for (TestData testData : this.testDatas) {
if (testData.isBaseline) {
- testData.setArtifactId(createNewArtifact(baselineBranch, GUID.create()).getArtId());
+ testData.setArtifactId(createNewArtifact(baselineBranch, GUID.create()));
}
switch (testData.item) {
@@ -279,7 +280,7 @@ public final class ReplaceWithBaselineTest {
createNewArtifact(baselineBranch, GUID.create()));
}
parentArtifact.persist(testName);
- testData.setArtifactId(parentArtifact.getArtId());
+ testData.setArtifactId(parentArtifact);
break;
}
break;
@@ -308,7 +309,7 @@ public final class ReplaceWithBaselineTest {
case ARTIFACT:
switch (testData.changeItem) {
case NEW:
- testData.setArtifactId(createNewArtifact(workingBranch, GUID.create()).getArtId());
+ testData.setArtifactId(createNewArtifact(workingBranch, GUID.create()));
break;
case INTRODUCED:
BranchId anotherBranch = BranchManager.createWorkingBranch(workingBranch, "another working branch",
@@ -322,7 +323,7 @@ public final class ReplaceWithBaselineTest {
new Artifact[] {artifactToIntroduce}, false);
Operations.executeWork(dropHandler);
- testData.setArtifactId(artifactToIntroduce.getArtId());
+ testData.setArtifactId(artifactToIntroduce);
}
break;
case RELATION:
@@ -420,7 +421,7 @@ public final class ReplaceWithBaselineTest {
newParent.persist(testName);
//This is to revert the child artifact
- testData.setArtifactId(child.getArtId());
+ testData.setArtifactId(child);
child.persist(testName);
break;
case RELATION_ORDER_ATTR:
@@ -477,7 +478,7 @@ public final class ReplaceWithBaselineTest {
public final ChangeItem changeItem;
public final boolean isBaseline;
- private int artifactId;
+ private ArtifactId artifactId;
private RelationTypeSide relationType;
private int bArtifactId;
@@ -523,11 +524,11 @@ public final class ReplaceWithBaselineTest {
this.bArtifactId = bArtifactId;
}
- public int getArtifactId() {
+ public ArtifactId getArtifactId() {
return artifactId;
}
- public void setArtifactId(int artId) {
+ public void setArtifactId(ArtifactId artId) {
artifactId = artId;
}
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
index dd2046e36d..9fd4ad34b5 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.framework.core.data.IAccessContextId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.TokenFactory;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.RelationSorter;
@@ -77,7 +78,8 @@ public final class MockDataFactory {
value++;
}
IOseeBranch branch = IOseeBranch.create(branchUuid, "fake test branch");
- return new TransactionRecord(value * 47L, branch, "comment_" + value, new Date(), value * 37, value * 42, type);
+ return new TransactionRecord(value * 47L, branch, "comment_" + value, new Date(), UserId.valueOf(value * 37),
+ value * 42, type);
}
public static OseeEnumEntry createEnumEntry(int index) {
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
index cffb62c6e9..c65ef49f94 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/type/TransactionRecordTest.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.Date;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionId;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.mocks.MockDataFactory;
@@ -40,20 +41,20 @@ public class TransactionRecordTest {
private final String comment;
private final Date time;
- private final int authorArtId;
+ private final UserId author;
private final int commitArtId;
- public TransactionRecordTest(int transactionNumber, BranchId branch, String comment, Date time, int authorArtId, int commitArtId, TransactionDetailsType txType) {
+ public TransactionRecordTest(int transactionNumber, BranchId branch, String comment, Date time, UserId author, int commitArtId, TransactionDetailsType txType) {
this.transactionNumber = (long) transactionNumber;
this.branch = branch;
this.comment = comment;
this.time = time;
- this.authorArtId = authorArtId;
+ this.author = author;
this.commitArtId = commitArtId;
this.txType = txType;
this.transaction =
- new TransactionRecord(this.transactionNumber, branch, comment, time, authorArtId, commitArtId, txType);
+ new TransactionRecord(this.transactionNumber, branch, comment, time, author, commitArtId, txType);
}
@Test
@@ -94,12 +95,13 @@ public class TransactionRecordTest {
@Test
public void testGetSetAuthor() {
- Assert.assertEquals(authorArtId, transaction.getAuthor());
+ Assert.assertEquals(author, transaction.getAuthor());
- transaction.setAuthor(authorArtId * 101);
- Assert.assertEquals(authorArtId * 101, transaction.getAuthor());
+ UserId otherAuthor = UserId.valueOf(author.getId() * 101);
+ transaction.setAuthor(otherAuthor);
+ Assert.assertEquals(otherAuthor, transaction.getAuthor());
- transaction.setAuthor(authorArtId);
+ transaction.setAuthor(author);
}
@Test
@@ -118,7 +120,7 @@ public class TransactionRecordTest {
TransactionId tx1 = TransactionId.valueOf(tx2.getId());
// Add some variation to tx2 so we are certain that only the txId is used in the equals method;
- tx2.setAuthor(0);
+ tx2.setAuthor(UserId.SENTINEL);
tx2.setComment("a");
tx2.setCommit(1);
tx2.setTimeStamp(new Date(11111111111L));
@@ -155,7 +157,7 @@ public class TransactionRecordTest {
BranchId branch = BranchId.valueOf(index * 9L);
String comment = GUID.create();
Date time = new Date();
- int authorArtId = index * 47;
+ UserId authorArtId = UserId.valueOf(index * 47);
int commitArtId = index * 37;
TransactionDetailsType txType = TransactionDetailsType.toEnum(index % TransactionDetailsType.values().length);
data.add(new Object[] {transactionNumber, branch, comment, time, authorArtId, commitArtId, txType});
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/TransactionRecord.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/TransactionRecord.java
index 3f855acda7..e0cfa32854 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/TransactionRecord.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/TransactionRecord.java
@@ -12,8 +12,10 @@ package org.eclipse.osee.framework.core.model;
import java.util.Date;
import org.eclipse.osee.framework.core.data.Adaptable;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TransactionToken;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.jdk.core.type.BaseId;
import org.eclipse.osee.framework.jdk.core.type.Id;
@@ -23,16 +25,16 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
* @author Jeff C. Phillips
*/
public class TransactionRecord extends BaseId implements TransactionToken, Adaptable {
- public static TransactionRecord SENTINEL =
- new TransactionRecord(Id.SENTINEL, BranchId.SENTINEL, null, null, 0, 0, TransactionDetailsType.INVALID);
+ public static TransactionRecord SENTINEL = new TransactionRecord(Id.SENTINEL, BranchId.SENTINEL, null, null,
+ UserId.SENTINEL, 0, TransactionDetailsType.INVALID);
private final TransactionDetailsType txType;
private final BranchId branch;
private String comment;
private Date time;
- private int authorArtId;
+ private ArtifactId authorArtId;
private int commitArtId;
- public TransactionRecord(Long id, BranchId branch, String comment, Date time, int authorArtId, int commitArtId, TransactionDetailsType txType) {
+ public TransactionRecord(Long id, BranchId branch, String comment, Date time, ArtifactId authorArtId, int commitArtId, TransactionDetailsType txType) {
super(id);
this.branch = branch;
this.comment = Strings.intern(comment);
@@ -55,7 +57,7 @@ public class TransactionRecord extends BaseId implements TransactionToken, Adapt
return time;
}
- public int getAuthor() {
+ public ArtifactId getAuthor() {
return authorArtId;
}
@@ -75,16 +77,11 @@ public class TransactionRecord extends BaseId implements TransactionToken, Adapt
this.time = time;
}
- public void setAuthor(int authorArtId) {
+ public void setAuthor(ArtifactId authorArtId) {
this.authorArtId = authorArtId;
}
public void setCommit(int commitArtId) {
this.commitArtId = commitArtId;
}
-
- @Override
- public String toString() {
- return String.valueOf(getId());
- }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
index 964a26842d..f2db1d1442 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
@@ -124,7 +124,7 @@ public final class UserManager {
return getUserAdmin().getUserNames();
}
- public static String getSafeUserNameById(int userArtifactId) {
+ public static String getSafeUserNameById(ArtifactId userArtifactId) {
UserAdmin userAdmin = null;
try {
userAdmin = getUserAdmin();
@@ -133,10 +133,10 @@ public final class UserManager {
}
String name;
- if (userAdmin != null) {
- name = userAdmin.getSafeUserNameById(ArtifactId.valueOf(userArtifactId));
- } else {
+ if (userAdmin == null) {
name = String.format("Unable resolve user by artId[%s] since userAdmin was unavailable", userArtifactId);
+ } else {
+ name = userAdmin.getSafeUserNameById(userArtifactId);
}
return name;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
index 117f4d4439..4283da756f 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
@@ -106,16 +106,12 @@ public class ArtifactQuery {
/**
* search for exactly one artifact by one its id - otherwise throw an exception
*
- * @param artId the id of the desired artifact
+ * @param artifactId the id of the desired artifact
* @param allowDeleted whether to return the artifact even if it has been deleted
* @return exactly one artifact by one its id - otherwise throw an exception
* @throws ArtifactDoesNotExist if no artifacts are found
*/
- public static Artifact getArtifactFromId(long artId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException {
- return getOrCheckArtifactFromId(ArtifactId.valueOf(artId), branch, allowDeleted, QueryType.GET);
- }
-
- public static Artifact getArtifactFromId(ArtifactId artifactId, BranchId branch, DeletionFlag allowDeleted) throws OseeCoreException {
+ public static Artifact getArtifactFromId(ArtifactId artifactId, BranchId branch, DeletionFlag allowDeleted) {
return getOrCheckArtifactFromId(artifactId, branch, allowDeleted, QueryType.GET);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
index b4759b3678..5054bd747d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/accessors/DatabaseBranchAccessor.java
@@ -9,6 +9,7 @@ import java.util.List;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.BranchViewData;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
@@ -146,7 +147,7 @@ public class DatabaseBranchAccessor implements IOseeDataAccessor<Branch> {
Long transactionId = stmt.getLong(base ? "baseline_transaction_id" : "parent_transaction_id");
String comment = stmt.getString(base ? "b_osee_comment" : "p_osee_comment");
Date timestamp = stmt.getTimestamp(base ? "b_time" : "p_time");
- Integer authorArtId = stmt.getInt(base ? "b_author" : "p_author");
+ UserId authorArtId = UserId.valueOf(stmt.getLong(base ? "b_author" : "p_author"));
Integer commitArtId = stmt.getInt(base ? "b_commit_art_id" : "p_commit_art_id");
TransactionDetailsType txType = TransactionDetailsType.toEnum(stmt.getInt(base ? "b_tx_type" : "p_tx_type"));
return new TransactionRecord(transactionId, branch, comment, timestamp, authorArtId, commitArtId, txType);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
index 9366260384..292f993940 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/SkynetTransaction.java
@@ -395,13 +395,12 @@ public final class SkynetTransaction extends TransactionOperation<BranchId> {
if (comment == null) {
comment = "";
}
- Integer authorArtId = userToBlame.getArtId();
TransactionDetailsType txType = TransactionDetailsType.NonBaselined;
Date timestamp = GlobalTime.GreenwichMeanTimestamp();
//keep transaction id's sequential in the face of concurrent transaction by multiple users
Long txId = ConnectionHandler.getNextSequence("SKYNET_TRANSACTION_ID_SEQ", false);
- return new TransactionRecord(txId, branch, comment, timestamp, authorArtId, 0, txType);
+ return new TransactionRecord(txId, branch, comment, timestamp, userToBlame, 0, txType);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
index 5c8bcd02af..ed6d57a2a4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.data.TransactionToken;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
@@ -183,7 +184,7 @@ public final class TransactionManager {
Long transactionNumber = stmt.getLong("transaction_id");
String comment = stmt.getString("osee_comment");
Date timestamp = stmt.getTimestamp("time");
- Integer authorArtId = stmt.getInt("author");
+ UserId authorArtId = UserId.valueOf(stmt.getLong("author"));
Integer commitArtId = stmt.getInt("commit_art_id");
TransactionDetailsType txType = TransactionDetailsType.toEnum(stmt.getInt("tx_type"));
return new TransactionRecord(transactionNumber, branch, comment, timestamp, authorArtId, commitArtId, txType);
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
index 71004dbc80..d9c3f78003 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -144,7 +145,7 @@ public class GraphLoader {
chStmt.runPreparedQuery(GET_TRANSACTION_DATA, queryId);
while (chStmt.next()) {
BranchId branch = BranchId.valueOf(chStmt.getLong("branch_id"));
- TxData txData = new TxData(branch, chStmt.getInt("author"), chStmt.getTimestamp("time"),
+ TxData txData = new TxData(branch, UserId.valueOf(chStmt.getLong("author")), chStmt.getTimestamp("time"),
chStmt.getString("osee_comment"), chStmt.getInt("tx_type"), chStmt.getInt("commit_art_id"),
chStmt.getLong("transaction_id"));
txDatas.add(txData);
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/StubBranchModel.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/StubBranchModel.java
index e0fa754ba1..0feda31bca 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/StubBranchModel.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/StubBranchModel.java
@@ -15,6 +15,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.data.UserId;
/**
* @author Roberto E. Escobar
@@ -34,7 +35,7 @@ public class StubBranchModel extends BranchModel {
public TxModel addTx(Long value) {
TxModel toReturn = stubs.get(value);
if (toReturn == null) {
- toReturn = new TxModel(new TxData(STUB_BRANCH, 0, new Timestamp(new Date().getTime()),
+ toReturn = new TxModel(new TxData(STUB_BRANCH, UserId.SENTINEL, new Timestamp(new Date().getTime()),
String.format("Transaction: [%s] not found", value), 0, 0, value));
addTx(toReturn);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java
index 0f5022f7dc..b296032c66 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.ui.branch.graph.model;
import java.util.Date;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.model.TransactionRecord;
@@ -23,7 +24,7 @@ import org.eclipse.osee.framework.skynet.core.UserManager;
*/
public class TxData {
- private final int authorId;
+ private final ArtifactId authorId;
private final Date timeStamp;
private final String comment;
private final TransactionDetailsType txType;
@@ -31,7 +32,7 @@ public class TxData {
private final BranchId branch;
private final Long txId;
- public TxData(BranchId branch, int authorId, Date timeStamp, String comment, int txType, int commitArtId, long txId) {
+ public TxData(BranchId branch, ArtifactId authorId, Date timeStamp, String comment, int txType, int commitArtId, long txId) {
this.authorId = authorId;
this.timeStamp = timeStamp;
this.comment = comment;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java
index 0f0f42366e..7ed5cd12db 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/commandHandlers/branch/RenameBranchHandler.java
@@ -123,8 +123,8 @@ public class RenameBranchHandler extends CommandHandler {
}
IOseeBranch branch = branches.get(0);
return AccessControlManager.isOseeAdmin() || BranchManager.getType(
- branch).isWorkingBranch() || BranchManager.getBaseTransaction(
- branch).getAuthor() == UserManager.getUser().getArtId();
+ branch).isWorkingBranch() || BranchManager.getBaseTransaction(branch).getAuthor().equals(
+ UserManager.getUser());
}
}

Back to the top