test_class.declarator: repository
test_class.modifier: private
test_class.original_string: private InMemoryRepository repository;
test_class.type: InMemoryRepository
test_class.var_name: repository
test_class.file: session-replacement/src/test/java/com/amadeus/session/repository/inmemory/TestInMemoryRepository.java
test_class.identifier: TestInMemoryRepository
test_case.body: @Test
    public void testSessionIdChange() {
      SessionData sessionData = new SessionData("test", 1000, 10);
      repository.storeSessionData(sessionData);
      repository.setSessionAttribute(sessionData, "name", "value");
      SessionData sessionData2 = new SessionData("test", 1000, 10);
      sessionData2.setNewSessionId("test2");
      repository.sessionIdChange(sessionData2);
      assertNotNull(repository.getSessionAttribute(sessionData2, "name"));
      SessionData sessionDataOrig = new SessionData("test", 1000, 10);
      assertNull(repository.getSessionAttribute(sessionDataOrig, "name"));
    }
test_case.class_method_signature: TestInMemoryRepository.testSessionIdChange()
test_case.full_signature: @Test public void testSessionIdChange()
test_case.identifier: testSessionIdChange
test_case.invocations: storeSessionData setSessionAttribute setNewSessionId sessionIdChange assertNotNull getSessionAttribute assertNull getSessionAttribute
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSessionIdChange()
focal_class.declarator: logger = LoggerFactory.getLogger(InMemoryRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(InMemoryRepository.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: sessionDataCache = new ConcurrentHashMap<>()
focal_class.original_string: ConcurrentHashMap<String, SessionData> sessionDataCache = new ConcurrentHashMap<>();
focal_class.type: ConcurrentHashMap<String, SessionData>
focal_class.var_name: sessionDataCache
focal_class.declarator: sessionAttributeCache = new ConcurrentHashMap<>()
focal_class.original_string: ConcurrentHashMap<String, Map<String, Object>> sessionAttributeCache = new ConcurrentHashMap<>();
focal_class.type: ConcurrentHashMap<String, Map<String, Object>>
focal_class.var_name: sessionAttributeCache
focal_class.declarator: sessionManager
focal_class.modifier: private
focal_class.original_string: private SessionManager sessionManager;
focal_class.type: SessionManager
focal_class.var_name: sessionManager
focal_class.declarator: namespace
focal_class.modifier: private final
focal_class.original_string: private final String namespace;
focal_class.type: String
focal_class.var_name: namespace
focal_class.declarator: cleanupFuture
focal_class.modifier: private
focal_class.original_string: private ScheduledFuture<?> cleanupFuture;
focal_class.type: ScheduledFuture<?>
focal_class.var_name: cleanupFuture
focal_class.file: session-replacement/src/main/java/com/amadeus/session/repository/inmemory/InMemoryRepository.java
focal_class.identifier: InMemoryRepository
focal_class.interfaces: implements SessionRepository
focal_class.class_method_signature: InMemoryRepository.InMemoryRepository(String namespace)
focal_class.full_signature: public  InMemoryRepository(String namespace)
focal_class.identifier: InMemoryRepository
focal_class.modifiers: public
focal_class.parameters: (String namespace)
focal_class.signature:  InMemoryRepository(String namespace)
focal_class.class_method_signature: InMemoryRepository.remove(String sessionId)
focal_class.full_signature: private void remove(String sessionId)
focal_class.identifier: remove
focal_class.modifiers: private
focal_class.parameters: (String sessionId)
focal_class.return: void
focal_class.signature: void remove(String sessionId)
focal_class.class_method_signature: InMemoryRepository.id(String id)
focal_class.full_signature: private String id(String id)
focal_class.identifier: id
focal_class.modifiers: private
focal_class.parameters: (String id)
focal_class.return: String
focal_class.signature: String id(String id)
focal_class.class_method_signature: InMemoryRepository.getSessionData(String id)
focal_class.full_signature: @Override public SessionData getSessionData(String id)
focal_class.identifier: getSessionData
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: SessionData
focal_class.signature: SessionData getSessionData(String id)
focal_class.class_method_signature: InMemoryRepository.storeSessionData(SessionData sessionData)
focal_class.full_signature: @Override public void storeSessionData(SessionData sessionData)
focal_class.identifier: storeSessionData
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData sessionData)
focal_class.return: void
focal_class.signature: void storeSessionData(SessionData sessionData)
focal_class.class_method_signature: InMemoryRepository.getAllKeys(SessionData session)
focal_class.full_signature: @Override public Set<String> getAllKeys(SessionData session)
focal_class.identifier: getAllKeys
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session)
focal_class.return: Set<String>
focal_class.signature: Set<String> getAllKeys(SessionData session)
focal_class.class_method_signature: InMemoryRepository.getSessionAttribute(SessionData session, String attribute)
focal_class.full_signature: @Override public Object getSessionAttribute(SessionData session, String attribute)
focal_class.identifier: getSessionAttribute
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session, String attribute)
focal_class.return: Object
focal_class.signature: Object getSessionAttribute(SessionData session, String attribute)
focal_class.class_method_signature: InMemoryRepository.remove(SessionData session)
focal_class.full_signature: @Override public void remove(SessionData session)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session)
focal_class.return: void
focal_class.signature: void remove(SessionData session)
focal_class.class_method_signature: InMemoryRepository.prepareRemove(SessionData session)
focal_class.full_signature: @Override public boolean prepareRemove(SessionData session)
focal_class.identifier: prepareRemove
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session)
focal_class.return: boolean
focal_class.signature: boolean prepareRemove(SessionData session)
focal_class.class_method_signature: InMemoryRepository.startCommit(SessionData session)
focal_class.full_signature: @Override public SessionRepository.CommitTransaction startCommit(SessionData session)
focal_class.identifier: startCommit
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session)
focal_class.return: SessionRepository.CommitTransaction
focal_class.signature: SessionRepository.CommitTransaction startCommit(SessionData session)
focal_class.class_method_signature: InMemoryRepository.setSessionManager(final SessionManager sessionManager)
focal_class.full_signature: @Override public void setSessionManager(final SessionManager sessionManager)
focal_class.identifier: setSessionManager
focal_class.modifiers: @Override public
focal_class.parameters: (final SessionManager sessionManager)
focal_class.return: void
focal_class.signature: void setSessionManager(final SessionManager sessionManager)
focal_class.class_method_signature: InMemoryRepository.requestFinished()
focal_class.full_signature: @Override public void requestFinished()
focal_class.identifier: requestFinished
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void requestFinished()
focal_class.class_method_signature: InMemoryRepository.setSessionAttribute(SessionData session, String name, Object value)
focal_class.full_signature: @Override public void setSessionAttribute(SessionData session, String name, Object value)
focal_class.identifier: setSessionAttribute
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session, String name, Object value)
focal_class.return: void
focal_class.signature: void setSessionAttribute(SessionData session, String name, Object value)
focal_class.class_method_signature: InMemoryRepository.getAttributeMap(String sessionId)
focal_class.full_signature: private Map<String, Object> getAttributeMap(String sessionId)
focal_class.identifier: getAttributeMap
focal_class.modifiers: private
focal_class.parameters: (String sessionId)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getAttributeMap(String sessionId)
focal_class.class_method_signature: InMemoryRepository.removeSessionAttribute(SessionData session, String name)
focal_class.full_signature: @Override public void removeSessionAttribute(SessionData session, String name)
focal_class.identifier: removeSessionAttribute
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData session, String name)
focal_class.return: void
focal_class.signature: void removeSessionAttribute(SessionData session, String name)
focal_class.class_method_signature: InMemoryRepository.cleanSessionsOnShutdown()
focal_class.full_signature: @Override public boolean cleanSessionsOnShutdown()
focal_class.identifier: cleanSessionsOnShutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean cleanSessionsOnShutdown()
focal_class.class_method_signature: InMemoryRepository.getOwnedSessionIds()
focal_class.full_signature: @Override public Collection<String> getOwnedSessionIds()
focal_class.identifier: getOwnedSessionIds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<String>
focal_class.signature: Collection<String> getOwnedSessionIds()
focal_class.class_method_signature: InMemoryRepository.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: InMemoryRepository.reset()
focal_class.full_signature: @Override public void reset()
focal_class.identifier: reset
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: InMemoryRepository.sessionIdChange(SessionData sessionData)
focal_class.full_signature: @Override public void sessionIdChange(SessionData sessionData)
focal_class.identifier: sessionIdChange
focal_class.modifiers: @Override public
focal_class.parameters: (SessionData sessionData)
focal_class.return: void
focal_class.signature: void sessionIdChange(SessionData sessionData)
focal_class.class_method_signature: InMemoryRepository.isConnected()
focal_class.full_signature: @Override public boolean isConnected()
focal_class.identifier: isConnected
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isConnected()
focal_method.body: @Override
    public void sessionIdChange(SessionData sessionData) {
      String id = id(sessionData.getId());
      String oldId = id(sessionData.getOriginalId());
      SessionData originalSessionData = sessionDataCache.get(oldId);
      if (originalSessionData != null) {
        sessionDataCache.put(id, originalSessionData);
        sessionDataCache.remove(oldId);
        originalSessionData.setNewSessionId(sessionData.getId());
      }
      Map<String, Object> attributes = sessionAttributeCache.remove(oldId);
      if (attributes != null) {
        sessionAttributeCache.put(id, attributes);
        sessionAttributeCache.remove(oldId);
      }
    }
focal_method.class_method_signature: InMemoryRepository.sessionIdChange(SessionData sessionData)
focal_method.full_signature: @Override public void sessionIdChange(SessionData sessionData)
focal_method.identifier: sessionIdChange
focal_method.invocations: id getId id getOriginalId get put remove setNewSessionId getId remove put remove
focal_method.modifiers: @Override public
focal_method.parameters: (SessionData sessionData)
focal_method.return: void
focal_method.signature: void sessionIdChange(SessionData sessionData)