Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-12-02 17:57:19 +0000
committerAngel Avila2014-12-02 17:57:19 +0000
commitf254847d86fcbf0a3d6a2c46e663fc7816bf3cb7 (patch)
tree294650cdfb2a675ea4690d2d113528540b3f7a62 /plugins
parent09bf48a0b39f76928766081e67a27a0299330f27 (diff)
downloadorg.eclipse.osee-f254847d86fcbf0a3d6a2c46e663fc7816bf3cb7.tar.gz
org.eclipse.osee-f254847d86fcbf0a3d6a2c46e663fc7816bf3cb7.tar.xz
org.eclipse.osee-f254847d86fcbf0a3d6a2c46e663fc7816bf3cb7.zip
bug: Fix AtsServer service circularity
Remove uses of OseeLog in server impl bundle Fix AtsServer service circularity issues Fix database conversion service issues Change-Id: I7620cdfaa1ee09d65cb59cc97709ed19446f6c6f
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java9
-rw-r--r--plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.osee.ats.impl.test/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessorTest.java14
-rw-r--r--plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.attribute.resolver.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.database.convert.service.ref.xml5
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.database.conversion.xml7
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.notifier.service.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.notification.service.xml3
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.rev.xml5
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.xml10
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.user.service.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.workdef.store.service.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/IAtsServer.java6
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java66
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerService.java30
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AbstractConvertGuidToUuid.java36
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AtsDatabaseConversions.java39
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertBaselineGuidToBaselineUuid.java8
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertFavoriteBranchGuidToUuid.java13
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/NoopAtsDatabaseConversion.java (renamed from plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsSequenceProvider.java)25
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNotifierServiceImpl.java13
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/NoOpAtsNotifierServiceImpl.java (renamed from plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNoOpNotifierServiceImpl.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/SendNotificationEvents.java13
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessor.java30
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUserServiceImpl.java16
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsAttributeResolverServiceImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsChangeSet.java9
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsStoreFactoryImpl.java7
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/WorkItem.java1
31 files changed, 192 insertions, 213 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
index c12c365b5d..bed4f34d05 100644
--- a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
@@ -53,6 +53,7 @@ Import-Package: com.google.inject,
org.eclipse.osee.framework.core.services,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.database,
+ org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.jdk.core.util.xml,
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 4b8c6f06d7..252ddf3b5e 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -91,7 +91,6 @@ import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
import org.eclipse.osee.ats.core.config.IVersionFactory;
import org.eclipse.osee.ats.core.util.ActionFactory;
import org.eclipse.osee.ats.core.util.AtsCoreFactory;
-import org.eclipse.osee.ats.core.util.AtsSequenceProvider;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.ats.core.util.IAtsActionFactory;
@@ -210,7 +209,13 @@ public class AtsClientImpl implements IAtsClient {
configItemFactory = new ConfigItemFactory();
actionableItemManager = new ActionableItemManager(getConfig(), attributeResolverService);
- sequenceProvider = new AtsSequenceProvider(dbService);
+ sequenceProvider = new ISequenceProvider() {
+
+ @Override
+ public long getNext(String sequenceName) {
+ return dbService.getSequence().getNextSequence(sequenceName);
+ }
+ };
utilService = AtsCoreFactory.getUtilService(attributeResolverService);
actionFactory =
diff --git a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
index 548b778339..a021e54bb4 100644
--- a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
@@ -5,8 +5,7 @@ Bundle-SymbolicName: org.eclipse.osee.ats.core;singleton:=true
Bundle-Version: 0.20.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: com.google.inject,
- org.eclipse.osee.ats.api,
+Import-Package: org.eclipse.osee.ats.api,
org.eclipse.osee.ats.api.ai,
org.eclipse.osee.ats.api.commit,
org.eclipse.osee.ats.api.cpa,
@@ -25,24 +24,15 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.api.workflow.log,
org.eclipse.osee.ats.api.workflow.state,
org.eclipse.osee.ats.api.workflow.transition,
- org.eclipse.osee.ats.dsl,
- org.eclipse.osee.ats.dsl.atsDsl,
- org.eclipse.osee.ats.dsl.atsDsl.impl,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
- org.eclipse.osee.framework.core.model,
- org.eclipse.osee.framework.core.operation,
org.eclipse.osee.framework.core.util,
- org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.framework.logging,
- org.eclipse.osee.orcs.data,
- org.eclipse.xtext.resource,
- org.osgi.framework
+ org.eclipse.osee.orcs.data
Bundle-Vendor: Eclipse Open System Engineering Environment
Export-Package: org.eclipse.osee.ats.core,
org.eclipse.osee.ats.core.ai,
diff --git a/plugins/org.eclipse.osee.ats.impl.test/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessorTest.java b/plugins/org.eclipse.osee.ats.impl.test/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessorTest.java
index c3a3fde5ec..c4bd3c9bc2 100644
--- a/plugins/org.eclipse.osee.ats.impl.test/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessorTest.java
+++ b/plugins/org.eclipse.osee.ats.impl.test/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessorTest.java
@@ -35,6 +35,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.junit.Assert;
import org.junit.Before;
@@ -53,6 +54,7 @@ public class WorkItemNotificationProcessorTest {
@Mock IAtsTeamWorkflow teamWf;
@Mock IAtsPeerToPeerReview peerReview;
@Mock IAtsStateManager stateMgr;
+ @Mock Log logger;
@Mock IAtsServer atsServer;
@Mock OrcsApi orcsApi;
@Mock IAtsWorkItemFactory workItemFactory;
@@ -103,7 +105,7 @@ public class WorkItemNotificationProcessorTest {
public void testNotifyOriginator() throws OseeCoreException {
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
AtsWorkItemNotificationEvent event = new AtsWorkItemNotificationEvent();
event.setFromUserId(joeSmith_CurrentUser.getUserId());
@@ -132,7 +134,7 @@ public class WorkItemNotificationProcessorTest {
public void testNotifyAssignee() throws OseeCoreException {
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
AtsWorkItemNotificationEvent event = new AtsWorkItemNotificationEvent();
event.setFromUserId(joeSmith_CurrentUser.getUserId());
@@ -192,7 +194,7 @@ public class WorkItemNotificationProcessorTest {
event.getAtsIds().add(teamWf.getAtsId());
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
processor.run(notifications, event);
@@ -222,7 +224,7 @@ public class WorkItemNotificationProcessorTest {
when(stateMgr.getCurrentStateName()).thenReturn("Completed");
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
processor.run(notifications, event);
@@ -259,7 +261,7 @@ public class WorkItemNotificationProcessorTest {
when(stateMgr.getCurrentStateName()).thenReturn("Cancelled");
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
processor.run(notifications, event);
@@ -294,7 +296,7 @@ public class WorkItemNotificationProcessorTest {
when(stateMgr.getCurrentStateName()).thenReturn(StateType.Working.name());
WorkItemNotificationProcessor processor =
- new WorkItemNotificationProcessor(atsServer, workItemFactory, userService, attrResolver);
+ new WorkItemNotificationProcessor(logger, atsServer, workItemFactory, userService, attrResolver);
AtsNotificationCollector notifications = new AtsNotificationCollector();
processor.run(notifications, event);
diff --git a/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
index 5593c68e27..b04d7e3b67 100644
--- a/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
@@ -4,10 +4,9 @@ Bundle-Name: ATS Implementation (Incubation)
Bundle-SymbolicName: org.eclipse.osee.ats.impl;singleton:=true
Bundle-Version: 0.20.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: com.google.inject,
- javax.ws.rs;version="2.0.0",
+Import-Package: javax.ws.rs;version="2.0.0",
javax.ws.rs.core;version="2.0.0",
- javax.ws.rs.ext;version="2.0.0",
+ org.eclipse.core.runtime,
org.eclipse.osee.ats.api,
org.eclipse.osee.ats.api.ai,
org.eclipse.osee.ats.api.commit,
@@ -32,7 +31,6 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.core.util,
org.eclipse.osee.ats.core.workdef,
org.eclipse.osee.ats.core.workflow.state,
- org.eclipse.osee.ats.core.workflow.transition,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.model,
@@ -41,18 +39,15 @@ Import-Package: com.google.inject,
org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
- org.eclipse.osee.framework.logging,
org.eclipse.osee.jaxrs.mvc,
org.eclipse.osee.logger,
org.eclipse.osee.mail.api,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
org.eclipse.osee.orcs.search,
- org.eclipse.osee.orcs.transaction,
- org.eclipse.osee.template.engine
+ org.eclipse.osee.orcs.transaction
Service-Component: OSGI-INF/*.xml
Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.runtime
Export-Package: org.eclipse.osee.ats.impl,
org.eclipse.osee.ats.impl.config
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.attribute.resolver.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.attribute.resolver.xml
index 82c674bda7..f255056c8b 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.attribute.resolver.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.attribute.resolver.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.ats.impl.internal.util.AtsAttributeResolverServiceImpl"/>
<service>
<provide interface="org.eclipse.osee.ats.api.workdef.IAttributeResolver"/>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.database.convert.service.ref.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.database.convert.service.ref.xml
deleted file mode 100644
index a5d89b8156..0000000000
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.database.convert.service.ref.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.impl.internal.convert.AtsDatabaseConversions">
- <implementation class="org.eclipse.osee.ats.impl.internal.convert.AtsDatabaseConversions"/>
- <reference bind="addDatabaseConversion" cardinality="1..n" interface="org.eclipse.osee.ats.api.util.IAtsDatabaseConversion" name="IAtsDatabaseConversion" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.database.conversion.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.database.conversion.xml
new file mode 100644
index 0000000000..80f913bc13
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.database.conversion.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+ <implementation class="org.eclipse.osee.ats.impl.internal.convert.NoopAtsDatabaseConversion"/>
+ <service>
+ <provide interface="org.eclipse.osee.ats.api.util.IAtsDatabaseConversion"/>
+ </service>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.notifier.service.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.notifier.service.xml
index 18b0ec1ee6..af0eecd932 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.notifier.service.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.no.op.notifier.service.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
- <implementation class="org.eclipse.osee.ats.impl.internal.notify.AtsNoOpNotifierServiceImpl"/>
+ <implementation class="org.eclipse.osee.ats.impl.internal.notify.NoOpAtsNotifierServiceImpl"/>
<service>
<provide interface="org.eclipse.osee.ats.impl.internal.notify.IAtsNotifierServer"/>
</service>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.notification.service.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.notification.service.xml
index 545f8ea2d8..a4af2edd14 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.notification.service.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.notification.service.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
<implementation class="org.eclipse.osee.ats.impl.internal.notify.AtsNotifierServiceImpl"/>
- <reference bind="setMailService" cardinality="1..1" interface="org.eclipse.osee.mail.api.MailService" name="MailService" policy="static"/>
<service>
<provide interface="org.eclipse.osee.ats.impl.internal.notify.IAtsNotifierServer"/>
</service>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setMailService" cardinality="1..1" interface="org.eclipse.osee.mail.api.MailService" name="MailService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.rev.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.rev.xml
deleted file mode 100644
index c8d07c457b..0000000000
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.rev.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.impl.internal.AtsServerService">
- <implementation class="org.eclipse.osee.ats.impl.internal.AtsServerService"/>
- <reference bind="setServerService" cardinality="1..1" interface="org.eclipse.osee.ats.impl.IAtsServer" name="IAtsServer" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.xml
index 43197766e9..101de8c4ab 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.server.service.xml
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.ats.impl.internal.AtsServerImpl"/>
- <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
- <reference bind="setWorkDefService" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService" name="IAtsWorkDefinitionService" policy="static"/>
<service>
<provide interface="org.eclipse.osee.ats.impl.IAtsServer"/>
</service>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
<reference bind="addNotifier" cardinality="1..n" interface="org.eclipse.osee.ats.impl.internal.notify.IAtsNotifierServer" name="IAtsNotifierServer" policy="dynamic" unbind="removeNotifier"/>
+ <reference bind="addAtsDatabaseConversion" cardinality="1..n" interface="org.eclipse.osee.ats.api.util.IAtsDatabaseConversion" name="IAtsDatabaseConversion" policy="dynamic" unbind="removeAtsDatabaseConversion"/>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+ <reference bind="setWorkDefService" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService" name="IAtsWorkDefinitionService" policy="static"/>
+ <reference bind="setAtsUserService" cardinality="1..1" interface="org.eclipse.osee.ats.api.user.IAtsUserService" name="IAtsUserService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.user.service.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.user.service.xml
index dba950e272..eab6eb1e4e 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.user.service.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.user.service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ats.impl.internal.user.AtsUserServiceImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.ats.impl.internal.user.AtsUserServiceImpl"/>
<service>
<provide interface="org.eclipse.osee.ats.api.user.IAtsUserService"/>
diff --git a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.workdef.store.service.xml b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.workdef.store.service.xml
index 82d023919d..044375303c 100644
--- a/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.workdef.store.service.xml
+++ b/plugins/org.eclipse.osee.ats.impl/OSGI-INF/ats.workdef.store.service.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.impl.internal.workdef.AtsWorkDefinitionStoreImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation class="org.eclipse.osee.ats.impl.internal.workdef.AtsWorkDefinitionStoreImpl"/>
<service>
<provide interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionStore"/>
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/IAtsServer.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/IAtsServer.java
index b9ce6e34d4..5d516c0524 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/IAtsServer.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/IAtsServer.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
import org.eclipse.osee.ats.api.util.IAtsDatabaseConversion;
import org.eclipse.osee.ats.api.util.IAtsStoreFactory;
import org.eclipse.osee.ats.api.util.IAtsUtilService;
+import org.eclipse.osee.ats.api.util.ISequenceProvider;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionServiceProvider;
import org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider;
@@ -31,7 +32,6 @@ import org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
import org.eclipse.osee.ats.core.config.IAtsConfigProvider;
-import org.eclipse.osee.ats.core.util.AtsSequenceProvider;
import org.eclipse.osee.ats.core.util.IAtsActionFactory;
import org.eclipse.osee.ats.impl.internal.workitem.IArtifactProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -64,11 +64,11 @@ public interface IAtsServer extends IAtsServices, IAtsNotifier, IAtsConfigItemFa
IAtsLogFactory getLogFactory();
- List<IAtsDatabaseConversion> getDatabaseConversions();
+ Iterable<IAtsDatabaseConversion> getDatabaseConversions();
IAtsUtilService getUtilService();
- AtsSequenceProvider getSequenceProvider();
+ ISequenceProvider getSequenceProvider();
IAtsActionFactory getActionFactory();
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
index 4eb51af268..85485705dd 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
@@ -13,8 +13,9 @@ package org.eclipse.osee.ats.impl.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.IAtsWorkItem;
@@ -32,6 +33,7 @@ import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsDatabaseConversion;
import org.eclipse.osee.ats.api.util.IAtsStoreFactory;
import org.eclipse.osee.ats.api.util.IAtsUtilService;
+import org.eclipse.osee.ats.api.util.ISequenceProvider;
import org.eclipse.osee.ats.api.version.IAtsVersionService;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
@@ -46,17 +48,16 @@ import org.eclipse.osee.ats.core.ai.ActionableItemManager;
import org.eclipse.osee.ats.core.config.IAtsConfig;
import org.eclipse.osee.ats.core.util.ActionFactory;
import org.eclipse.osee.ats.core.util.AtsCoreFactory;
-import org.eclipse.osee.ats.core.util.AtsSequenceProvider;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.core.util.IAtsActionFactory;
import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionAdminImpl;
import org.eclipse.osee.ats.impl.IAtsServer;
-import org.eclipse.osee.ats.impl.internal.convert.AtsDatabaseConversions;
+import org.eclipse.osee.ats.impl.internal.convert.ConvertBaselineGuidToBaselineUuid;
+import org.eclipse.osee.ats.impl.internal.convert.ConvertFavoriteBranchGuidToUuid;
import org.eclipse.osee.ats.impl.internal.notify.AtsNotificationEventProcessor;
import org.eclipse.osee.ats.impl.internal.notify.AtsNotifierServiceImpl;
import org.eclipse.osee.ats.impl.internal.notify.IAtsNotifierServer;
import org.eclipse.osee.ats.impl.internal.notify.WorkItemNotificationProcessor;
-import org.eclipse.osee.ats.impl.internal.user.AtsUserServiceImpl;
import org.eclipse.osee.ats.impl.internal.util.AtsArtifactConfigCache;
import org.eclipse.osee.ats.impl.internal.util.AtsAttributeResolverServiceImpl;
import org.eclipse.osee.ats.impl.internal.util.AtsBranchServiceImpl;
@@ -79,7 +80,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -111,7 +111,7 @@ public class AtsServerImpl implements IAtsServer {
private IAtsStateFactory atsStateFactory;
private IAtsStoreFactory atsStoreFactory;
private IAtsUtilService utilService;
- private AtsSequenceProvider sequenceProvider;
+ private ISequenceProvider sequenceProvider;
private IAtsActionFactory actionFactory;
private ActionableItemManager actionableItemManager;
private IOseeDatabaseService dbService;
@@ -124,6 +124,9 @@ public class AtsServerImpl implements IAtsServer {
private IAtsTeamDefinitionService atsTeamDefinitionService;
private boolean emailEnabled = true;
+ private final Map<String, IAtsDatabaseConversion> externalConversions =
+ new ConcurrentHashMap<String, IAtsDatabaseConversion>();
+
public void setLogger(Log logger) {
this.logger = logger;
}
@@ -145,6 +148,18 @@ public class AtsServerImpl implements IAtsServer {
this.workDefService = workDefService;
}
+ public void setAtsUserService(IAtsUserService userService) {
+ this.userService = userService;
+ }
+
+ public void addAtsDatabaseConversion(IAtsDatabaseConversion conversion) {
+ externalConversions.put(conversion.getName(), conversion);
+ }
+
+ public void removeAtsDatabaseConversion(IAtsDatabaseConversion conversion) {
+ externalConversions.remove(conversion.getName());
+ }
+
public void addNotifier(IAtsNotifierServer notifier) {
notifiers.add(notifier);
}
@@ -154,7 +169,6 @@ public class AtsServerImpl implements IAtsServer {
}
public void start() throws OseeCoreException {
-
notifyService = new AtsNotifierServiceImpl();
workItemFactory = new WorkItemFactory(logger, this);
configItemFactory = new ConfigItemFactory(logger, this);
@@ -172,14 +186,20 @@ public class AtsServerImpl implements IAtsServer {
new AtsWorkDefinitionAdminImpl(workDefCacheProvider, workItemService, workDefService, teamWorkflowProvider,
attributeResolverService);
- userService = new AtsUserServiceImpl();
-
atsLogFactory = AtsCoreFactory.newLogFactory();
atsStateFactory = AtsCoreFactory.newStateFactory(getServices(), atsLogFactory);
- atsStoreFactory = new AtsStoreFactoryImpl(orcsApi, atsStateFactory, atsLogFactory, this);
+ atsStoreFactory =
+ new AtsStoreFactoryImpl(attributeResolverService, orcsApi, atsStateFactory, atsLogFactory, this);
utilService = AtsCoreFactory.getUtilService(attributeResolverService);
- sequenceProvider = new AtsSequenceProvider(dbService);
+ sequenceProvider = new ISequenceProvider() {
+
+ @Override
+ public long getNext(String sequenceName) {
+ return dbService.getSequence().getNextSequence(sequenceName);
+ }
+
+ };
config = new AtsArtifactConfigCache(configItemFactory, orcsApi);
actionableItemManager = new ActionableItemManager(config, attributeResolverService);
actionFactory =
@@ -188,10 +208,17 @@ public class AtsServerImpl implements IAtsServer {
atsProgramService = new AtsProgramService(this);
atsTeamDefinitionService = new AtsTeamDefinitionService(this);
+ addAtsDatabaseConversion(new ConvertBaselineGuidToBaselineUuid(logger, dbService, orcsApi, this));
+ addAtsDatabaseConversion(new ConvertFavoriteBranchGuidToUuid(logger, dbService, orcsApi, this));
+
System.out.println("ATS - AtsServerImpl started");
started = true;
}
+ public void stop() {
+ //
+ }
+
private static void checkStarted() throws OseeStateException {
if (started == null) {
throw new OseeStateException("AtsServer did not start");
@@ -293,12 +320,8 @@ public class AtsServerImpl implements IAtsServer {
}
@Override
- public List<IAtsDatabaseConversion> getDatabaseConversions() {
- return AtsDatabaseConversions.getConversions(getOrcsApi(), getDatabaseService());
- }
-
- private IOseeDatabaseService getDatabaseService() {
- return dbService;
+ public Iterable<IAtsDatabaseConversion> getDatabaseConversions() {
+ return externalConversions.values();
}
@Override
@@ -307,7 +330,7 @@ public class AtsServerImpl implements IAtsServer {
}
@Override
- public AtsSequenceProvider getSequenceProvider() {
+ public ISequenceProvider getSequenceProvider() {
return sequenceProvider;
}
@@ -381,7 +404,7 @@ public class AtsServerImpl implements IAtsServer {
@Override
public boolean isProduction() {
- return getDatabaseService().isProduction();
+ return dbService.isProduction();
}
@Override
@@ -393,10 +416,10 @@ public class AtsServerImpl implements IAtsServer {
public void sendNotifications(AtsNotificationCollector notifications) {
if (isEmailEnabled()) {
if (notifiers.isEmpty() || !isProduction()) {
- OseeLog.log(AtsServerImpl.class, Level.INFO, "Osee Notification Disabled");
+ logger.info("Osee Notification Disabled");
} else {
workItemNotificationProcessor =
- new WorkItemNotificationProcessor(this, workItemFactory, userService, attributeResolverService);
+ new WorkItemNotificationProcessor(logger, this, workItemFactory, userService, attributeResolverService);
notificationEventProcessor =
new AtsNotificationEventProcessor(workItemNotificationProcessor, userService,
getConfigValue("NoReplyEmail"));
@@ -477,6 +500,7 @@ public class AtsServerImpl implements IAtsServer {
public void setEmailEnabled(boolean emailEnabled) {
this.emailEnabled = emailEnabled;
}
+
@Override
public IAtsProgramService getProgramService() {
return atsProgramService;
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerService.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerService.java
deleted file mode 100644
index 1edb8c2ac2..0000000000
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ats.impl.internal;
-
-import org.eclipse.osee.ats.impl.IAtsServer;
-
-/**
- * @author Donald G. Dunne
- */
-public class AtsServerService {
-
- private static IAtsServer dbService;
-
- public static IAtsServer get() {
- return dbService;
- }
-
- public void setServerService(IAtsServer dbService) {
- AtsServerService.dbService = dbService;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AbstractConvertGuidToUuid.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AbstractConvertGuidToUuid.java
index b4b87d1d09..71f94c7215 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AbstractConvertGuidToUuid.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AbstractConvertGuidToUuid.java
@@ -12,11 +12,12 @@ package org.eclipse.osee.ats.impl.internal.convert;
import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
import org.eclipse.osee.ats.api.util.IAtsDatabaseConversion;
-import org.eclipse.osee.ats.impl.internal.AtsServerService;
+import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.BranchReadable;
import org.eclipse.osee.orcs.transaction.TransactionBuilder;
@@ -27,12 +28,31 @@ import org.eclipse.osee.orcs.transaction.TransactionFactory;
*/
public abstract class AbstractConvertGuidToUuid implements IAtsDatabaseConversion {
+ private static final String SELECT_BRANCH_ID_BY_GUID = "select branch_id from osee_branch where branch_guid = ?";
+
+ private final Log logger;
private final IOseeDatabaseService dbService;
private final OrcsApi orcsApi;
+ private final IAtsServer atsServer;
- public AbstractConvertGuidToUuid(IOseeDatabaseService dbService, OrcsApi orcsApi) {
+ public AbstractConvertGuidToUuid(Log logger, IOseeDatabaseService dbService, OrcsApi orcsApi, IAtsServer atsServer) {
+ super();
+ this.logger = logger;
this.dbService = dbService;
this.orcsApi = orcsApi;
+ this.atsServer = atsServer;
+ }
+
+ protected OrcsApi getOrcsApi() {
+ return orcsApi;
+ }
+
+ protected Log getLogger() {
+ return logger;
+ }
+
+ protected IOseeDatabaseService getDatabaseService() {
+ return dbService;
}
protected BranchReadable getBranch(String guid) throws OseeCoreException {
@@ -42,23 +62,17 @@ public abstract class AbstractConvertGuidToUuid implements IAtsDatabaseConversio
protected TransactionBuilder createTransactionBuilder() throws OseeCoreException {
TransactionFactory txFactory = getOrcsApi().getTransactionFactory(null);
Conditions.checkNotNull(txFactory, "transaction factory");
- return txFactory.createTransaction(COMMON,
- AtsServerService.get().getArtifactByGuid(SystemUser.OseeSystem.getGuid()), getName());
+ return txFactory.createTransaction(COMMON, atsServer.getArtifactByGuid(SystemUser.OseeSystem.getGuid()),
+ getName());
}
- private final String SELECT_BRANCH_ID_BY_GUID = "select branch_id from osee_branch where branch_guid = ?";
-
/**
* Temporary method till all code uses branch uuid. Remove after 0.17.0
*/
private long getBranchIdLegacy(String branchGuid) {
- Long longId = dbService.runPreparedQueryFetchObject(0L, SELECT_BRANCH_ID_BY_GUID, branchGuid);
+ Long longId = getDatabaseService().runPreparedQueryFetchObject(0L, SELECT_BRANCH_ID_BY_GUID, branchGuid);
Conditions.checkExpressionFailOnTrue(longId <= 0, "Error getting branch_id for branch: [%s]", branchGuid);
return longId;
}
- public OrcsApi getOrcsApi() {
- return orcsApi;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AtsDatabaseConversions.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AtsDatabaseConversions.java
deleted file mode 100644
index 9c3bb63222..0000000000
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/AtsDatabaseConversions.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ats.impl.internal.convert;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.osee.ats.api.util.IAtsDatabaseConversion;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.orcs.OrcsApi;
-
-/**
- * Return available database conversions
- *
- * @author Donald G Dunne
- */
-public class AtsDatabaseConversions {
-
- private static List<IAtsDatabaseConversion> externalConversions = new ArrayList<IAtsDatabaseConversion>();
-
- public static List<IAtsDatabaseConversion> getConversions(OrcsApi orcsApi, IOseeDatabaseService dbService) {
- List<IAtsDatabaseConversion> conversions = new ArrayList<IAtsDatabaseConversion>();
- conversions.add(new ConvertBaselineGuidToBaselineUuid(dbService, orcsApi));
- conversions.add(new ConvertFavoriteBranchGuidToUuid(dbService, orcsApi));
- conversions.addAll(externalConversions);
- return conversions;
- }
-
- public void addDatabaseConversion(IAtsDatabaseConversion conversion) {
- externalConversions.add(conversion);
- }
-}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertBaselineGuidToBaselineUuid.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertBaselineGuidToBaselineUuid.java
index 19423916e3..20f0480e58 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertBaselineGuidToBaselineUuid.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertBaselineGuidToBaselineUuid.java
@@ -14,11 +14,13 @@ import java.util.List;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
+import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.BranchReadable;
@@ -32,11 +34,11 @@ import org.eclipse.osee.orcs.transaction.TransactionBuilder;
public class ConvertBaselineGuidToBaselineUuid extends AbstractConvertGuidToUuid {
// Leave this attribute definition and conversion for other OSEE sites to convert
- public static final IAttributeType BaselineBranchGuid = TokenFactory.createAttributeType(0x10000000000000A9L,
+ private static final IAttributeType BaselineBranchGuid = TokenFactory.createAttributeType(0x10000000000000A9L,
"ats.Baseline Branch Guid");
- public ConvertBaselineGuidToBaselineUuid(IOseeDatabaseService dbService, OrcsApi orcsApi) {
- super(dbService, orcsApi);
+ public ConvertBaselineGuidToBaselineUuid(Log logger, IOseeDatabaseService dbService, OrcsApi orcsApi, IAtsServer atsServer) {
+ super(logger, dbService, orcsApi, atsServer);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertFavoriteBranchGuidToUuid.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertFavoriteBranchGuidToUuid.java
index 7feee3c1ce..435c14ace7 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertFavoriteBranchGuidToUuid.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/ConvertFavoriteBranchGuidToUuid.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.ats.impl.internal.convert;
-import java.util.logging.Level;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
+import org.eclipse.osee.ats.impl.IAtsServer;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.util.XResultData;
@@ -19,7 +19,7 @@ import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.AttributeReadable;
@@ -34,8 +34,8 @@ public class ConvertFavoriteBranchGuidToUuid extends AbstractConvertGuidToUuid {
private int numChanges = 0;
- public ConvertFavoriteBranchGuidToUuid(IOseeDatabaseService dbService, OrcsApi orcsApi) {
- super(dbService, orcsApi);
+ public ConvertFavoriteBranchGuidToUuid(Log logger, IOseeDatabaseService dbService, OrcsApi orcsApi, IAtsServer atsServer) {
+ super(logger, dbService, orcsApi, atsServer);
}
@Override
@@ -74,8 +74,7 @@ public class ConvertFavoriteBranchGuidToUuid extends AbstractConvertGuidToUuid {
}
numChanges = 0;
} catch (OseeCoreException ex) {
- OseeLog.log(this.getClass(), Level.SEVERE, "Exception occurred while trying to convert branch guid to uuid",
- ex);
+ getLogger().error(ex, "Exception occurred while trying to convert branch guid to uuid");
}
}
@@ -97,7 +96,7 @@ public class ConvertFavoriteBranchGuidToUuid extends AbstractConvertGuidToUuid {
try {
branch = getBranch(value);
} catch (OseeCoreException ex) {
- OseeLog.log(this.getClass(), Level.WARNING, "No Branch found with value: " + value);
+ getLogger().warn(ex, "No Branch found with value: [%s]", value);
}
if (branch != null) {
addUuid(data, reportOnly, tx, art, attr, branch);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsSequenceProvider.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/NoopAtsDatabaseConversion.java
index 3d05daf75b..f7a6f5a1a3 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsSequenceProvider.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/convert/NoopAtsDatabaseConversion.java
@@ -8,24 +8,29 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.util;
+package org.eclipse.osee.ats.impl.internal.convert;
-import org.eclipse.osee.ats.api.util.ISequenceProvider;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.ats.api.util.IAtsDatabaseConversion;
+import org.eclipse.osee.framework.core.util.XResultData;
/**
- * @author Donald G. Dunne
+ * @author Roberto E. Escobar
*/
-public class AtsSequenceProvider implements ISequenceProvider {
+public class NoopAtsDatabaseConversion implements IAtsDatabaseConversion {
- private final IOseeDatabaseService databaseService;
+ @Override
+ public String getName() {
+ return "NoopAtsDatabaseConversion";
+ }
- public AtsSequenceProvider(IOseeDatabaseService databaseService) {
- this.databaseService = databaseService;
+ @Override
+ public void run(XResultData data, boolean reportOnly) {
+ //
}
@Override
- public long getNext(String name) {
- return databaseService.getSequence().getNextSequence(name);
+ public String getDescription() {
+ return "NoopAtsDatabaseConversion";
}
+
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNotifierServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNotifierServiceImpl.java
index 549c0cd2b1..097b465514 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNotifierServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNotifierServiceImpl.java
@@ -12,7 +12,8 @@ package org.eclipse.osee.ats.impl.internal.notify;
import java.util.Collection;
import org.eclipse.osee.ats.api.notify.AtsNotificationEvent;
-import org.eclipse.osee.ats.impl.internal.AtsServerService;
+import org.eclipse.osee.ats.impl.IAtsServer;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.mail.api.MailService;
/**
@@ -20,7 +21,13 @@ import org.eclipse.osee.mail.api.MailService;
*/
public class AtsNotifierServiceImpl implements IAtsNotifierServer {
+ private Log logger;
private MailService mailService;
+ private IAtsServer atsServer;
+
+ public void setLogger(Log logger) {
+ this.logger = logger;
+ }
public void setMailService(MailService mailService) {
this.mailService = mailService;
@@ -32,8 +39,8 @@ public class AtsNotifierServiceImpl implements IAtsNotifierServer {
@Override
public void sendNotifications(String fromUserEmail, String testingUserEmail, String subject, String body, Collection<? extends AtsNotificationEvent> notificationEvents) {
SendNotificationEvents job =
- new SendNotificationEvents(mailService, fromUserEmail, testingUserEmail, subject, body, notificationEvents,
- AtsServerService.get().getUserService());
+ new SendNotificationEvents(logger, mailService, fromUserEmail, testingUserEmail, subject, body,
+ notificationEvents, atsServer.getUserService());
job.run();
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNoOpNotifierServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/NoOpAtsNotifierServiceImpl.java
index f4868479f8..8be1b4e26f 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/AtsNoOpNotifierServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/NoOpAtsNotifierServiceImpl.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.ats.api.notify.AtsNotificationEvent;
/**
* @author Donald G. Dunne
*/
-public class AtsNoOpNotifierServiceImpl implements IAtsNotifierServer {
+public class NoOpAtsNotifierServiceImpl implements IAtsNotifierServer {
@Override
public void sendNotifications(String fromUserEmail, String testingUserEmail, String subject, String body, Collection<? extends AtsNotificationEvent> notificationEvents) {
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/SendNotificationEvents.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/SendNotificationEvents.java
index 3cb02eb379..8345decb20 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/SendNotificationEvents.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/SendNotificationEvents.java
@@ -16,7 +16,6 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.logging.Level;
import org.eclipse.osee.ats.api.notify.AtsNotificationEvent;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.user.IAtsUserService;
@@ -27,8 +26,7 @@ import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.logger.Log;
import org.eclipse.osee.mail.api.MailMessage;
import org.eclipse.osee.mail.api.MailService;
import org.eclipse.osee.mail.api.MailStatus;
@@ -37,6 +35,7 @@ import org.eclipse.osee.mail.api.MailStatus;
* @author Donald G. Dunne
*/
public class SendNotificationEvents {
+ private final Log logger;
private final Collection<? extends AtsNotificationEvent> notificationEvents;
private final String subject;
private final String body;
@@ -45,7 +44,8 @@ public class SendNotificationEvents {
private final String testingUserEmail;
private final IAtsUserService userService;
- protected SendNotificationEvents(MailService mailService, String fromUserEmail, String testingUserEmail, String subject, String body, Collection<? extends AtsNotificationEvent> notificationEvents, IAtsUserService userService) {
+ protected SendNotificationEvents(Log logger, MailService mailService, String fromUserEmail, String testingUserEmail, String subject, String body, Collection<? extends AtsNotificationEvent> notificationEvents, IAtsUserService userService) {
+ this.logger = logger;
this.mailService = mailService;
this.fromUserEmail = fromUserEmail;
this.testingUserEmail = testingUserEmail;
@@ -54,8 +54,7 @@ public class SendNotificationEvents {
this.notificationEvents = notificationEvents;
this.userService = userService;
if (isTesting()) {
- OseeLog.log(SendNotificationEvents.class, Level.SEVERE,
- "OseeNotifyUsersJob: testing is enabled....turn off for production.");
+ logger.error("OseeNotifyUsersJob: testing is enabled....turn off for production.");
}
}
@@ -81,7 +80,7 @@ public class SendNotificationEvents {
}
return Result.TrueResult;
} catch (Exception ex) {
- OseeLog.log(SendNotificationEvents.class, OseeLevel.SEVERE_POPUP, ex);
+ logger.error(ex, "Error notifying users");
return new Result("Error notifying users [%s]", ex.getMessage());
}
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessor.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessor.java
index 02ca50ba30..b5b41aaa1c 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessor.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/notify/WorkItemNotificationProcessor.java
@@ -15,7 +15,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
-import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
@@ -40,20 +39,22 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.jdk.core.util.EmailUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.logger.Log;
/**
* @author Donald G. Dunne
*/
public class WorkItemNotificationProcessor {
+ private final Log logger;
private final IAtsUserService userService;
private final IAttributeResolver attrResolver;
private final IAtsWorkItemFactory workItemFactory;
private final IAtsServer atsServer;
private static String actionUrl;
- public WorkItemNotificationProcessor(IAtsServer atsServer, IAtsWorkItemFactory workItemFactory, IAtsUserService userService, IAttributeResolver attrResolver) throws OseeCoreException {
+ public WorkItemNotificationProcessor(Log logger, IAtsServer atsServer, IAtsWorkItemFactory workItemFactory, IAtsUserService userService, IAttributeResolver attrResolver) throws OseeCoreException {
+ this.logger = logger;
this.atsServer = atsServer;
this.workItemFactory = workItemFactory;
this.userService = userService;
@@ -81,8 +82,7 @@ public class WorkItemNotificationProcessor {
IAtsUser originator = workItem.getCreatedBy();
if (originator.isActive()) {
if (!EmailUtil.isEmailValid(originator.getEmail()) && !AtsCoreUsers.isAtsCoreUser(originator)) {
- OseeLog.logf(WorkItemNotificationProcessor.class, Level.INFO, "Email [%s] invalid for user [%s]",
- originator.getEmail(), originator.getName());
+ logger.info("Email [%s] invalid for user [%s]", originator.getEmail(), originator.getName());
} else if (!fromUser.equals(originator)) {
notifications.addNotificationEvent(AtsNotificationEventFactory.getNotificationEvent(
getFromUser(event),
@@ -96,8 +96,7 @@ public class WorkItemNotificationProcessor {
}
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
- "Error processing Originator for workItem [%s] and event [%s]", workItem.toStringWithId(),
+ logger.error(ex, "Error processing Originator for workItem [%s] and event [%s]", workItem.toStringWithId(),
event.toString());
}
}
@@ -124,8 +123,7 @@ public class WorkItemNotificationProcessor {
workItem.getName())));
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
- "Error processing Assigned for workItem [%s] and event [%s]", workItem.toStringWithId(),
+ logger.error(ex, "Error processing Assigned for workItem [%s] and event [%s]", workItem.toStringWithId(),
event.toString());
}
}
@@ -144,7 +142,7 @@ public class WorkItemNotificationProcessor {
workItem.getStateMgr().getCurrentStateName())));
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
+ logger.error(ex,
"Error processing Subscribed for workItem [%s] and event [%s]", workItem.toStringWithId(),
event.toString());
}
@@ -154,8 +152,7 @@ public class WorkItemNotificationProcessor {
IAtsUser originator = workItem.getCreatedBy();
if (originator.isActive()) {
if (!EmailUtil.isEmailValid(originator.getEmail())) {
- OseeLog.logf(WorkItemNotificationProcessor.class, Level.INFO, "Email [%s] invalid for user [%s]",
- originator.getEmail(), originator.getName());
+ logger.info("Email [%s] invalid for user [%s]", originator.getEmail(), originator.getName());
} else if (isOriginatorDifferentThanCancelledOrCompletedBy(workItem, fromUser, originator)) {
if (workItem.getStateDefinition().getStateType().isCompleted()) {
notifications.addNotificationEvent(AtsNotificationEventFactory.getNotificationEvent(
@@ -176,7 +173,7 @@ public class WorkItemNotificationProcessor {
}
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
+ logger.error(ex,
"Error processing Completed or Cancelled for workItem [%s] and event [%s]",
workItem.toStringWithId(), event.toString());
}
@@ -200,7 +197,7 @@ public class WorkItemNotificationProcessor {
workItem.getArtifactTypeName(), workItem.getName())));
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
+ logger.error(ex,
"Error processing Peer_Reviewers_Completed for workItem [%s] and event [%s]",
workItem.toStringWithId(), event.toString());
}
@@ -237,8 +234,7 @@ public class WorkItemNotificationProcessor {
}
}
} catch (OseeCoreException ex) {
- OseeLog.logf(AtsNotifierServiceImpl.class, Level.SEVERE, ex,
- "Error processing SubscribedTeamOrAi for workItem [%s] and event [%s]", workItem.toStringWithId(),
+ logger.error(ex, "Error processing SubscribedTeamOrAi for workItem [%s] and event [%s]", workItem.toStringWithId(),
event.toString());
}
}
@@ -280,7 +276,7 @@ public class WorkItemNotificationProcessor {
return "ID: " + workItem.getAtsId() + " / LegacyId: " + legacyPcrId;
}
} catch (Exception ex) {
- OseeLog.log(WorkItemNotificationProcessor.class, Level.SEVERE, ex);
+ logger.error(ex, "Error getting legacyId pcr for workItem [%s]", workItem);
}
return "ID: " + workItem.getAtsId();
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUserServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUserServiceImpl.java
index 45fab94ca7..153f9f0c5b 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUserServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUserServiceImpl.java
@@ -39,10 +39,10 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
*/
public class AtsUserServiceImpl extends AbstractAtsUserService {
- private static OrcsApi orcsApi;
+ private OrcsApi orcsApi;
- public static void setOrcsApi(OrcsApi orcsApi) {
- AtsUserServiceImpl.orcsApi = orcsApi;
+ public void setOrcsApi(OrcsApi orcsApi) {
+ this.orcsApi = orcsApi;
}
public void start() throws OseeCoreException {
@@ -50,6 +50,10 @@ public class AtsUserServiceImpl extends AbstractAtsUserService {
System.out.println("ATS - AtsUserService started");
}
+ public void stop() {
+ //
+ }
+
@Override
public String getCurrentUserId() throws OseeCoreException {
if (currentUserId == null) {
@@ -113,12 +117,6 @@ public class AtsUserServiceImpl extends AbstractAtsUserService {
return orcsApi.getQueryFactory(null).fromBranch(AtsUtilCore.getAtsBranch()).andGuid(user.getGuid()).getResults().getExactlyOne();
}
- public static ArtifactReadable getCurrentUserArt() throws OseeCoreException {
- // TODO Switch to real user
- return orcsApi.getQueryFactory(null).fromBranch(AtsUtilCore.getAtsBranch()).andIsOfType(CoreArtifactTypes.User).and(
- CoreAttributeTypes.UserId, SystemUser.OseeSystem.getUserId()).getResults().getExactlyOne();
- }
-
@Override
public List<IAtsUser> getUsers(Active active) {
ensureLoaded();
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsAttributeResolverServiceImpl.java
index 0ad3de8e9b..264d4f887c 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsAttributeResolverServiceImpl.java
@@ -53,6 +53,10 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
System.out.println("ATS - AtsAttributeResolverServiceImpl started");
}
+ public void stop() {
+ //
+ }
+
@Override
public boolean isAttributeNamed(String attributeName) {
return getAttributeType(attributeName) != null;
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsChangeSet.java
index 96e8334ba1..86a26daca9 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsChangeSet.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.notify.IAtsNotifier;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IExecuteListener;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
@@ -22,7 +23,6 @@ import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.core.util.AbstractAtsChangeSet;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.core.util.AttributeIdWrapper;
-import org.eclipse.osee.ats.impl.internal.AtsServerService;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
@@ -40,13 +40,16 @@ import org.eclipse.osee.orcs.transaction.TransactionBuilder;
public class AtsChangeSet extends AbstractAtsChangeSet {
private TransactionBuilder transaction;
+
+ private final IAttributeResolver attributeResolver;
private final OrcsApi orcsApi;
private final IAtsStateFactory stateFactory;
private final IAtsLogFactory logFactory;
private final IAtsNotifier notifier;
- public AtsChangeSet(OrcsApi orcsApi, IAtsStateFactory stateFactory, IAtsLogFactory logFactory, String comment, IAtsUser user, IAtsNotifier notifier) {
+ public AtsChangeSet(IAttributeResolver attributeResolver, OrcsApi orcsApi, IAtsStateFactory stateFactory, IAtsLogFactory logFactory, String comment, IAtsUser user, IAtsNotifier notifier) {
super(comment, user);
+ this.attributeResolver = attributeResolver;
this.orcsApi = orcsApi;
this.stateFactory = stateFactory;
this.logFactory = logFactory;
@@ -82,7 +85,7 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
stateFactory.writeToStore(user, workItem, this);
}
if (workItem.getLog().isDirty()) {
- logFactory.writeToStore(workItem, AtsServerService.get().getAttributeResolver(), this);
+ logFactory.writeToStore(workItem, attributeResolver, this);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsStoreFactoryImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsStoreFactoryImpl.java
index 3e890ca088..20464a4d66 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsStoreFactoryImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsStoreFactoryImpl.java
@@ -14,6 +14,7 @@ import org.eclipse.osee.ats.api.notify.IAtsNotifier;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsStoreFactory;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
import org.eclipse.osee.orcs.OrcsApi;
@@ -23,12 +24,14 @@ import org.eclipse.osee.orcs.OrcsApi;
*/
public class AtsStoreFactoryImpl implements IAtsStoreFactory {
+ private final IAttributeResolver attributeResolver;
private final OrcsApi orcsApi;
private final IAtsStateFactory stateFactory;
private final IAtsLogFactory logFactory;
private final IAtsNotifier notifier;
- public AtsStoreFactoryImpl(OrcsApi orcsApi, IAtsStateFactory stateFactory, IAtsLogFactory logFactory, IAtsNotifier notifier) {
+ public AtsStoreFactoryImpl(IAttributeResolver attributeResolver, OrcsApi orcsApi, IAtsStateFactory stateFactory, IAtsLogFactory logFactory, IAtsNotifier notifier) {
+ this.attributeResolver = attributeResolver;
this.logFactory = logFactory;
this.stateFactory = stateFactory;
this.orcsApi = orcsApi;
@@ -37,7 +40,7 @@ public class AtsStoreFactoryImpl implements IAtsStoreFactory {
@Override
public IAtsChangeSet createAtsChangeSet(String comment, IAtsUser user) {
- return new AtsChangeSet(orcsApi, stateFactory, logFactory, comment, user, notifier);
+ return new AtsChangeSet(attributeResolver, orcsApi, stateFactory, logFactory, comment, user, notifier);
}
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/WorkItem.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/WorkItem.java
index 5e584897c9..53dcd74e67 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/WorkItem.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/WorkItem.java
@@ -126,6 +126,7 @@ public class WorkItem extends AtsObject implements IAtsWorkItem {
return stateMgr;
}
+ @Override
public void setStateManager(IAtsStateManager stateMgr) {
this.stateMgr = stateMgr;
}

Back to the top