diff options
author | jmisinco | 2013-10-25 15:28:30 +0000 |
---|---|---|
committer | jmisinco | 2013-11-04 17:05:54 +0000 |
commit | 1dd2453be862c689cd7506aa9ae195850c04ee6e (patch) | |
tree | 519c87c8202e17aa8d6d75cab7197437505103c1 /plugins/org.eclipse.osee.framework.core.message | |
parent | 63693d264eddca2a6c1ac2b08bd91fec05ab3e2d (diff) | |
download | org.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.tar.gz org.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.tar.xz org.eclipse.osee-1dd2453be862c689cd7506aa9ae195850c04ee6e.zip |
feature[ats_ZQZZF]: Change identity service to return longs for local ids
Change-Id: I1f0d06787affd6582551254ec6170785f5c56fe7
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.message')
18 files changed, 144 insertions, 120 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java index 8ce34099218..09cba7ce782 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AbstractBranchCacheMessage.java @@ -22,20 +22,20 @@ import org.eclipse.osee.framework.jdk.core.type.Triplet; public abstract class AbstractBranchCacheMessage { private final List<BranchRow> rows; - private final Map<Integer, Integer> childToParent; - private final Map<Integer, Integer> branchToBaseTx; - private final Map<Integer, Integer> branchToSourceTx; - private final Map<Integer, Integer> branchToAssocArt; - private final Map<Integer, String[]> branchToAliases; + private final Map<Long, Long> childToParent; + private final Map<Long, Integer> branchToBaseTx; + private final Map<Long, Integer> branchToSourceTx; + private final Map<Long, Integer> branchToAssocArt; + private final Map<Long, String[]> branchToAliases; private final List<Triplet<String, String, String>> srcDestMerge; protected AbstractBranchCacheMessage() { this.rows = new ArrayList<BranchRow>(); - this.childToParent = new HashMap<Integer, Integer>(); - this.branchToBaseTx = new HashMap<Integer, Integer>(); - this.branchToSourceTx = new HashMap<Integer, Integer>(); - this.branchToAssocArt = new HashMap<Integer, Integer>(); - this.branchToAliases = new HashMap<Integer, String[]>(); + this.childToParent = new HashMap<Long, Long>(); + this.branchToBaseTx = new HashMap<Long, Integer>(); + this.branchToSourceTx = new HashMap<Long, Integer>(); + this.branchToAssocArt = new HashMap<Long, Integer>(); + this.branchToAliases = new HashMap<Long, String[]>(); this.srcDestMerge = new ArrayList<Triplet<String, String, String>>(); } @@ -43,23 +43,23 @@ public abstract class AbstractBranchCacheMessage { return rows; } - public Map<Integer, Integer> getChildToParent() { + public Map<Long, Long> getChildToParent() { return childToParent; } - public Map<Integer, Integer> getBranchToBaseTx() { + public Map<Long, Integer> getBranchToBaseTx() { return branchToBaseTx; } - public Map<Integer, Integer> getBranchToSourceTx() { + public Map<Long, Integer> getBranchToSourceTx() { return branchToSourceTx; } - public Map<Integer, Integer> getBranchToAssocArt() { + public Map<Long, Integer> getBranchToAssocArt() { return branchToAssocArt; } - public Map<Integer, String[]> getBranchAliases() { + public Map<Long, String[]> getBranchAliases() { return branchToAliases; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java index 9d1d4949b09..fd8e99d5672 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ArtifactTypeCacheUpdateResponse.java @@ -21,10 +21,10 @@ import org.eclipse.osee.framework.jdk.core.type.Triplet; public class ArtifactTypeCacheUpdateResponse { private final List<ArtifactTypeRow> rows; - private final Map<Integer, Integer[]> baseToSuper; + private final Map<Long, Long[]> baseToSuper; private final List<Triplet<Long, String, Long>> artAttrs; - public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Integer, Integer[]> baseToSuper, List<Triplet<Long, String, Long>> artAttrs) { + public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Long, Long[]> baseToSuper, List<Triplet<Long, String, Long>> artAttrs) { this.rows = rows; this.baseToSuper = baseToSuper; this.artAttrs = artAttrs; @@ -34,7 +34,7 @@ public class ArtifactTypeCacheUpdateResponse { return rows; } - public Map<Integer, Integer[]> getBaseToSuperTypes() { + public Map<Long, Long[]> getBaseToSuperTypes() { return baseToSuper; } @@ -43,13 +43,13 @@ public class ArtifactTypeCacheUpdateResponse { } public static final class ArtifactTypeRow { - private final int id; + private final long id; private final String name; private final Long guid; private final boolean isAbstract; private StorageState storageState; - public ArtifactTypeRow(int id, Long guid, String name, boolean isAbstract, StorageState storageState) { + public ArtifactTypeRow(long id, Long guid, String name, boolean isAbstract, StorageState storageState) { this.id = id; this.guid = guid; this.name = name; @@ -57,7 +57,7 @@ public class ArtifactTypeCacheUpdateResponse { this.storageState = storageState; } - public int getId() { + public long getId() { return id; } @@ -91,7 +91,7 @@ public class ArtifactTypeCacheUpdateResponse { } public static ArtifactTypeRow fromArray(String[] data) { - int id = Integer.valueOf(data[0]); + long id = Long.valueOf(data[0]); long remoteId = Long.parseLong(data[1]); String name = data[2]; boolean isAbstract = Boolean.valueOf(data[3]); diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java index 58c30adf2c1..ec608d0fc48 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java @@ -20,9 +20,9 @@ import org.eclipse.osee.framework.core.model.type.AttributeType; public class AttributeTypeCacheUpdateResponse { private final List<AttributeType> rows; - private final Map<Integer, Integer> attrToEnum; + private final Map<Long, Long> attrToEnum; - public AttributeTypeCacheUpdateResponse(List<AttributeType> rows, Map<Integer, Integer> attrToEnum) { + public AttributeTypeCacheUpdateResponse(List<AttributeType> rows, Map<Long, Long> attrToEnum) { this.rows = rows; this.attrToEnum = attrToEnum; } @@ -31,7 +31,7 @@ public class AttributeTypeCacheUpdateResponse { return rows; } - public Map<Integer, Integer> getAttrToEnums() { + public Map<Long, Long> getAttrToEnums() { return attrToEnum; } 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 d2991d7ca8c..26a0658717c 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 @@ -56,12 +56,12 @@ public final class BranchCacheUpdateUtil { public Collection<Branch> updateCache(AbstractBranchCacheMessage cacheMessage, IOseeCache<String, Branch> cache) throws OseeCoreException { List<Branch> updatedItems = new ArrayList<Branch>(); - Map<Integer, Integer> branchToAssocArt = cacheMessage.getBranchToAssocArt(); + Map<Long, Integer> branchToAssocArt = cacheMessage.getBranchToAssocArt(); preLoadTransactions(cacheMessage); for (BranchRow srcItem : cacheMessage.getBranchRows()) { - int branchId = srcItem.getBranchId(); + long branchId = srcItem.getBranchId(); Branch updated = factory.createOrUpdate(cache, srcItem.getBranchId(), srcItem.getStorageState(), srcItem.getBranchGuid(), srcItem.getBranchName(), srcItem.getBranchType(), srcItem.getBranchState(), @@ -77,7 +77,7 @@ public final class BranchCacheUpdateUtil { updated.setSourceTransaction(getTx(cacheMessage.getBranchToSourceTx(), branchId)); } - for (Entry<Integer, Integer> entry : cacheMessage.getChildToParent().entrySet()) { + for (Entry<Long, Long> entry : cacheMessage.getChildToParent().entrySet()) { Branch parent = cache.getById(entry.getValue()); if (parent != null) { Branch child = cache.getById(entry.getKey()); @@ -119,7 +119,7 @@ public final class BranchCacheUpdateUtil { } } - private TransactionRecord getTx(Map<Integer, Integer> branchToTx, Integer branchId) throws OseeCoreException { + private TransactionRecord getTx(Map<Long, Integer> branchToTx, Long branchId) throws OseeCoreException { TransactionRecord tx = null; Integer txId = branchToTx.get(branchId); if (txId != null && txId > 0) { @@ -130,7 +130,7 @@ public final class BranchCacheUpdateUtil { public static void loadFromCache(AbstractBranchCacheMessage message, Collection<Branch> types) throws OseeCoreException { for (Branch br : types) { - Integer branchId = br.getId(); + Long branchId = br.getId(); message.getBranchRows().add( new BranchRow(br.getId(), br.getGuid(), br.getName(), br.getBranchType(), br.getBranchState(), br.getArchiveState(), br.getStorageState())); @@ -146,7 +146,7 @@ public final class BranchCacheUpdateUtil { } } - private static void addAssocArtifact(Map<Integer, Integer> map, Integer branchId, Integer artId) { + private static void addAssocArtifact(Map<Long, Integer> map, Long branchId, Integer artId) { if (artId != null) { map.put(branchId, artId); } else { @@ -161,7 +161,7 @@ public final class BranchCacheUpdateUtil { srcDestMerge.add(new Triplet<String, String, String>(src, dest, merge)); } - private static void addTxRecord(Map<Integer, Integer> map, Integer branchId, TransactionRecord toAdd) { + private static void addTxRecord(Map<Long, Integer> map, Long branchId, TransactionRecord toAdd) { if (toAdd != null) { map.put(branchId, toAdd.getId()); } else { @@ -176,7 +176,7 @@ public final class BranchCacheUpdateUtil { String[] rowData = store.getArray(TranslationUtil.createKey(Fields.BRANCH_ROW, index)); rows.add(BranchRow.fromArray(rowData)); } - TranslationUtil.loadMap(message.getChildToParent(), store, Fields.CHILD_TO_PARENT); + TranslationUtil.loadMapLong(message.getChildToParent(), store, Fields.CHILD_TO_PARENT); TranslationUtil.loadMap(message.getBranchToBaseTx(), store, Fields.BRANCH_TO_BASE_TX); TranslationUtil.loadMap(message.getBranchToSourceTx(), store, Fields.BRANCH_TO_SRC_TX); TranslationUtil.loadMap(message.getBranchToAssocArt(), store, Fields.BRANCH_TO_ASSOC_ART); @@ -192,7 +192,7 @@ public final class BranchCacheUpdateUtil { } store.put(Fields.BRANCH_COUNT.name(), rows.size()); - TranslationUtil.putMap(store, Fields.CHILD_TO_PARENT, message.getChildToParent()); + TranslationUtil.putMapLong(store, Fields.CHILD_TO_PARENT, message.getChildToParent()); TranslationUtil.putMap(store, Fields.BRANCH_TO_BASE_TX, message.getBranchToBaseTx()); TranslationUtil.putMap(store, Fields.BRANCH_TO_SRC_TX, message.getBranchToSourceTx()); TranslationUtil.putMap(store, Fields.BRANCH_TO_ASSOC_ART, message.getBranchToAssocArt()); diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitRequest.java index 71144edb4bd..065cc1ed578 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCommitRequest.java @@ -16,11 +16,11 @@ package org.eclipse.osee.framework.core.message; public class BranchCommitRequest { private final int userArtifact; - private final int sourceBranch; - private final int destinationBranch; + private final long sourceBranch; + private final long destinationBranch; private final boolean isArchiveAllowed; - public BranchCommitRequest(int userArtifact, int sourceBranch, int destinationBranch, boolean isArchiveAllowed) { + public BranchCommitRequest(int userArtifact, long sourceBranch, long destinationBranch, boolean isArchiveAllowed) { super(); this.userArtifact = userArtifact; this.sourceBranch = sourceBranch; @@ -32,11 +32,11 @@ public class BranchCommitRequest { return userArtifact; } - public int getSourceBranchId() { + public long getSourceBranchId() { return sourceBranch; } - public int getDestinationBranchId() { + public long getDestinationBranchId() { return destinationBranch; } 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 aed5c5ca718..b5a5ebb0fbf 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 @@ -17,7 +17,7 @@ import org.eclipse.osee.framework.core.enums.BranchType; */ public class BranchCreationRequest { private final String branchName; - private final int parentBranchId; + private final long parentBranchId; private final int associatedArtifactId; private final BranchType branchType; @@ -28,10 +28,10 @@ public class BranchCreationRequest { private final String creationComment; private final int mergeAddressingQueryId; - private final int mergeDestinationBranchId; + private final long mergeDestinationBranchId; private boolean isTxCopyBranchType; - public BranchCreationRequest(BranchType branchType, int sourceTransactionId, int parentBranchId, String branchGuid, String branchName, int associatedArtifactId, int authorId, String creationComment, int mergeAddressingQueryId, int destinationBranchId) { + public BranchCreationRequest(BranchType branchType, int sourceTransactionId, long parentBranchId, String branchGuid, String branchName, int associatedArtifactId, int authorId, String creationComment, int mergeAddressingQueryId, long destinationBranchId) { this.parentBranchId = parentBranchId; this.branchName = branchName; this.associatedArtifactId = associatedArtifactId; @@ -49,7 +49,7 @@ public class BranchCreationRequest { return branchName; } - public int getParentBranchId() { + public long getParentBranchId() { return parentBranchId; } @@ -81,7 +81,7 @@ public class BranchCreationRequest { return mergeAddressingQueryId; } - public int getMergeDestinationBranchId() { + public long getMergeDestinationBranchId() { return mergeDestinationBranchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationResponse.java index db2d09c156f..a2fb2968959 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationResponse.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/BranchCreationResponse.java @@ -15,17 +15,17 @@ package org.eclipse.osee.framework.core.message; */ public class BranchCreationResponse { - private int branchId; + private long branchId; - public BranchCreationResponse(int branchId) { + public BranchCreationResponse(long branchId) { this.branchId = branchId; } - public int getBranchId() { + public long getBranchId() { return branchId; } - public void setBranchId(int branchId) { + public void setBranchId(long branchId) { this.branchId = branchId; } 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 4aa7cade73e..b44d5316fbb 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 @@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.enums.BranchType; import org.eclipse.osee.framework.core.enums.StorageState; public final class BranchRow { - private final int branchId; + private final long branchId; private final String branchGuid; private final String branchName; @@ -30,7 +30,7 @@ public final class BranchRow { this.storageState = storageState; } - public BranchRow(int branchId, String branchGuid, String branchName, BranchType branchType, BranchState branchState, BranchArchivedState branchArchived, StorageState storageState) { + public BranchRow(long branchId, String branchGuid, String branchName, BranchType branchType, BranchState branchState, BranchArchivedState branchArchived, StorageState storageState) { this.branchId = branchId; this.branchGuid = branchGuid; this.branchName = branchName; @@ -40,7 +40,7 @@ public final class BranchRow { this.storageState = storageState; } - public int getBranchId() { + public long getBranchId() { return branchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchArchiveStateRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchArchiveStateRequest.java index 46406482177..87b707c169a 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchArchiveStateRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchArchiveStateRequest.java @@ -16,16 +16,16 @@ import org.eclipse.osee.framework.core.enums.BranchArchivedState; * @author Megumi Telles */ public class ChangeBranchArchiveStateRequest { - private final int branchId; + private final long branchId; private final BranchArchivedState state; - public ChangeBranchArchiveStateRequest(int branchId, BranchArchivedState state) { + public ChangeBranchArchiveStateRequest(long branchId, BranchArchivedState state) { super(); this.branchId = branchId; this.state = state; } - public int getBranchId() { + public long getBranchId() { return branchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchStateRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchStateRequest.java index 9b49e2c696a..aac473a230b 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchStateRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchStateRequest.java @@ -16,16 +16,16 @@ import org.eclipse.osee.framework.core.enums.BranchState; * @author Megumi Telles */ public class ChangeBranchStateRequest { - private final int branchId; + private final long branchId; private final BranchState state; - public ChangeBranchStateRequest(int branchId, BranchState state) { + public ChangeBranchStateRequest(long branchId, BranchState state) { super(); this.branchId = branchId; this.state = state; } - public int getBranchId() { + public long getBranchId() { return branchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchTypeRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchTypeRequest.java index cea7d5443af..477e4582e24 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchTypeRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/ChangeBranchTypeRequest.java @@ -16,16 +16,16 @@ import org.eclipse.osee.framework.core.enums.BranchType; * @author Megumi Telles */ public class ChangeBranchTypeRequest { - private final int branchId; + private final long branchId; private final BranchType type; - public ChangeBranchTypeRequest(int branchId, BranchType type) { + public ChangeBranchTypeRequest(long branchId, BranchType type) { super(); this.branchId = branchId; this.type = type; } - public int getBranchId() { + public long getBranchId() { return branchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java index fc4d27c5bed..7b6236bc361 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/PurgeBranchRequest.java @@ -15,15 +15,15 @@ package org.eclipse.osee.framework.core.message; * @author Megumi Telles */ public class PurgeBranchRequest { - private final int branchId; + private final long branchId; private final boolean recursive; - public PurgeBranchRequest(int branchId, boolean recursive) { + public PurgeBranchRequest(long branchId, boolean recursive) { this.branchId = branchId; this.recursive = recursive; } - public int getBranchId() { + public long getBranchId() { return branchId; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java index 135e6d23d38..2f49b81a143 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java @@ -30,19 +30,19 @@ public class RelationTypeCacheUpdateResponse { } public static final class RelationTypeRow { - private final int id; + private final long id; private final String name; private final long guid; private StorageState storageState; private final String sideAName; private final String sideBName; - private final int artifactTypeSideA; - private final int artifactTypeSideB; + private final long artifactTypeSideA; + private final long artifactTypeSideB; private final RelationTypeMultiplicity multiplicity; private final String defaultOrderTypeGuid; - public RelationTypeRow(int id, String name, long guid, StorageState storageState, String sideAName, String sideBName, int artifactTypeSideA, int artifactTypeSideB, RelationTypeMultiplicity multiplicity, String defaultOrderTypeGuid) { + public RelationTypeRow(long id, String name, long guid, StorageState storageState, String sideAName, String sideBName, long artifactTypeSideA, long artifactTypeSideB, RelationTypeMultiplicity multiplicity, String defaultOrderTypeGuid) { super(); this.id = id; this.name = name; @@ -56,15 +56,15 @@ public class RelationTypeCacheUpdateResponse { this.defaultOrderTypeGuid = defaultOrderTypeGuid; } - public int getArtifactTypeSideA() { + public long getArtifactTypeSideA() { return artifactTypeSideA; } - public int getArtifactTypeSideB() { + public long getArtifactTypeSideB() { return artifactTypeSideB; } - public int getId() { + public long getId() { return id; } @@ -117,15 +117,15 @@ public class RelationTypeCacheUpdateResponse { public static RelationTypeRow fromArray(String[] data) { int index = 0; - int id = Integer.valueOf(data[index++]); + long id = Long.valueOf(data[index++]); long guid = Long.valueOf(data[index++]); String name = data[index++]; StorageState storageState = StorageState.valueOf(data[index++]); String sideAName = data[index++]; String sideBName = data[index++]; - int artifactTypeSideA = Integer.valueOf(data[index++]); - int artifactTypeSideB = Integer.valueOf(data[index++]); + long artifactTypeSideA = Long.valueOf(data[index++]); + long artifactTypeSideB = Long.valueOf(data[index++]); RelationTypeMultiplicity multiplicity = RelationTypeMultiplicity.valueOf(data[index++]); String defaultOrderTypeGuid = data[index++]; diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchResponse.java index 2f97e64cece..8f407744ea3 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchResponse.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/SearchResponse.java @@ -27,8 +27,8 @@ import org.eclipse.osee.framework.jdk.core.util.Strings; public class SearchResponse { private final Map<String, Long> searchTags = new LinkedHashMap<String, Long>(); - private final CompositeKeyHashMap<Integer, Integer, ArtifactMatchMetaData> data = - new CompositeKeyHashMap<Integer, Integer, ArtifactMatchMetaData>(); + private final CompositeKeyHashMap<Long, Integer, ArtifactMatchMetaData> data = + new CompositeKeyHashMap<Long, Integer, ArtifactMatchMetaData>(); private String errorMessage; @@ -48,22 +48,22 @@ public class SearchResponse { return searchTags; } - public AttributeMatchMetaData add(int branchId, int artId, long gammaId) { + public AttributeMatchMetaData add(long branchId, int artId, long gammaId) { ArtifactMatchMetaData artifact = getOrCreateArtifactMatch(branchId, artId); return artifact.getOrCreate(artId, gammaId); } - public void add(int branchId, int artId, long gammaId, int startPosition, int endPosition) { + public void add(long branchId, int artId, long gammaId, int startPosition, int endPosition) { AttributeMatchMetaData attribute = add(branchId, artId, gammaId); attribute.addLocation(startPosition, endPosition); } - public void add(int branchId, int artId, long gammaId, Collection<MatchLocation> matches) { + public void add(long branchId, int artId, long gammaId, Collection<MatchLocation> matches) { AttributeMatchMetaData attribute = add(branchId, artId, gammaId); attribute.addLocations(matches); } - private ArtifactMatchMetaData getOrCreateArtifactMatch(int branchId, int artId) { + private ArtifactMatchMetaData getOrCreateArtifactMatch(long branchId, int artId) { ArtifactMatchMetaData artifact = getArtifactMatch(branchId, artId); if (artifact == null) { artifact = new ArtifactMatchMetaData(branchId, artId); @@ -84,23 +84,23 @@ public class SearchResponse { return count; } - public Set<Integer> getBranchIds() { - Set<Integer> branchIds = new HashSet<Integer>(); - for (Pair<Integer, Integer> entry : data.getEnumeratedKeys()) { + public Set<Long> getBranchIds() { + Set<Long> branchIds = new HashSet<Long>(); + for (Pair<Long, Integer> entry : data.getEnumeratedKeys()) { branchIds.add(entry.getFirst()); } return branchIds; } - public Collection<Integer> getArtifactIds(int branchId) { + public Collection<Integer> getArtifactIds(long branchId) { return data.getKeyedValues(branchId).keySet(); } - public Collection<ArtifactMatchMetaData> getArtifacts(int branchId) { + public Collection<ArtifactMatchMetaData> getArtifacts(long branchId) { return data.getValues(branchId); } - public ArtifactMatchMetaData getArtifactMatch(int branchId, int artId) { + public ArtifactMatchMetaData getArtifactMatch(long branchId, int artId) { return data.get(branchId, artId); } @@ -110,10 +110,10 @@ public class SearchResponse { public static final class ArtifactMatchMetaData { private final int artId; - private final int branchId; + private final Long branchId; private final Map<Long, AttributeMatchMetaData> attributeMatch = new HashMap<Long, AttributeMatchMetaData>(); - public ArtifactMatchMetaData(int branchId, int artId) { + public ArtifactMatchMetaData(long branchId, int artId) { this.branchId = branchId; this.artId = artId; } @@ -122,7 +122,7 @@ public class SearchResponse { return artId; } - public int getBranchId() { + public long getBranchId() { return branchId; } @@ -160,7 +160,7 @@ public class SearchResponse { final int prime = 11; int result = 1; result = prime * result + (artId * 53); - result = prime * result + (branchId * 11); + result = prime * result + (branchId.hashCode() * 11); return result; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java index ea91355d141..d3249606fb4 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java @@ -25,19 +25,27 @@ public final class TranslationUtil { //Utility Class } - public static void loadArrayMap(Map<Integer, String[]> map, PropertyStore store, Enum<?> key) { + public static void loadArrayMap(Map<Long, String[]> map, PropertyStore store, Enum<?> key) { storeToArrayMap(map, store.getPropertyStore(key.name())); } - public static void loadMap(Map<Integer, Integer> map, PropertyStore store, Enum<?> key) { + public static void loadMap(Map<Long, Integer> map, PropertyStore store, Enum<?> key) { storeToMap(map, store.getPropertyStore(key.name())); } - public static void putMap(PropertyStore store, Enum<?> key, Map<Integer, Integer> map) { + public static void loadMapLong(Map<Long, Long> map, PropertyStore store, Enum<?> key) { + storeToMapLong(map, store.getPropertyStore(key.name())); + } + + public static void putMap(PropertyStore store, Enum<?> key, Map<Long, Integer> map) { store.put(key.name(), mapToStore(map)); } - public static void putArrayMap(PropertyStore store, Enum<?> key, Map<Integer, String[]> map) { + public static void putMapLong(PropertyStore store, Enum<?> key, Map<Long, Long> map) { + store.put(key.name(), mapToStoreLong(map)); + } + + public static void putArrayMap(PropertyStore store, Enum<?> key, Map<Long, String[]> map) { store.put(key.name(), arrayMapToStore(map)); } @@ -57,18 +65,18 @@ public final class TranslationUtil { store.put(key.name(), tripletLongListToStore(list)); } - private static PropertyStore arrayMapToStore(Map<Integer, String[]> map) { + private static PropertyStore arrayMapToStore(Map<Long, String[]> map) { PropertyStore innerStore = new PropertyStore(); - for (Entry<Integer, String[]> entry : map.entrySet()) { + for (Entry<Long, String[]> entry : map.entrySet()) { innerStore.put(String.valueOf(entry.getKey()), entry.getValue()); } return innerStore; } - private static PropertyStore intArrayMapToStore(Map<Integer, Integer[]> map) { + private static PropertyStore longArrayMapToStore(Map<Long, Long[]> map) { PropertyStore innerStore = new PropertyStore(); - for (Entry<Integer, Integer[]> entry : map.entrySet()) { - Integer[] values = entry.getValue(); + for (Entry<Long, Long[]> entry : map.entrySet()) { + Long[] values = entry.getValue(); String[] data = new String[values.length]; for (int index = 0; index < values.length; index++) { data[index] = String.valueOf(values[index]); @@ -78,37 +86,53 @@ public final class TranslationUtil { return innerStore; } - private static PropertyStore mapToStore(Map<Integer, Integer> map) { + private static PropertyStore mapToStore(Map<Long, Integer> map) { PropertyStore innerStore = new PropertyStore(); - for (Entry<Integer, Integer> entry : map.entrySet()) { + for (Entry<Long, Integer> entry : map.entrySet()) { innerStore.put(String.valueOf(entry.getKey()), entry.getValue()); } return innerStore; } - private static void storeToMap(Map<Integer, Integer> map, PropertyStore innerStore) { + private static PropertyStore mapToStoreLong(Map<Long, Long> map) { + PropertyStore innerStore = new PropertyStore(); + for (Entry<Long, Long> entry : map.entrySet()) { + innerStore.put(String.valueOf(entry.getKey()), entry.getValue()); + } + return innerStore; + } + + private static void storeToMap(Map<Long, Integer> map, PropertyStore innerStore) { for (String strkey : innerStore.keySet()) { - Integer key = Integer.valueOf(strkey); + Long key = Long.valueOf(strkey); Integer value = innerStore.getInt(strkey); map.put(key, value); } } - private static void storeToArrayMap(Map<Integer, String[]> map, PropertyStore innerStore) { + private static void storeToMapLong(Map<Long, Long> map, PropertyStore innerStore) { + for (String strkey : innerStore.keySet()) { + Long key = Long.valueOf(strkey); + Long value = innerStore.getLong(strkey); + map.put(key, value); + } + } + + private static void storeToArrayMap(Map<Long, String[]> map, PropertyStore innerStore) { for (String strkey : innerStore.arrayKeySet()) { - Integer key = Integer.valueOf(strkey); + Long key = Long.valueOf(strkey); String[] value = innerStore.getArray(strkey); map.put(key, value); } } - private static void storeToIntArrayMap(Map<Integer, Integer[]> map, PropertyStore innerStore) { + private static void storeToLongArrayMap(Map<Long, Long[]> map, PropertyStore innerStore) { for (String strkey : innerStore.arrayKeySet()) { - Integer key = Integer.valueOf(strkey); + Long key = Long.valueOf(strkey); String[] value = innerStore.getArray(strkey); - Integer[] intValues = new Integer[value.length]; + Long[] intValues = new Long[value.length]; for (int index = 0; index < value.length; index++) { - intValues[index] = Integer.valueOf(value[index]); + intValues[index] = Long.valueOf(value[index]); } map.put(key, intValues); } @@ -151,12 +175,12 @@ public final class TranslationUtil { return innerStore; } - public static void loadIntArrayMap(Map<Integer, Integer[]> map, PropertyStore store, Enum<?> key) { - storeToIntArrayMap(map, store.getPropertyStore(key.name())); + public static void loadLongArrayMap(Map<Long, Long[]> map, PropertyStore store, Enum<?> key) { + storeToLongArrayMap(map, store.getPropertyStore(key.name())); } - public static void putIntArrayMap(PropertyStore store, Enum<?> key, Map<Integer, Integer[]> map) { - store.put(key.name(), intArrayMapToStore(map)); + public static void putLongArrayMap(PropertyStore store, Enum<?> key, Map<Long, Long[]> map) { + store.put(key.name(), longArrayMapToStore(map)); } public static String createKey(Enum<?> prefix, int index) { diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java index 42a0d312291..70e57dff817 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java @@ -36,7 +36,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar @Override public ArtifactTypeCacheUpdateResponse convert(PropertyStore store) { List<ArtifactTypeRow> rows = new ArrayList<ArtifactTypeRow>(); - Map<Integer, Integer[]> baseToSuper = new HashMap<Integer, Integer[]>(); + Map<Long, Long[]> baseToSuper = new HashMap<Long, Long[]>(); List<Triplet<Long, String, Long>> artAttrs = new ArrayList<Triplet<Long, String, Long>>(); int rowCount = store.getInt(Fields.ITEM_COUNT.name()); @@ -45,7 +45,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar rows.add(ArtifactTypeRow.fromArray(rowData)); } - TranslationUtil.loadIntArrayMap(baseToSuper, store, Fields.BASE_TO_SUPER_TYPES); + TranslationUtil.loadLongArrayMap(baseToSuper, store, Fields.BASE_TO_SUPER_TYPES); TranslationUtil.loadTripletLongList(artAttrs, store, Fields.BASE_BRANCH_ATTR); return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs); } @@ -60,7 +60,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar } store.put(Fields.ITEM_COUNT.name(), rows.size()); - TranslationUtil.putIntArrayMap(store, Fields.BASE_TO_SUPER_TYPES, object.getBaseToSuperTypes()); + TranslationUtil.putLongArrayMap(store, Fields.BASE_TO_SUPER_TYPES, object.getBaseToSuperTypes()); TranslationUtil.putTripletLongList(store, Fields.BASE_BRANCH_ATTR, object.getAttributeTypes()); return store; } diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java index dcc64852dcb..87ca0027e59 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java @@ -53,8 +53,8 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A String[] rowData = store.getArray(createKey(Fields.ROW, index)); rows.add(createfromArray(factory, rowData)); } - Map<Integer, Integer> attrToEnum = new HashMap<Integer, Integer>(); - TranslationUtil.loadMap(attrToEnum, store, Fields.ATTR_TO_ENUM); + Map<Long, Long> attrToEnum = new HashMap<Long, Long>(); + TranslationUtil.loadMapLong(attrToEnum, store, Fields.ATTR_TO_ENUM); return new AttributeTypeCacheUpdateResponse(rows, attrToEnum); } @@ -68,7 +68,7 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A } store.put(Fields.ROW_COUNT.name(), rows.size()); - TranslationUtil.putMap(store, Fields.ATTR_TO_ENUM, object.getAttrToEnums()); + TranslationUtil.putMapLong(store, Fields.ATTR_TO_ENUM, object.getAttrToEnums()); return store; } @@ -100,7 +100,7 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A String description = data[3]; String fileTypeExtension = data[4]; long remoteId = Long.valueOf(data[5]); - int uniqueId = Integer.valueOf(data[6]); + long uniqueId = Long.valueOf(data[6]); int maxOccurrences = Integer.valueOf(data[7]); int minOccurrences = Integer.valueOf(data[8]); StorageState storageState = StorageState.valueOf(data[9]); diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchResponseTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchResponseTranslator.java index 3807f4ea57d..2b74cd6c009 100644 --- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchResponseTranslator.java +++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchResponseTranslator.java @@ -103,7 +103,7 @@ public class SearchResponseTranslator implements ITranslator<SearchResponse> { private Collection<String[]> toArray(SearchResponse object) { Collection<String[]> toReturn = new ArrayList<String[]>(); for (ArtifactMatchMetaData artMeta : object.getAll()) { - int branchId = artMeta.getBranchId(); + long branchId = artMeta.getBranchId(); for (AttributeMatchMetaData attrMeta : artMeta.getAll()) { Collection<MatchLocation> locs = attrMeta.getLocations(); if (!locs.isEmpty()) { |