use of org.opendaylight.protocol.bgp.evpn.spi.EsiSerializer in project bgpcep by opendaylight.
the class SimpleEsiTypeRegistry method parseEsiModel.
@Override
public Esi parseEsiModel(final ChoiceNode esiChoice) {
Preconditions.checkArgument(esiChoice != null && !esiChoice.getValue().isEmpty(), "ESI is mandatory. Can't be null or empty.");
final ContainerNode cont = (ContainerNode) Iterables.getOnlyElement(esiChoice.getValue());
final EsiSerializer serializer = this.modelHandlers.get(cont.getIdentifier());
if (serializer != null) {
return serializer.serializeEsi(cont);
}
LOG.warn("Unrecognized ESI {}", esiChoice);
return null;
}
use of org.opendaylight.protocol.bgp.evpn.spi.EsiSerializer in project bgpcep by opendaylight.
the class SimpleEsiTypeRegistry method serializeEsi.
@Override
public void serializeEsi(final Esi esi, final ByteBuf buffer) {
final EsiSerializer serializer = this.handlers.getSerializer(esi.getImplementedInterface());
if (serializer == null) {
return;
}
serializer.serializeEsi(esi, buffer);
}
Aggregations