@Test public void sessionPersistedCorrectlyAfterARestart() { sessionContexts.onLogon(aSession, fixDictionary); final SessionContexts sessionContextsAfterRestart = newSessionContexts(buffer); final SessionContext reloadedAContext = sessionContextsAfterRestart.onLogon(aSession, fixDictionary); reloadedAContext.onSequenceReset(time + 1); final SessionContexts sessionContextsAfterSecondRestart = newSessionContexts(buffer); final SessionContext reloadedAgainContext = sessionContextsAfterSecondRestart.onLogon(aSession, fixDictionary); assertEquals(time + 1, reloadedAgainContext.lastSequenceResetTime()); }
public SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary) { final SessionContext sessionContext = newSessionContext(compositeKey, fixDictionary); if (!currentlyAuthenticatedSessionIds.add(sessionContext.sessionId())) { return DUPLICATE_SESSION; } return sessionContext; }
SessionContexts { public SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary) { final SessionContext sessionContext = newSessionContext(compositeKey, fixDictionary); if (!currentlyAuthenticatedSessionIds.add(sessionContext.sessionId())) { return DUPLICATE_SESSION; } return sessionContext; } }
SessionContexts { public SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary) { final SessionContext sessionContext = newSessionContext(compositeKey, fixDictionary); if (!currentlyAuthenticatedSessionIds.add(sessionContext.sessionId())) { return DUPLICATE_SESSION; } return sessionContext; } SessionContexts(
        final MappedFile mappedFile,
        final SessionIdStrategy idStrategy,
        final int initialSequenceIndex,
        final ErrorHandler errorHandler); }
SessionContexts { public SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary) { final SessionContext sessionContext = newSessionContext(compositeKey, fixDictionary); if (!currentlyAuthenticatedSessionIds.add(sessionContext.sessionId())) { return DUPLICATE_SESSION; } return sessionContext; } SessionContexts(
        final MappedFile mappedFile,
        final SessionIdStrategy idStrategy,
        final int initialSequenceIndex,
        final ErrorHandler errorHandler); SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary); void onDisconnect(final long sessionId); void reset(final File backupLocation); List<SessionInfo> allSessions(); }
SessionContexts { public SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary) { final SessionContext sessionContext = newSessionContext(compositeKey, fixDictionary); if (!currentlyAuthenticatedSessionIds.add(sessionContext.sessionId())) { return DUPLICATE_SESSION; } return sessionContext; } SessionContexts(
        final MappedFile mappedFile,
        final SessionIdStrategy idStrategy,
        final int initialSequenceIndex,
        final ErrorHandler errorHandler); SessionContext onLogon(final CompositeKey compositeKey, final FixDictionary fixDictionary); void onDisconnect(final long sessionId); void reset(final File backupLocation); List<SessionInfo> allSessions();  }