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
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
-rw-r--r--plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java36
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/OSGI-INF/osee.message.translation.service.xml2
-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
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/TempCachingService.java (renamed from plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TempCachingService.java)2
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml3
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java5
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/AtsServlet.java4
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/DataServlet.java4
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java202
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java20
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ats/AtsService.java4
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java24
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/osee.client.caching.service.xml1
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.api.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.update.cache.console.command.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataModule.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsTypesDataStore.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/CacheUpdateCommand.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypeIndex.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java30
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/EnumTypesImpl.java59
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesImpl.java37
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java131
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactoryTest.java40
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java51
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java63
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactory.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataModuleFactory.java45
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TempCachingServiceFactory.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java15
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java2
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumTypes.java18
50 files changed, 632 insertions, 516 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java
index fa7c61cef5..324e860c3d 100644
--- a/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java
+++ b/plugins/org.eclipse.osee.framework.core.message.test/src/org/eclipse/osee/framework/core/message/test/translation/DataTranslationServiceFactoryTest.java
@@ -39,20 +39,15 @@ import org.eclipse.osee.framework.core.message.internal.translation.TransactionC
import org.eclipse.osee.framework.core.message.internal.translation.TransactionRecordTranslator;
import org.eclipse.osee.framework.core.model.BranchFactory;
import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.IOseeCache;
-import org.eclipse.osee.framework.core.model.cache.OseeEnumTypeCache;
-import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.model.type.ArtifactTypeFactory;
import org.eclipse.osee.framework.core.model.type.AttributeTypeFactory;
import org.eclipse.osee.framework.core.model.type.OseeEnumTypeFactory;
import org.eclipse.osee.framework.core.model.type.RelationTypeFactory;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.core.services.IdentityService;
+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;
@@ -70,7 +65,7 @@ public class DataTranslationServiceFactoryTest {
public void testServiceCreation() throws OseeCoreException {
DataTranslationService srvc = new DataTranslationService();
srvc.setModelFactory(new MockModelFactoryService());
- srvc.setOseeCachingService(new MockOseeCachingService());
+ srvc.setTempCachingService(new MockOseeCachingService());
srvc.start();
checkExists(srvc, TransactionRecordTranslator.class, CoreTranslatorId.TRANSACTION_RECORD);
@@ -148,7 +143,7 @@ public class DataTranslationServiceFactoryTest {
}
}
- private final class MockOseeCachingService implements IOseeCachingService {
+ private final class MockOseeCachingService implements TempCachingService {
@Override
public BranchCache getBranchCache() {
@@ -161,31 +156,6 @@ public class DataTranslationServiceFactoryTest {
}
@Override
- public ArtifactTypeCache getArtifactTypeCache() {
- return null;
- }
-
- @Override
- public AttributeTypeCache getAttributeTypeCache() {
- return null;
- }
-
- @Override
- public RelationTypeCache getRelationTypeCache() {
- return null;
- }
-
- @Override
- public OseeEnumTypeCache getEnumTypeCache() {
- return null;
- }
-
- @Override
- public IdentityService getIdentityService() {
- return null;
- }
-
- @Override
public Collection<?> getCaches() {
return null;
}
diff --git a/plugins/org.eclipse.osee.framework.core.message/OSGI-INF/osee.message.translation.service.xml b/plugins/org.eclipse.osee.framework.core.message/OSGI-INF/osee.message.translation.service.xml
index 70390ff6e7..a36cadbb83 100644
--- a/plugins/org.eclipse.osee.framework.core.message/OSGI-INF/osee.message.translation.service.xml
+++ b/plugins/org.eclipse.osee.framework.core.message/OSGI-INF/osee.message.translation.service.xml
@@ -5,5 +5,5 @@
<provide interface="org.eclipse.osee.framework.core.translation.IDataTranslationService"/>
</service>
<reference bind="setModelFactory" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
- <reference bind="setOseeCachingService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeCachingService" name="IOseeCachingService" policy="static"/>
+ <reference bind="setTempCachingService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.TempCachingService" name="TempCachingService" policy="static"/>
</scr:component>
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);
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java
index b324ac8dab..e1e11df013 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java
@@ -10,25 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.services;
-import java.util.Collection;
-import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
-import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.core.model.cache.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.OseeEnumTypeCache;
import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
-import org.eclipse.osee.framework.core.model.cache.TransactionCache;
/**
* @author Roberto E. Escobar
*/
-public interface IOseeCachingService {
-
- BranchCache getBranchCache();
-
- TransactionCache getTransactionCache();
+public interface IOseeCachingService extends TempCachingService {
ArtifactTypeCache getArtifactTypeCache();
@@ -40,11 +30,4 @@ public interface IOseeCachingService {
IdentityService getIdentityService();
- Collection<?> getCaches();
-
- IOseeCache<?, ?> getCache(OseeCacheEnum cacheId) throws OseeCoreException;
-
- void reloadAll() throws OseeCoreException;
-
- void clearAll();
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TempCachingService.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/TempCachingService.java
index 8ae5e5f2cd..0796dd5484 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/TempCachingService.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/TempCachingService.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.core.ds;
+package org.eclipse.osee.framework.core.services;
import java.util.Collection;
import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml b/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
index b1d139b7f3..97aac56c0f 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/OSGI-INF/legacy.servlets.xml
@@ -8,10 +8,11 @@
<reference bind="setServerLookup" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerLookup" name="IApplicationServerLookup" policy="static"/>
<reference bind="setAppServerManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerManager" name="IApplicationServerManager" policy="static"/>
<reference bind="setTranslationService" cardinality="1..1" interface="org.eclipse.osee.framework.core.translation.IDataTranslationService" name="IDataTranslationService" policy="static"/>
- <reference bind="setCaching" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeCachingService" name="IOseeCachingService" policy="static"/>
+ <reference bind="setCaching" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.TempCachingService" name="TempCachingService" policy="static"/>
<reference bind="setAuthenticationManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IAuthenticationManager" name="IAuthenticationManager" policy="static"/>
<reference bind="setFactoryService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
<reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
<reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+ <reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
index 465e9e3d40..5f752cab70 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ArtifactFileServlet.java
@@ -20,7 +20,6 @@ import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -45,10 +44,10 @@ public class ArtifactFileServlet extends UnsecuredOseeHttpServlet {
private final IResourceManager resourceManager;
private final BranchCache branchCache;
- public ArtifactFileServlet(Log logger, IResourceManager resourceManager, IOseeCachingService cachingService) {
+ public ArtifactFileServlet(Log logger, IResourceManager resourceManager, BranchCache branchCache) {
super(logger);
this.resourceManager = resourceManager;
- this.branchCache = cachingService.getBranchCache();
+ this.branchCache = branchCache;
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/AtsServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/AtsServlet.java
index d135cdc7c5..ec8f21200a 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/AtsServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/AtsServlet.java
@@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.manager.servlet.ats.AtsService;
import org.eclipse.osee.framework.manager.servlet.ats.AtsXmlMessages;
@@ -39,7 +39,7 @@ public class AtsServlet extends UnsecuredOseeHttpServlet {
private final IResourceManager resourceManager;
- public AtsServlet(Log logger, IResourceManager resourceManager, IOseeCachingService cacheService) {
+ public AtsServlet(Log logger, IResourceManager resourceManager, TempCachingService cacheService) {
super(logger);
this.resourceManager = resourceManager;
AtsService.IResourceProvider provider = new ResourceProvider();
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/DataServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/DataServlet.java
index 410b4a5f0f..494148e44e 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/DataServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/DataServlet.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeNotFoundException;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -35,7 +35,7 @@ public class DataServlet extends UnsecuredOseeHttpServlet {
private final IResourceManager resourceManager;
private final BranchCache branchCache;
- public DataServlet(Log logger, IResourceManager resourceManager, IOseeCachingService cacheService) {
+ public DataServlet(Log logger, IResourceManager resourceManager, TempCachingService cacheService) {
super(logger);
this.resourceManager = resourceManager;
branchCache = cacheService.getBranchCache();
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java
index a75bbe18a0..1406b25f0a 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeCacheServlet.java
@@ -15,16 +15,26 @@ import java.io.InputStream;
import java.io.OutputStream;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.CacheOperation;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
+import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse;
+import org.eclipse.osee.framework.core.message.ArtifactTypeCacheUpdateResponse.ArtifactTypeRow;
import org.eclipse.osee.framework.core.message.AttributeTypeCacheUpdateResponse;
import org.eclipse.osee.framework.core.message.BranchCacheStoreRequest;
import org.eclipse.osee.framework.core.message.BranchCacheUpdateResponse;
@@ -32,21 +42,34 @@ import org.eclipse.osee.framework.core.message.BranchCacheUpdateUtil;
import org.eclipse.osee.framework.core.message.CacheUpdateRequest;
import org.eclipse.osee.framework.core.message.OseeEnumTypeCacheUpdateResponse;
import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse;
+import org.eclipse.osee.framework.core.message.RelationTypeCacheUpdateResponse.RelationTypeRow;
import org.eclipse.osee.framework.core.message.TransactionCacheUpdateResponse;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
+import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.translation.ITranslatorId;
-import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.jdk.core.type.Triplet;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.manager.servlet.internal.ApplicationContextFactory;
import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.ApplicationContext;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.OrcsTypes;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.eclipse.osee.orcs.data.EnumEntry;
+import org.eclipse.osee.orcs.data.EnumType;
+import org.eclipse.osee.orcs.data.EnumTypes;
+import org.eclipse.osee.orcs.data.RelationTypes;
/**
* @author Roberto E. Escobar
@@ -55,33 +78,37 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
private static final long serialVersionUID = 6693534844874109524L;
private final IDataTranslationService translationService;
- private final IOseeCachingService cachingService;
private final IOseeModelFactoryService factoryService;
private final ISessionManager sessionManager;
+ private final BranchCache branchCache;
+ private final TransactionCache txCache;
+ private final OrcsApi orcsApi;
+ private final IdentityService identityService;
+ private static final StorageState DEFAULT_STORAGE_STATE = StorageState.CREATED;
- public OseeCacheServlet(Log logger, ISessionManager sessionManager, IDataTranslationService translationService, IOseeCachingService cachingService, IOseeModelFactoryService factoryService) {
+ public OseeCacheServlet(Log logger, ISessionManager sessionManager, IDataTranslationService translationService, TempCachingService cachingService, OrcsApi orcsApi, IOseeModelFactoryService factoryService, IdentityService identityService) {
super(logger);
this.sessionManager = sessionManager;
this.translationService = translationService;
- this.cachingService = cachingService;
+ this.branchCache = cachingService.getBranchCache();
+ this.txCache = cachingService.getTransactionCache();
+ this.orcsApi = orcsApi;
this.factoryService = factoryService;
+ this.identityService = identityService;
}
public IDataTranslationService getTranslationService() {
return translationService;
}
- public IOseeCachingService getCachingService() {
- return cachingService;
- }
-
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
OseeCacheEnum cacheId = OseeCacheEnum.valueOf(req.getParameter("cacheId"));
try {
- IOseeCachingService caching = getCachingService();
IDataTranslationService service = getTranslationService();
- Pair<Object, ITranslatorId> pair = createResponse(true, new CacheUpdateRequest(cacheId), caching);
+ ApplicationContext context = createAppContext(req);
+ OrcsTypes orcsTypes = orcsApi.getOrcsTypes(context);
+ Pair<Object, ITranslatorId> pair = createResponse(true, new CacheUpdateRequest(cacheId), orcsTypes);
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
resp.setContentType("text/xml");
resp.setCharacterEncoding("UTF-8");
@@ -103,7 +130,9 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
CacheOperation operation = CacheOperation.fromString(req.getParameter("function"));
switch (operation) {
case UPDATE:
- sendUpdates(isCompatible, req, resp);
+ ApplicationContext context = createAppContext(req);
+ OrcsTypes orcsTypes = orcsApi.getOrcsTypes(context);
+ sendUpdates(isCompatible, req, resp, orcsTypes);
break;
case STORE:
storeUpdates(isCompatible, req, resp);
@@ -116,6 +145,11 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
}
}
+ private ApplicationContext createAppContext(HttpServletRequest req) {
+ String sessionId = req.getParameter("sessionId");
+ return ApplicationContextFactory.createContext(sessionId);
+ }
+
private void handleError(HttpServletResponse resp, String request, Throwable th) throws IOException {
getLogger().error(th, "Osee Cache request error: [%s]", request);
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -127,8 +161,6 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
private void storeUpdates(boolean isCompatible, HttpServletRequest req, HttpServletResponse resp) throws OseeCoreException {
IDataTranslationService service = getTranslationService();
- IOseeCachingService caching = getCachingService();
- TransactionCache txCache = caching.getTransactionCache();
BranchCacheStoreRequest updateRequest = null;
InputStream inputStream = null;
@@ -141,10 +173,8 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
Lib.close(inputStream);
}
Collection<Branch> updated =
- new BranchCacheUpdateUtil(factoryService.getBranchFactory(), txCache).updateCache(updateRequest,
- caching.getBranchCache());
+ new BranchCacheUpdateUtil(factoryService.getBranchFactory(), txCache).updateCache(updateRequest, branchCache);
- BranchCache cache = caching.getBranchCache();
if (updateRequest.isServerUpdateMessage()) {
for (Branch branch : updated) {
if (branch.isCreated()) {
@@ -152,11 +182,11 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
}
branch.clearDirty();
if (branch.isPurged()) {
- cache.decache(branch);
+ branchCache.decache(branch);
}
}
} else {
- cache.storeItems(updated);
+ branchCache.storeItems(updated);
}
try {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
@@ -168,9 +198,8 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
}
}
- private void sendUpdates(boolean isCompatible, HttpServletRequest req, HttpServletResponse resp) throws OseeCoreException {
+ private void sendUpdates(boolean isCompatible, HttpServletRequest req, HttpServletResponse resp, OrcsTypes orcsTypes) throws OseeCoreException {
IDataTranslationService service = getTranslationService();
- IOseeCachingService caching = getCachingService();
CacheUpdateRequest updateRequest = null;
InputStream inputStream = null;
@@ -185,7 +214,7 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
OutputStream outputStream = null;
try {
- Pair<Object, ITranslatorId> pair = createResponse(isCompatible, updateRequest, caching);
+ Pair<Object, ITranslatorId> pair = createResponse(isCompatible, updateRequest, orcsTypes);
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
resp.setContentType("text/xml");
@@ -201,18 +230,16 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
}
}
- private Pair<Object, ITranslatorId> createResponse(boolean isCompatible, CacheUpdateRequest updateRequest, IOseeCachingService caching) throws OseeCoreException {
- Conditions.checkNotNull(caching, "caching service");
+ private Pair<Object, ITranslatorId> createResponse(boolean isCompatible, CacheUpdateRequest updateRequest, OrcsTypes orcsTypes) throws OseeCoreException {
Object response = null;
ITranslatorId transalatorId = null;
switch (updateRequest.getCacheId()) {
case BRANCH_CACHE:
- response = BranchCacheUpdateResponse.fromCache(caching.getBranchCache(), caching.getBranchCache().getAll());
+ response = BranchCacheUpdateResponse.fromCache(branchCache, branchCache.getAll());
transalatorId = CoreTranslatorId.BRANCH_CACHE_UPDATE_RESPONSE;
break;
case TRANSACTION_CACHE:
Collection<TransactionRecord> record;
- TransactionCache txCache = caching.getTransactionCache();
if (updateRequest.getItemsIds().isEmpty()) {
record = txCache.getAll();
@@ -223,26 +250,23 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
}
}
response =
- TransactionCacheUpdateResponse.fromCache(factoryService.getTransactionFactory(), record,
- caching.getBranchCache());
+ TransactionCacheUpdateResponse.fromCache(factoryService.getTransactionFactory(), record, branchCache);
transalatorId = CoreTranslatorId.TX_CACHE_UPDATE_RESPONSE;
break;
case ARTIFACT_TYPE_CACHE:
- response = ArtifactTypeCacheUpdateResponse.fromCache(caching.getArtifactTypeCache().getAll());
+ response = createArtifactTypeCacheUpdateResponse(orcsTypes);
transalatorId = CoreTranslatorId.ARTIFACT_TYPE_CACHE_UPDATE_RESPONSE;
break;
case ATTRIBUTE_TYPE_CACHE:
- response =
- AttributeTypeCacheUpdateResponse.fromCache(factoryService.getAttributeTypeFactory(),
- caching.getAttributeTypeCache().getAll());
+ response = createAttributeTypeCacheUpdateResponse(orcsTypes);
transalatorId = CoreTranslatorId.ATTRIBUTE_TYPE_CACHE_UPDATE_RESPONSE;
break;
case OSEE_ENUM_TYPE_CACHE:
- response = OseeEnumTypeCacheUpdateResponse.fromCache(caching.getEnumTypeCache().getAll());
+ response = createOseeEnumTypeCacheUpdateResponse(orcsTypes);
transalatorId = CoreTranslatorId.OSEE_ENUM_TYPE_CACHE_UPDATE_RESPONSE;
break;
case RELATION_TYPE_CACHE:
- response = RelationTypeCacheUpdateResponse.fromCache(caching);
+ response = createRelationTypeCacheUpdateResponse(orcsTypes);
transalatorId = CoreTranslatorId.RELATION_TYPE_CACHE_UPDATE_RESPONSE;
break;
default:
@@ -251,4 +275,114 @@ public class OseeCacheServlet extends UnsecuredOseeHttpServlet {
return new Pair<Object, ITranslatorId>(response, transalatorId);
}
+ private ArtifactTypeCacheUpdateResponse createArtifactTypeCacheUpdateResponse(OrcsTypes orcsTypes) 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>>();
+ ArtifactTypes artTypes = orcsTypes.getArtifactTypes();
+ for (IArtifactType artType : artTypes.getAll()) {
+ int artTypeId = identityService.getLocalId(artType.getGuid());
+ boolean isAbstract = artTypes.isAbstract(artType);
+ rows.add(new ArtifactTypeRow(artTypeId, artType.getGuid(), artType.getName(), isAbstract,
+ DEFAULT_STORAGE_STATE));
+
+ Collection<? extends IArtifactType> superTypes = artTypes.getSuperArtifactTypes(artType);
+ if (!superTypes.isEmpty()) {
+ Integer[] intSuperTypes = new Integer[superTypes.size()];
+ int index = 0;
+ for (IArtifactType superType : superTypes) {
+ intSuperTypes[index++] = identityService.getLocalId(superType.getGuid());
+ }
+ baseToSuper.put(artTypeId, intSuperTypes);
+ }
+
+ Map<IOseeBranch, Collection<IAttributeType>> allTypes = artTypes.getAllAttributeTypes(artType);
+ for (Entry<IOseeBranch, Collection<IAttributeType>> entry : allTypes.entrySet()) {
+ IOseeBranch branch = entry.getKey();
+ Collection<IAttributeType> attrTypes = entry.getValue();
+ for (IAttributeType type : attrTypes) {
+ artAttrs.add(new Triplet<Long, String, Long>(artType.getGuid(), branch.getGuid(), type.getGuid()));
+ }
+
+ }
+ }
+ return new ArtifactTypeCacheUpdateResponse(rows, baseToSuper, artAttrs);
+ }
+
+ private AttributeTypeCacheUpdateResponse createAttributeTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException {
+ List<AttributeType> rows = new ArrayList<AttributeType>();
+ Map<Integer, Integer> attrToEnum = new HashMap<Integer, Integer>();
+ AttributeTypes attrTypes = orcsTypes.getAttributeTypes();
+ for (IAttributeType item : attrTypes.getAll()) {
+ String baseAttributeTypeId = attrTypes.getBaseAttributeTypeId(item);
+ String attributeProviderNameId = attrTypes.getAttributeProviderId(item);
+ String fileTypeExtension = attrTypes.getFileTypeExtension(item);
+ String defaultValue = attrTypes.getDefaultValue(item);
+ int minOccurrances = attrTypes.getMinOccurrences(item);
+ int maxOccurrences = attrTypes.getMaxOccurrences(item);
+ String description = attrTypes.getDescription(item);
+ String taggerId = attrTypes.getTaggerId(item);
+ String mediaType = attrTypes.getMediaType(item);
+ AttributeType type =
+ new AttributeType(item.getGuid(), item.getName(), baseAttributeTypeId, attributeProviderNameId,
+ fileTypeExtension, defaultValue, minOccurrances, maxOccurrences, description, taggerId, mediaType);
+
+ int localId = identityService.getLocalId(item);
+ type.setId(localId);
+ rows.add(type);
+
+ if (attrTypes.isEnumerated(item)) {
+ EnumType enumType = attrTypes.getEnumType(item);
+ int enumId = identityService.getLocalId(enumType);
+ attrToEnum.put(localId, enumId);
+ }
+
+ }
+ return new AttributeTypeCacheUpdateResponse(rows, attrToEnum);
+ }
+
+ private RelationTypeCacheUpdateResponse createRelationTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException {
+ List<RelationTypeRow> rows = new ArrayList<RelationTypeRow>();
+ RelationTypes relTypes = orcsTypes.getRelationTypes();
+ for (IRelationType item : relTypes.getAll()) {
+ IArtifactType sideAType = relTypes.getArtifactTypeSideA(item);
+ IArtifactType sideBType = relTypes.getArtifactTypeSideB(item);
+ int artifactTypeSideA = identityService.getLocalId(sideAType);
+ int artifactTypeSideB = identityService.getLocalId(sideBType);
+
+ int localId = identityService.getLocalId(item);
+
+ String sideAName = relTypes.getSideAName(item);
+ String sideBName = relTypes.getSideBName(item);
+ RelationTypeMultiplicity multiplicity = relTypes.getMultiplicity(item);
+ String defaultOrderTypeGuid = relTypes.getDefaultOrderTypeGuid(item);
+
+ rows.add(new RelationTypeRow(localId, item.getName(), item.getGuid(), DEFAULT_STORAGE_STATE, sideAName,
+ sideBName, artifactTypeSideA, artifactTypeSideB, multiplicity, defaultOrderTypeGuid));
+ }
+ return new RelationTypeCacheUpdateResponse(rows);
+ }
+
+ private OseeEnumTypeCacheUpdateResponse createOseeEnumTypeCacheUpdateResponse(OrcsTypes orcsTypes) throws OseeCoreException {
+ List<String[]> enumTypeRows = new ArrayList<String[]>();
+ List<String[]> enumEntryRows = new ArrayList<String[]>();
+ EnumTypes enumTypes = orcsTypes.getEnumTypes();
+ for (EnumType type : enumTypes.getAll()) {
+ int localId = identityService.getLocalId(type);
+ enumTypeRows.add(new String[] {
+ String.valueOf(localId),
+ DEFAULT_STORAGE_STATE.toString(),
+ String.valueOf(type.getGuid()),
+ type.getName()});
+ for (EnumEntry 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.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
index 989880e9dc..6a92512931 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/OseeModelServlet.java
@@ -16,6 +16,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
+import java.net.URISyntaxException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.osee.framework.core.enums.CoreTranslatorId;
@@ -86,9 +87,8 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
try {
- IDataTranslationService service = dataTransalatorService;
final OseeImportModelRequest modelRequest =
- service.convert(req.getInputStream(), CoreTranslatorId.OSEE_IMPORT_MODEL_REQUEST);
+ dataTransalatorService.convert(req.getInputStream(), CoreTranslatorId.OSEE_IMPORT_MODEL_REQUEST);
IResource resource = new IResource() {
@@ -105,6 +105,15 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
@Override
public URI getLocation() {
+ try {
+ String modelName = modelRequest.getModelName();
+ if (!modelName.endsWith(".osee")) {
+ modelName += ".osee";
+ }
+ return new URI("osee:/" + modelName);
+ } catch (URISyntaxException ex) {
+ getLogger().error(ex, "Error creating location URI for model import");
+ }
return null;
}
@@ -124,11 +133,16 @@ public class OseeModelServlet extends SecureOseeHttpServlet {
getOrcsTypes().loadTypes(resource, isInitializing(req)).call();
+ if (modelRequest.isPersistAllowed()) {
+ getOrcsTypes().save().call();
+ }
+
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
resp.setContentType("text/xml");
resp.setCharacterEncoding("UTF-8");
- InputStream inputStream = service.convertToStream(modelResponse, CoreTranslatorId.OSEE_IMPORT_MODEL_RESPONSE);
+ InputStream inputStream =
+ dataTransalatorService.convertToStream(modelResponse, CoreTranslatorId.OSEE_IMPORT_MODEL_RESPONSE);
Lib.inputStreamToOutputStream(inputStream, resp.getOutputStream());
} catch (Exception ex) {
handleError(resp, req.toString(), ex);
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ats/AtsService.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ats/AtsService.java
index 3b678515a0..03f643a2ad 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ats/AtsService.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ats/AtsService.java
@@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.manager.servlet.DataServlet;
import org.eclipse.osee.framework.resource.management.IResource;
@@ -47,7 +47,7 @@ public class AtsService {
private final IResourceManager resourceManager;
private final BranchCache branchCache;
- public AtsService(IResourceProvider resourceProvider, AtsXmlSearch xmlSearch, AtsXmlMessages messages, IResourceManager resourceManager, IOseeCachingService cacheService) {
+ public AtsService(IResourceProvider resourceProvider, AtsXmlSearch xmlSearch, AtsXmlMessages messages, IResourceManager resourceManager, TempCachingService cacheService) {
this.xmlSearch = xmlSearch;
this.messages = messages;
this.resourceProvider = resourceProvider;
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
index f70ad8c962..a737e09f0a 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java
@@ -13,13 +13,15 @@ package org.eclipse.osee.framework.manager.servlet.internal;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.data.OseeServerContext;
+import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.server.IApplicationServerLookup;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.server.IAuthenticationManager;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.OseeHttpServlet;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.manager.servlet.AdminServlet;
import org.eclipse.osee.framework.manager.servlet.ArtifactFileServlet;
@@ -55,11 +57,12 @@ public class ServletRegistrationHandler {
private IApplicationServerLookup serverLookup;
private IApplicationServerManager appServerManager;
private IDataTranslationService translationService;
- private IOseeCachingService caching;
+ private TempCachingService caching;
private IAuthenticationManager authenticationManager;
private IOseeModelFactoryService factoryService;
private IResourceManager resourceManager;
private OrcsApi orcsApi;
+ private IdentityService identityService;
private final Set<String> contexts = new HashSet<String>();
@@ -67,6 +70,10 @@ public class ServletRegistrationHandler {
this.sessionManager = sessionManager;
}
+ public void setIdentityService(IdentityService identityService) {
+ this.identityService = identityService;
+ }
+
public void setServerLookup(IApplicationServerLookup serverLookup) {
this.serverLookup = serverLookup;
}
@@ -79,7 +86,7 @@ public class ServletRegistrationHandler {
this.translationService = translationService;
}
- public void setCaching(IOseeCachingService caching) {
+ public void setCaching(TempCachingService caching) {
this.caching = caching;
}
@@ -123,11 +130,12 @@ public class ServletRegistrationHandler {
private void registerServices(BundleContext context) {
contexts.clear();
+ BranchCache branchCache = caching.getBranchCache();
register(new SystemManagerServlet(logger, sessionManager), OseeServerContext.MANAGER_CONTEXT);
register(new ResourceManagerServlet(logger, sessionManager, resourceManager), OseeServerContext.RESOURCE_CONTEXT);
- register(new ArtifactFileServlet(logger, resourceManager, caching), OseeServerContext.PROCESS_CONTEXT);
- register(new ArtifactFileServlet(logger, resourceManager, caching), OseeServerContext.ARTIFACT_CONTEXT);
- register(new ArtifactFileServlet(logger, resourceManager, caching), "index");
+ register(new ArtifactFileServlet(logger, resourceManager, branchCache), OseeServerContext.PROCESS_CONTEXT);
+ register(new ArtifactFileServlet(logger, resourceManager, branchCache), OseeServerContext.ARTIFACT_CONTEXT);
+ register(new ArtifactFileServlet(logger, resourceManager, branchCache), "index");
register(new BranchExchangeServlet(logger, sessionManager, resourceManager, orcsApi),
OseeServerContext.BRANCH_EXCHANGE_CONTEXT);
register(new BranchManagerServlet(logger, sessionManager, translationService, orcsApi),
@@ -139,8 +147,8 @@ public class ServletRegistrationHandler {
register(new SessionManagementServlet(logger, sessionManager, authenticationManager),
OseeServerContext.SESSION_CONTEXT);
register(new SessionClientLoopbackServlet(logger, sessionManager), OseeServerContext.CLIENT_LOOPBACK_CONTEXT);
- register(new OseeCacheServlet(logger, sessionManager, translationService, caching, factoryService),
- OseeServerContext.CACHE_CONTEXT);
+ register(new OseeCacheServlet(logger, sessionManager, translationService, caching, orcsApi, factoryService,
+ identityService), OseeServerContext.CACHE_CONTEXT);
register(new OseeModelServlet(logger, sessionManager, translationService, orcsApi),
OseeServerContext.OSEE_MODEL_CONTEXT);
register(new UnsubscribeServlet(logger, context, orcsApi), "osee/unsubscribe");
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/osee.client.caching.service.xml b/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/osee.client.caching.service.xml
index fd313692f1..f2337423cd 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/osee.client.caching.service.xml
+++ b/plugins/org.eclipse.osee.framework.skynet.core/OSGI-INF/osee.client.caching.service.xml
@@ -3,6 +3,7 @@
<implementation class="org.eclipse.osee.framework.skynet.core.internal.ClientCachingServiceProxy"/>
<service>
<provide interface="org.eclipse.osee.framework.core.services.IOseeCachingService"/>
+ <provide interface="org.eclipse.osee.framework.core.services.TempCachingService"/>
</service>
<reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
<reference bind="setModelFactory" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IOseeModelFactoryService" name="IOseeModelFactoryService" policy="static"/>
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
index 2742f03354..523fd2f356 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/types/OrcsTypesTest.java
@@ -290,21 +290,6 @@ public class OrcsTypesTest {
}
@Test
- public void testGetAllDescendantsWithDepth() throws OseeCoreException {
- ArtifactTypes artTypes = orcsTypes.getArtifactTypes();
-
- //@formatter:off
- assertEquals(true, artTypes.getDescendantTypes(ARTIFACT, 0).isEmpty());
- assertContains(artTypes.getDescendantTypes(ARTIFACT, 1), REQUIREMENT, OTHER_ARTIFACT);
- assertContains(artTypes.getDescendantTypes(ARTIFACT, 2), REQUIREMENT, OTHER_ARTIFACT, SOFTWARE_REQUIREMENT, SYSTEM_REQUIREMENT, SUBSYSTEM_REQUIREMENT);
- assertContains(artTypes.getDescendantTypes(ARTIFACT, 3), REQUIREMENT, OTHER_ARTIFACT, SOFTWARE_REQUIREMENT, SYSTEM_REQUIREMENT, SUBSYSTEM_REQUIREMENT, LAST_ARTIFACT);
-
- assertContains(artTypes.getDescendantTypes(ARTIFACT, 10), REQUIREMENT, OTHER_ARTIFACT, SOFTWARE_REQUIREMENT, SYSTEM_REQUIREMENT, SUBSYSTEM_REQUIREMENT, LAST_ARTIFACT);
- assertContains(artTypes.getDescendantTypes(ARTIFACT, -1), REQUIREMENT, OTHER_ARTIFACT, SOFTWARE_REQUIREMENT, SYSTEM_REQUIREMENT, SUBSYSTEM_REQUIREMENT, LAST_ARTIFACT);
- //@formatter:on
- }
-
- @Test
public void testIsValidAttributeType() throws OseeCoreException {
// Field 1 will only be visible on branch A and Branch D
// Field 2 will only be visible on branch B and Branch E
diff --git a/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.api.xml b/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.api.xml
index 678a89516f..f20ca9aa29 100644
--- a/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.api.xml
+++ b/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.api.xml
@@ -6,7 +6,7 @@
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setAttributeClassRegistry" cardinality="1..1" interface="org.eclipse.osee.orcs.core.internal.attribute.AttributeClassRegistry" name="AttributeClassRegistry" policy="static"/>
- <reference bind="setCacheService" cardinality="1..1" interface="org.eclipse.osee.orcs.core.ds.TempCachingService" name="IOseeCachingService" policy="static"/>
+ <reference bind="setCacheService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.TempCachingService" name="TempCachingService" policy="static"/>
<reference bind="setExecutorAdmin" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
<reference bind="setSystemPreferences" cardinality="1..1" interface="org.eclipse.osee.orcs.core.SystemPreferences" name="SystemPreferences" policy="static"/>
<reference bind="setOrcsDataStore" cardinality="1..1" interface="org.eclipse.osee.orcs.core.ds.OrcsDataStore" name="OrcsDataStore" policy="static"/>
diff --git a/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.update.cache.console.command.xml b/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.update.cache.console.command.xml
index ca290d3c62..d349a56847 100644
--- a/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.update.cache.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.core/OSGI-INF/orcs.update.cache.console.command.xml
@@ -5,5 +5,5 @@
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
<reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
- <reference bind="setCachingService" cardinality="1..1" interface="org.eclipse.osee.orcs.core.ds.TempCachingService" name="IOseeCachingService" policy="static"/>
+ <reference bind="setCachingService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.TempCachingService" name="IOseeCachingService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataModule.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataModule.java
new file mode 100644
index 0000000000..a4564f8020
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/DataModule.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.core.ds;
+
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface DataModule {
+
+ DataFactory getDataFactory();
+
+ DataLoaderFactory getDataLoaderFactory();
+
+}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
index 0066638108..c637c43f53 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsDataStore.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.AttributeTypes;
/**
* @author Roberto E. Escobar
@@ -20,9 +22,7 @@ public interface OrcsDataStore extends OrcsTypesDataStore {
DataStoreAdmin getDataStoreAdmin();
- DataFactory getDataFactory();
-
- DataLoaderFactory getDataLoaderFactory();
+ DataModule createDataModule(ArtifactTypes artifactTypes, AttributeTypes attributeTypes);
QueryEngine getQueryEngine();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsTypesDataStore.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsTypesDataStore.java
index 9546df95ca..2001b7a250 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsTypesDataStore.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsTypesDataStore.java
@@ -15,6 +15,7 @@ import java.util.concurrent.Callable;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.resource.management.IResource;
/**
@@ -24,9 +25,12 @@ public interface OrcsTypesDataStore {
Callable<IResource> getOrcsTypesLoader(String sessionId);
- Callable<?> purgeArtifactsByArtifactType(String sessionId, Collection<? extends IArtifactType> artifactTypes);
+ Callable<Void> purgeArtifactsByArtifactType(String sessionId, Collection<? extends IArtifactType> artifactTypes);
- Callable<?> purgeAttributesByAttributeType(String sessionId, Collection<? extends IAttributeType> attributeTypes);
+ Callable<Void> purgeAttributesByAttributeType(String sessionId, Collection<? extends IAttributeType> attributeTypes);
+
+ Callable<Void> purgeRelationsByRelationType(String sessionId, Collection<? extends IRelationType> relationTypes);
+
+ Callable<Void> persistTypeIdentities(String sessionId, Collection<Identity<Long>> types);
- Callable<?> purgeRelationsByRelationType(String sessionId, Collection<? extends IRelationType> relationTypes);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
index bd8a4328bc..25b9d2dbac 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/OrcsApiImpl.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.logger.Log;
@@ -33,8 +34,8 @@ import org.eclipse.osee.orcs.OrcsBranch;
import org.eclipse.osee.orcs.OrcsPerformance;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
+import org.eclipse.osee.orcs.core.ds.DataModule;
import org.eclipse.osee.orcs.core.ds.OrcsDataStore;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
import org.eclipse.osee.orcs.core.internal.artifact.ArtifactBuilderFactoryImpl;
import org.eclipse.osee.orcs.core.internal.artifact.ArtifactFactory;
import org.eclipse.osee.orcs.core.internal.attribute.AttributeClassRegistry;
@@ -130,27 +131,29 @@ public class OrcsApiImpl implements OrcsApi {
OrcsTypes orcsTypes = typesModule.createOrcsTypes(getSystemSession());
+ DataModule module = dataStore.createDataModule(orcsTypes.getArtifactTypes(), orcsTypes.getAttributeTypes());
+
RelationFactory relationFactory = new RelationFactory(orcsTypes.getRelationTypes());
AttributeClassResolver resolver = new AttributeClassResolver(registry, orcsTypes.getAttributeTypes());
AttributeFactory attributeFactory =
- new AttributeFactory(resolver, dataStore.getDataFactory(), orcsTypes.getAttributeTypes());
+ new AttributeFactory(resolver, module.getDataFactory(), orcsTypes.getAttributeTypes());
ArtifactFactory artifactFactory =
- new ArtifactFactory(dataStore.getDataFactory(), attributeFactory, relationFactory,
- cacheService.getBranchCache(), orcsTypes.getArtifactTypes());
+ new ArtifactFactory(module.getDataFactory(), attributeFactory, relationFactory, cacheService.getBranchCache(),
+ orcsTypes.getArtifactTypes());
proxyFactory = new ArtifactProxyFactory(artifactFactory);
- txUpdateFactory = new TxDataHandlerFactoryImpl(dataStore.getDataFactory());
+ txUpdateFactory = new TxDataHandlerFactoryImpl(module.getDataFactory());
ArtifactBuilderFactory builderFactory =
new ArtifactBuilderFactoryImpl(logger, proxyFactory, artifactFactory, attributeFactory);
- loaderFactory = new ArtifactLoaderFactoryImpl(dataStore.getDataLoaderFactory(), builderFactory);
+ loaderFactory = new ArtifactLoaderFactoryImpl(module.getDataLoaderFactory(), builderFactory);
queryModule =
- new QueryModule(logger, dataStore.getQueryEngine(), loaderFactory, dataStore.getDataLoaderFactory(),
+ new QueryModule(logger, dataStore.getQueryEngine(), loaderFactory, module.getDataLoaderFactory(),
orcsTypes.getArtifactTypes(), orcsTypes.getAttributeTypes());
indexerModule = new IndexerModule(logger, preferences, executorAdmin, dataStore.getQueryEngineIndexer());
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/CacheUpdateCommand.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/CacheUpdateCommand.java
index 8464078576..ff7b1a0396 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/CacheUpdateCommand.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/console/CacheUpdateCommand.java
@@ -21,10 +21,10 @@ import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.cache.IOseeCache;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.orcs.ApplicationContext;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.OrcsTypes;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypeIndex.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypeIndex.java
index 0751beeb21..22fbbc2ae7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypeIndex.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypeIndex.java
@@ -56,6 +56,11 @@ public class ArtifactTypeIndex extends TokenTypeIndex<Long, IArtifactType, XArti
return metaData;
}
+ public Map<IOseeBranch, Collection<IAttributeType>> getAllAttributeTypes(IArtifactType artifactType) {
+ ArtifactTypeMetaData metaData = tokenToTypeData.get(artifactType);
+ return metaData.attributeTypes;
+ }
+
public Collection<IArtifactType> getSuperTypes(IArtifactType artifactType) {
ArtifactTypeMetaData metaData = tokenToTypeData.get(artifactType);
return metaData != null ? metaData.getSuperTypes() : Collections.<IArtifactType> emptyList();
@@ -138,13 +143,13 @@ public class ArtifactTypeIndex extends TokenTypeIndex<Long, IArtifactType, XArti
Set<IArtifactType> originals = Sets.newHashSet(superTypes);
superTypes = Sets.newHashSet(newSuperTypes);
for (IArtifactType superType : superTypes) {
- ArtifactTypeMetaData metaData = tokenToTypeData.get(superType);
+ ArtifactTypeMetaData metaData = getOrCreateData(superType);
if (metaData != null) {
metaData.getDescendantTypes().add(type);
}
}
for (IArtifactType oldValue : originals) {
- ArtifactTypeMetaData metaData = tokenToTypeData.get(oldValue);
+ ArtifactTypeMetaData metaData = getOrCreateData(oldValue);
if (metaData != null) {
metaData.getDescendantTypes().remove(type);
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
index f4d3f935ed..10163ce838 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/ArtifactTypesImpl.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.types.impl;
import java.util.Collection;
import java.util.LinkedHashSet;
+import java.util.Map;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -30,10 +31,6 @@ public class ArtifactTypesImpl implements ArtifactTypes {
ArtifactTypeIndex getArtifactTypeIndex() throws OseeCoreException;
}
- private static final int INFINITE_DEPTH = -1;
- private static final int DEPTH_ZERO = 0;
- private static final int DEPTH_ONE = 1;
-
private final ArtifactTypeIndexProvider provider;
public ArtifactTypesImpl(ArtifactTypeIndexProvider provider) {
@@ -85,30 +82,18 @@ public class ArtifactTypesImpl implements ArtifactTypes {
}
@Override
- public Collection<? extends IArtifactType> getDescendantTypes(IArtifactType artType, int depth) throws OseeCoreException {
+ public Collection<? extends IArtifactType> getAllDescendantTypes(IArtifactType artType) throws OseeCoreException {
Conditions.checkNotNull(artType, "artifactType");
LinkedHashSet<IArtifactType> descendants = Sets.newLinkedHashSet();
- if (depth != DEPTH_ZERO) {
- int depthToUse = depth < 0 ? INFINITE_DEPTH : depth;
- walkDescendants(artType, descendants, depthToUse);
- }
+ walkDescendants(artType, descendants);
return descendants;
}
- @Override
- public Collection<? extends IArtifactType> getAllDescendantTypes(IArtifactType artType) throws OseeCoreException {
- return getDescendantTypes(artType, INFINITE_DEPTH);
- }
-
- private void walkDescendants(IArtifactType artifactType, Collection<IArtifactType> descendants, int depth) throws OseeCoreException {
+ private void walkDescendants(IArtifactType artifactType, Collection<IArtifactType> descendants) throws OseeCoreException {
Collection<IArtifactType> childTypes = getArtifactTypesIndex().getDescendantTypes(artifactType);
if (!childTypes.isEmpty()) {
- boolean isWalkNextLevelAllowed = depth > DEPTH_ONE || depth <= INFINITE_DEPTH;
- int nextLevel = depth - DEPTH_ONE;
for (IArtifactType type : childTypes) {
- if (isWalkNextLevelAllowed) {
- walkDescendants(type, descendants, nextLevel);
- }
+ walkDescendants(type, descendants);
descendants.add(type);
}
}
@@ -142,4 +127,9 @@ public class ArtifactTypesImpl implements ArtifactTypes {
return getArtifactTypesIndex().existsByUuid(item.getGuid());
}
+ @Override
+ public Map<IOseeBranch, Collection<IAttributeType>> getAllAttributeTypes(IArtifactType artType) throws OseeCoreException {
+ return getArtifactTypesIndex().getAllAttributeTypes(artType);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
index 9358222afa..cd21cefb2d 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/AttributeTypesImpl.java
@@ -195,4 +195,10 @@ public class AttributeTypesImpl implements AttributeTypes {
}
return toReturn;
}
+
+ @Override
+ public boolean isBooleanType(IAttributeType attrType) throws OseeCoreException {
+ String baseType = getBaseAttributeTypeId(attrType);
+ return baseType != null && baseType.toLowerCase().contains("boolean");
+ }
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/EnumTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/EnumTypesImpl.java
new file mode 100644
index 0000000000..3badcde156
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/EnumTypesImpl.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.core.internal.types.impl;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.orcs.core.internal.types.OrcsTypesIndexProvider;
+import org.eclipse.osee.orcs.data.EnumType;
+import org.eclipse.osee.orcs.data.EnumTypes;
+
+/**
+ * @author John Misinco
+ */
+public class EnumTypesImpl implements EnumTypes {
+
+ private final OrcsTypesIndexProvider indexProvider;
+
+ public EnumTypesImpl(OrcsTypesIndexProvider indexProvider) {
+ this.indexProvider = indexProvider;
+ }
+
+ @Override
+ public Collection<? extends EnumType> getAll() throws OseeCoreException {
+ return getIndex().getAllTokens();
+ }
+
+ @Override
+ public EnumType getByUuid(Long typeId) throws OseeCoreException {
+ return getIndex().getTokenByUuid(typeId);
+ }
+
+ @Override
+ public boolean exists(EnumType item) throws OseeCoreException {
+ return getIndex().existsByUuid(item.getGuid());
+ }
+
+ @Override
+ public boolean isEmpty() throws OseeCoreException {
+ return getAll().isEmpty();
+ }
+
+ @Override
+ public int size() throws OseeCoreException {
+ return getAll().size();
+ }
+
+ private EnumTypeIndex getIndex() throws OseeCoreException {
+ return indexProvider.getEnumTypeIndex();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesImpl.java
index 5fc90ee59b..ccbd961882 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/types/impl/OrcsTypesImpl.java
@@ -13,11 +13,13 @@ package org.eclipse.osee.orcs.core.internal.types.impl;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.concurrent.Callable;
import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.resource.management.IResource;
@@ -30,6 +32,7 @@ import org.eclipse.osee.orcs.core.internal.types.OrcsTypesLoaderFactory;
import org.eclipse.osee.orcs.core.internal.types.OrcsTypesResourceProvider;
import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.eclipse.osee.orcs.data.EnumTypes;
import org.eclipse.osee.orcs.data.RelationTypes;
/**
@@ -47,6 +50,7 @@ public class OrcsTypesImpl implements OrcsTypes {
private final ArtifactTypes artifactTypes;
private final AttributeTypes attributeTypes;
private final RelationTypes relationTypes;
+ private final EnumTypes enumTypes;
public OrcsTypesImpl(Log logger, SessionContext session, OrcsTypesDataStore dataStore, OrcsTypesLoaderFactory loaderFactory, OrcsTypesIndexProvider indexProvider) {
this.logger = logger;
@@ -59,6 +63,7 @@ public class OrcsTypesImpl implements OrcsTypes {
this.artifactTypes = new ArtifactTypesImpl(indexProvider);
this.attributeTypes = new AttributeTypesImpl(indexProvider, indexProvider);
this.relationTypes = new RelationTypesImpl(indexProvider);
+ this.enumTypes = new EnumTypesImpl(indexProvider);
}
@Override
@@ -77,12 +82,17 @@ public class OrcsTypesImpl implements OrcsTypes {
}
@Override
+ public EnumTypes getEnumTypes() {
+ return enumTypes;
+ }
+
+ @Override
public void invalidateAll() {
indexProvider.invalidate();
}
@Override
- public Callable<?> loadTypes(final IResource resource, final boolean isInitializing) {
+ public Callable<Void> loadTypes(final IResource resource, final boolean isInitializing) {
return new CancellableCallable<Void>() {
@Override
public Void call() throws Exception {
@@ -99,7 +109,7 @@ public class OrcsTypesImpl implements OrcsTypes {
}
@Override
- public Callable<?> writeTypes(final OutputStream outputStream) {
+ public Callable<Void> writeTypes(final OutputStream outputStream) {
return new CancellableCallable<Void>() {
@Override
public Void call() throws Exception {
@@ -122,18 +132,35 @@ public class OrcsTypesImpl implements OrcsTypes {
}
@Override
- public Callable<?> purgeArtifactsByArtifactType(Collection<? extends IArtifactType> artifactTypes) {
+ public Callable<Void> purgeArtifactsByArtifactType(Collection<? extends IArtifactType> artifactTypes) {
return dataStore.purgeArtifactsByArtifactType(session.getSessionId(), artifactTypes);
}
@Override
- public Callable<?> purgeAttributesByAttributeType(Collection<? extends IAttributeType> attributeTypes) {
+ public Callable<Void> purgeAttributesByAttributeType(Collection<? extends IAttributeType> attributeTypes) {
return dataStore.purgeAttributesByAttributeType(session.getSessionId(), attributeTypes);
}
@Override
- public Callable<?> purgeRelationsByRelationType(Collection<? extends IRelationType> relationTypes) {
+ public Callable<Void> purgeRelationsByRelationType(Collection<? extends IRelationType> relationTypes) {
return dataStore.purgeRelationsByRelationType(session.getSessionId(), relationTypes);
}
+ @Override
+ public Callable<Void> save() {
+ return new Callable<Void>() {
+
+ @Override
+ public Void call() throws Exception {
+ Collection<Identity<Long>> types = new LinkedList<Identity<Long>>();
+ types.addAll(artifactTypes.getAll());
+ types.addAll(attributeTypes.getAll());
+ types.addAll(relationTypes.getAll());
+ types.addAll(enumTypes.getAll());
+ dataStore.persistTypeIdentities(session.getSessionId(), types).call();
+ return null;
+ }
+ };
+ }
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
index a0e9c0f67f..ef241261e5 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
@@ -16,6 +16,7 @@ import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Active;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.UriGeneralStringData;
import static org.eclipse.osee.framework.core.enums.CoreRelationTypes.Default_Hierarchical__Parent;
+import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.sort;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.verifyData;
@@ -26,10 +27,10 @@ import java.util.Iterator;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.LoadLevel;
-import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.ds.ArtifactBuilder;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.ArtifactDataHandler;
@@ -40,6 +41,8 @@ import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
import org.eclipse.osee.orcs.core.ds.OrcsDataStore;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.RelationDataHandler;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.AttributeTypes;
import org.eclipse.osee.orcs.db.mock.OsgiService;
import org.junit.Before;
import org.junit.Rule;
@@ -67,25 +70,41 @@ public class LoaderTest {
@Captor private ArgumentCaptor<ArtifactData> artifactCaptor;
@Captor private ArgumentCaptor<AttributeData> attributeCaptor;
@Captor private ArgumentCaptor<RelationData> relationCaptor;
+ @Mock OrcsTypes types;
+ @Mock ArtifactTypes artTypes;
+ @Mock AttributeTypes attrTypes;
// @formatter:on
private String sessionId;
private HasCancellation cancellation;
+ private DataLoaderFactory loaderFactory;
@Before
- public void setUp() {
+ public void setUp() throws OseeCoreException {
MockitoAnnotations.initMocks(this);
+ loaderFactory = dataStore.createDataModule(artTypes, attrTypes).getDataLoaderFactory();
+
sessionId = GUID.create();
when(builder.createArtifactDataHandler()).thenReturn(artifactHandler);
when(builder.createAttributeDataHandler()).thenReturn(attributeHandler);
when(builder.createRelationDataHandler()).thenReturn(relationHandler);
+
+ when(artTypes.getByUuid(OseeTypeDefinition.getGuid())).thenReturn(OseeTypeDefinition);
+ when(artTypes.getByUuid(Folder.getGuid())).thenReturn(Folder);
+
+ when(attrTypes.getByUuid(Name.getGuid())).thenReturn(Name);
+ when(attrTypes.getByUuid(UriGeneralStringData.getGuid())).thenReturn(UriGeneralStringData);
+ when(attrTypes.getByUuid(Active.getGuid())).thenReturn(Active);
+
+ when(attrTypes.getAttributeProviderId(Name)).thenReturn("DefaultAttributeDataProvider");
+ when(attrTypes.getAttributeProviderId(UriGeneralStringData)).thenReturn("DefaultAttributeDataProvider");
+ when(attrTypes.getAttributeProviderId(Active)).thenReturn("DefaultAttributeDataProvider");
}
@org.junit.Test
public void testLoad() throws OseeCoreException {
- DataLoaderFactory loaderFactory = dataStore.getDataLoaderFactory();
DataLoader loader = loaderFactory.fromBranchAndArtifactIds(sessionId, CoreBranches.COMMON, 5, 6, 7);
loader.setLoadLevel(LoadLevel.FULL);
@@ -103,59 +122,37 @@ public class LoaderTest {
Iterator<ArtifactData> arts = artifactCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 15L);
- verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 16L);
- verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3",
- ModificationType.NEW, Folder.getGuid(), 2, 6, -1, 43L);
+ verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 15L);
+ verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 16L);
+ verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3", NEW, Folder.getGuid(), 2, 6, -1, 43L);
// @formatter:on
sort(attributeCaptor.getAllValues());
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 9, 5, ModificationType.NEW, Name.getGuid(), 2,
- 5, -1, 5L,
- "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework",
- "");
- verifyData(attrs.next(), 10, 5, ModificationType.NEW,
- UriGeneralStringData.getGuid(), 2, 5, -1, 6L, "",
- "attr://6/AkA10I4aUSDLuFNIaegA.zip");
- verifyData(attrs.next(), 11, 5, ModificationType.NEW, Active.getGuid(),
- 2, 5, -1, 7L, "true", "");
-
- verifyData(attrs.next(), 12, 6, ModificationType.NEW, Name.getGuid(),
- 2, 5, -1, 8L, "org.eclipse.osee.coverage.OseeTypes_Coverage",
- "");
- verifyData(attrs.next(), 13, 6, ModificationType.NEW,
- UriGeneralStringData.getGuid(), 2, 5, -1, 9L, "",
- "attr://9/AkA10LiAPEZLR4+jdFQA.zip");
- verifyData(attrs.next(), 14, 6, ModificationType.NEW, Active.getGuid(),
- 2, 5, -1, 10L, "true", "");
-
- verifyData(attrs.next(), 17, 7, ModificationType.NEW, Name.getGuid(),
- 2, 6, -1, 33L, "User Groups", "");
+ verifyData(attrs.next(), 9, 5, NEW, Name.getGuid(), 2, 5, -1, 5L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
+ verifyData(attrs.next(), 10, 5, NEW, UriGeneralStringData.getGuid(), 2, 5, -1, 6L, "", "attr://6/AkA10I4aUSDLuFNIaegA.zip");
+ verifyData(attrs.next(), 11, 5, NEW, Active.getGuid(), 2, 5, -1, 7L, "true", "");
+
+ verifyData(attrs.next(), 12, 6, NEW, Name.getGuid(), 2, 5, -1, 8L, "org.eclipse.osee.coverage.OseeTypes_Coverage", "");
+ verifyData(attrs.next(), 13, 6, NEW, UriGeneralStringData.getGuid(), 2, 5, -1, 9L, "", "attr://9/AkA10LiAPEZLR4+jdFQA.zip");
+ verifyData(attrs.next(), 14, 6, NEW, Active.getGuid(), 2, 5, -1, 10L, "true", "");
+ verifyData(attrs.next(), 17, 7, NEW, Name.getGuid(), 2, 6, -1, 33L, "User Groups", "");
// @formatter:on
sort(relationCaptor.getAllValues());
Iterator<RelationData> rels = relationCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(rels.next(), 1, 7, 7, 8, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 53L);
- verifyData(rels.next(), 2, 7, 1, 7, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
- verifyData(rels.next(), 3, 7, 7, 15, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
+ verifyData(rels.next(), 1, 7, 7, 8, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 53L);
+ verifyData(rels.next(), 2, 7, 1, 7, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
+ verifyData(rels.next(), 3, 7, 7, 15, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
// @formatter:on
}
@org.junit.Test
public void testLoadByTypes() throws OseeCoreException {
- DataLoaderFactory loaderFactory = dataStore.getDataLoaderFactory();
DataLoader loader = loaderFactory.fromBranchAndArtifactIds(sessionId, CoreBranches.COMMON, 5, 6, 7);
loader.setLoadLevel(LoadLevel.FULL);
@@ -176,47 +173,32 @@ public class LoaderTest {
Iterator<ArtifactData> arts = artifactCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 15L);
- verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 16L);
- verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3",
- ModificationType.NEW, Folder.getGuid(), 2, 6, -1, 43L);
+ verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 15L);
+ verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 16L);
+ verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3", NEW, Folder.getGuid(), 2, 6, -1, 43L);
// @formatter:on
sort(attributeCaptor.getAllValues());
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 9, 5, ModificationType.NEW, Name.getGuid(), 2,
- 5, -1, 5L,
- "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework",
- "");
- verifyData(attrs.next(), 12, 6, ModificationType.NEW, Name.getGuid(),
- 2, 5, -1, 8L, "org.eclipse.osee.coverage.OseeTypes_Coverage",
- "");
- verifyData(attrs.next(), 17, 7, ModificationType.NEW, Name.getGuid(),
- 2, 6, -1, 33L, "User Groups", "");
+ verifyData(attrs.next(), 9, 5, NEW, Name.getGuid(), 2, 5, -1, 5L, "org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "");
+ verifyData(attrs.next(), 12, 6, NEW, Name.getGuid(), 2, 5, -1, 8L, "org.eclipse.osee.coverage.OseeTypes_Coverage", "");
+ verifyData(attrs.next(), 17, 7, NEW, Name.getGuid(), 2, 6, -1, 33L, "User Groups", "");
// @formatter:on
sort(relationCaptor.getAllValues());
Iterator<RelationData> rels = relationCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(rels.next(), 1, 7, 7, 8, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 53L);
- verifyData(rels.next(), 2, 7, 1, 7, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
- verifyData(rels.next(), 3, 7, 7, 15, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
+ verifyData(rels.next(), 1, 7, 7, 8, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 53L);
+ verifyData(rels.next(), 2, 7, 1, 7, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
+ verifyData(rels.next(), 3, 7, 7, 15, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
// @formatter:on
}
@org.junit.Test
public void testLoadByIds() throws OseeCoreException {
- DataLoaderFactory loaderFactory = dataStore.getDataLoaderFactory();
DataLoader loader = loaderFactory.fromBranchAndArtifactIds(sessionId, CoreBranches.COMMON, 5, 6, 7);
loader.setLoadLevel(LoadLevel.FULL);
@@ -237,34 +219,25 @@ public class LoaderTest {
Iterator<ArtifactData> arts = artifactCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 15L);
- verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y",
- ModificationType.NEW, OseeTypeDefinition.getGuid(), 2, 5, -1,
- 16L);
- verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3",
- ModificationType.NEW, Folder.getGuid(), 2, 6, -1, 43L);
+ verifyData(arts.next(), 5, "AkA10I4aUSDLuFNIaegA", "3VY6B", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 15L);
+ verifyData(arts.next(), 6, "AkA10LiAPEZLR4+jdFQA", "N782Y", NEW, OseeTypeDefinition.getGuid(), 2, 5, -1, 16L);
+ verifyData(arts.next(), 7, "AkA2AcT6AXe6ivMFRhAA", "LBVP3", NEW, Folder.getGuid(), 2, 6, -1, 43L);
// @formatter:on
sort(attributeCaptor.getAllValues());
Iterator<AttributeData> attrs = attributeCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(attrs.next(), 11, 5, ModificationType.NEW, Active.getGuid(),
- 2, 5, -1, 7L, "true", "");
- verifyData(attrs.next(), 14, 6, ModificationType.NEW, Active.getGuid(),
- 2, 5, -1, 10L, "true", "");
+ verifyData(attrs.next(), 11, 5, NEW, Active.getGuid(), 2, 5, -1, 7L, "true", "");
+ verifyData(attrs.next(), 14, 6, NEW, Active.getGuid(), 2, 5, -1, 10L, "true", "");
// @formatter:on
sort(relationCaptor.getAllValues());
Iterator<RelationData> rels = relationCaptor.getAllValues().iterator();
// @formatter:off
- verifyData(rels.next(), 2, 7, 1, 7, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
- verifyData(rels.next(), 3, 7, 7, 15, "", ModificationType.NEW,
- Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
+ verifyData(rels.next(), 2, 7, 1, 7, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 52L);
+ verifyData(rels.next(), 3, 7, 7, 15, "", NEW, Default_Hierarchical__Parent.getGuid(), 2, 6, -1, 54L);
// @formatter:on
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
index 00655bc978..4854eb5d91 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryTest.java
@@ -10,12 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.change;
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
-import org.junit.Assert;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -39,6 +42,8 @@ import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.RelationDataHandler;
import org.eclipse.osee.orcs.core.ds.VersionData;
+import org.eclipse.osee.orcs.db.internal.loader.DataModuleFactory;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,6 +69,7 @@ public class MissingChangeItemFactoryTest {
@Mock private Branch destBranch;
@Mock private TransactionRecord sourceTx;
@Mock private TransactionRecord destTx;
+ @Mock private DataModuleFactory dataModuleFactory;
// @formatter:on
private MissingChangeItemFactory changeItemFactory;
@@ -103,7 +109,8 @@ public class MissingChangeItemFactoryTest {
destDataLoader);
when(sourceTx.getBranch()).thenReturn(sourceBranch);
when(destTx.getBranch()).thenReturn(destBranch);
- changeItemFactory = new MissingChangeItemFactoryImpl(dataLoaderFactory, identityService);
+ when(dataModuleFactory.getDataLoaderFactory()).thenReturn(dataLoaderFactory);
+ changeItemFactory = new MissingChangeItemFactoryImpl(dataModuleFactory, identityService);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactoryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactoryTest.java
index 6956059b30..d1b468f899 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactoryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactoryTest.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
-import org.junit.Assert;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.DataProxyFactory;
+import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -37,8 +37,8 @@ public class AttributeDataProxyFactoryTest {
//@formatter:off
@Mock DataProxyFactoryProvider proxyProvider;
- @Mock AttributeTypeCache attributeTypeCache;
- @Mock AttributeType attributeType;
+ @Mock AttributeTypes attributeTypeCache;
+ @Mock IAttributeType attributeType;
@Mock DataProxyFactory dataProxyFactory;
@Mock DataProxy proxy;
//@formatter:on
@@ -87,8 +87,8 @@ public class AttributeDataProxyFactoryTest {
String value = "hello";
String uri = "theUri";
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
thrown.expect(OseeArgumentException.class);
thrown.expectMessage("DataProxyFactory cannot be null - Unable to find data proxy factory for [proxyfactory]");
@@ -101,8 +101,8 @@ public class AttributeDataProxyFactoryTest {
String value = "hello";
String uri = "theUri";
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
Mockito.when(proxyProvider.getFactory("proxyfactory")).thenReturn(dataProxyFactory);
Mockito.when(dataProxyFactory.createInstance("proxyfactory")).thenReturn(proxy);
@@ -118,8 +118,8 @@ public class AttributeDataProxyFactoryTest {
String value = "hello";
String uri = null;
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
Mockito.when(proxyProvider.getFactory("proxyfactory")).thenReturn(dataProxyFactory);
Mockito.when(dataProxyFactory.createInstance("proxyfactory")).thenReturn(proxy);
@@ -135,8 +135,8 @@ public class AttributeDataProxyFactoryTest {
String value = null;
String uri = "theUri";
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
Mockito.when(proxyProvider.getFactory("proxyfactory")).thenReturn(dataProxyFactory);
Mockito.when(dataProxyFactory.createInstance("proxyfactory")).thenReturn(proxy);
@@ -152,8 +152,8 @@ public class AttributeDataProxyFactoryTest {
String value = null;
String uri = null;
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
Mockito.when(proxyProvider.getFactory("proxyfactory")).thenReturn(dataProxyFactory);
Mockito.when(dataProxyFactory.createInstance("proxyfactory")).thenReturn(proxy);
@@ -169,8 +169,8 @@ public class AttributeDataProxyFactoryTest {
String value = "hello";
String uri = null;
- Mockito.when(attributeTypeCache.getByGuid(45L)).thenReturn(attributeType);
- Mockito.when(attributeType.getAttributeProviderId()).thenReturn("org.eclipse.proxyfactory");
+ Mockito.when(attributeTypeCache.getByUuid(45L)).thenReturn(attributeType);
+ Mockito.when(attributeTypeCache.getAttributeProviderId(attributeType)).thenReturn("org.eclipse.proxyfactory");
Mockito.when(proxyProvider.getFactory("proxyfactory")).thenReturn(dataProxyFactory);
Mockito.when(dataProxyFactory.createInstance("proxyfactory")).thenReturn(proxy);
@@ -181,19 +181,19 @@ public class AttributeDataProxyFactoryTest {
Mockito.reset(spy);
- Mockito.when(attributeType.isEnumerated()).thenReturn(true);
+ Mockito.when(attributeTypeCache.isEnumerated(attributeType)).thenReturn(true);
spy.createProxy(typeUuid, value, uri);
Mockito.verify(spy).intern(value);
Mockito.reset(spy);
- Mockito.when(attributeType.isEnumerated()).thenReturn(false);
+ Mockito.when(attributeTypeCache.isEnumerated(attributeType)).thenReturn(false);
spy.createProxy(typeUuid, value, uri);
Mockito.verify(spy, Mockito.times(0)).intern(value);
Mockito.reset(spy);
- Mockito.when(attributeType.getBaseAttributeTypeId()).thenReturn("hellobooleanx");
+ Mockito.when(attributeTypeCache.isBooleanType(attributeType)).thenReturn(true);
spy.createProxy(typeUuid, value, uri);
Mockito.verify(spy).intern(value);
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
index b643ff73d4..a417d7d269 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -22,8 +22,6 @@ import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
@@ -33,6 +31,7 @@ import org.eclipse.osee.orcs.core.ds.DataFactory;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.HasLocalId;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
import org.eclipse.osee.orcs.db.internal.loader.data.OrcsObjectFactoryImpl;
@@ -57,7 +56,7 @@ public class DataFactoryImplTest {
@Mock private IdFactory idFactory;
@Mock private ProxyDataFactory proxyFactory;
@Mock private IdentityService identityService;
- @Mock private ArtifactTypeCache artifactCache;
+ @Mock private ArtifactTypes artifactCache;
@Mock private ArtifactData artData;
@Mock private AttributeData attrData;
@@ -66,7 +65,6 @@ public class DataFactoryImplTest {
@Mock private DataProxy dataProxy;
@Mock private DataProxy otherDataProxy;
- @Mock private ArtifactType artifactType;
@Mock private IArtifactType artifactTypeToken;
//@formatter:on
@@ -133,60 +131,49 @@ public class DataFactoryImplTest {
}
@Test
- public void testCreateArtifactDataNullType() throws OseeCoreException {
- when(artifactTypeToken.toString()).thenReturn("artifactTypeToken");
- when(artifactCache.get(artifactTypeToken)).thenReturn(null);
-
- thrown.expect(OseeArgumentException.class);
- thrown.expectMessage("artifactType cannot be null - Unable to find artifactType matching [artifactTypeToken]");
- dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid, hrid);
- }
-
- @Test
public void testCreateArtifactDataUsingAbstratArtifactType() throws OseeCoreException {
- when(artifactType.toString()).thenReturn("artifactType");
- when(artifactCache.get(artifactTypeToken)).thenReturn(artifactType);
- when(artifactType.isAbstract()).thenReturn(true);
+ when(artifactTypeToken.toString()).thenReturn("artifactTypeToken");
+ when(artifactCache.getByUuid(artifactTypeToken.getGuid())).thenReturn(artifactTypeToken);
+ when(artifactCache.isAbstract(artifactTypeToken)).thenReturn(true);
thrown.expect(OseeArgumentException.class);
- thrown.expectMessage("Cannot create an instance of abstract type [artifactType]");
+ thrown.expectMessage("Cannot create an instance of abstract type [artifactTypeToken]");
dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid, hrid);
}
@Test
public void testCreateArtifactDataInvalidGuid() throws OseeCoreException {
- when(artifactCache.get(artifactTypeToken)).thenReturn(artifactType);
- when(artifactType.isAbstract()).thenReturn(false);
- when(artifactType.toString()).thenReturn("artifactType");
+ when(artifactCache.getByUuid(artifactTypeToken.getGuid())).thenReturn(artifactTypeToken);
+ when(artifactCache.isAbstract(artifactTypeToken)).thenReturn(false);
+ when(artifactTypeToken.toString()).thenReturn("artifactTypeToken");
when(idFactory.getUniqueGuid(guid)).thenReturn("123");
thrown.expect(OseeArgumentException.class);
- thrown.expectMessage("Invalid guid [123] during artifact creation [type: artifactType]");
+ thrown.expectMessage("Invalid guid [123] during artifact creation [type: artifactTypeToken]");
dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid, hrid);
}
@Test
public void testCreateArtifactDataInvalidHrid() throws OseeCoreException {
- when(artifactCache.get(artifactTypeToken)).thenReturn(artifactType);
- when(artifactType.isAbstract()).thenReturn(false);
- when(artifactType.toString()).thenReturn("artifactType");
+ when(artifactCache.getByUuid(artifactTypeToken.getGuid())).thenReturn(artifactTypeToken);
+ when(artifactCache.isAbstract(artifactTypeToken)).thenReturn(false);
+ when(artifactTypeToken.toString()).thenReturn("artifactTypeToken");
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getUniqueHumanReadableId(hrid)).thenReturn("123");
thrown.expect(OseeArgumentException.class);
- thrown.expectMessage("Invalid human readable id [123] during artifact creation [type: artifactType, guid: " + guid + "]");
+ thrown.expectMessage("Invalid human readable id [123] during artifact creation [type: artifactTypeToken, guid: " + guid + "]");
dataFactory.create(CoreBranches.COMMON, artifactTypeToken, guid, hrid);
}
@Test
public void testCreateArtifactData() throws OseeCoreException {
- when(artifactCache.get(artifactTypeToken)).thenReturn(artifactType);
- when(artifactType.getGuid()).thenReturn(4536L);
- when(artifactType.isAbstract()).thenReturn(false);
+ when(artifactCache.isAbstract(artifactTypeToken)).thenReturn(false);
+ when(artifactTypeToken.getGuid()).thenReturn(4536L);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getUniqueHumanReadableId(hrid)).thenReturn(hrid);
when(idFactory.getNextArtifactId()).thenReturn(987);
@@ -219,9 +206,9 @@ public class DataFactoryImplTest {
public void testCreateArtifactDataGenerateHrid() throws OseeCoreException {
String newHrid = HumanReadableId.generate();
- when(artifactCache.get(artifactTypeToken)).thenReturn(artifactType);
- when(artifactType.getGuid()).thenReturn(4536L);
- when(artifactType.isAbstract()).thenReturn(false);
+ when(artifactCache.getByUuid(artifactTypeToken.getGuid())).thenReturn(artifactTypeToken);
+ when(artifactTypeToken.getGuid()).thenReturn(4536L);
+ when(artifactCache.isAbstract(artifactTypeToken)).thenReturn(false);
when(idFactory.getUniqueGuid(guid)).thenReturn(guid);
when(idFactory.getUniqueHumanReadableId(null)).thenReturn(newHrid);
when(idFactory.getNextArtifactId()).thenReturn(987);
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
index 6cbc96dc2a..8dddec5085 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
@@ -3,7 +3,7 @@
<implementation class="org.eclipse.osee.orcs.db.internal.OrcsDataStoreImpl"/>
<service>
<provide interface="org.eclipse.osee.orcs.core.ds.OrcsDataStore"/>
- <provide interface="org.eclipse.osee.framework.core.services.IOseeCachingService"/>
+ <provide interface="org.eclipse.osee.framework.core.services.TempCachingService"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
index 74d2b392d4..4d8d395673 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java
@@ -11,12 +11,15 @@
package org.eclipse.osee.orcs.db.internal;
import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
import java.util.concurrent.Callable;
import org.eclipse.osee.event.EventService;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.enums.OseeCacheEnum;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
@@ -24,19 +27,20 @@ import org.eclipse.osee.framework.core.model.cache.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceManager;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.SystemPreferences;
import org.eclipse.osee.orcs.core.ds.BranchDataStore;
-import org.eclipse.osee.orcs.core.ds.DataFactory;
-import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
+import org.eclipse.osee.orcs.core.ds.DataModule;
import org.eclipse.osee.orcs.core.ds.DataStoreAdmin;
import org.eclipse.osee.orcs.core.ds.OrcsDataStore;
import org.eclipse.osee.orcs.core.ds.QueryEngine;
import org.eclipse.osee.orcs.core.ds.QueryEngineIndexer;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.AttributeTypes;
import org.eclipse.osee.orcs.db.internal.branch.BranchDataStoreImpl;
import org.eclipse.osee.orcs.db.internal.callable.OrcsTypeLoaderCallable;
import org.eclipse.osee.orcs.db.internal.callable.PurgeArtifactTypeDatabaseTxCallable;
@@ -72,6 +76,8 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService {
private BranchDataStore branchStore;
private DataModuleFactory dataModuleFactory;
private QueryModuleFactory queryModule;
+ private IdFactory idFactory;
+ private SqlProvider sqlProvider;
private TempCachingService cacheService;
@@ -118,23 +124,18 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService {
cacheService = modelingService.createCachingService(true);
- StaticSqlProvider sqlProvider = new StaticSqlProvider();
- sqlProvider.setLogger(logger);
- sqlProvider.setPreferences(preferences);
+ sqlProvider = createSqlProvider();
- IdFactory idFactory = new IdFactoryImpl(dbService, cacheService.getBranchCache());
+ idFactory = new IdFactoryImpl(dbService, cacheService.getBranchCache());
dataModuleFactory = new DataModuleFactory(logger);
- dataModuleFactory.create(dbService, idFactory, identityService, sqlProvider, proxyProvider,
- cacheService.getBranchCache());
MissingChangeItemFactory missingChangeItemFactory =
- new MissingChangeItemFactoryImpl(dataModuleFactory.getDataLoaderFactory(), identityService);
+ new MissingChangeItemFactoryImpl(dataModuleFactory, identityService);
branchStore =
new BranchDataStoreImpl(logger, dbService, identityService, cacheService, preferences, executorAdmin,
- resourceManager, modelFactory, idFactory, dataModuleFactory.getDataLoaderFactory(),
- missingChangeItemFactory);
+ resourceManager, modelFactory, idFactory, dataModuleFactory, missingChangeItemFactory);
dataStoreAdmin = new DataStoreAdminImpl(logger, dbService, identityService, branchStore, preferences);
@@ -154,6 +155,13 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService {
dataStoreAdmin = null;
}
+ private SqlProvider createSqlProvider() {
+ StaticSqlProvider toReturn = new StaticSqlProvider();
+ toReturn.setLogger(logger);
+ toReturn.setPreferences(preferences);
+ return toReturn;
+ }
+
@Override
public BranchDataStore getBranchDataStore() {
return branchStore;
@@ -165,13 +173,9 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService {
}
@Override
- public DataFactory getDataFactory() {
- return dataModuleFactory.getDataFactory();
- }
-
- @Override
- public DataLoaderFactory getDataLoaderFactory() {
- return dataModuleFactory.getDataLoaderFactory();
+ public DataModule createDataModule(ArtifactTypes artifactTypes, AttributeTypes attributeTypes) {
+ return dataModuleFactory.create(dbService, idFactory, identityService, sqlProvider, proxyProvider,
+ cacheService.getBranchCache(), artifactTypes, attributeTypes);
}
@Override
@@ -224,18 +228,33 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService {
}
@Override
- public Callable<?> purgeArtifactsByArtifactType(String sessionId, Collection<? extends IArtifactType> typesToPurge) {
+ public Callable<Void> purgeArtifactsByArtifactType(String sessionId, Collection<? extends IArtifactType> typesToPurge) {
return new PurgeArtifactTypeDatabaseTxCallable(logger, dbService, identityService, typesToPurge);
}
@Override
- public Callable<?> purgeAttributesByAttributeType(String sessionId, Collection<? extends IAttributeType> typesToPurge) {
+ public Callable<Void> purgeAttributesByAttributeType(String sessionId, Collection<? extends IAttributeType> typesToPurge) {
return new PurgeAttributeTypeDatabaseTxCallable(logger, dbService, identityService, typesToPurge);
}
@Override
- public Callable<?> purgeRelationsByRelationType(String sessionId, Collection<? extends IRelationType> typesToPurge) {
+ public Callable<Void> purgeRelationsByRelationType(String sessionId, Collection<? extends IRelationType> typesToPurge) {
return new PurgeRelationTypeDatabaseTxCallable(logger, dbService, identityService, typesToPurge);
}
+ @Override
+ public Callable<Void> persistTypeIdentities(String sessionId, final Collection<Identity<Long>> types) {
+ return new Callable<Void>() {
+
+ @Override
+ public Void call() throws Exception {
+ List<Long> toPersist = new LinkedList<Long>();
+ for (Identity<Long> type : types) {
+ toPersist.add(type.getGuid());
+ }
+ identityService.store(toPersist);
+ return null;
+ }
+ };
+ }
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
index 4465ed3b4a..8a5e5bc1f6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchDataStoreImpl.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -30,8 +31,6 @@ import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
import org.eclipse.osee.orcs.core.ds.BranchDataStore;
-import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
import org.eclipse.osee.orcs.core.ds.TransactionData;
import org.eclipse.osee.orcs.core.ds.TransactionResult;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -47,6 +46,7 @@ import org.eclipse.osee.orcs.db.internal.callable.PurgeBranchDatabaseCallable;
import org.eclipse.osee.orcs.db.internal.callable.PurgeTransactionTxCallable;
import org.eclipse.osee.orcs.db.internal.change.MissingChangeItemFactory;
import org.eclipse.osee.orcs.db.internal.exchange.ExportItemFactory;
+import org.eclipse.osee.orcs.db.internal.loader.DataModuleFactory;
import org.eclipse.osee.orcs.db.internal.loader.IdFactory;
import org.eclipse.osee.orcs.db.internal.transaction.CheckProvider;
import org.eclipse.osee.orcs.db.internal.transaction.CommitTransactionDatabaseTxCallable;
@@ -73,10 +73,10 @@ public class BranchDataStoreImpl implements BranchDataStore {
private final IOseeModelFactoryService modelFactory;
private final IdFactory idFactory;
- private final DataLoaderFactory dataLoader;
+ private final DataModuleFactory dataLoader;
private final MissingChangeItemFactory missingChangeItemFactory;
- public BranchDataStoreImpl(Log logger, IOseeDatabaseService dbService, IdentityService identityService, TempCachingService cachingService, SystemPreferences preferences, ExecutorAdmin executorAdmin, IResourceManager resourceManager, IOseeModelFactoryService modelFactory, IdFactory idFactory, DataLoaderFactory dataLoader, MissingChangeItemFactory missingChangeItemFactory) {
+ public BranchDataStoreImpl(Log logger, IOseeDatabaseService dbService, IdentityService identityService, TempCachingService cachingService, SystemPreferences preferences, ExecutorAdmin executorAdmin, IResourceManager resourceManager, IOseeModelFactoryService modelFactory, IdFactory idFactory, DataModuleFactory dataModuleFactory, MissingChangeItemFactory missingChangeItemFactory) {
super();
this.logger = logger;
this.dbService = dbService;
@@ -87,7 +87,7 @@ public class BranchDataStoreImpl implements BranchDataStore {
this.resourceManager = resourceManager;
this.modelFactory = modelFactory;
this.idFactory = idFactory;
- this.dataLoader = dataLoader;
+ this.dataLoader = dataModuleFactory;
this.missingChangeItemFactory = missingChangeItemFactory;
}
@@ -156,7 +156,7 @@ public class BranchDataStoreImpl implements BranchDataStore {
@Override
public Collection<TransactionCheck> getTransactionChecks() {
- return Collections.<TransactionCheck> singletonList(new ComodificationCheck(dataLoader));
+ return Collections.<TransactionCheck> singletonList(new ComodificationCheck(dataLoader.getDataLoaderFactory()));
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
index 4155185289..d48faea851 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.callable;
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.net.URI;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
import java.util.Collection;
import java.util.LinkedHashSet;
import org.eclipse.osee.executor.admin.CancellableCallable;
@@ -142,10 +140,13 @@ public class OrcsTypeLoaderCallable extends CancellableCallable<IResource> {
Lib.close(inputStream);
}
}
- char[] chars = new char[builder.length()];
- builder.getChars(0, builder.length(), chars, 0);
- byte[] bytes = Charset.forName("UTF-8").encode(CharBuffer.wrap(chars)).array();
- return new ByteArrayInputStream(bytes);
+ InputStream toReturn = null;
+ try {
+ toReturn = Lib.stringToInputStream(builder.toString());
+ } catch (UnsupportedEncodingException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return toReturn;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
index cb367cb343..552a1ac3d5 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/MissingChangeItemFactoryImpl.java
@@ -36,6 +36,7 @@ import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.RelationDataHandler;
import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.db.internal.loader.DataModuleFactory;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
@@ -44,12 +45,12 @@ import com.google.common.collect.Multimap;
*/
public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
- private final DataLoaderFactory dataLoaderFactory;
+ private final DataModuleFactory dataLoaderFactory;
private final IdentityService identityService;
- public MissingChangeItemFactoryImpl(DataLoaderFactory dataLoader, IdentityService identityService) {
+ public MissingChangeItemFactoryImpl(DataModuleFactory dataModuleFactory, IdentityService identityService) {
super();
- this.dataLoaderFactory = dataLoader;
+ this.dataLoaderFactory = dataModuleFactory;
this.identityService = identityService;
}
@@ -88,7 +89,8 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
}
private Set<Integer> determineWhichArtifactsNotOnDestination(Set<Integer> artIds, TransactionRecord destTx, String sessionId) throws OseeCoreException {
- DataLoader loader = dataLoaderFactory.fromBranchAndArtifactIds(sessionId, destTx.getBranch(), artIds);
+ DataLoaderFactory factory = dataLoaderFactory.getDataLoaderFactory();
+ DataLoader loader = factory.fromBranchAndArtifactIds(sessionId, destTx.getBranch(), artIds);
final Set<Integer> missingArtIds = new LinkedHashSet<Integer>(artIds);
loader.includeDeleted();
loader.fromTransaction(destTx.getId());
@@ -129,7 +131,9 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
final Set<ChangeItem> toReturn = new LinkedHashSet<ChangeItem>();
final Set<RelationData> relations = new LinkedHashSet<RelationData>();
- DataLoader loader = dataLoaderFactory.fromBranchAndArtifactIds(sessionId, sourceTx.getBranch(), missingArtIds);
+ DataLoader loader =
+ dataLoaderFactory.getDataLoaderFactory().fromBranchAndArtifactIds(sessionId, sourceTx.getBranch(),
+ missingArtIds);
loader.setLoadLevel(LoadLevel.FULL);
loader.includeDeleted();
loader.fromTransaction(sourceTx.getId());
@@ -208,7 +212,8 @@ public class MissingChangeItemFactoryImpl implements MissingChangeItemFactory {
final Set<RelationChangeItem> toReturn = new LinkedHashSet<RelationChangeItem>();
DataLoader loader =
- dataLoaderFactory.fromBranchAndArtifactIds(sessionId, destTx.getBranch(), relationChangesToAdd.keySet());
+ dataLoaderFactory.getDataLoaderFactory().fromBranchAndArtifactIds(sessionId, destTx.getBranch(),
+ relationChangesToAdd.keySet());
loader.fromTransaction(destTx.getId());
loader.load(null, new ArtifactBuilder() {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactory.java
index ade07a9b58..908790cc23 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/AttributeDataProxyFactory.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.orcs.core.ds.DataProxy;
import org.eclipse.osee.orcs.core.ds.DataProxyFactory;
+import org.eclipse.osee.orcs.data.AttributeTypes;
/**
* @author Roberto E. Escobar
@@ -25,20 +25,20 @@ import org.eclipse.osee.orcs.core.ds.DataProxyFactory;
public class AttributeDataProxyFactory implements ProxyDataFactory {
private final DataProxyFactoryProvider proxyProvider;
- private final AttributeTypeCache attributeTypeCache;
+ private final AttributeTypes attributeTypeCache;
- public AttributeDataProxyFactory(DataProxyFactoryProvider proxyProvider, AttributeTypeCache attributeTypeCache) {
+ public AttributeDataProxyFactory(DataProxyFactoryProvider proxyProvider, AttributeTypes attributeTypes) {
super();
this.proxyProvider = proxyProvider;
- this.attributeTypeCache = attributeTypeCache;
+ this.attributeTypeCache = attributeTypes;
}
@Override
public DataProxy createProxy(long typeUuid, String value, String uri) throws OseeCoreException {
- AttributeType attributeType = attributeTypeCache.getByGuid(typeUuid);
+ IAttributeType attributeType = attributeTypeCache.getByUuid(typeUuid);
Conditions.checkNotNull(attributeType, "AttributeType", "Unable to find attributeType for [%s]", typeUuid);
- String dataProxyFactoryId = attributeType.getAttributeProviderId();
+ String dataProxyFactoryId = attributeTypeCache.getAttributeProviderId(attributeType);
if (dataProxyFactoryId.contains(".")) {
dataProxyFactoryId = Lib.getExtension(dataProxyFactoryId);
}
@@ -53,7 +53,7 @@ public class AttributeDataProxyFactory implements ProxyDataFactory {
return proxy;
}
- private String intern(AttributeType attributeType, String original) {
+ private String intern(IAttributeType attributeType, String original) throws OseeCoreException {
String value = original;
if (isEnumOrBoolean(attributeType)) {
value = intern(value);
@@ -65,11 +65,9 @@ public class AttributeDataProxyFactory implements ProxyDataFactory {
return Strings.intern(value);
}
- protected boolean isEnumOrBoolean(AttributeType attributeType) {
- boolean isEnumAttribute = attributeType.isEnumerated();
- String baseType = attributeType.getBaseAttributeTypeId();
- boolean isBooleanAttribute = baseType != null && baseType.toLowerCase().contains("boolean");
-
+ protected boolean isEnumOrBoolean(IAttributeType attributeType) throws OseeCoreException {
+ boolean isEnumAttribute = attributeTypeCache.isEnumerated(attributeType);
+ boolean isBooleanAttribute = attributeTypeCache.isBooleanType(attributeType);
return isBooleanAttribute || isEnumAttribute;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
index 4617d06f03..c6c7cbc3c6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
@@ -16,8 +16,6 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
@@ -27,6 +25,7 @@ import org.eclipse.osee.orcs.core.ds.DataFactory;
import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.RelationData;
import org.eclipse.osee.orcs.core.ds.VersionData;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.HasLocalId;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
@@ -37,13 +36,13 @@ public class DataFactoryImpl implements DataFactory {
private final IdFactory idFactory;
private final OrcsObjectFactory objectFactory;
- private final ArtifactTypeCache artifactCache;
+ private final ArtifactTypes artifactCache;
- public DataFactoryImpl(IdFactory idFactory, OrcsObjectFactory objectFactory, ArtifactTypeCache artifactCache) {
+ public DataFactoryImpl(IdFactory idFactory, OrcsObjectFactory objectFactory, ArtifactTypes artifactTypes) {
super();
this.idFactory = idFactory;
this.objectFactory = objectFactory;
- this.artifactCache = artifactCache;
+ this.artifactCache = artifactTypes;
}
@Override
@@ -55,21 +54,17 @@ public class DataFactoryImpl implements DataFactory {
public ArtifactData create(IOseeBranch branch, IArtifactType token, String guid, String hrid) throws OseeCoreException {
Conditions.checkNotNull(branch, "branch");
- ArtifactType artifactType = artifactCache.get(token);
- Conditions.checkNotNull(artifactType, "artifactType", "Unable to find artifactType matching [%s]", token);
-
- Conditions.checkExpressionFailOnTrue(artifactType.isAbstract(),
- "Cannot create an instance of abstract type [%s]", artifactType);
+ Conditions.checkExpressionFailOnTrue(artifactCache.isAbstract(token),
+ "Cannot create an instance of abstract type [%s]", token);
String guidToSet = idFactory.getUniqueGuid(guid);
String humanReadableId = idFactory.getUniqueHumanReadableId(hrid);
Conditions.checkExpressionFailOnTrue(!GUID.isValid(guidToSet),
- "Invalid guid [%s] during artifact creation [type: %s]", guidToSet, artifactType);
+ "Invalid guid [%s] during artifact creation [type: %s]", guidToSet, token);
Conditions.checkExpressionFailOnTrue(!HumanReadableId.isValid(humanReadableId),
- "Invalid human readable id [%s] during artifact creation [type: %s, guid: %s]", humanReadableId, artifactType,
- guid);
+ "Invalid human readable id [%s] during artifact creation [type: %s, guid: %s]", humanReadableId, token, guid);
int branchId = idFactory.getBranchId(branch);
@@ -79,7 +74,7 @@ public class DataFactoryImpl implements DataFactory {
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
int artifactId = idFactory.getNextArtifactId();
ArtifactData artifactData =
- objectFactory.createArtifactData(version, artifactId, artifactType, modType, guidToSet, humanReadableId);
+ objectFactory.createArtifactData(version, artifactId, token, modType, guidToSet, humanReadableId);
return artifactData;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataModuleFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataModuleFactory.java
index 0d4c366cf8..979171330d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataModuleFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataModuleFactory.java
@@ -12,8 +12,6 @@ package org.eclipse.osee.orcs.db.internal.loader;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
-import org.eclipse.osee.framework.core.model.cache.AttributeTypeCache;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -21,6 +19,9 @@ import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.Criteria;
import org.eclipse.osee.orcs.core.ds.DataFactory;
import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
+import org.eclipse.osee.orcs.core.ds.DataModule;
+import org.eclipse.osee.orcs.data.ArtifactTypes;
+import org.eclipse.osee.orcs.data.AttributeTypes;
import org.eclipse.osee.orcs.db.internal.OrcsObjectFactory;
import org.eclipse.osee.orcs.db.internal.SqlProvider;
import org.eclipse.osee.orcs.db.internal.loader.criteria.CriteriaArtifact;
@@ -37,52 +38,44 @@ import org.eclipse.osee.orcs.db.internal.sql.SqlHandlerFactoryImpl;
/**
* @author Roberto E. Escobar
*/
-public class DataModuleFactory {
+public class DataModuleFactory implements DataModule {
private final Log logger;
-
- private DataFactory dataFactory;
private DataLoaderFactory dataLoaderFactory;
+ private DataFactory dataFactory;
public DataModuleFactory(Log logger) {
super();
this.logger = logger;
}
- public void create(IOseeDatabaseService dbService, IdFactory idFactory, IdentityService identityService, SqlProvider sqlProvider, DataProxyFactoryProvider proxyProvider, BranchCache branchCache, ArtifactTypeCache artifactTypeCache, AttributeTypeCache attributeTypeCache) {
- ProxyDataFactory proxyDataFactory = createDataFactory(proxyProvider, attributeTypeCache);
+ public DataModule create(IOseeDatabaseService dbService, IdFactory idFactory, IdentityService identityService, SqlProvider sqlProvider, DataProxyFactoryProvider proxyProvider, BranchCache branchCache, ArtifactTypes artifactTypes, AttributeTypes attributeTypes) {
+ ProxyDataFactory proxyDataFactory = createDataFactory(proxyProvider, attributeTypes);
OrcsObjectFactory rowDataFactory = createOrcsObjectFactory(identityService, proxyDataFactory);
- dataFactory = createDataFactory(rowDataFactory, idFactory, artifactTypeCache);
+ dataFactory = createDataFactory(rowDataFactory, idFactory, artifactTypes);
SqlHandlerFactory handlerFactory = createHandlerFactory(identityService);
SqlArtifactLoader loader = createArtifactLoader(dbService, handlerFactory, sqlProvider, rowDataFactory);
dataLoaderFactory = createDataLoader(dbService, loader, branchCache);
+ return this;
}
public void stop() {
- dataLoaderFactory = null;
dataFactory = null;
+ dataLoaderFactory = null;
}
- public DataFactory getDataFactory() {
- return dataFactory;
- }
-
- public DataLoaderFactory getDataLoaderFactory() {
- return dataLoaderFactory;
- }
-
- protected ProxyDataFactory createDataFactory(DataProxyFactoryProvider proxyProvider, AttributeTypeCache attributeTypeCache) {
- return new AttributeDataProxyFactory(proxyProvider, attributeTypeCache);
+ protected ProxyDataFactory createDataFactory(DataProxyFactoryProvider proxyProvider, AttributeTypes attributeTypes) {
+ return new AttributeDataProxyFactory(proxyProvider, attributeTypes);
}
protected OrcsObjectFactory createOrcsObjectFactory(IdentityService identityService, ProxyDataFactory proxyDataFactory) {
return new OrcsObjectFactoryImpl(proxyDataFactory, identityService);
}
- protected DataFactory createDataFactory(OrcsObjectFactory factory, IdFactory idFactory, ArtifactTypeCache artifactTypeCache) {
- return new DataFactoryImpl(idFactory, factory, artifactTypeCache);
+ protected DataFactory createDataFactory(OrcsObjectFactory factory, IdFactory idFactory, ArtifactTypes artifactTypes) {
+ return new DataFactoryImpl(idFactory, factory, artifactTypes);
}
protected SqlHandlerFactory createHandlerFactory(IdentityService identityService) {
@@ -104,4 +97,14 @@ public class DataModuleFactory {
protected DataLoaderFactory createDataLoader(IOseeDatabaseService dbService, SqlArtifactLoader loader, BranchCache branchCache) {
return new DataLoaderFactoryImpl(logger, dbService, loader, branchCache);
}
+
+ @Override
+ public DataFactory getDataFactory() {
+ return dataFactory;
+ }
+
+ @Override
+ public DataLoaderFactory getDataLoaderFactory() {
+ return dataLoaderFactory;
+ }
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java
index 11e9dffcc9..9f20eac0a5 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/CacheServiceFactory.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.db.internal.types;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TempCachingServiceFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TempCachingServiceFactory.java
index 4afd86a42d..e6c428e2f5 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TempCachingServiceFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TempCachingServiceFactory.java
@@ -22,10 +22,10 @@ import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.TempCachingService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.logger.Log;
-import org.eclipse.osee.orcs.core.ds.TempCachingService;
import org.eclipse.osee.orcs.db.internal.accessor.DatabaseBranchAccessor;
import org.eclipse.osee.orcs.db.internal.accessor.DatabaseTransactionRecordAccessor;
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
index 21182cd93f..54cf45580d 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.orcs.data.ArtifactTypes;
import org.eclipse.osee.orcs.data.AttributeTypes;
+import org.eclipse.osee.orcs.data.EnumTypes;
import org.eclipse.osee.orcs.data.RelationTypes;
/**
@@ -32,16 +33,20 @@ public interface OrcsTypes {
RelationTypes getRelationTypes();
- Callable<?> loadTypes(IResource resource, boolean isInitializing);
+ EnumTypes getEnumTypes();
- Callable<?> writeTypes(OutputStream outputStream);
+ Callable<Void> loadTypes(IResource resource, boolean isInitializing);
- Callable<?> purgeArtifactsByArtifactType(Collection<? extends IArtifactType> artifactTypes);
+ Callable<Void> writeTypes(OutputStream outputStream);
- Callable<?> purgeAttributesByAttributeType(Collection<? extends IAttributeType> attributeTypes);
+ Callable<Void> purgeArtifactsByArtifactType(Collection<? extends IArtifactType> artifactTypes);
- Callable<?> purgeRelationsByRelationType(Collection<? extends IRelationType> relationTypes);
+ Callable<Void> purgeAttributesByAttributeType(Collection<? extends IAttributeType> attributeTypes);
+
+ Callable<Void> purgeRelationsByRelationType(Collection<? extends IRelationType> relationTypes);
void invalidateAll();
+ Callable<Void> save();
+
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
index f9cc8b5203..425f5ff21f 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.data;
import java.util.Collection;
+import java.util.Map;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -25,8 +26,6 @@ public interface ArtifactTypes extends IdentityCollection<Long, IArtifactType> {
Collection<? extends IArtifactType> getSuperArtifactTypes(IArtifactType artType) throws OseeCoreException;
- Collection<? extends IArtifactType> getDescendantTypes(IArtifactType artType, int depth) throws OseeCoreException;
-
Collection<? extends IArtifactType> getAllDescendantTypes(IArtifactType artType) throws OseeCoreException;
boolean isValidAttributeType(IArtifactType artType, IOseeBranch branch, IAttributeType attributeType) throws OseeCoreException;
@@ -37,4 +36,6 @@ public interface ArtifactTypes extends IdentityCollection<Long, IArtifactType> {
boolean inheritsFrom(IArtifactType artType, IArtifactType... otherTypes) throws OseeCoreException;
+ Map<IOseeBranch, Collection<IAttributeType>> getAllAttributeTypes(IArtifactType artType) throws OseeCoreException;
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
index 26cb8cd46a..3fa3c55d98 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
@@ -47,4 +47,6 @@ public interface AttributeTypes extends IdentityCollection<Long, IAttributeType>
boolean hasMediaType(IAttributeType attrType) throws OseeCoreException;
+ boolean isBooleanType(IAttributeType attrType) throws OseeCoreException;
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumTypes.java
new file mode 100644
index 0000000000..38fb6fc6be
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumTypes.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+/**
+ * @author John Misinco
+ */
+public interface EnumTypes extends IdentityCollection<Long, EnumType> {
+ // add additional methods here
+} \ No newline at end of file

Back to the top