@Test public void testDecodeAddIPv6() throws Exception { AddIpv6Attribute ipv4Attribute = (AddIpv6Attribute) LegacyAttributeFactory.decodeAddIPv6(AttributeType.AddIpv6, 26, new byte[] {0, 0, 0, 2, 0, 0, 0, 26, 32, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 117, 48}); assertEquals(30000, ipv4Attribute.getAddIpv6Attributes().getSgt().intValue()); assertEquals(IpPrefixBuilder.getDefaultInstance("2002:0:0:0:0:0:0:1/128"), ipv4Attribute.getAddIpv6Attributes().getIpPrefix()); }
public static AttributeOptionalFields decodeAddIPv6(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(); AddIpv6AttributeBuilder _attributeBuilder = new AddIpv6AttributeBuilder(); AddIpv6AttributesBuilder _attributesBuilder = new AddIpv6AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv6Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv6(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(); AddIpv6AttributeBuilder _attributeBuilder = new AddIpv6AttributeBuilder(); AddIpv6AttributesBuilder _attributesBuilder = new AddIpv6AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv6Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); } }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv6(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(); AddIpv6AttributeBuilder _attributeBuilder = new AddIpv6AttributeBuilder(); AddIpv6AttributesBuilder _attributesBuilder = new AddIpv6AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv6Attributes(_attributesBuilder.build()); return _attributeBuilder.build(); }  }
LegacyAttributeFactory { public static AttributeOptionalFields decodeAddIPv6(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(); AddIpv6AttributeBuilder _attributeBuilder = new AddIpv6AttributeBuilder(); AddIpv6AttributesBuilder _attributesBuilder = new AddIpv6AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv6Attributes(_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 decodeAddIPv6(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(); AddIpv6AttributeBuilder _attributeBuilder = new AddIpv6AttributeBuilder(); AddIpv6AttributesBuilder _attributesBuilder = new AddIpv6AttributesBuilder(); _attributesBuilder.setIpPrefix(mappingRecord.getAddress()); _attributesBuilder.setSgt(sgt); _attributeBuilder.setAddIpv6Attributes(_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);  }