use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.extended.community.extended.community.inet4.specific.extended.community._case.Inet4SpecificExtendedCommunity in project bgpcep by opendaylight.
the class Ipv4SpecificEcHandler method serializeExtendedCommunity.
@Override
public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
checkArgument(extendedCommunity instanceof Inet4SpecificExtendedCommunityCase, "The extended community %s is not Inet4SpecificExtendedCommunityCase type.", extendedCommunity);
final Inet4SpecificExtendedCommunity inet4SpecificExtendedCommunity = ((Inet4SpecificExtendedCommunityCase) extendedCommunity).getInet4SpecificExtendedCommunity();
final Inet4SpecificExtendedCommunityCommon common = inet4SpecificExtendedCommunity.getInet4SpecificExtendedCommunityCommon();
if (common != null) {
serializeCommon(inet4SpecificExtendedCommunity.getInet4SpecificExtendedCommunityCommon(), byteAggregator);
} else {
Ipv4Util.writeIpv4Address(inet4SpecificExtendedCommunity.getGlobalAdministrator(), byteAggregator);
byteAggregator.writeBytes(inet4SpecificExtendedCommunity.getLocalAdministrator());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.extended.community.extended.community.inet4.specific.extended.community._case.Inet4SpecificExtendedCommunity in project bgpcep by opendaylight.
the class VrfRouteImportHandler method serializeExtendedCommunity.
@Override
public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
Preconditions.checkArgument(extendedCommunity instanceof VrfRouteImportExtendedCommunityCase, "The extended community %s is not VrfRouteImportExtendedCommunityCase type.", extendedCommunity);
final VrfRouteImportExtendedCommunity inet4SpecificExtendedCommunity = ((VrfRouteImportExtendedCommunityCase) extendedCommunity).getVrfRouteImportExtendedCommunity();
serializeCommon(inet4SpecificExtendedCommunity.getInet4SpecificExtendedCommunityCommon(), byteAggregator);
}
Aggregations