@Test public void testCreateOpen() throws Exception { ByteBuf message = LegacyMessageFactory.createOpen(Version.Version1, ConnectionMode.Listener); byte[] result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2}; assertArrayEquals(result, toBytes(message)); message = LegacyMessageFactory.createOpen(Version.Version1, ConnectionMode.Speaker); result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}; assertArrayEquals(result, toBytes(message)); message = LegacyMessageFactory.createOpen(Version.Version2, ConnectionMode.Listener); result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 2}; assertArrayEquals(result, toBytes(message)); message = LegacyMessageFactory.createOpen(Version.Version2, ConnectionMode.Speaker); result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1}; assertArrayEquals(result, toBytes(message)); message = LegacyMessageFactory.createOpen(Version.Version3, ConnectionMode.Listener); result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 2}; assertArrayEquals(result, toBytes(message)); message = LegacyMessageFactory.createOpen(Version.Version3, ConnectionMode.Speaker); result = new byte[] {0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1}; assertArrayEquals(result, toBytes(message)); }
public static ByteBuf createOpen(Version version, ConnectionMode nodeMode) { return getMessage(MessageType.Open, ArraysUtil.combine(ArraysUtil.int2bytes(version.getIntValue()), ArraysUtil.int2bytes(nodeMode.getIntValue()))); }
LegacyMessageFactory extends MessageFactory { public static ByteBuf createOpen(Version version, ConnectionMode nodeMode) { return getMessage(MessageType.Open, ArraysUtil.combine(ArraysUtil.int2bytes(version.getIntValue()), ArraysUtil.int2bytes(nodeMode.getIntValue()))); } }
LegacyMessageFactory extends MessageFactory { public static ByteBuf createOpen(Version version, ConnectionMode nodeMode) { return getMessage(MessageType.Open, ArraysUtil.combine(ArraysUtil.int2bytes(version.getIntValue()), ArraysUtil.int2bytes(nodeMode.getIntValue()))); }  }
LegacyMessageFactory extends MessageFactory { public static ByteBuf createOpen(Version version, ConnectionMode nodeMode) { return getMessage(MessageType.Open, ArraysUtil.combine(ArraysUtil.int2bytes(version.getIntValue()), ArraysUtil.int2bytes(nodeMode.getIntValue()))); }  static ByteBuf createError(ErrorCodeNonExtended errorCode); static ByteBuf createError(ErrorCodeNonExtended errorCode, byte[] data); static ByteBuf createOpen(Version version, ConnectionMode nodeMode); static ByteBuf createOpenResp(Version version, ConnectionMode nodeMode); static ByteBuf createUpdate(List<T> deleteBindings, List<T> addBindings,
            Version version, SxpBindingFilter bindingFilter); static Notification decodeOpen(byte[] payload); static Notification decodeOpenResp(byte[] payload); static Notification decodeUpdate(byte[] payload); }
LegacyMessageFactory extends MessageFactory { public static ByteBuf createOpen(Version version, ConnectionMode nodeMode) { return getMessage(MessageType.Open, ArraysUtil.combine(ArraysUtil.int2bytes(version.getIntValue()), ArraysUtil.int2bytes(nodeMode.getIntValue()))); }  static ByteBuf createError(ErrorCodeNonExtended errorCode); static ByteBuf createError(ErrorCodeNonExtended errorCode, byte[] data); static ByteBuf createOpen(Version version, ConnectionMode nodeMode); static ByteBuf createOpenResp(Version version, ConnectionMode nodeMode); static ByteBuf createUpdate(List<T> deleteBindings, List<T> addBindings,
            Version version, SxpBindingFilter bindingFilter); static Notification decodeOpen(byte[] payload); static Notification decodeOpenResp(byte[] payload); static Notification decodeUpdate(byte[] payload);  }