Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-07-08 12:01:47 -0400
committerjmisinco2013-07-09 16:37:52 -0400
commit0f3f0522e0f9991fa9aae37f9bbe22c6abf55957 (patch)
treefc24cf862a90a45ee7c271f5b046c263bdc4c72a /plugins/org.eclipse.osee.framework.core.message/src/org
parent788466fcb13267248f4fbdd725ab319ccf62ea48 (diff)
downloadorg.eclipse.osee-0f3f0522e0f9991fa9aae37f9bbe22c6abf55957.tar.gz
org.eclipse.osee-0f3f0522e0f9991fa9aae37f9bbe22c6abf55957.tar.xz
org.eclipse.osee-0f3f0522e0f9991fa9aae37f9bbe22c6abf55957.zip
feature[ats_SF2V6]: Use OrcsTypes in OrcsDataStore
OrcsDataStore needs OrcsTypes which are created in the orcs.core bundle. The orcs.core bundle needs the OrcsDataStore in order to create the OrcsTypes. Once the data store is up, orcs api can come up, create the orcs types and pass them down to the data store. The datastore needs these types in order to set the data proxy on the attributes. Change-Id: Ie208abba6c4c73d81ebbd3b2e07e6fe6dd4cbb85
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.java42
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/AttributeTypeCacheUpdateResponse.java24
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/OseeEnumTypeCacheUpdateResponse.java25
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationService.java6
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java4
6 files changed, 6 insertions, 116 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 7606053a6d..9d1d4949b0 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
@@ -10,17 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.StorageState;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
/**
@@ -57,7 +49,7 @@ public class ArtifactTypeCacheUpdateResponse {
private final boolean isAbstract;
private StorageState storageState;
- protected ArtifactTypeRow(int id, Long guid, String name, boolean isAbstract, StorageState storageState) {
+ public ArtifactTypeRow(int id, Long guid, String name, boolean isAbstract, StorageState storageState) {
this.id = id;
this.guid = guid;
this.name = name;
@@ -113,38 +105,6 @@ 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<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()));
-
- Integer artId = artType.getId();
-
- Collection<ArtifactType> superTypes = artType.getSuperArtifactTypes();
- if (!superTypes.isEmpty()) {
- Integer[] intSuperTypes = new Integer[superTypes.size()];
- int index = 0;
- for (ArtifactType superType : superTypes) {
- intSuperTypes[index++] = superType.getId();
- }
- baseToSuper.put(artId, intSuperTypes);
- }
-
- for (Entry<IOseeBranch, Collection<AttributeType>> entry : artType.getLocalAttributeTypes().entrySet()) {
- IOseeBranch branch = entry.getKey();
- Collection<AttributeType> attrTypes = entry.getValue();
- for (AttributeType type : attrTypes) {
- artAttrs.add(new Triplet<Long, String, Long>(artType.getGuid(), branch.getGuid(), type.getGuid()));
- }
-
- }
- }
- return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs);
- }
-
@Override
public String toString() {
return "ArtifactTypeCacheUpdateResponse [artAttrs=" + artAttrs + ", baseToSuper=" + baseToSuper + ", rows=" + rows + "]";
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 62f4bd324c..58c30adf2c 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
@@ -10,14 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory;
/**
* @author Roberto E. Escobar
@@ -40,23 +35,4 @@ public class AttributeTypeCacheUpdateResponse {
return attrToEnum;
}
- public static AttributeTypeCacheUpdateResponse fromCache(AttributeTypeFactory factory, Collection<AttributeType> types) throws OseeCoreException {
- List<AttributeType> rows = new ArrayList<AttributeType>();
- Map<Integer, Integer> attrToEnum = new HashMap<Integer, Integer>();
- for (AttributeType item : types) {
- AttributeType type =
- factory.create(item.getGuid(), item.getName(), item.getBaseAttributeTypeId(),
- item.getAttributeProviderId(), item.getFileTypeExtension(), item.getDefaultValue(),
- item.getMinOccurrences(), item.getMaxOccurrences(), item.getDescription(), item.getTaggerId(),
- item.getMediaType());
- type.setId(item.getId());
- type.setStorageState(item.getStorageState());
- rows.add(type);
-
- if (item.getOseeEnumType() != null) {
- attrToEnum.put(item.getId(), item.getOseeEnumTypeId());
- }
- }
- return new AttributeTypeCacheUpdateResponse(rows, attrToEnum);
- }
}
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 335f07baf0..b3285038c4 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
@@ -10,12 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.OseeEnumEntry;
-import org.eclipse.osee.framework.core.model.type.OseeEnumType;
/**
* @author Roberto E. Escobar
@@ -38,24 +33,4 @@ public class OseeEnumTypeCacheUpdateResponse {
return enumEntryRows;
}
- public static OseeEnumTypeCacheUpdateResponse fromCache(Collection<OseeEnumType> types) throws OseeCoreException {
- List<String[]> enumTypeRows = new ArrayList<String[]>();
- List<String[]> enumEntryRows = new ArrayList<String[]>();
- for (OseeEnumType type : types) {
- enumTypeRows.add(new String[] {
- String.valueOf(type.getId()),
- type.getStorageState().toString(),
- String.valueOf(type.getGuid()),
- type.getName()});
- for (OseeEnumEntry entry : type.values()) {
- enumEntryRows.add(new String[] {
- String.valueOf(type.getGuid()),
- entry.getGuid(),
- entry.getName(),
- String.valueOf(entry.ordinal()),
- entry.getDescription()});
- }
- }
- return new OseeEnumTypeCacheUpdateResponse(enumTypeRows, enumEntryRows);
- }
}
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 728eecdbd8..135e6d23d3 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
@@ -10,15 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.message;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.enums.StorageState;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
-import org.eclipse.osee.framework.core.services.IdentityService;
/**
* @author Roberto E. Escobar
@@ -140,19 +134,4 @@ public class RelationTypeCacheUpdateResponse {
}
}
- public static RelationTypeCacheUpdateResponse fromCache(IOseeCachingService caching) throws OseeCoreException {
- Collection<RelationType> relationTypes = caching.getRelationTypeCache().getAll();
- IdentityService identityService = caching.getIdentityService();
-
- List<RelationTypeRow> rows = new ArrayList<RelationTypeRow>();
- for (RelationType item : relationTypes) {
- int artifactTypeSideA = identityService.getLocalId(item.getArtifactTypeSideA());
- int artifactTypeSideB = identityService.getLocalId(item.getArtifactTypeSideB());
-
- rows.add(new RelationTypeRow(item.getId(), item.getName(), item.getGuid(), item.getStorageState(),
- item.getSideAName(), item.getSideBName(), artifactTypeSideA, artifactTypeSideB, item.getMultiplicity(),
- item.getDefaultOrderTypeGuid()));
- }
- return new RelationTypeCacheUpdateResponse(rows);
- }
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationService.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationService.java
index 0298e27c33..dae8d493ed 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationService.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationService.java
@@ -22,8 +22,8 @@ import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.translation.ITranslator;
import org.eclipse.osee.framework.core.translation.ITranslatorId;
@@ -40,13 +40,13 @@ public class DataTranslationService implements IDataTranslationService {
new ConcurrentHashMap<ITranslatorId, ITranslator<?>>();
private IOseeModelFactoryService modelFactory;
- private IOseeCachingService cachingService;
+ private TempCachingService cachingService;
public void setModelFactory(IOseeModelFactoryService modelFactory) {
this.modelFactory = modelFactory;
}
- public void setOseeCachingService(IOseeCachingService cachingService) {
+ public void setTempCachingService(TempCachingService cachingService) {
this.cachingService = cachingService;
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java
index 0781e925e3..5ec2fbe79b 100644
--- a/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/internal/DataTranslationServiceFactory.java
@@ -40,7 +40,7 @@ import org.eclipse.osee.framework.core.message.internal.translation.TransactionR
import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
/**
@@ -53,7 +53,7 @@ public class DataTranslationServiceFactory {
//
}
- public void configureService(IDataTranslationService service, TransactionRecordFactory txRecordFactory, AttributeTypeFactory attributeTypeFactory, IOseeCachingService cachingService) throws OseeCoreException {
+ public void configureService(IDataTranslationService service, TransactionRecordFactory txRecordFactory, AttributeTypeFactory attributeTypeFactory, TempCachingService cachingService) throws OseeCoreException {
BranchCache branchCache = cachingService.getBranchCache();
service.addTranslator(new TransactionRecordTranslator(txRecordFactory, branchCache),
CoreTranslatorId.TRANSACTION_RECORD);

Back to the top