@Override public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) { Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object."); final Attributes pathAttributes = (Attributes) attribute; final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class); if (pathAttributes2 == null) { return; } final MpUnreachNlri mpUnreachNlri = pathAttributes2.getMpUnreachNlri(); final ByteBuf unreachBuffer = Unpooled.buffer(); this.reg.serializeMpUnReach(mpUnreachNlri, unreachBuffer); for (final NlriSerializer nlriSerializer : this.reg.getSerializers()){ nlriSerializer.serializeAttribute(attribute,unreachBuffer); } AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, TYPE, unreachBuffer, byteAggregator); } }
@Override public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) { Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object."); final Attributes pathAttributes = (Attributes) attribute; final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class); if (pathAttributes1 == null) { return; } final MpReachNlri mpReachNlri = pathAttributes1.getMpReachNlri(); final ByteBuf reachBuffer = Unpooled.buffer(); this.reg.serializeMpReach(mpReachNlri, reachBuffer); for (final NlriSerializer nlriSerializer : this.reg.getSerializers()) { nlriSerializer.serializeAttribute(attribute, reachBuffer); } AttributeUtil.formatAttribute(AttributeUtil.OPTIONAL, TYPE, reachBuffer, byteAggregator); } }