use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev200120.bgp.rib.route.PmsiTunnelAugmentation in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandler method serializeAttribute.
@Override
public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object.");
final PmsiTunnelAugmentation pmsiTunnelAugmentation = ((Attributes) attribute).getAugmentation(PmsiTunnelAugmentation.class);
if (pmsiTunnelAugmentation == null) {
return;
}
final PmsiTunnel pmsiTunnelAttribute = pmsiTunnelAugmentation.getPmsiTunnel();
final TunnelIdentifier tunnel = pmsiTunnelAttribute.getTunnelIdentifier();
final ByteBuf tunnelBuffer = Unpooled.buffer();
final int tunnelType = this.tunnelIdentifierHandler.serialize(tunnel, tunnelBuffer);
final ByteBuf body = Unpooled.buffer();
serializeFlag(pmsiTunnelAttribute, body);
body.writeByte(tunnelType);
serializeMpls(pmsiTunnelAttribute.getMplsLabel(), body);
body.writeBytes(tunnelBuffer);
AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, getType(), body, byteAggregator);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev200120.bgp.rib.route.PmsiTunnelAugmentation in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandler method serializeAttribute.
@Override
public void serializeAttribute(final Attributes attribute, final ByteBuf byteAggregator) {
final PmsiTunnelAugmentation pmsiTunnelAugmentation = attribute.augmentation(PmsiTunnelAugmentation.class);
if (pmsiTunnelAugmentation == null) {
return;
}
final PmsiTunnel pmsiTunnelAttribute = pmsiTunnelAugmentation.getPmsiTunnel();
final TunnelIdentifier tunnel = pmsiTunnelAttribute.getTunnelIdentifier();
final ByteBuf tunnelBuffer = Unpooled.buffer();
final int tunnelType = this.tunnelIdentifierHandler.serialize(tunnel, tunnelBuffer);
final ByteBuf body = Unpooled.buffer();
serializeFlag(pmsiTunnelAttribute, body);
body.writeByte(tunnelType);
serializeMpls(pmsiTunnelAttribute.getMplsLabel(), body);
body.writeBytes(tunnelBuffer);
AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL | AttributeUtil.TRANSITIVE, getType(), body, byteAggregator);
}
Aggregations