@Override
public ListenableFuture<Void> apply(Optional<BridgeDomain> optBridgeDomainConf) throws Exception {
if (optBridgeDomainConf.isPresent() && optBridgeDomainConf.get().getPhysicalLocationRef() != null) {
for (PhysicalLocationRef ref : optBridgeDomainConf.get().getPhysicalLocationRef()) {
if (!ref.getNodeId().equals(vppNodeId)) continue;
if (ref.getInterface() != null && ref.getInterface().size() > 0) {
NodeVbridgeVlanAugment vppNodeVlanAug = new NodeVbridgeVlanAugmentBuilder()
.setSuperInterface(ref.getInterface().get(0)).build();
Node vppNode = createBasicVppNodeBuilder(vppNodeId)
.addAugmentation(NodeVbridgeVlanAugment.class, vppNodeVlanAug).build();
return createBridgeDomainOnVppNode(bridgeDomainName, topoAug, vppNode);
}
}
}
return Futures.immediateFailedFuture(
new Throwable("Failed to apply config for VLAN bridge domain " + bridgeDomainName));
}
});