@Test public void differentIdsDoNotClash() { final Set<Object> compositeKeys = IDS.stream().flatMap((sender) -> IDS.stream().flatMap((senderSub) -> IDS.stream().map( (target) -> strategy.onInitiateLogon( sender, senderSub, null, target, null, null)))) .collect(toSet()); assertThat(compositeKeys, hasSize(IDS.size() * IDS.size() * IDS.size())); }
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);  }