@Test public void testDecodeAddIPv4() throws Exception { AddIpv4Attribute ipv4Attribute = (AddIpv4Attribute) LegacyAttributeFactory.decodeAddIPv4(AttributeType.AddIpv4, 14, new byte[] {0, 0, 0, 1, 0, 0, 0, 14, -64, -88, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 39, 16}); assertEquals(10000, ipv4Attribute.getAddIpv4Attributes().getSgt().intValue()); assertEquals(IpPrefixBuilder.getDefaultInstance("192.168.0.1/32"), ipv4Attribute.getAddIpv4Attributes().getIpPrefix()); }
public static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value) throws UnknownHostException, AddressLengthException, UnknownPrefixException, TlvNotFoundException { MappingRecord mappingRecord = org.opendaylight.sxp.core.messaging.legacy.MappingRecord.decodeAddress(operationCode, length, value); int sgt = ((SourceGroupTagTlvAttribute) org.opendaylight.sxp.core.messaging.legacy.MappingRecord.create( mappingRecord.getTlv()).get(TlvType.Sgt)).getSourceGroupTagTlvAttributes().getSgt(); AddIpv4AttributeBuilder _attributeBuilder = new AddIpv4AttributeBuilder(); AddIpv4AttributesBuilder _attributesBuilder = new AddIpv4AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv4Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value) throws UnknownHostException, AddressLengthException, UnknownPrefixException, TlvNotFoundException { MappingRecord mappingRecord = org.opendaylight.sxp.core.messaging.legacy.MappingRecord.decodeAddress(operationCode, length, value); int sgt = ((SourceGroupTagTlvAttribute) org.opendaylight.sxp.core.messaging.legacy.MappingRecord.create( mappingRecord.getTlv()).get(TlvType.Sgt)).getSourceGroupTagTlvAttributes().getSgt(); AddIpv4AttributeBuilder _attributeBuilder = new AddIpv4AttributeBuilder(); AddIpv4AttributesBuilder _attributesBuilder = new AddIpv4AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv4Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); } }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value) throws UnknownHostException, AddressLengthException, UnknownPrefixException, TlvNotFoundException { MappingRecord mappingRecord = org.opendaylight.sxp.core.messaging.legacy.MappingRecord.decodeAddress(operationCode, length, value); int sgt = ((SourceGroupTagTlvAttribute) org.opendaylight.sxp.core.messaging.legacy.MappingRecord.create( mappingRecord.getTlv()).get(TlvType.Sgt)).getSourceGroupTagTlvAttributes().getSgt(); AddIpv4AttributeBuilder _attributeBuilder = new AddIpv4AttributeBuilder(); AddIpv4AttributesBuilder _attributesBuilder = new AddIpv4AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv4Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }  }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value) throws UnknownHostException, AddressLengthException, UnknownPrefixException, TlvNotFoundException { MappingRecord mappingRecord = org.opendaylight.sxp.core.messaging.legacy.MappingRecord.decodeAddress(operationCode, length, value); int sgt = ((SourceGroupTagTlvAttribute) org.opendaylight.sxp.core.messaging.legacy.MappingRecord.create( mappingRecord.getTlv()).get(TlvType.Sgt)).getSourceGroupTagTlvAttributes().getSgt(); AddIpv4AttributeBuilder _attributeBuilder = new AddIpv4AttributeBuilder(); AddIpv4AttributesBuilder _attributesBuilder = new AddIpv4AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv4Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }  static MappingRecord createAddIpv4(Sgt sgt, IpPrefix prefix); static MappingRecord createAddIpv6(Sgt sgt, IpPrefix prefix); static MappingRecord createDeleteIpv4(IpPrefix prefix); static MappingRecord createDeleteIpv6(IpPrefix prefix); static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeAddIPv6(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeDeleteIPv4(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeDeleteIPv6(AttributeType operationCode, int length, byte[] value); }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value) throws UnknownHostException, AddressLengthException, UnknownPrefixException, TlvNotFoundException { MappingRecord mappingRecord = org.opendaylight.sxp.core.messaging.legacy.MappingRecord.decodeAddress(operationCode, length, value); int sgt = ((SourceGroupTagTlvAttribute) org.opendaylight.sxp.core.messaging.legacy.MappingRecord.create( mappingRecord.getTlv()).get(TlvType.Sgt)).getSourceGroupTagTlvAttributes().getSgt(); AddIpv4AttributeBuilder _attributeBuilder = new AddIpv4AttributeBuilder(); AddIpv4AttributesBuilder _attributesBuilder = new AddIpv4AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv4Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }  static MappingRecord createAddIpv4(Sgt sgt, IpPrefix prefix); static MappingRecord createAddIpv6(Sgt sgt, IpPrefix prefix); static MappingRecord createDeleteIpv4(IpPrefix prefix); static MappingRecord createDeleteIpv6(IpPrefix prefix); static AttributeOptionalFields decodeAddIPv4(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeAddIPv6(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeDeleteIPv4(AttributeType operationCode, int length, byte[] value); static AttributeOptionalFields decodeDeleteIPv6(AttributeType operationCode, int length, byte[] value);  }