@Test public void testDecodeUpdate() throws Exception { UpdateMessageLegacy message = (UpdateMessageLegacy) LegacyMessageFactory.decodeUpdate( new byte[] {0, 0, 0, 1, 0, 0, 0, 14, -64, -88, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 39, 16, 0, 0, 0, 3, 0, 0, 0, 13, -64, -88, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 32}); assertEquals(2, message.getMappingRecord().size()); org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.protocol.rev141002.mapping.records.fields.MappingRecord record = message.getMappingRecord().get(0); assertEquals(record.getOperationCode(), AttributeType.AddIpv4); assertEquals(record.getAddress(), IpPrefixBuilder.getDefaultInstance("192.168.0.1/32")); record = message.getMappingRecord().get(1); assertEquals(record.getOperationCode(), AttributeType.DelIpv4); assertEquals(record.getAddress(), IpPrefixBuilder.getDefaultInstance("192.168.0.2/32")); }
public static Notification decodeUpdate(byte[] payload) throws UnknownPrefixException, AddressLengthException, AttributeLengthException, UnknownHostException { UpdateMessageLegacyBuilder messageBuilder = new UpdateMessageLegacyBuilder(); messageBuilder.setType(MessageType.Update); messageBuilder.setLength(MESSAGE_HEADER_LENGTH_LENGTH + MESSAGE_HEADER_TYPE_LENGTH + payload.length); messageBuilder.setPayload(payload); messageBuilder.setMappingRecord(MappingRecordList.decode(payload)); return messageBuilder.build(); }
LegacyMessageFactory extends MessageFactory { public static Notification decodeUpdate(byte[] payload) throws UnknownPrefixException, AddressLengthException, AttributeLengthException, UnknownHostException { UpdateMessageLegacyBuilder messageBuilder = new UpdateMessageLegacyBuilder(); messageBuilder.setType(MessageType.Update); messageBuilder.setLength(MESSAGE_HEADER_LENGTH_LENGTH + MESSAGE_HEADER_TYPE_LENGTH + payload.length); messageBuilder.setPayload(payload); messageBuilder.setMappingRecord(MappingRecordList.decode(payload)); return messageBuilder.build(); } }
LegacyMessageFactory extends MessageFactory { public static Notification decodeUpdate(byte[] payload) throws UnknownPrefixException, AddressLengthException, AttributeLengthException, UnknownHostException { UpdateMessageLegacyBuilder messageBuilder = new UpdateMessageLegacyBuilder(); messageBuilder.setType(MessageType.Update); messageBuilder.setLength(MESSAGE_HEADER_LENGTH_LENGTH + MESSAGE_HEADER_TYPE_LENGTH + payload.length); messageBuilder.setPayload(payload); messageBuilder.setMappingRecord(MappingRecordList.decode(payload)); return messageBuilder.build(); }  }
LegacyMessageFactory extends MessageFactory { public static Notification decodeUpdate(byte[] payload) throws UnknownPrefixException, AddressLengthException, AttributeLengthException, UnknownHostException { UpdateMessageLegacyBuilder messageBuilder = new UpdateMessageLegacyBuilder(); messageBuilder.setType(MessageType.Update); messageBuilder.setLength(MESSAGE_HEADER_LENGTH_LENGTH + MESSAGE_HEADER_TYPE_LENGTH + payload.length); messageBuilder.setPayload(payload); messageBuilder.setMappingRecord(MappingRecordList.decode(payload)); return messageBuilder.build(); }  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 Notification decodeUpdate(byte[] payload) throws UnknownPrefixException, AddressLengthException, AttributeLengthException, UnknownHostException { UpdateMessageLegacyBuilder messageBuilder = new UpdateMessageLegacyBuilder(); messageBuilder.setType(MessageType.Update); messageBuilder.setLength(MESSAGE_HEADER_LENGTH_LENGTH + MESSAGE_HEADER_TYPE_LENGTH + payload.length); messageBuilder.setPayload(payload); messageBuilder.setMappingRecord(MappingRecordList.decode(payload)); return messageBuilder.build(); }  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);  }