@Test public void findsDuplicateSessions() { sessionContexts.onLogon(aSession, fixDictionary); assertEquals(SessionContexts.DUPLICATE_SESSION, sessionContexts.onLogon(aSession, fixDictionary)); }
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();  }