Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2013-03-22 16:21:46 +0000
committerGerrit Code Review @ Eclipse.org2013-03-27 20:08:57 +0000
commit6779e93d504a8a542b01361de4e7ea19a88337c3 (patch)
tree9153a21d343abe062736a1171ddd34db172cd8d5 /plugins/org.eclipse.osee.ote.client
parentefc2a587ad3585880e35a65b446ecafc122955de (diff)
downloadorg.eclipse.osee-6779e93d504a8a542b01361de4e7ea19a88337c3.tar.gz
org.eclipse.osee-6779e93d504a8a542b01361de4e7ea19a88337c3.tar.xz
org.eclipse.osee-6779e93d504a8a542b01361de4e7ea19a88337c3.zip
feature[ats_5Z6FP]: Add OTE SessionManager
Move the session management out of the TestEnvironment and into it's own service. This also involves removing the UserSessionKey and replacing it with a UUID to identify the client session. Change-Id: I2dc09c96031f3c0670081f4bf158d62912140506
Diffstat (limited to 'plugins/org.eclipse.osee.ote.client')
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ConnectionEvent.java9
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IOteClientService.java4
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java5
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java12
5 files changed, 19 insertions, 15 deletions
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ConnectionEvent.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ConnectionEvent.java
index 30414eb065..f9f2f179e6 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ConnectionEvent.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/ConnectionEvent.java
@@ -10,8 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.ote.service;
+import java.util.UUID;
+
import org.eclipse.osee.connection.service.IServiceConnector;
-import org.eclipse.osee.ote.core.environment.UserTestSessionKey;
import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
@@ -24,11 +25,11 @@ public final class ConnectionEvent {
private final ITestEnvironment environment;
private final IServiceConnector connector;
- private final UserTestSessionKey sessionKey;
+ private final UUID sessionKey;
private final OteServiceProperties props;
private final IHostTestEnvironment hostTestEnvironment;
- public ConnectionEvent(IHostTestEnvironment hostTestEnvironment, IServiceConnector connector, ITestEnvironment environment, UserTestSessionKey sessionKey) {
+ public ConnectionEvent(IHostTestEnvironment hostTestEnvironment, IServiceConnector connector, ITestEnvironment environment, UUID sessionKey) {
if (connector == null) {
throw new NullPointerException("connector cannot be null");
}
@@ -62,7 +63,7 @@ public final class ConnectionEvent {
*
* @return the sessionKey
*/
- public UserTestSessionKey getSessionKey() {
+ public UUID getSessionKey() {
return sessionKey;
}
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IOteClientService.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IOteClientService.java
index a7690f80b3..586d067274 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IOteClientService.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/IOteClientService.java
@@ -12,11 +12,11 @@ package org.eclipse.osee.ote.service;
import java.net.InetAddress;
import java.util.List;
+import java.util.UUID;
import org.eclipse.osee.connection.service.IServiceConnector;
import org.eclipse.osee.ote.core.OSEEPerson1_4;
import org.eclipse.osee.ote.core.environment.TestEnvironmentConfig;
-import org.eclipse.osee.ote.core.environment.UserTestSessionKey;
import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
@@ -104,5 +104,5 @@ public interface IOteClientService {
IServiceConnector getConnector(IHostTestEnvironment host);
- UserTestSessionKey getSessionKey();
+ UUID getSessionKey();
}
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java
index 3aa6eaf61f..cc1d415d46 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/ClientSession.java
@@ -12,9 +12,11 @@ package org.eclipse.osee.ote.service.core;
import java.net.InetAddress;
import java.rmi.RemoteException;
+import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
+
import org.eclipse.osee.connection.service.IServiceConnector;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -167,8 +169,9 @@ public class ClientSession extends AbstractRemoteSession {
if (lock.tryLock(TIMEOUT, TimeUnit.MINUTES)) {
try {
IRemoteUserSession exportedSession = (IRemoteUserSession) connector.export(this);
+ UUID id = UUID.randomUUID();
Thread.currentThread().setContextClassLoader(ExportClassLoader.getInstance());
- ConnectionRequestResult result = testHost.requestEnvironment(exportedSession, config);
+ ConnectionRequestResult result = testHost.requestEnvironment(exportedSession, id, config);
if (result.getStatus().getStatus()) {
return new TestHostConnection(connector, testHost, result.getEnvironment(), result.getSessionKey());
} else {
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java
index df44c70115..7024cf2a6d 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestClientServiceImpl.java
@@ -20,6 +20,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.UUID;
import java.util.logging.Level;
import org.eclipse.osee.connection.service.IConnectionService;
@@ -28,7 +29,6 @@ import org.eclipse.osee.connection.service.IServiceConnector;
import org.eclipse.osee.framework.jdk.core.util.EnhancedProperties;
import org.eclipse.osee.ote.core.OSEEPerson1_4;
import org.eclipse.osee.ote.core.environment.TestEnvironmentConfig;
-import org.eclipse.osee.ote.core.environment.UserTestSessionKey;
import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
import org.eclipse.osee.ote.service.Activator;
@@ -268,7 +268,7 @@ public class TestClientServiceImpl implements IOteClientService, IConnectorListe
}
@Override
- public synchronized UserTestSessionKey getSessionKey() {
+ public synchronized UUID getSessionKey() {
return testConnection != null ? testConnection.getSessionKey() : null;
}
diff --git a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java
index f5948cecb6..6680b6b0f5 100644
--- a/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java
+++ b/plugins/org.eclipse.osee.ote.client/src/org/eclipse/osee/ote/service/core/TestHostConnection.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.ote.service.core;
import java.rmi.RemoteException;
+import java.util.UUID;
import org.eclipse.osee.connection.service.IServiceConnector;
-import org.eclipse.osee.ote.core.environment.UserTestSessionKey;
import org.eclipse.osee.ote.core.environment.interfaces.IHostTestEnvironment;
import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
@@ -27,11 +27,11 @@ class TestHostConnection {
private final IServiceConnector serviceConnector;
private final ITestEnvironment connectEnvironment;
- private final UserTestSessionKey sessionKey;
+ private final UUID sessionKey;
private final IHostTestEnvironment host;
private String serverId;
- TestHostConnection(IServiceConnector connector, IHostTestEnvironment host, ITestEnvironment connectEnvironment, UserTestSessionKey sessionKey) {
+ TestHostConnection(IServiceConnector connector, IHostTestEnvironment host, ITestEnvironment connectEnvironment, UUID uuid) {
// intentionally package-private
if (connector == null) {
throw new NullPointerException("service connector cannot be null");
@@ -39,13 +39,13 @@ class TestHostConnection {
if (connectEnvironment == null) {
throw new NullPointerException("test environment cannot be null");
}
- if (sessionKey == null) {
+ if (uuid == null) {
throw new NullPointerException("session key cannot be null");
}
this.serviceConnector = connector;
this.host = host;
this.connectEnvironment = connectEnvironment;
- this.sessionKey = sessionKey;
+ this.sessionKey = uuid;
try {
this.serverId = (String) host.getProperties().getProperty("id");
} catch (RemoteException e) {
@@ -70,7 +70,7 @@ class TestHostConnection {
/**
* @return the sessionKey
*/
- public UserTestSessionKey getSessionKey() {
+ public UUID getSessionKey() {
return sessionKey;
}

Back to the top