@Test public void initiatingTheSameLogonTwiceGeneratesTheSameKey() { IDS.forEach((sender) -> IDS.forEach((senderSub) -> IDS.forEach((target) -> { final Object first = strategy.onInitiateLogon(sender, senderSub, null, target, null, null); final Object second = strategy.onInitiateLogon(sender, senderSub, null, target, null, null); assertEquals(first, second); assertEquals(first.hashCode(), second.hashCode()); }))); }
public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { final char[] senderCompIdChars = localCompId.toCharArray(); final char[] senderSubIdChars = localSubId.toCharArray(); final char[] targetCompIdChars = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompIdChars, senderCompIdChars.length, senderSubIdChars, senderSubIdChars.length, targetCompIdChars, targetCompIdChars.length); }
SenderTargetAndSubSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { final char[] senderCompIdChars = localCompId.toCharArray(); final char[] senderSubIdChars = localSubId.toCharArray(); final char[] targetCompIdChars = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompIdChars, senderCompIdChars.length, senderSubIdChars, senderSubIdChars.length, targetCompIdChars, targetCompIdChars.length); } }
SenderTargetAndSubSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { final char[] senderCompIdChars = localCompId.toCharArray(); final char[] senderSubIdChars = localSubId.toCharArray(); final char[] targetCompIdChars = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompIdChars, senderCompIdChars.length, senderSubIdChars, senderSubIdChars.length, targetCompIdChars, targetCompIdChars.length); } SenderTargetAndSubSessionIdStrategy(); }
SenderTargetAndSubSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { final char[] senderCompIdChars = localCompId.toCharArray(); final char[] senderSubIdChars = localSubId.toCharArray(); final char[] targetCompIdChars = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompIdChars, senderCompIdChars.length, senderSubIdChars, senderSubIdChars.length, targetCompIdChars, targetCompIdChars.length); } SenderTargetAndSubSessionIdStrategy(); CompositeKey onAcceptLogon(final SessionHeaderDecoder header); CompositeKey onInitiateLogon(
        final String localCompId,
        final String localSubId,
        final String localLocationId,
        final String remoteCompId,
        final String remoteSubId,
        final String remoteLocationId); void setupSession(final CompositeKey compositeKey, final SessionHeaderEncoder headerEncoder); int save(final CompositeKey compositeKey, final MutableDirectBuffer buffer, final int offset); CompositeKey load(final DirectBuffer buffer, final int offset, final int length); int validateCompIds(final CompositeKey compositeKey, final SessionHeaderDecoder header); }
SenderTargetAndSubSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { final char[] senderCompIdChars = localCompId.toCharArray(); final char[] senderSubIdChars = localSubId.toCharArray(); final char[] targetCompIdChars = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompIdChars, senderCompIdChars.length, senderSubIdChars, senderSubIdChars.length, targetCompIdChars, targetCompIdChars.length); } SenderTargetAndSubSessionIdStrategy(); CompositeKey onAcceptLogon(final SessionHeaderDecoder header); CompositeKey onInitiateLogon(
        final String localCompId,
        final String localSubId,
        final String localLocationId,
        final String remoteCompId,
        final String remoteSubId,
        final String remoteLocationId); void setupSession(final CompositeKey compositeKey, final SessionHeaderEncoder headerEncoder); int save(final CompositeKey compositeKey, final MutableDirectBuffer buffer, final int offset); CompositeKey load(final DirectBuffer buffer, final int offset, final int length); int validateCompIds(final CompositeKey compositeKey, final SessionHeaderDecoder header);  }