@Test public void differentIdsDoNotClash() { final Set<Object> compositeKeys = IDS.stream() .flatMap((sender) -> IDS.stream() .map((target) -> strategy.onInitiateLogon(sender, null, null, target, null, null))) .collect(toSet()); assertThat(compositeKeys, hasSize(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) { requireNonNull(localCompId, "senderCompId"); requireNonNull(remoteCompId, "targetCompId"); final char[] senderCompID = localCompId.toCharArray(); final char[] targetCompID = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompID, senderCompID.length, targetCompID, targetCompID.length); }
SenderAndTargetSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { requireNonNull(localCompId, "senderCompId"); requireNonNull(remoteCompId, "targetCompId"); final char[] senderCompID = localCompId.toCharArray(); final char[] targetCompID = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompID, senderCompID.length, targetCompID, targetCompID.length); } }
SenderAndTargetSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { requireNonNull(localCompId, "senderCompId"); requireNonNull(remoteCompId, "targetCompId"); final char[] senderCompID = localCompId.toCharArray(); final char[] targetCompID = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompID, senderCompID.length, targetCompID, targetCompID.length); } SenderAndTargetSessionIdStrategy(); }
SenderAndTargetSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { requireNonNull(localCompId, "senderCompId"); requireNonNull(remoteCompId, "targetCompId"); final char[] senderCompID = localCompId.toCharArray(); final char[] targetCompID = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompID, senderCompID.length, targetCompID, targetCompID.length); } SenderAndTargetSessionIdStrategy(); 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); }
SenderAndTargetSessionIdStrategy implements SessionIdStrategy { public CompositeKey onInitiateLogon( final String localCompId, final String localSubId, final String localLocationId, final String remoteCompId, final String remoteSubId, final String remoteLocationId) { requireNonNull(localCompId, "senderCompId"); requireNonNull(remoteCompId, "targetCompId"); final char[] senderCompID = localCompId.toCharArray(); final char[] targetCompID = remoteCompId.toCharArray(); return new CompositeKeyImpl( senderCompID, senderCompID.length, targetCompID, targetCompID.length); } SenderAndTargetSessionIdStrategy(); 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);  }