Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-09-08 15:01:41 -0400
committerRyan D. Brooks2011-09-08 15:01:41 -0400
commitf59b22470fb23f97b3a75de44ac52419c04e21de (patch)
tree90aa8b7944bdb156a54788a2b9449dd05184b7f0
parentfd418e66265b005de8f3087a3723cd139b798eea (diff)
downloadorg.eclipse.osee-f59b22470fb23f97b3a75de44ac52419c04e21de.tar.gz
org.eclipse.osee-f59b22470fb23f97b3a75de44ac52419c04e21de.tar.xz
org.eclipse.osee-f59b22470fb23f97b3a75de44ac52419c04e21de.zip
refactor: Remove calls to getId for types
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java10
-rw-r--r--plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlServiceRegHandler.java10
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/OseeServices.java9
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java22
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/trackers/OseeBranchExchangeServiceRegistrationHandler.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.message/src/org/eclipse/osee/framework/core/message/RelationTypeCacheUpdateResponse.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeTypeCacheTest.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java11
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IOseeCachingService.java2
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/OseeTypesSetup.java1
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java3
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java7
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeTransaction.java10
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/OSGI-INF/component.xml9
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/build.properties5
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java32
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/search/SearchEngine.java9
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineRegHandler.java9
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineTaggerRegHandler.java9
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/SearchEngineTagger.java8
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java27
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeRelationType.java7
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java4
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/internal/Activator.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java14
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java6
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/ClientCachingServiceRegHandler.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java12
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/AbstractWordAttributeHealthOperation.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/Activator.java10
42 files changed, 198 insertions, 124 deletions
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
index e03dd36378..221b6f6956 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlService.java
@@ -44,10 +44,10 @@ import org.eclipse.osee.framework.core.model.cache.ArtifactTypeCache;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.services.IAccessControlService;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.DoubleKeyHashMap;
@@ -107,11 +107,13 @@ public class AccessControlService implements IAccessControlService {
private final IOseeCachingService cachingService;
private final IOseeDatabaseService databaseService;
+ private final IdentityService identityService;
- public AccessControlService(IOseeDatabaseService databaseService, IOseeCachingService cachingService) {
+ public AccessControlService(IOseeDatabaseService databaseService, IOseeCachingService cachingService, IdentityService identityService) {
super();
this.databaseService = databaseService;
this.cachingService = cachingService;
+ this.identityService = identityService;
try {
reloadCache();
} catch (OseeCoreException ex) {
@@ -215,8 +217,8 @@ public class AccessControlService implements IAccessControlService {
IOseeStatement chStmt = getDatabaseService().getStatement();
try {
- RelationType relationType = getRelationTypeCache().get(CoreRelationTypes.Users_User);
- chStmt.runPreparedQuery(USER_GROUP_MEMBERS, groupId, relationType.getId());
+ chStmt.runPreparedQuery(USER_GROUP_MEMBERS, groupId,
+ identityService.getLocalId(CoreRelationTypes.Users_User));
// get group members and populate subjectToGroupCache
while (chStmt.next()) {
diff --git a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlServiceRegHandler.java b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlServiceRegHandler.java
index e41314f14c..5a14d08b20 100644
--- a/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlServiceRegHandler.java
+++ b/plugins/org.eclipse.osee.framework.access/src/org/eclipse/osee/framework/access/internal/AccessControlServiceRegHandler.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.framework.access.internal;
import java.util.Map;
-
import org.eclipse.osee.framework.core.services.IAccessControlService;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
@@ -22,7 +22,10 @@ import org.osgi.framework.ServiceRegistration;
public final class AccessControlServiceRegHandler extends AbstractTrackingHandler {
- private static final Class<?>[] DEPENDENCIES = new Class[] {IOseeDatabaseService.class, IOseeCachingService.class};
+ private static final Class<?>[] DEPENDENCIES = new Class[] {
+ IOseeDatabaseService.class,
+ IOseeCachingService.class,
+ IdentityService.class,};
private AccessControlService accessService;
private ServiceRegistration serviceRegistration;;
@@ -41,11 +44,12 @@ public final class AccessControlServiceRegHandler extends AbstractTrackingHandle
public void onActivate(BundleContext context, Map<Class<?>, Object> services) {
IOseeDatabaseService databaseService = getService(IOseeDatabaseService.class, services);
IOseeCachingService cachingService = getService(IOseeCachingService.class, services);
+ IdentityService identityService = getService(IdentityService.class, services);
// IAccessCacheAccessor accessor = new DatabaseAccessCacheAccessor(databaseService, cachingService);
// ObjectBasedAccessCache cache = new ObjectBasedAccessCache(accessor);
- accessService = new AccessControlService(databaseService, cachingService);
+ accessService = new AccessControlService(databaseService, cachingService, identityService);
serviceRegistration = context.registerService(IAccessControlService.class.getName(), accessService, null);
accessEventListener = new AccessEventListener(accessService, new AccessControlCacheHandler());
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/OseeServices.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/OseeServices.java
index 0d91e60c48..cdca5940eb 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/OseeServices.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/OseeServices.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.framework.branch.management.exchange;
import org.eclipse.osee.framework.core.message.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -23,14 +24,16 @@ public class OseeServices {
private final IOseeCachingService cachingService;
private final IOseeModelingService modelService;
private final IOseeDatabaseService databaseService;
+ private final IdentityService identityService;
- public OseeServices(IResourceManager resourceService, IResourceLocatorManager locatorSservice, IOseeCachingService cachingService, IOseeModelingService modelService, IOseeDatabaseService databaseService) {
+ public OseeServices(IResourceManager resourceService, IResourceLocatorManager locatorSservice, IOseeCachingService cachingService, IOseeModelingService modelService, IOseeDatabaseService databaseService, IdentityService identityService) {
super();
this.resourceService = resourceService;
this.locatorSservice = locatorSservice;
this.cachingService = cachingService;
this.modelService = modelService;
this.databaseService = databaseService;
+ this.identityService = identityService;
}
public IResourceManager getResourceManager() {
@@ -52,4 +55,8 @@ public class OseeServices {
public IOseeDatabaseService getDatabaseService() {
return databaseService;
}
+
+ public IdentityService getIdentityService() {
+ return identityService;
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java
index 8b5df418ca..790614d39b 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/handler/DbTableSaxHandler.java
@@ -26,9 +26,7 @@ import org.eclipse.osee.framework.branch.management.internal.Activator;
import org.eclipse.osee.framework.core.enums.ConflictType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.model.AbstractOseeType;
-import org.eclipse.osee.framework.core.model.cache.AbstractOseeCache;
-import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.core.util.HexUtil;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -94,17 +92,15 @@ public class DbTableSaxHandler extends BaseDbSaxHandler {
}
}
- private int getTypeId(AbstractOseeCache<Long, ? extends AbstractOseeType<Long>> cache, Map<String, String> fieldMap) throws OseeCoreException {
- Conditions.checkNotNull(cache, "cache");
+ private int getTypeId(IdentityService identityService, Map<String, String> fieldMap) throws OseeCoreException {
+ Conditions.checkNotNull(identityService, "identityService");
String hexString = fieldMap.get(ExchangeDb.TYPE_GUID);
Long uuid = HexUtil.toLong(hexString);
- AbstractOseeType<Long> typeObject = cache.getByGuid(uuid);
- Conditions.checkNotNull(typeObject, "type", "type [%s] was not found in cache [%s]", uuid, cache.getCacheId());
- return typeObject.getId();
+ return identityService.getLocalId(uuid);
}
- private IOseeCachingService getCachingService() {
- return services.getCachingService();
+ private IdentityService getIdentityService() {
+ return services.getIdentityService();
}
@Override
@@ -134,17 +130,17 @@ public class DbTableSaxHandler extends BaseDbSaxHandler {
}
if (exportItem.equals(ExportItem.OSEE_ARTIFACT_DATA)) {
- int typeId = getTypeId(getCachingService().getArtifactTypeCache(), fieldMap);
+ int typeId = getTypeId(getIdentityService(), fieldMap);
fieldMap.put("art_type_id", String.valueOf(typeId));
}
if (exportItem.equals(ExportItem.OSEE_ATTRIBUTE_DATA)) {
- int typeId = getTypeId(getCachingService().getAttributeTypeCache(), fieldMap);
+ int typeId = getTypeId(getIdentityService(), fieldMap);
fieldMap.put("attr_type_id", String.valueOf(typeId));
}
if (exportItem.equals(ExportItem.OSEE_RELATION_LINK_DATA)) {
- int typeId = getTypeId(getCachingService().getRelationTypeCache(), fieldMap);
+ int typeId = getTypeId(getIdentityService(), fieldMap);
fieldMap.put("rel_link_type_id", String.valueOf(typeId));
}
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/trackers/OseeBranchExchangeServiceRegistrationHandler.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/trackers/OseeBranchExchangeServiceRegistrationHandler.java
index d3ebe49eb8..3c55592965 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/trackers/OseeBranchExchangeServiceRegistrationHandler.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/internal/trackers/OseeBranchExchangeServiceRegistrationHandler.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.framework.branch.management.exchange.BranchExchange;
import org.eclipse.osee.framework.branch.management.exchange.OseeServices;
import org.eclipse.osee.framework.core.message.IOseeModelingService;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
@@ -33,7 +34,8 @@ public class OseeBranchExchangeServiceRegistrationHandler extends AbstractTracki
IResourceLocatorManager.class,
IOseeModelingService.class,
IOseeCachingService.class,
- IOseeDatabaseService.class};
+ IOseeDatabaseService.class,
+ IdentityService.class,};
private ServiceRegistration serviceRegistration;
@@ -61,8 +63,10 @@ public class OseeBranchExchangeServiceRegistrationHandler extends AbstractTracki
IOseeModelingService modelingService = getService(IOseeModelingService.class, services);
IOseeCachingService cachingService = getService(IOseeCachingService.class, services);
IOseeDatabaseService databaseService = getService(IOseeDatabaseService.class, services);
+ IdentityService identityService = getService(IdentityService.class, services);
OseeServices oseeServices =
- new OseeServices(resourceManager, resourceLocatorManager, cachingService, modelingService, databaseService);
+ new OseeServices(resourceManager, resourceLocatorManager, cachingService, modelingService, databaseService,
+ identityService);
return new BranchExchange(oseeServices);
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java
index bf32d59d3a..176ab66911 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java
@@ -87,6 +87,6 @@ public class ServerOseeCachingServiceFactory implements IOseeCachingServiceFacto
locatorManager, resourceManager, branchCache, identityService));
return new OseeCachingService(branchCache, txCache, artifactCache, attributeCache, relationCache,
- oseeEnumTypeCache);
+ oseeEnumTypeCache, identityService);
}
}
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 07609a39ad..728eecdbd8 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
@@ -16,9 +16,9 @@ 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.cache.ArtifactTypeCache;
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
@@ -142,12 +142,12 @@ public class RelationTypeCacheUpdateResponse {
public static RelationTypeCacheUpdateResponse fromCache(IOseeCachingService caching) throws OseeCoreException {
Collection<RelationType> relationTypes = caching.getRelationTypeCache().getAll();
- ArtifactTypeCache artifactTypeCache = caching.getArtifactTypeCache();
+ IdentityService identityService = caching.getIdentityService();
List<RelationTypeRow> rows = new ArrayList<RelationTypeRow>();
for (RelationType item : relationTypes) {
- int artifactTypeSideA = artifactTypeCache.get(item.getArtifactTypeSideA()).getId();
- int artifactTypeSideB = artifactTypeCache.get(item.getArtifactTypeSideB()).getId();
+ 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(),
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeTypeCacheTest.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeTypeCacheTest.java
index 9f3e6151c0..1d96884571 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeTypeCacheTest.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/cache/AbstractOseeTypeCacheTest.java
@@ -16,7 +16,6 @@ public class AbstractOseeTypeCacheTest<T extends AbstractOseeType<Long>> extends
@Override
protected Long createKey() {
- // john check what needs to happen here.
return 0x00L;
}
}
diff --git a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
index 1eb7879652..3c61ec94e4 100644
--- a/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.model.test/src/org/eclipse/osee/framework/core/model/mocks/MockDataFactory.java
@@ -146,7 +146,8 @@ public final class MockDataFactory {
RelationTypeCache relCache = new RelationTypeCache(new MockOseeDataAccessor<Long, RelationType>());
OseeEnumTypeCache enumCache = new OseeEnumTypeCache(new MockOseeDataAccessor<Long, OseeEnumType>());
- IOseeCachingService service = new OseeCachingService(brCache, txCache, artCache, attrCache, relCache, enumCache);
+ IOseeCachingService service =
+ new OseeCachingService(brCache, txCache, artCache, attrCache, relCache, enumCache, null);
return new MockOseeCachingServiceProvider(service);
}
diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
index 3d594d8e16..0544c2e9d4 100644
--- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/OseeCachingService.java
@@ -23,6 +23,7 @@ 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.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.Conditions;
/**
@@ -37,15 +38,17 @@ public class OseeCachingService implements IOseeCachingService {
private final AttributeTypeCache attributeTypeCache;
private final RelationTypeCache relationTypeCache;
private final OseeEnumTypeCache oseeEnumTypeCache;
+ public final IdentityService identityService;
private final Collection<IOseeCache<?, ?>> caches;
- public OseeCachingService(BranchCache branchCache, TransactionCache transactionCache, ArtifactTypeCache artifactTypeCache, AttributeTypeCache attributeTypeCache, RelationTypeCache relationTypeCache, OseeEnumTypeCache oseeEnumTypeCache) {
+ public OseeCachingService(BranchCache branchCache, TransactionCache transactionCache, ArtifactTypeCache artifactTypeCache, AttributeTypeCache attributeTypeCache, RelationTypeCache relationTypeCache, OseeEnumTypeCache oseeEnumTypeCache, IdentityService identityService) {
this.branchCache = branchCache;
this.transactionCache = transactionCache;
this.artifactTypeCache = artifactTypeCache;
this.attributeTypeCache = attributeTypeCache;
this.relationTypeCache = relationTypeCache;
this.oseeEnumTypeCache = oseeEnumTypeCache;
+ this.identityService = identityService;
caches = new HashSet<IOseeCache<?, ?>>();
caches.add(branchCache);
caches.add(transactionCache);
@@ -109,6 +112,7 @@ public class OseeCachingService implements IOseeCachingService {
getAttributeTypeCache().reloadCache();
getArtifactTypeCache().reloadCache();
getRelationTypeCache().reloadCache();
+ getIdentityService().clear();
}
@Override
@@ -120,4 +124,9 @@ public class OseeCachingService implements IOseeCachingService {
getArtifactTypeCache().decacheAll();
getRelationTypeCache().decacheAll();
}
+
+ @Override
+ public IdentityService getIdentityService() {
+ return identityService;
+ }
}
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 842eee0776..b324ac8dab 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
@@ -38,6 +38,8 @@ public interface IOseeCachingService {
OseeEnumTypeCache getEnumTypeCache();
+ IdentityService getIdentityService();
+
Collection<?> getCaches();
IOseeCache<?, ?> getCache(OseeCacheEnum cacheId) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/OseeTypesSetup.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/OseeTypesSetup.java
index e3ee53a3af..993f2a857d 100644
--- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/OseeTypesSetup.java
+++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/OseeTypesSetup.java
@@ -71,7 +71,6 @@ public class OseeTypesSetup {
// Only delete file if no problems processing
combinedFile.delete();
- //john - for each in map, create artifact (OseeTypeDefinition) and store xtext data in artifact
} catch (IOException ex) {
OseeExceptions.wrapAndThrow(ex);
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java
index 0200ac772b..ed0a7199ed 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java
@@ -84,10 +84,11 @@ public class IdentityServiceImpl implements IdentityService {
}
@Override
- public void clear() {
+ public synchronized void clear() {
universalIdToLocalId.clear();
localIdToUniversalId.clear();
persistedIds.clear();
+ ensurePopulatedRanOnce = false;
}
private void cache(Long remoteId, Integer localId) {
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
index 7f47103fa1..7d27e86369 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.server.UnsecuredOseeHttpServlet;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -35,11 +36,13 @@ public class UnsubscribeServlet extends UnsecuredOseeHttpServlet {
private final IOseeDatabaseService databaseService;
private final IOseeCachingService cacheService;
private final BundleContext bundleContext;
+ private final IdentityService identityService;
- public UnsubscribeServlet(BundleContext bundleContext, IOseeDatabaseService databaseService, IOseeCachingService cacheService) {
+ public UnsubscribeServlet(BundleContext bundleContext, IOseeDatabaseService databaseService, IOseeCachingService cacheService, IdentityService identityService) {
this.databaseService = databaseService;
this.cacheService = cacheService;
this.bundleContext = bundleContext;
+ this.identityService = identityService;
}
@Override
@@ -83,7 +86,7 @@ public class UnsubscribeServlet extends UnsecuredOseeHttpServlet {
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws IOException {
try {
UnsubscribeRequest data = UnsubscribeRequest.createFromXML(request);
- UnsubscribeTransaction del = new UnsubscribeTransaction(databaseService, cacheService, data);
+ UnsubscribeTransaction del = new UnsubscribeTransaction(databaseService, cacheService, data, identityService);
Operations.executeWorkAndCheckStatus(del, new LogProgressMonitor());
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/plain");
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeTransaction.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeTransaction.java
index 948bc40cb5..71a87564ad 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeTransaction.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeTransaction.java
@@ -20,8 +20,8 @@ import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.model.Branch;
-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;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.IOseeStatement;
@@ -43,12 +43,14 @@ public final class UnsubscribeTransaction extends AbstractDbTxOperation {
private int currentGammaId;
private final UnsubscribeRequest unsubscribeData;
private final IOseeCachingService cacheService;
+ private final IdentityService identityService;
private String completionMethod;
- public UnsubscribeTransaction(IOseeDatabaseService databaseService, IOseeCachingService cacheService, UnsubscribeRequest unsubscribeData) {
+ public UnsubscribeTransaction(IOseeDatabaseService databaseService, IOseeCachingService cacheService, UnsubscribeRequest unsubscribeData, IdentityService identityService) {
super(databaseService, "Delete Relation", Activator.PLUGIN_ID);
this.unsubscribeData = unsubscribeData;
this.cacheService = cacheService;
+ this.identityService = identityService;
}
@Override
@@ -64,12 +66,12 @@ public final class UnsubscribeTransaction extends AbstractDbTxOperation {
private boolean getRelationTxData() throws OseeCoreException {
common = cacheService.getBranchCache().getCommonBranch();
- RelationType relationType = cacheService.getRelationTypeCache().get(CoreRelationTypes.Users_Artifact);
+ int relationTypeId = identityService.getLocalId(CoreRelationTypes.Users_Artifact);
IOseeStatement chStmt = getDatabaseService().getStatement();
try {
chStmt.runPreparedQuery(1, SELECT_RELATION_LINK, unsubscribeData.getGroupId(), unsubscribeData.getUserId(),
- relationType.getId(), common.getId(), TxChange.NOT_CURRENT.getValue());
+ relationTypeId, common.getId(), TxChange.NOT_CURRENT.getValue());
if (chStmt.next()) {
currentGammaId = chStmt.getInt("gamma_id");
relationId = chStmt.getInt("rel_link_id");
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 c0836a3210..76f16b5b99 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
@@ -129,7 +129,7 @@ public class ServletRegistrationHandler extends AbstractTrackingHandler {
register(new OseeCacheServlet(sessionManager, translationService, caching, factoryService),
OseeServerContext.CACHE_CONTEXT);
register(new OseeModelServlet(sessionManager, translationService, modeling), OseeServerContext.OSEE_MODEL_CONTEXT);
- register(new UnsubscribeServlet(context, databaseService, caching), "osee/unsubscribe");
+ register(new UnsubscribeServlet(context, databaseService, caching, identityService), "osee/unsubscribe");
register(new AtsServlet(locatorManager, resourceManager, caching), "osee/ats");
register(new ConfigurationServlet(appServerManager, translationService, databaseService, caching, branchService,
diff --git a/plugins/org.eclipse.osee.framework.search.engine/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.search.engine/META-INF/MANIFEST.MF
index 79441eadda..44fd1fbbf7 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.search.engine/META-INF/MANIFEST.MF
@@ -39,3 +39,4 @@ Export-Package: org.eclipse.osee.framework.search.engine,
org.eclipse.osee.framework.search.engine.data,
org.eclipse.osee.framework.search.engine.utility
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Service-Component: OSGI-INF/*.xml
diff --git a/plugins/org.eclipse.osee.framework.search.engine/OSGI-INF/component.xml b/plugins/org.eclipse.osee.framework.search.engine/OSGI-INF/component.xml
new file mode 100644
index 0000000000..2bddc00077
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.search.engine/OSGI-INF/component.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore">
+ <implementation class="org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore"/>
+ <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setIdentityService" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.IdentityService" name="IdentityService" policy="static"/>
+ <service>
+ <provide interface="org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore"/>
+ </service>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.search.engine/build.properties b/plugins/org.eclipse.osee.framework.search.engine/build.properties
index 34d2e4d2da..fc8c47cdaf 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/build.properties
+++ b/plugins/org.eclipse.osee.framework.search.engine/build.properties
@@ -1,4 +1,5 @@
-source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ OSGI-INF/component.xml
+source.. = src/
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
index 500e7631a9..6e3f5f816a 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
@@ -16,10 +16,11 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
@@ -36,14 +37,21 @@ public final class AttributeDataStore {
private static final SearchTagQueryBuilder searchTagQueryBuilder = new SearchTagQueryBuilder();
- private AttributeDataStore() {
- // Utility Class
+ private IOseeDatabaseService databaseService;
+ private IdentityService identityService;
+
+ public void setDatabaseService(IOseeDatabaseService databaseService) {
+ this.databaseService = databaseService;
+ }
+
+ public void setIdentityService(IdentityService identityService) {
+ this.identityService = identityService;
}
- public static Collection<AttributeData> getAttribute(final OseeConnection connection, final int tagQueueQueryId) throws OseeCoreException {
+ public Collection<AttributeData> getAttribute(final OseeConnection connection, final int tagQueueQueryId) throws OseeCoreException {
final Collection<AttributeData> attributeData = new ArrayList<AttributeData>();
- IOseeStatement chStmt = ConnectionHandler.getStatement(connection);
+ IOseeStatement chStmt = databaseService.getStatement(connection);
try {
chStmt.runPreparedQuery(LOAD_ATTRIBUTE, tagQueueQueryId);
while (chStmt.next()) {
@@ -57,11 +65,11 @@ public final class AttributeDataStore {
return attributeData;
}
- public static Set<AttributeData> getAttributesByTags(int branchId, DeletionFlag deletionFlag, final Collection<Long> tagData, final Collection<AttributeType> attributeTypes) throws OseeCoreException {
+ public Set<AttributeData> getAttributesByTags(int branchId, DeletionFlag deletionFlag, final Collection<Long> tagData, final Collection<IAttributeType> attributeTypes) throws OseeCoreException {
final Set<AttributeData> toReturn = new HashSet<AttributeData>();
IdJoinQuery oseeIdJoin = null;
- IOseeStatement chStmt = ConnectionHandler.getStatement();
+ IOseeStatement chStmt = databaseService.getStatement();
boolean useAttrTypeJoin = attributeTypes.size() > 1;
try {
@@ -74,8 +82,8 @@ public final class AttributeDataStore {
sqlQuery += " and attr1.attr_type_id = ?";
} else if (useAttrTypeJoin) {
oseeIdJoin = JoinUtility.createIdJoinQuery();
- for (AttributeType attributeType : attributeTypes) {
- oseeIdJoin.add(attributeType.getId());
+ for (IAttributeType attributeType : attributeTypes) {
+ oseeIdJoin.add(identityService.getLocalId(attributeType));
}
oseeIdJoin.store();
params.add(oseeIdJoin.getQueryId());
@@ -85,8 +93,8 @@ public final class AttributeDataStore {
params.add(branchId);
}
if (attributeTypes.size() == 1) {
- AttributeType type = attributeTypes.iterator().next();
- params.add(type.getId());
+ IAttributeType type = attributeTypes.iterator().next();
+ params.add(identityService.getLocalId(type));
}
chStmt.runPreparedQuery(sqlQuery, params.toArray(new Object[params.size()]));
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/search/SearchEngine.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/search/SearchEngine.java
index dc573e22c1..63bd503053 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/search/SearchEngine.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/search/SearchEngine.java
@@ -44,13 +44,15 @@ public class SearchEngine implements ISearchEngine {
private final IAttributeTaggerProviderManager taggingManager;
private final AttributeTypeCache attributeTypeCache;
private final BranchCache branchCache;
+ private final AttributeDataStore attributeDataStore;
- public SearchEngine(SearchStatistics statistics, TagProcessor tagProcessor, IAttributeTaggerProviderManager taggingManager, AttributeTypeCache attributeTypeCache, BranchCache branchCache) {
+ public SearchEngine(SearchStatistics statistics, TagProcessor tagProcessor, IAttributeTaggerProviderManager taggingManager, AttributeTypeCache attributeTypeCache, BranchCache branchCache, AttributeDataStore attributeDataStore) {
this.statistics = statistics;
this.tagProcessor = tagProcessor;
this.taggingManager = taggingManager;
this.attributeTypeCache = attributeTypeCache;
this.branchCache = branchCache;
+ this.attributeDataStore = attributeDataStore;
}
private Collection<AttributeType> getAttributeTypes(Collection<IAttributeType> tokens) throws OseeCoreException {
@@ -89,12 +91,11 @@ public class SearchEngine implements ISearchEngine {
SearchOptions options = searchRequest.getOptions();
Collection<IAttributeType> attributeTypeTokens = options.getAttributeTypeFilter();
- Collection<AttributeType> attributeTypes = getAttributeTypes(attributeTypeTokens);
int branchId = branchCache.get(searchRequest.getBranch()).getId();
Collection<AttributeData> tagMatches =
- AttributeDataStore.getAttributesByTags(branchId, options.getDeletionFlag(), searchTags.values(),
- attributeTypes);
+ attributeDataStore.getAttributesByTags(branchId, options.getDeletionFlag(), searchTags.values(),
+ attributeTypeTokens);
String message =
String.format("Attribute Search Query found [%d] in [%d] ms", tagMatches.size(),
System.currentTimeMillis() - startDataStoreSearch);
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineRegHandler.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineRegHandler.java
index d37ff9fd32..e906fff57b 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineRegHandler.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineRegHandler.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.search.engine.IAttributeTaggerProviderManager;
import org.eclipse.osee.framework.search.engine.ISearchEngine;
+import org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore;
import org.eclipse.osee.framework.search.engine.internal.search.SearchEngine;
import org.eclipse.osee.framework.search.engine.internal.search.SearchStatistics;
import org.eclipse.osee.framework.search.engine.utility.TagProcessor;
@@ -34,7 +35,8 @@ public class SearchEngineRegHandler extends AbstractTrackingHandler {
private static final Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {
IAttributeTaggerProviderManager.class,
IOseeCachingService.class,
- IOseeDatabaseService.class
+ IOseeDatabaseService.class,
+ AttributeDataStore.class,
};
//@formatter:on
@@ -54,7 +56,7 @@ public class SearchEngineRegHandler extends AbstractTrackingHandler {
public void onActivate(BundleContext context, Map<Class<?>, Object> services) {
IAttributeTaggerProviderManager taggingManager = getService(IAttributeTaggerProviderManager.class, services);
IOseeCachingService cachingService = getService(IOseeCachingService.class, services);
- // IOseeDatabaseService databaseService = getService(IOseeDatabaseService.class, services);
+ AttributeDataStore attributeDataStore = getService(AttributeDataStore.class, services);
SearchStatistics searchStatistics = new SearchStatistics();
@@ -62,7 +64,8 @@ public class SearchEngineRegHandler extends AbstractTrackingHandler {
BranchCache branchCache = cachingService.getBranchCache();
ISearchEngine searchEngine =
- new SearchEngine(searchStatistics, processor, taggingManager, attributeTypeCache, branchCache);
+ new SearchEngine(searchStatistics, processor, taggingManager, attributeTypeCache, branchCache,
+ attributeDataStore);
serviceRegistration = context.registerService(ISearchEngine.class.getName(), searchEngine, null);
}
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineTaggerRegHandler.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineTaggerRegHandler.java
index 6680dff7d3..597fa79c23 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineTaggerRegHandler.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/services/SearchEngineTaggerRegHandler.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.search.engine.IAttributeTaggerProviderManager;
import org.eclipse.osee.framework.search.engine.ISearchEngineTagger;
+import org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore;
import org.eclipse.osee.framework.search.engine.internal.tagger.SearchEngineTagger;
import org.eclipse.osee.framework.search.engine.utility.SearchTagDataStore;
import org.osgi.framework.BundleContext;
@@ -34,7 +35,8 @@ public class SearchEngineTaggerRegHandler extends AbstractTrackingHandler {
private static final Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {
IApplicationServerManager.class,
IOseeDatabaseService.class,
- IAttributeTaggerProviderManager.class
+ IAttributeTaggerProviderManager.class,
+ AttributeDataStore.class,
};
//@formatter:on
@@ -50,12 +52,13 @@ public class SearchEngineTaggerRegHandler extends AbstractTrackingHandler {
IOseeDatabaseService databaseService = getService(IOseeDatabaseService.class, services);
IApplicationServerManager serverManager = getService(IApplicationServerManager.class, services);
IAttributeTaggerProviderManager taggingManager = getService(IAttributeTaggerProviderManager.class, services);
-
+ AttributeDataStore attributeDataStore = getService(AttributeDataStore.class, services);
ThreadFactory threadFactory = serverManager.createNewThreadFactory("tagger.worker", Thread.NORM_PRIORITY);
ExecutorService executorService = Executors.newFixedThreadPool(3, threadFactory);
SearchTagDataStore dataStore = new SearchTagDataStore(databaseService);
- ISearchEngineTagger tagger = new SearchEngineTagger(executorService, dataStore, taggingManager);
+ ISearchEngineTagger tagger =
+ new SearchEngineTagger(executorService, dataStore, taggingManager, attributeDataStore);
serviceRegistration = context.registerService(ISearchEngineTagger.class.getName(), tagger, null);
}
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/SearchEngineTagger.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/SearchEngineTagger.java
index b8b854f78d..6656703367 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/SearchEngineTagger.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/SearchEngineTagger.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.framework.search.engine.IAttributeTaggerProviderManager;
import org.eclipse.osee.framework.search.engine.ISearchEngineTagger;
import org.eclipse.osee.framework.search.engine.ITagListener;
import org.eclipse.osee.framework.search.engine.ITaggerStatistics;
+import org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore;
import org.eclipse.osee.framework.search.engine.utility.SearchTagDataStore;
/**
@@ -36,12 +37,14 @@ public final class SearchEngineTagger implements ISearchEngineTagger {
private final TaggerStatistics statistics;
private final SearchTagDataStore searchTagDataStore;
private final IAttributeTaggerProviderManager taggingManager;
+ private final AttributeDataStore attributeDataStore;
- public SearchEngineTagger(ExecutorService executor, SearchTagDataStore searchTagDataStore, IAttributeTaggerProviderManager taggingManager) {
+ public SearchEngineTagger(ExecutorService executor, SearchTagDataStore searchTagDataStore, IAttributeTaggerProviderManager taggingManager, AttributeDataStore attributeDataStore) {
this.statistics = new TaggerStatistics(searchTagDataStore);
this.executor = executor;
this.searchTagDataStore = searchTagDataStore;
this.taggingManager = taggingManager;
+ this.attributeDataStore = attributeDataStore;
Timer timer = new Timer("Start-Up Tagger");
timer.schedule(new StartUpRunnable(this), 3000);
@@ -61,7 +64,8 @@ public final class SearchEngineTagger implements ISearchEngineTagger {
@Override
public FutureTask<?> tagByQueueQueryId(ITagListener listener, int queryId) {
- TaggerRunnable runnable = new TaggerRunnable(taggingManager, searchTagDataStore, queryId, false, CACHE_LIMIT);
+ TaggerRunnable runnable =
+ new TaggerRunnable(taggingManager, searchTagDataStore, queryId, false, CACHE_LIMIT, attributeDataStore);
runnable.addListener(statistics);
if (listener != null) {
runnable.addListener(listener);
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
index e6fed4bfa8..750afddbc4 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
@@ -45,8 +45,9 @@ class TaggerRunnable implements Runnable {
private long waitTime;
private final SearchTagDataStore tagDataStore;
private final IAttributeTaggerProviderManager taggingManager;
+ private final AttributeDataStore attributeDataStore;
- TaggerRunnable(IAttributeTaggerProviderManager taggingManager, SearchTagDataStore tagDataStore, int tagQueueQueryId, boolean isCacheAll, int cacheLimit) {
+ TaggerRunnable(IAttributeTaggerProviderManager taggingManager, SearchTagDataStore tagDataStore, int tagQueueQueryId, boolean isCacheAll, int cacheLimit, AttributeDataStore attributeDataStore) {
this.taggingManager = taggingManager;
this.tagDataStore = tagDataStore;
this.listeners = new HashSet<ITagListener>();
@@ -56,6 +57,7 @@ class TaggerRunnable implements Runnable {
this.processingTime = 0;
this.cacheLimit = cacheLimit;
this.isCacheAll = isCacheAll;
+ this.attributeDataStore = attributeDataStore;
}
public int getTagQueueQueryId() {
@@ -76,8 +78,7 @@ class TaggerRunnable implements Runnable {
AttributeToTagTx attributeToTagTx = new AttributeToTagTx();
attributeToTagTx.execute();
} catch (Exception ex) {
- OseeLog.logf(Activator.class, Level.SEVERE,
- ex, "Unable to tag - tagQueueQueryId [%d]", getTagQueueQueryId());
+ OseeLog.logf(Activator.class, Level.SEVERE, ex, "Unable to tag - tagQueueQueryId [%d]", getTagQueueQueryId());
} finally {
this.processingTime = System.currentTimeMillis() - processStart;
notifyOnTagQueryIdTagComplete();
@@ -90,8 +91,8 @@ class TaggerRunnable implements Runnable {
try {
listener.onAttributeTagComplete(tagQueueQueryId, gammaId, totalTags, processingTime);
} catch (Exception ex) {
- OseeLog.logf(TaggerRunnable.class, Level.SEVERE,
- ex, "Error notifying listener: [%s] ", listener.getClass().getName());
+ OseeLog.logf(TaggerRunnable.class, Level.SEVERE, ex, "Error notifying listener: [%s] ",
+ listener.getClass().getName());
}
}
}
@@ -101,8 +102,8 @@ class TaggerRunnable implements Runnable {
try {
listener.onTagQueryIdTagComplete(tagQueueQueryId, waitTime, processingTime);
} catch (Exception ex) {
- OseeLog.logf(TaggerRunnable.class, Level.SEVERE,
- ex, "Error notifying listener: [%s] ", listener.getClass().getName());
+ OseeLog.logf(TaggerRunnable.class, Level.SEVERE, ex, "Error notifying listener: [%s] ",
+ listener.getClass().getName());
}
}
}
@@ -112,8 +113,8 @@ class TaggerRunnable implements Runnable {
try {
listener.onAttributeAddTagEvent(tagQueueQueryId, gammaId, word, codedTag);
} catch (Exception ex) {
- OseeLog.logf(TaggerRunnable.class, Level.SEVERE,
- ex, "Error notifying listener: [%s] ", listener.getClass().getName());
+ OseeLog.logf(TaggerRunnable.class, Level.SEVERE, ex, "Error notifying listener: [%s] ",
+ listener.getClass().getName());
}
}
}
@@ -130,7 +131,7 @@ class TaggerRunnable implements Runnable {
}
private Collection<AttributeData> getDataFromQueryId(OseeConnection connection, int queryId, final int numberOfRetries) throws OseeCoreException {
- Collection<AttributeData> attributeDatas = AttributeDataStore.getAttribute(connection, getTagQueueQueryId());
+ Collection<AttributeData> attributeDatas = attributeDataStore.getAttribute(connection, getTagQueueQueryId());
// Re-try in case query id hasn't been committed to the database
int retry = 0;
while (attributeDatas.isEmpty() && retry < numberOfRetries) {
@@ -139,7 +140,7 @@ class TaggerRunnable implements Runnable {
} catch (InterruptedException ex) {
OseeLog.log(Activator.class, Level.WARNING, ex);
}
- attributeDatas = AttributeDataStore.getAttribute(connection, getTagQueueQueryId());
+ attributeDatas = attributeDataStore.getAttribute(connection, getTagQueueQueryId());
retry++;
}
return attributeDatas;
@@ -171,8 +172,8 @@ class TaggerRunnable implements Runnable {
ConnectionHandler.runPreparedUpdate(connection, JoinItem.TAG_GAMMA_QUEUE.getDeleteSql(),
getTagQueueQueryId());
} catch (Exception ex) {
- OseeLog.logf(Activator.class, Level.SEVERE,
- ex, "Unable to store tags - tagQueueQueryId [%d]", getTagQueueQueryId());
+ OseeLog.logf(Activator.class, Level.SEVERE, ex, "Unable to store tags - tagQueueQueryId [%d]",
+ getTagQueueQueryId());
}
} else {
System.out.println(String.format("Empty gamma query id: %s", getTagQueueQueryId()));
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeRelationType.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeRelationType.java
index efb9d203ce..d8ceb5586b 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeRelationType.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/PurgeRelationType.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.model.cache.RelationTypeCache;
import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.core.operation.OperationLogger;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
@@ -53,13 +54,15 @@ public final class PurgeRelationType extends AbstractDbTxOperation {
private final String[] typesToPurge;
private final boolean forcePurge;
private final List<Long[]> relationTypeGuids;
+ private final IdentityService identityService;
- public PurgeRelationType(IOseeDatabaseService databaseService, IOseeCachingService cachingService, OperationLogger logger, boolean force, String... typesToPurge) {
+ public PurgeRelationType(IOseeDatabaseService databaseService, IOseeCachingService cachingService, IdentityService identityService, OperationLogger logger, boolean force, String... typesToPurge) {
super(databaseService, "Purge Relation Type", Activator.PLUGIN_ID, logger);
this.cache = cachingService.getRelationTypeCache();
this.forcePurge = force;
this.typesToPurge = typesToPurge;
this.relationTypeGuids = new ArrayList<Long[]>(typesToPurge.length);
+ this.identityService = identityService;
}
@Override
@@ -104,7 +107,7 @@ public final class PurgeRelationType extends AbstractDbTxOperation {
try {
for (Long[] relationTypeId : relationTypeGuids) {
- chStmt.runPreparedQuery(RETRIEVE_GAMMAS_OF_REL_LINK_TXS, cache.getByGuid(relationTypeId[0]).getId());
+ chStmt.runPreparedQuery(RETRIEVE_GAMMAS_OF_REL_LINK_TXS, identityService.getLocalId(relationTypeId[0]));
while (chStmt.next()) {
gammas.add(new Integer[] {chStmt.getInt("gamma_id")});
}
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
index d38dcee745..a30eec767f 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/ServerAdminCommandProvider.java
@@ -135,8 +135,8 @@ public class ServerAdminCommandProvider implements CommandProvider {
}
IOperation operation =
- new PurgeRelationType(Activator.getOseeDatabaseService(), Activator.getOseeCachingService(), logger, force,
- relationTypes.toArray(new String[relationTypes.size()]));
+ new PurgeRelationType(Activator.getOseeDatabaseService(), Activator.getOseeCachingService(),
+ Activator.getIdentityService(), logger, force, relationTypes.toArray(new String[relationTypes.size()]));
return Operations.executeAsJob(operation, false);
}
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/internal/Activator.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/internal/Activator.java
index 02d55612a9..e3588a9090 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/internal/Activator.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/internal/Activator.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.framework.core.enums.OseeServiceTrackerId;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
import org.eclipse.osee.framework.resource.management.IResourceManager;
@@ -49,6 +50,7 @@ public class Activator implements BundleActivator {
createServiceTracker(context, IOseeDatabaseService.class, OseeServiceTrackerId.OSEE_DATABASE_SERVICE);
createServiceTracker(context, IApplicationServerManager.class, OseeServiceTrackerId.APPLICATION_MANAGER);
createServiceTracker(context, ISessionManager.class, OseeServiceTrackerId.SESSION_MANAGER);
+ createServiceTracker(context, IdentityService.class, OseeServiceTrackerId.IDENTITY_SERVICE);
}
@Override
@@ -103,6 +105,10 @@ public class Activator implements BundleActivator {
return getTracker(OseeServiceTrackerId.SESSION_MANAGER, ISessionManager.class);
}
+ public static IdentityService getIdentityService() {
+ return getTracker(OseeServiceTrackerId.IDENTITY_SERVICE, IdentityService.class);
+ }
+
private static <T> T getTracker(OseeServiceTrackerId trackerId, Class<T> clazz) {
ServiceTracker tracker = instance.mappedTrackers.get(trackerId);
Object service = tracker.getService();
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
index f49408039a..81516bdd28 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactTypeManager.java
@@ -125,10 +125,6 @@ public class ArtifactTypeManager {
return getTypeByGuid(artifactType.getGuid());
}
- public static int getTypeId(IArtifactType artifactType) throws OseeCoreException {
- return getType(artifactType).getId();
- }
-
/**
* @return Returns the descriptor with a particular name, null if it does not exist.
*/
@@ -183,7 +179,7 @@ public class ArtifactTypeManager {
"select count(1) from (select DISTINCT(art_id) FROM osee_artifact where art_type_id = ?) t1";
public static void purgeArtifactType(IArtifactType artifactType) throws OseeCoreException {
- final int artifactTypeId = getTypeId(artifactType);
+ final int artifactTypeId = Activator.getInstance().getIdentityService().getLocalId(artifactType);
int artifactCount = ConnectionHandler.runPreparedQueryFetchInt(0, COUNT_ARTIFACT_OCCURRENCE, artifactTypeId);
if (artifactCount != 0) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
index b7828ac088..0834bfeec8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.database.core.AbstractJoinQuery;
import org.eclipse.osee.framework.database.core.CharJoinQuery;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
@@ -42,11 +43,11 @@ import org.eclipse.osee.framework.database.core.OseeSql;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactLoader;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.ISearchConfirmer;
import org.eclipse.osee.framework.skynet.core.artifact.LoadLevel;
import org.eclipse.osee.framework.skynet.core.artifact.LoadType;
+import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
* @author Ryan D. Brooks
@@ -292,8 +293,9 @@ public class ArtifactQueryBuilder {
if (hasValues(artifactTypes)) {
Set<Integer> artTypeIds = new HashSet<Integer>();
+ IdentityService identityService = Activator.getInstance().getIdentityService();
for (IArtifactType artifactType : artifactTypes) {
- artTypeIds.add(ArtifactTypeManager.getTypeId(artifactType));
+ artTypeIds.add(identityService.getLocalId(artifactType));
}
idTypeJoinQuery = addToIdJoin(artTypeIds);
sql.append(artAlias);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
index df9286a018..db43635696 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.core.CharJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
* @author Ryan D. Brooks
@@ -138,7 +138,7 @@ public class AttributeCriteria extends AbstractArtifactSearchCriteria {
if (attributeType != null) {
builder.append(attrAlias);
builder.append(".attr_type_id=? AND ");
- builder.addParameter(AttributeTypeManager.getTypeId(attributeType));
+ builder.addParameter(Activator.getInstance().getIdentityService().getLocalId(attributeType));
}
if (value != null) {
builder.append(attrAlias);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java
index 88df774c56..8904c3e371 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/OrphanArtifactSearch.java
@@ -13,12 +13,14 @@ package org.eclipse.osee.framework.skynet.core.artifact.search;
import java.util.List;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
* @author Jeff C. Phillips
@@ -28,17 +30,19 @@ public class OrphanArtifactSearch implements ISearchPrimitive {
private static final String tables = "osee_artifact";
private static final String sql =
"art_type_id =? AND art_id NOT in (SELECT t2.art_id FROM osee_relation_link t1, osee_artifact t2, osee_txs t4, (SELECT Max(t1.gamma_id) AS gamma_id, t1.rel_link_id, t2.branch_id FROM osee_relation_link t1, osee_txs t2 WHERE t1.gamma_id = t2.gamma_id AND t2.branch_id = ? GROUP BY t1.rel_link_id, t2.branch_id) t6 WHERE t1.rel_link_type_id =? AND t1.b_art_id = t2.art_id AND t1.gamma_id = t4.gamma_id AND t1.rel_link_id = t6.rel_link_id AND t4.branch_id = t6.branch_id AND t1.gamma_id = t6.gamma_id AND t4.mod_type <> " + ModificationType.DELETED.getValue() + " GROUP BY t2.art_id)";
- private final ArtifactType aritfactType;
+ private final IArtifactType aritfactType;
private final int relationTypeId;
public OrphanArtifactSearch(IArtifactType aritfactType) throws OseeCoreException {
- this.aritfactType = ArtifactTypeManager.getType(aritfactType);
- this.relationTypeId = RelationTypeManager.getType("Default Hierarchical").getId();
+ this.aritfactType = aritfactType;
+ this.relationTypeId =
+ Activator.getInstance().getIdentityService().getLocalId(CoreRelationTypes.Default_Hierarchical__Child);
}
@Override
public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException {
- dataList.add(aritfactType.getId());
+ IdentityService identityService = Activator.getInstance().getIdentityService();
+ dataList.add(identityService.getLocalId(aritfactType));
dataList.add(BranchManager.getBranchId(branch));
dataList.add(relationTypeId);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java
index 2444ca7359..24a401c462 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/RelationCriteria.java
@@ -14,7 +14,8 @@ import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+import org.eclipse.osee.framework.core.services.IdentityService;
+import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
* @author Ryan D. Brooks
@@ -60,9 +61,10 @@ public class RelationCriteria extends AbstractArtifactSearchCriteria {
builder.addParameter(artifactId);
}
if (relationType != null) {
+ IdentityService identityService = Activator.getInstance().getIdentityService();
builder.append(relAlias);
builder.append(".rel_link_type_id=? AND ");
- builder.addParameter(RelationTypeManager.getTypeId(relationType));
+ builder.addParameter(identityService.getLocalId(relationType));
}
builder.append(relAlias);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java
index 2a5bead6ff..c84bbdd7d2 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java
@@ -135,10 +135,6 @@ public class AttributeTypeManager {
getCache().storeAllModified();
}
- public static int getTypeId(IAttributeType typeToken) throws OseeCoreException {
- return getType(typeToken).getId();
- }
-
@SuppressWarnings("rawtypes")
public static boolean isBaseTypeCompatible(Class<? extends Attribute> baseType, IAttributeType attributeType) throws OseeCoreException {
return baseType.isAssignableFrom(getAttributeBaseClass(attributeType));
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/ClientCachingServiceRegHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/ClientCachingServiceRegHandler.java
index d6cb9f296c..b6d32c14de 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/ClientCachingServiceRegHandler.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/ClientCachingServiceRegHandler.java
@@ -84,6 +84,6 @@ public class ClientCachingServiceRegHandler extends AbstractTrackingHandler {
new RelationTypeCache(new ClientRelationTypeAccessor(factory.getRelationTypeFactory(), artifactTypeCache));
return new OseeCachingService(branchCache, transactionCache, artifactTypeCache, attributeTypeCache,
- relationTypeCache, oseeEnumTypeCache);
+ relationTypeCache, oseeEnumTypeCache, Activator.getInstance().getIdentityService());
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
index f305f2c818..325b5b9ff0 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java
@@ -81,7 +81,7 @@ public class RelationManager {
relation.getBArtifactId() == newRelation.getBArtifactId() && //
relation.getRelationType() == newRelation.getRelationType() && //
relation != newRelation) {
- OseeLog.logf(Activator.class, Level.WARNING,
+ OseeLog.logf(Activator.class, Level.WARNING,
"Duplicate relation objects for same relation for RELATION 1 [%s] RELATION 2 [%s]", relation,
newRelation);
}
@@ -220,17 +220,17 @@ public class RelationManager {
return relatedArtifacts;
}
- public static List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationTypeSide relationEnum, DeletionFlag deletionFlag) throws OseeCoreException {
- List<Artifact> artifacts = getRelatedArtifacts(artifact, relationEnum, relationEnum.getSide());
+ public static List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationTypeSide relationType, DeletionFlag deletionFlag) throws OseeCoreException {
+ List<Artifact> artifacts = getRelatedArtifacts(artifact, relationType, relationType.getSide());
Collection<Integer> artIds = new ArrayList<Integer>();
if (deletionFlag.areDeletedAllowed()) {
- Object[] formatArgs = relationEnum.getSide().isSideA() ? new Object[] {"a", "b"} : new Object[] {"b", "a"};
+ Object[] formatArgs = relationType.getSide().isSideA() ? new Object[] {"a", "b"} : new Object[] {"b", "a"};
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
String sql = String.format(GET_DELETED_ARTIFACT, formatArgs);
- chStmt.runPreparedQuery(sql, artifact.getBranch().getId(), RelationTypeManager.getTypeId(relationEnum),
- artifact.getArtId());
+ chStmt.runPreparedQuery(sql, artifact.getBranch().getId(),
+ Activator.getInstance().getIdentityService().getLocalId(relationType), artifact.getArtId());
while (chStmt.next()) {
int artId = chStmt.getInt(formatArgs[0] + "_art_id");
artIds.add(artId);
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java
index 1bbaf57099..d25bd63130 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java
@@ -96,10 +96,6 @@ public class RelationTypeManager {
return getCache().get(relationType);
}
- public static int getTypeId(IRelationType relationType) throws OseeCoreException {
- return getCache().get(relationType).getId();
- }
-
public static RelationType getType(String typeName) throws OseeCoreException {
RelationType relationType = getCache().getUniqueByName(typeName);
if (relationType == null) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java
index 78e9c0792d..91265c6015 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java
@@ -38,7 +38,7 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.io.Streams;
import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
* Provides utility methods for parsing wordML.
@@ -128,8 +128,8 @@ public class WordUtil {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- chStmt.runPreparedQuery(SELECT_WORD_VALUES, artId,
- AttributeTypeManager.getTypeId(CoreAttributeTypes.WordTemplateContent), branch.getId());
+ int localId = Activator.getInstance().getIdentityService().getLocalId(CoreAttributeTypes.WordTemplateContent);
+ chStmt.runPreparedQuery(SELECT_WORD_VALUES, artId, localId, branch.getId());
List<Pair<String, Integer>> values = new LinkedList<Pair<String, Integer>>();
while (chStmt.next()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
index 1daf4e16fd..3812b31a0d 100644
--- a/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
+++ b/plugins/org.eclipse.osee.framework.ui.data.model.editor/src/org/eclipse/osee/framework/ui/data/model/editor/input/OseeDataTypeDatastore.java
@@ -78,7 +78,7 @@ public class OseeDataTypeDatastore {
artifactType.getAttributeTypes(BranchManager.getBranch(CoreBranches.SYSTEM_ROOT));
for (IAttributeType attrType : attributeTypes) {
- int typeId = AttributeTypeManager.getTypeId(attrType);
+ int typeId = AttributeTypeManager.getType(attrType).getId();
toReturn.put(String.valueOf(artifactType.getId()), String.valueOf(typeId));
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
index 2879380ee7..8e5a6080c8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/FixTemplateContentArtifacts.java
@@ -46,7 +46,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
@@ -131,8 +130,8 @@ public class FixTemplateContentArtifacts extends AbstractBlam {
}
} catch (Exception ex) {
badData.add(attrData.gammaId);
- OseeLog.logf(Activator.class, Level.SEVERE, "Skiping File %s because of exception %s",
- attrData.getHrid(), ex);
+ OseeLog.logf(Activator.class, Level.SEVERE, "Skiping File %s because of exception %s", attrData.getHrid(),
+ ex);
}
if (fixedAttribute) {
@@ -173,7 +172,8 @@ public class FixTemplateContentArtifacts extends AbstractBlam {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- chStmt.runPreparedQuery(GET_ATTRS, AttributeTypeManager.getTypeId(CoreAttributeTypes.WordTemplateContent));
+ chStmt.runPreparedQuery(GET_ATTRS,
+ Activator.getInstance().getIdentityService().getLocalId(CoreAttributeTypes.WordTemplateContent));
while (chStmt.next()) {
attrData.add(new AttrData(chStmt.getString("gamma_Id"), chStmt.getString("human_readable_id"),
chStmt.getString("uri")));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/AbstractWordAttributeHealthOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/AbstractWordAttributeHealthOperation.java
index 1315d8337b..7dda33b06a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/AbstractWordAttributeHealthOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/AbstractWordAttributeHealthOperation.java
@@ -42,7 +42,6 @@ import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
/**
@@ -157,7 +156,7 @@ public abstract class AbstractWordAttributeHealthOperation extends DatabaseHealt
List<AttrData> attrData = new ArrayList<AttrData>();
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- chStmt.runPreparedQuery(GET_ATTRS, AttributeTypeManager.getTypeId(attributeType));
+ chStmt.runPreparedQuery(GET_ATTRS, Activator.getInstance().getIdentityService().getLocalId(attributeType));
while (chStmt.next()) {
checkForCancelledStatus(monitor);
String uri = chStmt.getString("uri");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/Activator.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/Activator.java
index 911729c4d1..7f48385da8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/Activator.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/Activator.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.framework.core.client.ClientSessionManager;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationRequiredException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.ServiceDependencyTracker;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
@@ -58,6 +59,7 @@ public class Activator extends OseeUiActivator implements IBroadcastEventListene
private ServiceTracker cacheServiceTracker;
private ServiceTracker databaseServiceTracker;
private ServiceTracker accessServiceTracker;
+ private ServiceTracker identityServiceTracker;
private final Map<String, ServiceDependencyTracker> trackers = new HashMap<String, ServiceDependencyTracker>();
@@ -73,6 +75,7 @@ public class Activator extends OseeUiActivator implements IBroadcastEventListene
cacheServiceTracker.close();
databaseServiceTracker.close();
accessServiceTracker.close();
+ identityServiceTracker.close();
for (ServiceDependencyTracker tracker : trackers.values()) {
Lib.close(tracker);
@@ -95,6 +98,9 @@ public class Activator extends OseeUiActivator implements IBroadcastEventListene
accessServiceTracker = new ServiceTracker(context, AccessPolicy.class.getName(), null);
accessServiceTracker.open();
+ identityServiceTracker = new ServiceTracker(context, IdentityService.class.getName(), null);
+ identityServiceTracker.open();
+
trackers.put(ArtifactPromptService.class.getName(), new ServiceDependencyTracker(context,
new ArtifactPromptServiceRegHandler()));
@@ -161,6 +167,10 @@ public class Activator extends OseeUiActivator implements IBroadcastEventListene
return (AccessPolicy) accessServiceTracker.getService();
}
+ public IdentityService getIdentityService() {
+ return (IdentityService) identityServiceTracker.getService();
+ }
+
public ArtifactPromptService getArtifactPromptService() throws OseeCoreException {
return ((ArtifactPromptServiceRegHandler) trackers.get(ArtifactPromptService.class.getName()).getHandler()).getService();
}

Back to the top