use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.leaf.a.d.grouping.LeafAD in project bgpcep by opendaylight.
the class LeafADHandler method serializeBody.
@Override
protected ByteBuf serializeBody(final LeafADCase mvpn) {
final LeafAD leaf = mvpn.getLeafAD();
final ByteBuf nlriByteBuf = Unpooled.buffer();
final LeafADRouteKey key = leaf.getLeafADRouteKey();
final MvpnChoice keyCase;
if (key instanceof InterAsIPmsiADCase) {
keyCase = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.mvpn.mvpn.choice.InterAsIPmsiADCaseBuilder((InterAsIPmsiADCase) key).build();
} else {
keyCase = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.mvpn.mvpn.choice.SPmsiADCaseBuilder((SPmsiADCase) key).build();
}
nlriByteBuf.writeBytes(SimpleMvpnNlriRegistry.getInstance().serializeMvpn(keyCase));
final ByteBuf orig = IpAddressUtil.bytesWOLengthFor(leaf.getOrigRouteIp());
checkArgument(orig.readableBytes() > 0);
nlriByteBuf.writeBytes(orig);
return nlriByteBuf;
}
Aggregations