Search in sources :

Example 1 with RedirectExtendedCommunity

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.extended.community.RedirectExtendedCommunity in project bgpcep by opendaylight.

the class RedirectAsTwoOctetEcHandler method serializeExtendedCommunity.

@Override
public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
    Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.RedirectExtendedCommunity, "The extended community %s is not RedirectExtendedCommunityCase type.", extendedCommunity);
    final RedirectExtendedCommunity redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.RedirectExtendedCommunity) extendedCommunity).getRedirectExtendedCommunity();
    ByteBufWriteUtil.writeUnsignedShort(redirect.getGlobalAdministrator().getValue().intValue(), byteAggregator);
    byteAggregator.writeBytes(redirect.getLocalAdministrator());
}
Also used : Preconditions(com.google.common.base.Preconditions) RedirectExtendedCommunity(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.extended.community.RedirectExtendedCommunity)

Aggregations

Preconditions (com.google.common.base.Preconditions)1 RedirectExtendedCommunity (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.extended.community.RedirectExtendedCommunity)1