Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-09-07 15:20:50 -0400
committerRyan D. Brooks2011-09-07 15:20:50 -0400
commitfd418e66265b005de8f3087a3723cd139b798eea (patch)
treea18accb0ce2c10c673b089c4a2bb41166e462885
parent677d9c246419d158237c5e5b9d9bbd3da3888770 (diff)
downloadorg.eclipse.osee-fd418e66265b005de8f3087a3723cd139b798eea.tar.gz
org.eclipse.osee-fd418e66265b005de8f3087a3723cd139b798eea.tar.xz
org.eclipse.osee-fd418e66265b005de8f3087a3723cd139b798eea.zip
refactor: Rename RemoteIdManager to IdentityService
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/DatastoreInitOperation.java7
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java18
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/OseeCachingServiceRegistrationHandler.java5
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ServerOseeCachingServiceFactory.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IdentityService.java (renamed from plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/RemoteIdManager.java)10
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeServiceTrackerId.java3
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java4
-rw-r--r--plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/internal/DatabaseInitActivator.java12
-rw-r--r--plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.framework.database/build.properties5
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java3
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java (renamed from plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/RemoteIdManagerImpl.java)36
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java7
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/trackers/OseeDatabaseServiceRegistrationHandler.java14
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ConfigurationServlet.java7
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/internal/ServletRegistrationHandler.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/Activator.java6
20 files changed, 101 insertions, 70 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/DatastoreInitOperation.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/DatastoreInitOperation.java
index b491a65431..5b8a814197 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/DatastoreInitOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/DatastoreInitOperation.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.server.OseeServerProperties;
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.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.OseeInfo;
@@ -44,8 +45,9 @@ public class DatastoreInitOperation extends AbstractOperation {
private final IOseeSchemaProvider schemaProvider;
private final SchemaCreationOptions options;
private final IApplicationServerManager appServerManager;
+ private final IdentityService identityService;
- public DatastoreInitOperation(IApplicationServerManager appServerManager, IOseeDatabaseService dbService, IOseeCachingService cachingService, IOseeBranchService branchService, IOseeSchemaProvider schemaProvider, SchemaCreationOptions options) {
+ public DatastoreInitOperation(IApplicationServerManager appServerManager, IOseeDatabaseService dbService, IOseeCachingService cachingService, IOseeBranchService branchService, IOseeSchemaProvider schemaProvider, SchemaCreationOptions options, IdentityService identityService) {
super("Datastore Initialization", Activator.PLUGIN_ID);
this.appServerManager = appServerManager;
this.dbService = dbService;
@@ -53,6 +55,7 @@ public class DatastoreInitOperation extends AbstractOperation {
this.branchService = branchService;
this.schemaProvider = schemaProvider;
this.options = options;
+ this.identityService = identityService;
}
@Override
@@ -64,7 +67,7 @@ public class DatastoreInitOperation extends AbstractOperation {
doSubWork(subOp, monitor, 0.30);
dbService.getSequence().clear();
- dbService.getRemoteIdManager().clear();
+ identityService.clear();
appServerManager.executeLookupRegistration();
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
index dfa77b8f60..fcc2829501 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/ArtifactTypeDataAccessor.java
@@ -25,9 +25,9 @@ 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.IOseeCache;
import org.eclipse.osee.framework.core.model.cache.IOseeDataAccessor;
+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.RemoteIdManager;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.resource.management.IResource;
@@ -48,13 +48,15 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
private final IResourceLocatorManager locatorManager;
private final IResourceManager resourceManager;
private final BranchCache branchCache;
+ private final IdentityService identityService;
- public ArtifactTypeDataAccessor(ModelingServiceProvider modelService, IOseeDatabaseService databaseService, IResourceLocatorManager locatorManager, IResourceManager resourceManager, BranchCache branchCache) {
+ public ArtifactTypeDataAccessor(ModelingServiceProvider modelService, IOseeDatabaseService databaseService, IResourceLocatorManager locatorManager, IResourceManager resourceManager, BranchCache branchCache, IdentityService identityService) {
this.modelService = modelService;
this.databaseService = databaseService;
this.locatorManager = locatorManager;
this.resourceManager = resourceManager;
this.branchCache = branchCache;
+ this.identityService = identityService;
}
@Override
@@ -75,14 +77,13 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
@Override
public void store(Collection<T> types) throws OseeCoreException {
- RemoteIdManager manager = databaseService.getRemoteIdManager();
Collection<Long> remoteIds = new ArrayList<Long>();
for (T type : types) {
remoteIds.add(type.getGuid());
}
- manager.store(remoteIds);
+ identityService.store(remoteIds);
for (T type : types) {
- type.setId(manager.getLocalId(type.getGuid()));
+ type.setId(identityService.getLocalId(type.getGuid()));
type.clearDirty();
}
}
@@ -90,11 +91,8 @@ public class ArtifactTypeDataAccessor<T extends AbstractOseeType<Long>> implemen
private Collection<String> findOseeTypeData() throws OseeCoreException {
Collection<String> paths = new ArrayList<String>();
- RemoteIdManager manager = databaseService.getRemoteIdManager();
-
- // john: Which attribute type store type def binary data
- Integer artifactTypeId = manager.getLocalId(CoreArtifactTypes.OseeTypeDefinition.getGuid());
- Integer attributeTypeId = manager.getLocalId(CoreAttributeTypes.UriGeneralStringData.getGuid());
+ Integer artifactTypeId = identityService.getLocalId(CoreArtifactTypes.OseeTypeDefinition.getGuid());
+ Integer attributeTypeId = identityService.getLocalId(CoreAttributeTypes.UriGeneralStringData.getGuid());
Branch commonBranch = branchCache.get(CoreBranches.COMMON);
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/OseeCachingServiceRegistrationHandler.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/OseeCachingServiceRegistrationHandler.java
index f005442324..7493ae6a5f 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/OseeCachingServiceRegistrationHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/internal/OseeCachingServiceRegistrationHandler.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -43,6 +44,7 @@ public class OseeCachingServiceRegistrationHandler extends AbstractTrackingHandl
// IOseeModelingService.class,
IResourceLocatorManager.class,
IResourceManager.class,
+ IdentityService.class,
};
//@formatter:on
@@ -81,6 +83,7 @@ public class OseeCachingServiceRegistrationHandler extends AbstractTrackingHandl
final IApplicationServerManager appManager = getService(IApplicationServerManager.class, services);
final IResourceManager resourceManager = getService(IResourceManager.class, services);
final IResourceLocatorManager resourceLocatorManager = getService(IResourceLocatorManager.class, services);
+ final IdentityService identityService = getService(IdentityService.class, services);
ModelingServiceProvider provider = new ModelingServiceProvider() {
@@ -99,6 +102,6 @@ public class OseeCachingServiceRegistrationHandler extends AbstractTrackingHandl
};
return new ServerOseeCachingServiceFactory(dbService, modelFactoryService, translationService, lookupService,
- appManager, provider, resourceLocatorManager, resourceManager);
+ appManager, provider, resourceLocatorManager, resourceManager, identityService);
}
}
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 68413770a9..bf32d59d3a 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
@@ -30,6 +30,7 @@ import org.eclipse.osee.framework.core.server.IApplicationServerManager;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
@@ -48,8 +49,9 @@ public class ServerOseeCachingServiceFactory implements IOseeCachingServiceFacto
private final ModelingServiceProvider modelingService;
private final IResourceLocatorManager locatorManager;
private final IResourceManager resourceManager;
+ private final IdentityService identityService;
- public ServerOseeCachingServiceFactory(IOseeDatabaseService databaseService, IOseeModelFactoryService factoryService, IDataTranslationService translationService, IApplicationServerLookup serverLookUp, IApplicationServerManager appManager, ModelingServiceProvider modelingService, IResourceLocatorManager locatorManager, IResourceManager resourceManager) {
+ public ServerOseeCachingServiceFactory(IOseeDatabaseService databaseService, IOseeModelFactoryService factoryService, IDataTranslationService translationService, IApplicationServerLookup serverLookUp, IApplicationServerManager appManager, ModelingServiceProvider modelingService, IResourceLocatorManager locatorManager, IResourceManager resourceManager, IdentityService identityService) {
this.databaseService = databaseService;
this.factoryService = factoryService;
this.translationService = translationService;
@@ -58,6 +60,7 @@ public class ServerOseeCachingServiceFactory implements IOseeCachingServiceFacto
this.modelingService = modelingService;
this.locatorManager = locatorManager;
this.resourceManager = resourceManager;
+ this.identityService = identityService;
}
@Override
@@ -72,16 +75,16 @@ public class ServerOseeCachingServiceFactory implements IOseeCachingServiceFacto
OseeEnumTypeCache oseeEnumTypeCache =
new OseeEnumTypeCache(new ArtifactTypeDataAccessor<OseeEnumType>(modelingService, databaseService,
- locatorManager, resourceManager, branchCache));
+ locatorManager, resourceManager, branchCache, identityService));
AttributeTypeCache attributeCache =
new AttributeTypeCache(new ArtifactTypeDataAccessor<AttributeType>(modelingService, databaseService,
- locatorManager, resourceManager, branchCache));
+ locatorManager, resourceManager, branchCache, identityService));
ArtifactTypeCache artifactCache =
new ArtifactTypeCache(new ArtifactTypeDataAccessor<ArtifactType>(modelingService, databaseService,
- locatorManager, resourceManager, branchCache));
+ locatorManager, resourceManager, branchCache, identityService));
RelationTypeCache relationCache =
new RelationTypeCache(new ArtifactTypeDataAccessor<RelationType>(modelingService, databaseService,
- locatorManager, resourceManager, branchCache));
+ locatorManager, resourceManager, branchCache, identityService));
return new OseeCachingService(branchCache, txCache, artifactCache, attributeCache, relationCache,
oseeEnumTypeCache);
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/RemoteIdManager.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IdentityService.java
index f3027e0ebd..0ea7de5827 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/RemoteIdManager.java
+++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/services/IdentityService.java
@@ -3,21 +3,21 @@
*
* PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
*/
-package org.eclipse.osee.framework.database.core;
+package org.eclipse.osee.framework.core.services;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-public interface RemoteIdManager {
+public interface IdentityService {
- Integer getLocalId(Long remoteId) throws OseeCoreException;
+ Integer getLocalId(Long universalId) throws OseeCoreException;
- Long getRemoteId(Integer localId) throws OseeCoreException;
+ Long getUniversalId(Integer localId) throws OseeCoreException;
int getLocalId(Identity<Long> identity) throws OseeCoreException;
- void store(Collection<Long> remoteIds) throws OseeCoreException;
+ void store(Collection<Long> universalIds) throws OseeCoreException;
void clear();
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeServiceTrackerId.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeServiceTrackerId.java
index ac3b15a3be..bdc66f0634 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeServiceTrackerId.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeServiceTrackerId.java
@@ -37,5 +37,6 @@ public enum OseeServiceTrackerId {
SESSION_MANAGER,
AUTHENTICATION_SERVICE,
OSEE_BRANCH_SERVICE,
- LIFECYCLE_SERVER;
+ LIFECYCLE_SERVER,
+ IDENTITY_SERVICE;
}
diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
index 2fb7c10264..d2e8ee6d96 100644
--- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
+++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/DbBootstrapTask.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.message.DatastoreInitRequest;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.core.util.HttpMessage;
@@ -69,7 +70,8 @@ public class DbBootstrapTask implements IDbInitializationTask {
IOseeDatabaseService databaseService = DatabaseInitActivator.getInstance().getDatabaseService();
databaseService.getSequence().clear();
- databaseService.getRemoteIdManager().clear();
+ IdentityService identityService = DatabaseInitActivator.getInstance().getIdentityService();
+ identityService.clear();
Branch systemRoot = BranchManager.getSystemRootBranch();
Conditions.checkNotNull(systemRoot, "System root was not created - ");
diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/internal/DatabaseInitActivator.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/internal/DatabaseInitActivator.java
index 2f4ac197ef..5674e17177 100644
--- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/internal/DatabaseInitActivator.java
+++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/internal/DatabaseInitActivator.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.database.init.internal;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.translation.IDataTranslationServiceProvider;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -25,6 +26,7 @@ public class DatabaseInitActivator implements BundleActivator, IDataTranslationS
private ServiceTracker serviceTracker;
private ServiceTracker serviceTracker2;
private ServiceTracker serviceTracker3;
+ private ServiceTracker serviceTracker4;
@Override
public void start(BundleContext context) throws Exception {
@@ -37,6 +39,9 @@ public class DatabaseInitActivator implements BundleActivator, IDataTranslationS
serviceTracker3 = new ServiceTracker(context, IOseeDatabaseService.class.getName(), null);
serviceTracker3.open(true);
+
+ serviceTracker4 = new ServiceTracker(context, IdentityService.class.getName(), null);
+ serviceTracker4.open(true);
}
@Override
@@ -50,6 +55,9 @@ public class DatabaseInitActivator implements BundleActivator, IDataTranslationS
if (serviceTracker3 != null) {
serviceTracker3.close();
}
+ if (serviceTracker4 != null) {
+ serviceTracker4.close();
+ }
}
public static DatabaseInitActivator getInstance() {
@@ -68,4 +76,8 @@ public class DatabaseInitActivator implements BundleActivator, IDataTranslationS
public IOseeDatabaseService getDatabaseService() {
return (IOseeDatabaseService) serviceTracker3.getService();
}
+
+ public IdentityService getIdentityService() {
+ return (IdentityService) serviceTracker4.getService();
+ }
}
diff --git a/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF
index ba24cb272b..5a018dc033 100644
--- a/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF
@@ -31,5 +31,5 @@ Import-Package: org.eclipse.core.runtime,
org.osgi.framework,
org.osgi.util.tracker
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Service-Component: OSGI-INF/uri.connection.contributor.xml
+Service-Component: OSGI-INF/*.xml
Require-Bundle: org.eclipse.equinox.ds
diff --git a/plugins/org.eclipse.osee.framework.database/build.properties b/plugins/org.eclipse.osee.framework.database/build.properties
index c58ea2178c..2a0c8ce1ed 100644
--- a/plugins/org.eclipse.osee.framework.database/build.properties
+++ b/plugins/org.eclipse.osee.framework.database/build.properties
@@ -1,5 +1,6 @@
-source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- OSGI-INF/
+ OSGI-INF/,\
+ OSGI-INF/component.xml
+source.. = src/
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
index 1141dcd06f..736cba49a3 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
@@ -17,15 +17,12 @@ import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.core.IOseeSequence;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
/**
* @author Roberto E. Escobar
*/
public interface IOseeDatabaseService {
- RemoteIdManager getRemoteIdManager();
-
IOseeSequence getSequence() throws OseeDataStoreException;
IOseeStatement getStatement() throws OseeDataStoreException;
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/RemoteIdManagerImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java
index 98d7dbe10c..0200ac772b 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/RemoteIdManagerImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/IdentityServiceImpl.java
@@ -14,51 +14,51 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Lib;
-public class RemoteIdManagerImpl implements RemoteIdManager {
+public class IdentityServiceImpl implements IdentityService {
private static final String SELECT_ALL = "select * from osee_type_id_map";
private static final String INSERT_SQL = "insert into osee_type_id_map (remote_id, local_id) values (?,?)";
- private final Map<Long, Integer> remoteIdToLocalId = new ConcurrentHashMap<Long, Integer>();
- private final Map<Integer, Long> localIdToRemoteId = new ConcurrentHashMap<Integer, Long>();
+ private final Map<Long, Integer> universalIdToLocalId = new ConcurrentHashMap<Long, Integer>();
+ private final Map<Integer, Long> localIdToUniversalId = new ConcurrentHashMap<Integer, Long>();
private final Set<Long> persistedIds = new ConcurrentSkipListSet<Long>();
private final IOseeDatabaseService service;
private volatile boolean ensurePopulatedRanOnce;
- public RemoteIdManagerImpl(IOseeDatabaseService service) {
+ public IdentityServiceImpl(IOseeDatabaseService service) {
super();
this.service = service;
}
@Override
- public Integer getLocalId(Long remoteId) throws OseeCoreException {
+ public Integer getLocalId(Long universalId) throws OseeCoreException {
ensurePopulate();
- Conditions.checkNotNull(remoteId, "remoteId");
- Integer localId = remoteIdToLocalId.get(remoteId);
+ Conditions.checkNotNull(universalId, "universalId");
+ Integer localId = universalIdToLocalId.get(universalId);
if (localId == null) {
reloadCache();
- localId = remoteIdToLocalId.get(remoteId);
+ localId = universalIdToLocalId.get(universalId);
if (localId == null) {
localId = service.getSequence().getNextLocalTypeId();
- cache(remoteId, localId);
+ cache(universalId, localId);
}
}
return localId;
}
@Override
- public Long getRemoteId(Integer localId) throws OseeCoreException {
+ public Long getUniversalId(Integer localId) throws OseeCoreException {
ensurePopulate();
Conditions.checkNotNull(localId, "localId");
- Long remoteId = localIdToRemoteId.get(localId);
+ Long remoteId = localIdToUniversalId.get(localId);
if (remoteId == null) {
throw new OseeCoreException("Remote id for local id [%s] was not found", remoteId);
}
@@ -85,14 +85,14 @@ public class RemoteIdManagerImpl implements RemoteIdManager {
@Override
public void clear() {
- remoteIdToLocalId.clear();
- localIdToRemoteId.clear();
+ universalIdToLocalId.clear();
+ localIdToUniversalId.clear();
persistedIds.clear();
}
private void cache(Long remoteId, Integer localId) {
- remoteIdToLocalId.put(remoteId, localId);
- localIdToRemoteId.put(localId, remoteId);
+ universalIdToLocalId.put(remoteId, localId);
+ localIdToUniversalId.put(localId, remoteId);
}
private synchronized void ensurePopulate() throws OseeCoreException {
@@ -103,10 +103,10 @@ public class RemoteIdManagerImpl implements RemoteIdManager {
}
@Override
- public void store(Collection<Long> remoteIds) throws OseeCoreException {
+ public void store(Collection<Long> universalIds) throws OseeCoreException {
ensurePopulate();
List<Object[]> data = new ArrayList<Object[]>();
- List<Long> toPersist = Collections.setComplement(remoteIds, persistedIds);
+ List<Long> toPersist = Collections.setComplement(universalIds, persistedIds);
for (Long remoteId : toPersist) {
Integer localId = getLocalId(remoteId);
data.add(new Object[] {remoteId, localId});
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
index e6e72ff7a1..4cbda6ebf6 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
@@ -27,7 +27,6 @@ import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
import org.eclipse.osee.framework.database.core.IOseeSequence;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
import org.eclipse.osee.framework.database.internal.Activator;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -42,11 +41,9 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
private final IOseeSequence oseeSequence;
private final ConnectionFactoryProvider dbConnectionFactory;
private final IDatabaseInfoProvider dbInfoProvider;
- private final RemoteIdManager remoteIdManager;
public OseeDatabaseServiceImpl(IDatabaseInfoProvider dbInfoProvider, ConnectionFactoryProvider dbConnectionFactory) {
this.oseeSequence = new OseeSequenceImpl(this);
- this.remoteIdManager = new RemoteIdManagerImpl(this);
this.dbInfoProvider = dbInfoProvider;
this.dbConnectionFactory = dbConnectionFactory;
}
@@ -230,8 +227,4 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
return getDatabaseInfoProvider().isProduction();
}
- @Override
- public RemoteIdManager getRemoteIdManager() {
- return remoteIdManager;
- }
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/trackers/OseeDatabaseServiceRegistrationHandler.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/trackers/OseeDatabaseServiceRegistrationHandler.java
index 4642f7d77d..23a71c9f8d 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/trackers/OseeDatabaseServiceRegistrationHandler.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/trackers/OseeDatabaseServiceRegistrationHandler.java
@@ -11,10 +11,13 @@
package org.eclipse.osee.framework.database.internal.trackers;
import java.util.Map;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
+import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
import org.eclipse.osee.framework.database.internal.core.ConnectionFactoryProvider;
+import org.eclipse.osee.framework.database.internal.core.IdentityServiceImpl;
import org.eclipse.osee.framework.database.internal.core.OseeDatabaseServiceImpl;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -26,7 +29,8 @@ public final class OseeDatabaseServiceRegistrationHandler extends AbstractTracki
private final static Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {IDatabaseInfoProvider.class};
- private ServiceRegistration serviceRegistration;
+ private ServiceRegistration<?> serviceRegistration;
+ private ServiceRegistration<?> serviceRegistration2;
public OseeDatabaseServiceRegistrationHandler() {
super();
@@ -44,12 +48,14 @@ public final class OseeDatabaseServiceRegistrationHandler extends AbstractTracki
ConnectionFactoryProvider dbConnectionFactory = new ConnectionFactoryProvider(context);
IOseeDatabaseService databaseService = new OseeDatabaseServiceImpl(dbInfoProvider, dbConnectionFactory);
serviceRegistration = context.registerService(IOseeDatabaseService.class.getName(), databaseService, null);
+
+ IdentityService identityService = new IdentityServiceImpl(databaseService);
+ serviceRegistration2 = context.registerService(IdentityService.class.getName(), identityService, null);
}
@Override
public void onDeActivate() {
- if (serviceRegistration != null) {
- serviceRegistration.unregister();
- }
+ OsgiUtil.close(serviceRegistration);
+ OsgiUtil.close(serviceRegistration2);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ConfigurationServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ConfigurationServlet.java
index 1ac112cf18..e624cd3e9e 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ConfigurationServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/ConfigurationServlet.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
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.core.translation.IDataTranslationService;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -50,13 +51,15 @@ public class ConfigurationServlet extends UnsecuredOseeHttpServlet {
private final IOseeCachingService cachingService;
private final IOseeBranchService branchService;
private final IApplicationServerManager appServerService;
+ private final IdentityService identityService;
- public ConfigurationServlet(IApplicationServerManager appServerService, IDataTranslationService translationService, IOseeDatabaseService databaseService, IOseeCachingService cachingService, IOseeBranchService branchService) {
+ public ConfigurationServlet(IApplicationServerManager appServerService, IDataTranslationService translationService, IOseeDatabaseService databaseService, IOseeCachingService cachingService, IOseeBranchService branchService, IdentityService identityService) {
this.translationService = translationService;
this.databaseService = databaseService;
this.branchService = branchService;
this.cachingService = cachingService;
this.appServerService = appServerService;
+ this.identityService = identityService;
}
@Override
@@ -94,7 +97,7 @@ public class ConfigurationServlet extends UnsecuredOseeHttpServlet {
IOseeSchemaProvider schemaProvider = new OseeSchemaProvider();
IOperation operation =
new DatastoreInitOperation(appServerService, databaseService, cachingService, branchService,
- schemaProvider, options);
+ schemaProvider, options, identityService);
Operations.executeWorkAndCheckStatus(operation, new LogProgressMonitor());
} catch (Exception ex) {
String message = String.format("Datastore Initialization: [%s]\n%s", response.toString(), ex.toString());
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 bf05809cf2..c0836a3210 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
@@ -25,6 +25,7 @@ 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.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -75,6 +76,7 @@ public class ServletRegistrationHandler extends AbstractTrackingHandler {
IResourceLocatorManager.class,
IResourceManager.class,
HttpService.class,
+ IdentityService.class,
};
//@formatter:on
@@ -104,6 +106,7 @@ public class ServletRegistrationHandler extends AbstractTrackingHandler {
IOseeModelFactoryService factoryService = getService(IOseeModelFactoryService.class, services);
IResourceLocatorManager locatorManager = getService(IResourceLocatorManager.class, services);
IResourceManager resourceManager = getService(IResourceManager.class, services);
+ IdentityService identityService = getService(IdentityService.class, services);
httpService = getService(HttpService.class, services);
appServerManager = getService(IApplicationServerManager.class, services);
@@ -129,8 +132,8 @@ public class ServletRegistrationHandler extends AbstractTrackingHandler {
register(new UnsubscribeServlet(context, databaseService, caching), "osee/unsubscribe");
register(new AtsServlet(locatorManager, resourceManager, caching), "osee/ats");
- register(new ConfigurationServlet(appServerManager, translationService, databaseService, caching, branchService),
- OseeServerContext.OSEE_CONFIGURE_CONTEXT);
+ register(new ConfigurationServlet(appServerManager, translationService, databaseService, caching, branchService,
+ identityService), OseeServerContext.OSEE_CONFIGURE_CONTEXT);
register(new DataServlet(locatorManager, resourceManager, caching), "osee/data");
register(new AdminServlet(context), "osee/console");
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java
index 0e08579ac1..b0be3ca1d3 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactTypeSearch.java
@@ -15,7 +15,7 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.data.NamedIdentity;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
/**
@@ -41,7 +41,7 @@ public class ArtifactTypeSearch implements ISearchPrimitive {
@Override
public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException {
String sql = "osee_artifact.art_type_id = ?";
- RemoteIdManager remoteIdManager = Activator.getInstance().getOseeDatabaseService().getRemoteIdManager();
+ IdentityService remoteIdManager = Activator.getInstance().getIdentityService();
dataList.add(remoteIdManager.getLocalId(artifactType));
return sql;
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java
index 3201cee56f..7ca9b5e247 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeValueSearch.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.data.NamedIdentity;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
@@ -61,7 +61,7 @@ public class AttributeValueSearch implements ISearchPrimitive {
sql.append(" attr_1.attr_type_id = ? AND attr_1.gamma_id = txs.gamma_id AND txs.tx_current = 1 and txs.branch_id = ?");
- RemoteIdManager remoteIdManager = Activator.getInstance().getOseeDatabaseService().getRemoteIdManager();
+ IdentityService remoteIdManager = Activator.getInstance().getIdentityService();
dataList.add(remoteIdManager.getLocalId(attributeType));
dataList.add(BranchManager.getBranchId(branch));
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java
index 370a568533..0dfdb7d49c 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/InRelationSearch.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.framework.core.data.Identity;
import org.eclipse.osee.framework.core.data.NamedIdentity;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
+import org.eclipse.osee.framework.core.services.IdentityService;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
@@ -41,7 +41,7 @@ public class InRelationSearch implements ISearchPrimitive {
@Override
public String getCriteriaSql(List<Object> dataList, IOseeBranch branch) throws OseeCoreException {
- RemoteIdManager remoteIdManager = Activator.getInstance().getOseeDatabaseService().getRemoteIdManager();
+ IdentityService remoteIdManager = Activator.getInstance().getIdentityService();
dataList.add(remoteIdManager.getLocalId(relationType));
dataList.add(BranchManager.getBranchId(branch));
dataList.add(ModificationType.DELETED.getValue());
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/Activator.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/Activator.java
index daac36f235..6bbffcbd3a 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/Activator.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/Activator.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.framework.core.enums.OseeServiceTrackerId;
import org.eclipse.osee.framework.core.model.TransactionRecordFactory;
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.translation.IDataTranslationService;
import org.eclipse.osee.framework.core.util.ServiceDependencyTracker;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
@@ -70,6 +71,7 @@ public class Activator implements BundleActivator, IOseeDatabaseServiceProvider,
createServiceTracker(context, IOseeDatabaseService.class, OseeServiceTrackerId.OSEE_DATABASE_SERVICE);
createServiceTracker(context, ILifecycleService.class, OseeServiceTrackerId.LIFECYCLE_SERVER);
createServiceTracker(context, AccessPolicy.class, OseeServiceTrackerId.OSEE_ACCESS_CONTROL_SERVICE);
+ createServiceTracker(context, IdentityService.class, OseeServiceTrackerId.IDENTITY_SERVICE);
for (ServiceDependencyTracker dependencyTracker : trackers) {
dependencyTracker.open();
@@ -95,6 +97,10 @@ public class Activator implements BundleActivator, IOseeDatabaseServiceProvider,
return instance;
}
+ public IdentityService getIdentityService() {
+ return getTracker(OseeServiceTrackerId.IDENTITY_SERVICE, IdentityService.class);
+ }
+
public IOseeCachingService getOseeCacheService() {
return getTracker(OseeServiceTrackerId.OSEE_CACHING_SERVICE, IOseeCachingService.class);
}

Back to the top