Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-08-30 14:05:17 -0400
committerRyan D. Brooks2011-08-30 14:05:17 -0400
commitb3a73c6915c8e1f820bd6ef567e374041eff996e (patch)
tree3eb52a27e06d409e385751da51d8b1228f9e8acb /plugins/org.eclipse.osee.framework.core.message/src/org
parent16a75dbee850b5b98d29aa6bfaeb8c590659b4a8 (diff)
downloadorg.eclipse.osee-b3a73c6915c8e1f820bd6ef567e374041eff996e.tar.gz
org.eclipse.osee-b3a73c6915c8e1f820bd6ef567e374041eff996e.tar.xz
org.eclipse.osee-b3a73c6915c8e1f820bd6ef567e374041eff996e.zip
feature[ats_M1Y56]: Type types use Long for guid
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/ArtifactTypeCacheUpdateResponse.java22
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java10
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/TranslationUtil.java31
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/ArtifactTypeCacheUpdateResponseTranslator.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/AttributeTypeCacheUpdateResponseTranslator.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java6
7 files changed, 57 insertions, 28 deletions
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 a006fd522a..7606053a6d 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
@@ -30,9 +30,9 @@ public class ArtifactTypeCacheUpdateResponse {
private final List<ArtifactTypeRow> rows;
private final Map<Integer, Integer[]> baseToSuper;
- private final List<Triplet<String, String, String>> artAttrs;
+ private final List<Triplet<Long, String, Long>> artAttrs;
- public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Integer, Integer[]> baseToSuper, List<Triplet<String, String, String>> artAttrs) {
+ public ArtifactTypeCacheUpdateResponse(List<ArtifactTypeRow> rows, Map<Integer, Integer[]> baseToSuper, List<Triplet<Long, String, Long>> artAttrs) {
this.rows = rows;
this.baseToSuper = baseToSuper;
this.artAttrs = artAttrs;
@@ -46,18 +46,18 @@ public class ArtifactTypeCacheUpdateResponse {
return baseToSuper;
}
- public List<Triplet<String, String, String>> getAttributeTypes() {
+ public List<Triplet<Long, String, Long>> getAttributeTypes() {
return artAttrs;
}
public static final class ArtifactTypeRow {
private final int id;
private final String name;
- private final String guid;
+ private final Long guid;
private final boolean isAbstract;
private StorageState storageState;
- protected ArtifactTypeRow(int id, String guid, String name, boolean isAbstract, StorageState storageState) {
+ protected ArtifactTypeRow(int id, Long guid, String name, boolean isAbstract, StorageState storageState) {
this.id = id;
this.guid = guid;
this.name = name;
@@ -73,7 +73,7 @@ public class ArtifactTypeCacheUpdateResponse {
return name;
}
- public String getGuid() {
+ public Long getGuid() {
return guid;
}
@@ -92,7 +92,7 @@ public class ArtifactTypeCacheUpdateResponse {
public String[] toArray() {
return new String[] {
String.valueOf(getId()),
- getGuid(),
+ String.valueOf(getGuid()),
getName(),
String.valueOf(isAbstract()),
getStorageState().name()};
@@ -100,11 +100,11 @@ public class ArtifactTypeCacheUpdateResponse {
public static ArtifactTypeRow fromArray(String[] data) {
int id = Integer.valueOf(data[0]);
- String guid = data[1];
+ long remoteId = Long.parseLong(data[1]);
String name = data[2];
boolean isAbstract = Boolean.valueOf(data[3]);
StorageState storageState = StorageState.valueOf(data[4]);
- return new ArtifactTypeRow(id, guid, name, isAbstract, storageState);
+ return new ArtifactTypeRow(id, remoteId, name, isAbstract, storageState);
}
@Override
@@ -116,7 +116,7 @@ public class ArtifactTypeCacheUpdateResponse {
public static ArtifactTypeCacheUpdateResponse fromCache(Collection<ArtifactType> types) throws OseeCoreException {
List<ArtifactTypeRow> rows = new ArrayList<ArtifactTypeRow>();
Map<Integer, Integer[]> baseToSuper = new HashMap<Integer, Integer[]>();
- List<Triplet<String, String, String>> artAttrs = new ArrayList<Triplet<String, String, String>>();
+ List<Triplet<Long, String, Long>> artAttrs = new ArrayList<Triplet<Long, String, Long>>();
for (ArtifactType artType : types) {
rows.add(new ArtifactTypeRow(artType.getId(), artType.getGuid(), artType.getName(), artType.isAbstract(),
artType.getStorageState()));
@@ -137,7 +137,7 @@ public class ArtifactTypeCacheUpdateResponse {
IOseeBranch branch = entry.getKey();
Collection<AttributeType> attrTypes = entry.getValue();
for (AttributeType type : attrTypes) {
- artAttrs.add(new Triplet<String, String, String>(artType.getGuid(), branch.getGuid(), type.getGuid()));
+ artAttrs.add(new Triplet<Long, String, Long>(artType.getGuid(), branch.getGuid(), type.getGuid()));
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java
index bfbfafd2f5..709d03c550 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java
@@ -45,11 +45,11 @@ public class OseeEnumTypeCacheUpdateResponse {
enumTypeRows.add(new String[] {
String.valueOf(type.getId()),
type.getStorageState().toString(),
- type.getGuid(),
+ String.valueOf(type.getGuid()),
type.getName()});
for (OseeEnumEntry entry : type.values()) {
enumEntryRows.add(new String[] {
- type.getGuid(),
+ String.valueOf(type.getGuid()),
entry.getGuid(),
entry.getName(),
String.valueOf(entry.ordinal())});
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 974ad9d240..07609a39ad 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
@@ -38,7 +38,7 @@ public class RelationTypeCacheUpdateResponse {
public static final class RelationTypeRow {
private final int id;
private final String name;
- private final String guid;
+ private final long guid;
private StorageState storageState;
private final String sideAName;
@@ -48,7 +48,7 @@ public class RelationTypeCacheUpdateResponse {
private final RelationTypeMultiplicity multiplicity;
private final String defaultOrderTypeGuid;
- public RelationTypeRow(int id, String name, String guid, StorageState storageState, String sideAName, String sideBName, int artifactTypeSideA, int artifactTypeSideB, RelationTypeMultiplicity multiplicity, String defaultOrderTypeGuid) {
+ public RelationTypeRow(int id, String name, long guid, StorageState storageState, String sideAName, String sideBName, int artifactTypeSideA, int artifactTypeSideB, RelationTypeMultiplicity multiplicity, String defaultOrderTypeGuid) {
super();
this.id = id;
this.name = name;
@@ -78,7 +78,7 @@ public class RelationTypeCacheUpdateResponse {
return name;
}
- public String getGuid() {
+ public long getGuid() {
return guid;
}
@@ -109,7 +109,7 @@ public class RelationTypeCacheUpdateResponse {
public String[] toArray() {
return new String[] {
String.valueOf(getId()),
- getGuid(),
+ String.valueOf(getGuid()),
getName(),
getStorageState().name(),
getSideAName(),
@@ -124,7 +124,7 @@ public class RelationTypeCacheUpdateResponse {
int index = 0;
int id = Integer.valueOf(data[index++]);
- String guid = data[index++];
+ long guid = Long.valueOf(data[index++]);
String name = data[index++];
StorageState storageState = StorageState.valueOf(data[index++]);
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 2f62fc65a5..ea91355d14 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
@@ -42,6 +42,10 @@ public final class TranslationUtil {
}
public static void loadTripletList(List<Triplet<String, String, String>> data, PropertyStore store, Enum<?> key) {
+ storeToStringTripletList(data, store.getPropertyStore(key.name()));
+ }
+
+ public static void loadTripletLongList(List<Triplet<Long, String, Long>> data, PropertyStore store, Enum<?> key) {
storeToTripletList(data, store.getPropertyStore(key.name()));
}
@@ -49,6 +53,10 @@ public final class TranslationUtil {
store.put(key.name(), tripletListToStore(list));
}
+ public static void putTripletLongList(PropertyStore store, Enum<?> key, List<Triplet<Long, String, Long>> list) {
+ store.put(key.name(), tripletLongListToStore(list));
+ }
+
private static PropertyStore arrayMapToStore(Map<Integer, String[]> map) {
PropertyStore innerStore = new PropertyStore();
for (Entry<Integer, String[]> entry : map.entrySet()) {
@@ -106,7 +114,14 @@ public final class TranslationUtil {
}
}
- private static void storeToTripletList(List<Triplet<String, String, String>> data, PropertyStore innerStore) {
+ private static void storeToTripletList(List<Triplet<Long, String, Long>> data, PropertyStore innerStore) {
+ for (String strKey : innerStore.arrayKeySet()) {
+ String[] value = innerStore.getArray(strKey);
+ data.add(new Triplet<Long, String, Long>(Long.valueOf(value[0]), value[1], Long.valueOf(value[2])));
+ }
+ }
+
+ private static void storeToStringTripletList(List<Triplet<String, String, String>> data, PropertyStore innerStore) {
for (String strKey : innerStore.arrayKeySet()) {
String[] value = innerStore.getArray(strKey);
data.add(new Triplet<String, String, String>(value[0], value[1], value[2]));
@@ -123,6 +138,19 @@ public final class TranslationUtil {
return innerStore;
}
+ private static PropertyStore tripletLongListToStore(List<Triplet<Long, String, Long>> list) {
+ PropertyStore innerStore = new PropertyStore();
+ int index = 0;
+ for (Triplet<Long, String, Long> entry : list) {
+ innerStore.put(String.valueOf(index), new String[] {
+ String.valueOf(entry.getFirst()),
+ entry.getSecond(),
+ String.valueOf(entry.getThird())});
+ index++;
+ }
+ return innerStore;
+ }
+
public static void loadIntArrayMap(Map<Integer, Integer[]> map, PropertyStore store, Enum<?> key) {
storeToIntArrayMap(map, store.getPropertyStore(key.name()));
}
@@ -134,4 +162,5 @@ public final class TranslationUtil {
public static String createKey(Enum<?> prefix, int index) {
return prefix.name() + "_" + 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 b3a69e39b0..42a0d31229 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
@@ -37,7 +37,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar
public ArtifactTypeCacheUpdateResponse convert(PropertyStore store) {
List<ArtifactTypeRow> rows = new ArrayList<ArtifactTypeRow>();
Map<Integer, Integer[]> baseToSuper = new HashMap<Integer, Integer[]>();
- List<Triplet<String, String, String>> artAttrs = new ArrayList<Triplet<String, String, String>>();
+ List<Triplet<Long, String, Long>> artAttrs = new ArrayList<Triplet<Long, String, Long>>();
int rowCount = store.getInt(Fields.ITEM_COUNT.name());
for (int index = 0; index < rowCount; index++) {
@@ -46,7 +46,7 @@ public class ArtifactTypeCacheUpdateResponseTranslator implements ITranslator<Ar
}
TranslationUtil.loadIntArrayMap(baseToSuper, store, Fields.BASE_TO_SUPER_TYPES);
- TranslationUtil.loadTripletList(artAttrs, store, Fields.BASE_BRANCH_ATTR);
+ TranslationUtil.loadTripletLongList(artAttrs, store, Fields.BASE_BRANCH_ATTR);
return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs);
}
@@ -61,7 +61,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.putTripletList(store, Fields.BASE_BRANCH_ATTR, object.getAttributeTypes());
+ 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 cbb2e7149a..6d9dbd6c02 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
@@ -83,7 +83,7 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A
type.getDefaultValue(),
type.getDescription(),
type.getFileTypeExtension(),
- type.getGuid(),
+ String.valueOf(type.getGuid()),
String.valueOf(type.getId()),
String.valueOf(type.getMaxOccurrences()),
String.valueOf(type.getMinOccurrences()),
@@ -98,7 +98,7 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A
String defaultValue = data[2];
String description = data[3];
String fileTypeExtension = data[4];
- String guid = data[5];
+ long remoteId = Long.valueOf(data[5]);
int uniqueId = Integer.valueOf(data[6]);
int maxOccurrences = Integer.valueOf(data[7]);
int minOccurrences = Integer.valueOf(data[8]);
@@ -107,7 +107,7 @@ public class AttributeTypeCacheUpdateResponseTranslator implements ITranslator<A
String taggerId = data[11];
AttributeType type =
- factory.create(guid, name, baseAttributeTypeId, attributeProviderId, fileTypeExtension, defaultValue,
+ factory.create(remoteId, name, baseAttributeTypeId, attributeProviderId, fileTypeExtension, defaultValue,
minOccurrences, maxOccurrences, description, taggerId);
type.setId(uniqueId);
type.setStorageState(storageState);
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
index 69c92df90a..040b0fe15f 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/translation/SearchRequestTranslator.java
@@ -58,9 +58,9 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
String[] typeFilterNames = store.getArray(Entry.OPTION_ATTRIBUTE_TYPE_FILTER_NAMES.name());
if (typeFilterGuids.length > 0 && typeFilterNames.length > 0) {
for (int index = 0; index < typeFilterGuids.length; index++) {
- guid = typeFilterGuids[index];
+ long id = Long.valueOf(typeFilterGuids[index]);
name = index < typeFilterNames.length ? typeFilterNames[index] : Strings.emptyString();
- IAttributeType type = TokenFactory.createAttributeType(guid, name);
+ IAttributeType type = TokenFactory.createAttributeType(id, name);
options.addAttributeTypeFilter(type);
}
}
@@ -89,7 +89,7 @@ public class SearchRequestTranslator implements ITranslator<SearchRequest> {
String[] names = new String[types.size()];
int index = 0;
for (IAttributeType type : types) {
- guids[index] = type.getGuid();
+ guids[index] = String.valueOf(type.getGuid());
names[index] = type.getName();
index++;
}

Back to the top