diff options
author | jmisinco | 2013-11-08 18:06:01 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-12-04 16:14:56 +0000 |
commit | 8233349a064dc0ea7a1347b154114728b2d65806 (patch) | |
tree | 0f9449fdfcac994b1a43a568fc67cd0515341e8f /plugins | |
parent | b0350ac9f7bcb8645573caf150c1b573c0c4f844 (diff) | |
download | org.eclipse.osee-8233349a064dc0ea7a1347b154114728b2d65806.tar.gz org.eclipse.osee-8233349a064dc0ea7a1347b154114728b2d65806.tar.xz org.eclipse.osee-8233349a064dc0ea7a1347b154114728b2d65806.zip |
feature[ats_XJMFJ]: Remove update session code
Change-Id: I16249b17b4510f8db424b24ca59669d96b9d7b6e
Diffstat (limited to 'plugins')
18 files changed, 28 insertions, 197 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionFactoryTest.java b/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionFactoryTest.java index 9e44b0eb67a..cb6d849a09d 100644 --- a/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionFactoryTest.java +++ b/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionFactoryTest.java @@ -34,35 +34,29 @@ public class SessionFactoryTest { private final String guid; private final String userId; private final Date creationDate; - private final String managedByServerId; private final String clientVersion; private final String clientMachineName; private final String clientAddress; private final int clientPort; - private final Date lastInteractionDate; - private final String lastInteractionDetails; private final MockBuildTypeIdentifier typeIdentifier = new MockBuildTypeIdentifier(); private final SessionFactory factory = new SessionFactory(new MockLog(), null, null, typeIdentifier); - public SessionFactoryTest(String guid, String userId, Date creationDate, String managedByServerId, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public SessionFactoryTest(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { super(); this.guid = guid; this.userId = userId; this.creationDate = creationDate; - this.managedByServerId = managedByServerId; this.clientVersion = clientVersion; this.clientMachineName = clientMachineName; this.clientAddress = clientAddress; this.clientPort = clientPort; - this.lastInteractionDate = lastInteractionDate; - this.lastInteractionDetails = lastInteractionDetails; } @Test public void testCreate() { Session session = factory.createNewSession(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, - clientPort, lastInteractionDate, lastInteractionDetails); + clientPort); Assert.assertEquals(guid, session.getGuid()); Assert.assertEquals(userId, session.getUserId()); @@ -71,8 +65,6 @@ public class SessionFactoryTest { Assert.assertEquals(clientMachineName, session.getClientMachineName()); Assert.assertEquals(clientAddress, session.getClientAddress()); Assert.assertEquals(clientPort, session.getClientPort()); - Assert.assertEquals(lastInteractionDate, session.getLastInteractionDate()); - Assert.assertEquals(lastInteractionDetails, session.getLastInteractionDetails()); } @Parameters @@ -87,21 +79,10 @@ public class SessionFactoryTest { int clientPort = index * 345; Date creationDate = new Date(); String userId = "hello.userId-" + index; - Date lastInteractionDate = new Date(); - String lastInteraction = "lastInteraction-" + index; - String managedByServerId = "serverId-" + index; - data.add(new Object[] { - guid, - userId, - creationDate, - managedByServerId, - clientVersion, - clientMachine, - clientAddress, - clientPort, - lastInteractionDate, - lastInteraction,}); + data.add(new Object[] {guid, userId, creationDate, clientVersion, clientMachine, clientAddress, clientPort + + }); } return data; } diff --git a/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionTest.java b/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionTest.java index 0c5f5f6bab9..7817b7f1127 100644 --- a/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionTest.java +++ b/plugins/org.eclipse.osee.framework.core.server.test/src/org/eclipse/osee/framework/core/server/test/internal/session/SessionTest.java @@ -37,10 +37,8 @@ public class SessionTest { private final int expectedClientPort; private final Date expectedCreationDate; private final String expectedUserId; - private final Date expectedLastInteractionDate; - private final String expectedLastInteraction; - public SessionTest(Session session, String guid, String expectedClientAddress, String expectedClientMachine, String expectedClientVersion, int expectedClientPort, Date expectedCreationDate, String expectedUserId, Date expectedLastInteractionDate, String expectedLastInteraction) { + public SessionTest(Session session, String guid, String expectedClientAddress, String expectedClientMachine, String expectedClientVersion, int expectedClientPort, Date expectedCreationDate, String expectedUserId) { this.session = session; this.expectedGuid = guid; this.expectedClientAddress = expectedClientAddress; @@ -49,8 +47,6 @@ public class SessionTest { this.expectedClientPort = expectedClientPort; this.expectedCreationDate = expectedCreationDate; this.expectedUserId = expectedUserId; - this.expectedLastInteractionDate = expectedLastInteractionDate; - this.expectedLastInteraction = expectedLastInteraction; } @Test @@ -103,26 +99,6 @@ public class SessionTest { Assert.assertEquals(newValue, session.getClientPort()); } - @Test - public void testSetGetLastInteractionDate() throws Exception { - Date newValue = new Date(); - - Assert.assertEquals(expectedLastInteractionDate, session.getLastInteractionDate()); - - session.setLastInteractionDate(newValue); - Assert.assertEquals(newValue, session.getLastInteractionDate()); - } - - @Test - public void testSetGetLastInteractionDetails() throws Exception { - String newValue = GUID.create(); - - Assert.assertEquals(expectedLastInteraction, session.getLastInteractionDetails()); - - session.setLastInteractionDetails(newValue); - Assert.assertEquals(newValue, session.getLastInteractionDetails()); - } - @Parameters public static Collection<Object[]> getData() { Collection<Object[]> data = new ArrayList<Object[]>(); @@ -134,12 +110,9 @@ public class SessionTest { int clientPort = index * 345; Date creationDate = new Date(); String userId = "userId-" + index; - Date lastInteractionDate = new Date(); - String lastInteraction = "lastInteraction-" + index; Session session = - new Session(guid, userId, creationDate, clientVersion, clientMachine, clientAddress, clientPort, - lastInteractionDate, lastInteraction); + new Session(guid, userId, creationDate, clientVersion, clientMachine, clientAddress, clientPort); data.add(new Object[] { session, @@ -149,9 +122,9 @@ public class SessionTest { clientVersion, clientPort, creationDate, - userId, - lastInteractionDate, - lastInteraction}); + userId + + }); } return data; } diff --git a/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/session.manager.xml b/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/session.manager.xml index 478b8230bd7..34991198db7 100644 --- a/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/session.manager.xml +++ b/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/session.manager.xml @@ -5,7 +5,6 @@ <provide interface="org.eclipse.osee.framework.core.server.ISessionManager"/> </service> <reference bind="setDbService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/> - <reference bind="setServerManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerManager" name="IApplicationServerManager" policy="static"/> <reference bind="setAuthenticationManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IAuthenticationManager" name="IAuthenticationManager" policy="static"/> <reference bind="setDbInfoRegistry" cardinality="1..1" interface="org.eclipse.osee.framework.database.DatabaseInfoRegistry" name="DatabaseInfoRegistry" policy="static"/> <reference bind="setCacheAdmin" cardinality="1..1" interface="org.eclipse.osee.cache.admin.CacheAdmin" name="CacheAdmin" policy="static"/> diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISession.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISession.java index d5eaebbbb52..e4837a157e7 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISession.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISession.java @@ -19,10 +19,6 @@ public interface ISession { String getUserId(); - Date getLastInteractionDate(); - - String getLastInteractionDetails(); - String getClientMachineName(); String getClientVersion(); @@ -33,10 +29,6 @@ public interface ISession { int getClientPort(); - void setLastInteractionDetails(String string); - - void setLastInteractionDate(Date date); - String getGuid(); } diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISessionManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISessionManager.java index 7660e88af33..dc75489c89a 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISessionManager.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/ISessionManager.java @@ -24,8 +24,6 @@ public interface ISessionManager { public void releaseSession(String sessionId) throws OseeCoreException; - public void updateSessionActivity(String sessionId, String interactionName) throws OseeCoreException; - public ISession getSessionById(String sessionId) throws OseeCoreException; public Collection<ISession> getSessionByClientAddress(String clientAddress) throws OseeCoreException; diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/SecureOseeHttpServlet.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/SecureOseeHttpServlet.java index 8fa6463b46f..708290bb0e7 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/SecureOseeHttpServlet.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/SecureOseeHttpServlet.java @@ -13,6 +13,7 @@ package org.eclipse.osee.framework.core.server; import javax.servlet.http.HttpServletRequest; import org.eclipse.osee.framework.core.enums.SystemUser; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.framework.jdk.core.util.Conditions; import org.eclipse.osee.logger.Log; /** @@ -35,9 +36,8 @@ public class SecureOseeHttpServlet extends OseeHttpServlet { @Override protected void checkAccessControl(HttpServletRequest request) throws OseeCoreException { String sessionId = getSessionId(request); - String interaction = - String.format("%s %s %s", request.getMethod(), request.getRequestURI(), request.getQueryString()); - sessionManager.updateSessionActivity(sessionId, interaction); + ISession session = sessionManager.getSessionById(sessionId); + Conditions.checkNotNull(session, "session"); } public boolean isInitializing(HttpServletRequest request) throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionAccessor.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionAccessor.java index d31d743a14d..4927ccf6d87 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionAccessor.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionAccessor.java @@ -32,7 +32,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; public final class DatabaseSessionAccessor implements CacheDataLoader<String, Session>, CacheKeysLoader<String>, WriteDataAccessor<Session> { private static final String INSERT_SESSION = - "INSERT INTO osee_session (session_id, user_id, client_machine_name, client_address, client_port, client_version, created_on, last_interaction_date, last_interaction) VALUES (?,?,?,?,?,?,?,?,?)"; + "INSERT INTO osee_session (session_id, user_id, client_machine_name, client_address, client_port, client_version, created_on) VALUES (?,?,?,?,?,?,?)"; private static final String DELETE_SESSION = "DELETE FROM osee_session WHERE session_id = ?"; @@ -70,11 +70,6 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se } @Override - public void update(Iterable<Session> sessions) throws OseeCoreException { - executeTx(SessionTxType.UPDATE, sessions); - } - - @Override public void delete(Iterable<Session> sessions) throws OseeCoreException { executeTx(SessionTxType.DELETE, sessions); } @@ -85,10 +80,10 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se ISessionCollector collector = new ISessionCollector() { @Override - public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { Session session = getFactory().createLoadedSession(guid, userId, creationDate, clientVersion, clientMachineName, - clientAddress, clientPort, lastInteractionDate, lastInteractionDetails); + clientAddress, clientPort); sessions.put(guid, session); } }; @@ -118,7 +113,7 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se ISessionCollector idCollector = new ISessionCollector() { @Override - public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { ids.add(guid); } }; @@ -128,7 +123,6 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se private static enum SessionTxType { CREATE, - UPDATE, DELETE; } @@ -155,9 +149,6 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se case CREATE: create(connection); break; - case UPDATE: - update(connection); - break; case DELETE: delete(connection); break; @@ -176,18 +167,6 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se } } - private void update(OseeConnection connection) { - // do not update session table for now - - // List<Object[]> updateData = new ArrayList<Object[]>(); - // for (Session session : sessions) { - // updateData.add(toUpdate(session)); - // } - // if (!updateData.isEmpty()) { - // dbService.runBatchUpdate(connection, UPDATE_SESSION, updateData); - // } - } - private void delete(OseeConnection connection) throws OseeCoreException { List<Object[]> deleteData = new ArrayList<Object[]>(); for (Session session : sessions) { @@ -206,13 +185,7 @@ public final class DatabaseSessionAccessor implements CacheDataLoader<String, Se session.getClientAddress(), session.getClientPort(), session.getClientVersion(), - session.getCreationDate(), - session.getLastInteractionDate(), - session.getLastInteractionDetails()}; - } - - private Object[] toUpdate(Session session) { - return new Object[] {session.getLastInteractionDate(), session.getLastInteractionDetails(), session.getGuid()}; + session.getCreationDate()}; } private Object[] toDelete(Session session) { diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionQuery.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionQuery.java index cd4e55bcef8..02ab0e83998 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionQuery.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DatabaseSessionQuery.java @@ -68,10 +68,8 @@ public final class DatabaseSessionQuery implements ISessionQuery { String clientMachineName = chStmt.getString("client_machine_name"); String clientAddress = chStmt.getString("client_address"); int clientPort = chStmt.getInt("client_port"); - Date lastInteractionDate = chStmt.getTimestamp("last_interaction_date"); - String lastInteractionDetails = chStmt.getString("last_interaction"); collector.collect(sessionGuid, userId, creationDate, clientVersion, clientMachineName, clientAddress, - clientPort, lastInteractionDate, lastInteractionDetails); + clientPort); } } finally { chStmt.close(); diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DefaultSessionCollector.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DefaultSessionCollector.java index 51733e7ba6c..55abcf27fb7 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DefaultSessionCollector.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/DefaultSessionCollector.java @@ -27,10 +27,10 @@ public final class DefaultSessionCollector implements ISessionCollector { } @Override - public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { Session session = factory.createLoadedSession(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, - clientPort, lastInteractionDate, lastInteractionDetails); + clientPort); sessions.add(session); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/ISessionCollector.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/ISessionCollector.java index 240db2033f4..06e917b9235 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/ISessionCollector.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/ISessionCollector.java @@ -18,6 +18,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; */ public interface ISessionCollector { - void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) throws OseeCoreException; + void collect(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) throws OseeCoreException; }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/Session.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/Session.java index 35ed888c8ae..9adad047a00 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/Session.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/Session.java @@ -25,10 +25,8 @@ public class Session extends BaseIdentity<String> implements ISession { private String clientMachineName; private String clientAddress; private int clientPort; - private Date lastInteractionDate; - private String lastInteractionDetails; - public Session(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public Session(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { super(guid); this.userId = userId; this.creationDate = creationDate; @@ -36,8 +34,6 @@ public class Session extends BaseIdentity<String> implements ISession { this.clientMachineName = clientMachineName; this.clientAddress = clientAddress; this.clientPort = clientPort; - this.lastInteractionDate = lastInteractionDate; - this.lastInteractionDetails = lastInteractionDetails; } @Override @@ -46,16 +42,6 @@ public class Session extends BaseIdentity<String> implements ISession { } @Override - public Date getLastInteractionDate() { - return lastInteractionDate; - } - - @Override - public String getLastInteractionDetails() { - return lastInteractionDetails; - } - - @Override public String getClientMachineName() { return clientMachineName; } @@ -80,17 +66,6 @@ public class Session extends BaseIdentity<String> implements ISession { return clientPort; } - @Override - public void setLastInteractionDetails(String lastInteractionDetails) { - this.lastInteractionDetails = lastInteractionDetails; - } - - @Override - public void setLastInteractionDate(Date lastInteractionDate) { - this.lastInteractionDate = lastInteractionDate; - - } - public void setClientMachineName(String clientMachineName) { this.clientMachineName = clientMachineName; } diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java index a0af6dd633e..2481709f36b 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java @@ -44,17 +44,15 @@ public final class SessionFactory implements IOseeTypeFactory { this.dbService = dbService; } - public Session createLoadedSession(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public Session createLoadedSession(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { Session toReturn = - createNewSession(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, clientPort, - lastInteractionDate, lastInteractionDetails); + createNewSession(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, clientPort); return toReturn; } - public Session createNewSession(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort, Date lastInteractionDate, String lastInteractionDetails) { + public Session createNewSession(String guid, String userId, Date creationDate, String clientVersion, String clientMachineName, String clientAddress, int clientPort) { Session toReturn = - new Session(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, clientPort, - lastInteractionDate, lastInteractionDetails); + new Session(guid, userId, creationDate, clientVersion, clientMachineName, clientAddress, clientPort); return toReturn; } diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java index fa098396957..4067cd327e1 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java @@ -21,7 +21,6 @@ import org.eclipse.osee.cache.admin.Cache; import org.eclipse.osee.framework.core.data.IUserToken; import org.eclipse.osee.framework.core.data.OseeCredential; import org.eclipse.osee.framework.core.data.OseeSessionGrant; -import org.eclipse.osee.framework.core.enums.StorageState; import org.eclipse.osee.framework.core.enums.SystemUser; import org.eclipse.osee.framework.core.exception.OseeExceptions; import org.eclipse.osee.framework.core.server.IAuthenticationManager; @@ -30,7 +29,6 @@ import org.eclipse.osee.framework.core.server.ISessionManager; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Conditions; import org.eclipse.osee.framework.jdk.core.util.GUID; -import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime; /** @@ -68,7 +66,7 @@ public final class SessionManagerImpl implements ISessionManager { Session session = sessionFactory.createNewSession(newSessionId, userToken.getUserId(), creationDate, credential.getVersion(), credential.getClientMachineName(), credential.getClientAddress(), - credential.getPort(), creationDate, StorageState.CREATED.name().toLowerCase()); + credential.getPort()); // if the user is BootStrap we do not want to insert into database since tables may not exist if (!SystemUser.BootStrap.equals(userToken)) { @@ -96,16 +94,6 @@ public final class SessionManagerImpl implements ISessionManager { } @Override - public void updateSessionActivity(String sessionId, String interactionName) throws OseeCoreException { - Conditions.checkNotNull(sessionId, "sessionId"); - Session session = getSessionById(sessionId); - Conditions.checkNotNull(session, "Session", "for id [%s]", sessionId); - session.setLastInteractionDetails(Strings.isValid(interactionName) ? interactionName : "unknown"); - session.setLastInteractionDate(GlobalTime.GreenwichMeanTimestamp()); - storeDataAccessor.update(Collections.singleton(session)); - } - - @Override public Session getSessionById(String sessionId) throws OseeCoreException { Conditions.checkNotNull(sessionId, "sessionId"); Session session = null; diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerService.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerService.java index 3cbbc61bef9..3ebe08bd42b 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerService.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerService.java @@ -17,7 +17,6 @@ import org.eclipse.osee.cache.admin.CacheConfiguration; import org.eclipse.osee.framework.core.data.OseeCredential; import org.eclipse.osee.framework.core.data.OseeSessionGrant; import org.eclipse.osee.framework.core.exception.OseeExceptions; -import org.eclipse.osee.framework.core.server.IApplicationServerManager; import org.eclipse.osee.framework.core.server.IAuthenticationManager; import org.eclipse.osee.framework.core.server.ISession; import org.eclipse.osee.framework.core.server.ISessionManager; @@ -36,7 +35,6 @@ public final class SessionManagerService implements ISessionManager { private Log logger; private DatabaseInfoRegistry registry; private IOseeDatabaseService dbService; - private IApplicationServerManager serverManager; private IAuthenticationManager authenticationManager; private CacheAdmin cacheAdmin; private ISessionManager proxiedSessionManager; @@ -53,10 +51,6 @@ public final class SessionManagerService implements ISessionManager { this.dbService = dbService; } - public void setServerManager(IApplicationServerManager serverManager) { - this.serverManager = serverManager; - } - public void setAuthenticationManager(IAuthenticationManager authenticationManager) { this.authenticationManager = authenticationManager; } @@ -69,10 +63,6 @@ public final class SessionManagerService implements ISessionManager { return dbService; } - private IApplicationServerManager getServerManager() { - return serverManager; - } - private IAuthenticationManager getAuthenticationManager() { return authenticationManager; } @@ -113,11 +103,6 @@ public final class SessionManagerService implements ISessionManager { } @Override - public void updateSessionActivity(String sessionId, String interactionName) throws OseeCoreException { - proxiedSessionManager.updateSessionActivity(sessionId, interactionName); - } - - @Override public ISession getSessionById(String sessionId) throws OseeCoreException { return proxiedSessionManager.getSessionById(sessionId); } diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/WriteDataAccessor.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/WriteDataAccessor.java index 8432e34d2ee..4b6fc89469e 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/WriteDataAccessor.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/WriteDataAccessor.java @@ -20,8 +20,6 @@ public interface WriteDataAccessor<D> { void create(Iterable<D> sessions) throws OseeCoreException; - void update(Iterable<D> sessions) throws OseeCoreException; - void delete(Iterable<D> sessions) throws OseeCoreException; }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SessionClientLoopbackServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SessionClientLoopbackServlet.java index 66d4ec97b94..9b314196f84 100644 --- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SessionClientLoopbackServlet.java +++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SessionClientLoopbackServlet.java @@ -19,9 +19,7 @@ import java.net.URLEncoder; import java.net.UnknownHostException; import java.util.Arrays; import java.util.Collection; -import java.util.Comparator; import java.util.Enumeration; -import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.osee.framework.core.data.OseeServerContext; @@ -34,7 +32,6 @@ import org.eclipse.osee.logger.Log; import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Ordering; /** * @author Roberto E. Escobar @@ -176,15 +173,6 @@ public class SessionClientLoopbackServlet extends UnsecuredOseeHttpServlet { } } } - if (sessionData == null) { - List<? extends ISession> sortedByNewestCreationDate = sortByNewestCreationDate(filteredByAddress); - for (ISession session : sortedByNewestCreationDate) { - if (isSessionValid(session)) { - sessionData = session; - break; - } - } - } return sessionData != null ? sessionData.getClientPort() : -1; } @@ -197,15 +185,4 @@ public class SessionClientLoopbackServlet extends UnsecuredOseeHttpServlet { } }); } - - private List<? extends ISession> sortByNewestCreationDate(Iterable<? extends ISession> sessions) { - Ordering<ISession> ordered = Ordering.from(new Comparator<ISession>() { - @Override - public int compare(ISession arg1, ISession arg2) { - return Long.valueOf(arg1.getCreationDate().getTime()).compareTo( - Long.valueOf(arg2.getCreationDate().getTime())); - } - }); - return ordered.reverse().sortedCopy(sessions); - } } diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SystemManagerServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SystemManagerServlet.java index 643a5796b3d..272b1ef921d 100644 --- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SystemManagerServlet.java +++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/SystemManagerServlet.java @@ -232,7 +232,6 @@ public class SystemManagerServlet extends UnsecuredOseeHttpServlet { "User", "Version", "Machine", - "Last Interaction", "IP", "Port", "Delete"})); @@ -250,7 +249,6 @@ public class SystemManagerServlet extends UnsecuredOseeHttpServlet { session.getUserId(), session.getClientVersion(), session.getClientMachineName(), - dateFormat.format(session.getLastInteractionDate()), clientAddress, clientPort, getAnchor(AnchorType.DELETE_ANCHOR, sessionId, requestAddress, requestPort)})); diff --git a/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml b/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml index 5ba48a65282..61e6ceaae86 100644 --- a/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml +++ b/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml @@ -530,8 +530,6 @@ <Column id="CLIENT_PORT" defaultValue="not null" type="INTEGER" /> <Column id="CLIENT_VERSION" defaultValue="not null" type="VARCHAR" limits="100"/> <Column id="CREATED_ON" defaultValue="not null" type="TIMESTAMP" /> - <Column id="LAST_INTERACTION_DATE" defaultValue="not null" type="TIMESTAMP" /> - <Column id="LAST_INTERACTION" defaultValue="not null" type="VARCHAR" limits="1000"/> <Constraint schema="OSEE" id="OSEE_SESSION_PK" type="PRIMARY KEY" appliesTo="SESSION_ID" /> </Table> |