use of org.opendaylight.protocol.bgp.linkstate.spi.NlriTypeCaseSerializer in project bgpcep by opendaylight.
the class SimpleNlriTypeRegistry method serializeNlriType.
public void serializeNlriType(final CLinkstateDestination nlri, final ByteBuf byteAggregator) {
if (nlri == null) {
return;
}
requireNonNull(byteAggregator);
final ObjectType objectType = nlri.getObjectType();
final NlriTypeCaseSerializer serializer = this.nlriRegistry.getSerializer((Class<? extends ObjectType>) objectType.getImplementedInterface());
if (serializer == null) {
LOG.warn("Linkstate NLRI serializer for Type: {} was not found.", objectType.getImplementedInterface());
return;
}
final ByteBuf nlriType = Unpooled.buffer();
serializer.serializeTypeNlri(nlri, nlriType);
TlvUtil.writeTLV(serializer.getNlriType(), nlriType, byteAggregator);
}
Aggregations