routerPort.getUuid().getValue(), vpnId.getValue());
}
nvpnManager.addToNeutronRouterInterfacesMap(routerId, routerPort.getUuid().getValue());
- nvpnNatManager.handleSubnetsForExternalRouter(routerId);
+ jobCoordinator.enqueueJob(routerId.toString(), () -> {
+ nvpnNatManager.handleSubnetsForExternalRouter(routerId);
+ return Collections.emptyList();
+ });
ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
confTx -> {
String portInterfaceName = createOfPortInterface(routerPort, confTx);
nvpnManager.removeFromNeutronRouterInterfacesMap(routerId, routerPort.getUuid().getValue());
deleteElanInterface(routerPort.getUuid().getValue(), confTx);
deleteOfPortInterface(routerPort, confTx);
- nvpnNatManager.handleSubnetsForExternalRouter(routerId);
+ jobCoordinator.enqueueJob(routerId.toString(), () -> {
+ nvpnNatManager.handleSubnetsForExternalRouter(routerId);
+ return Collections.emptyList();
+ });
if (vpnInstanceIpVersionRemoved) {
neutronvpnUtils.updateVpnInstanceWithIpFamily(vpnId.getValue(), vpnInstanceIpVersionToRemove,
false);
private void setupGwMac(Router router, Port routerGwPort, Uuid routerId) {
gwMacResolver.sendArpRequestsToExtGateways(router);
- setExternalGwMac(routerGwPort, routerId);
-
+ jobCoordinator.enqueueJob(routerId.toString(), () -> {
+ setExternalGwMac(routerGwPort, routerId);
+ return Collections.emptyList();
+ });
}
private void setExternalGwMac(Port routerGwPort, Uuid routerId) {
import com.google.common.base.Optional;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import javax.annotation.PostConstruct;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase;
import org.opendaylight.genius.mdsalutil.NwConstants;
+import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
private final NeutronvpnNatManager nvpnNatManager;
private final NeutronSubnetGwMacResolver gwMacResolver;
private final NeutronvpnUtils neutronvpnUtils;
+ private final JobCoordinator jobCoordinator;
@Inject
public NeutronRouterChangeListener(final DataBroker dataBroker, final NeutronvpnManager neutronvpnManager,
final NeutronvpnNatManager neutronvpnNatManager,
final NeutronSubnetGwMacResolver gwMacResolver,
- final NeutronvpnUtils neutronvpnUtils) {
+ final NeutronvpnUtils neutronvpnUtils,
+ final JobCoordinator jobCoordinator) {
super(Router.class, NeutronRouterChangeListener.class);
this.dataBroker = dataBroker;
nvpnManager = neutronvpnManager;
nvpnNatManager = neutronvpnNatManager;
this.gwMacResolver = gwMacResolver;
this.neutronvpnUtils = neutronvpnUtils;
+ this.jobCoordinator = jobCoordinator;
}
@Override
neutronvpnUtils.addToRouterCache(input);
// Create internal VPN
nvpnManager.createL3InternalVpn(input.getUuid(), null, null, null, null, null, input.getUuid(), null);
- nvpnNatManager.handleExternalNetworkForRouter(null, input);
+ jobCoordinator.enqueueJob(input.getUuid().toString(), () -> {
+ nvpnNatManager.handleExternalNetworkForRouter(null, input);
+ return Collections.emptyList();
+ });
gwMacResolver.sendArpRequestsToExtGateways(input);
}
if (input.getExternalGatewayInfo() != null) {
Uuid extNetId = input.getExternalGatewayInfo().getExternalNetworkId();
List<ExternalFixedIps> externalFixedIps = input.getExternalGatewayInfo().getExternalFixedIps();
- nvpnNatManager.removeExternalNetworkFromRouter(extNetId, input, externalFixedIps);
+ jobCoordinator.enqueueJob(input.getUuid().toString(), () -> {
+ nvpnNatManager.removeExternalNetworkFromRouter(extNetId, input, externalFixedIps);
+ return Collections.emptyList();
+ });
}
//NOTE: Pass an empty routerSubnetIds list, as router interfaces
//will be removed from VPN by invocations from NeutronPortChangeListener
handleChangedRoutes(vpnId, newRoutes, NwConstants.ADD_FLOW);
}
- nvpnNatManager.handleExternalNetworkForRouter(original, update);
+ jobCoordinator.enqueueJob(update.getUuid().toString(), () -> {
+ nvpnNatManager.handleExternalNetworkForRouter(original, update);
+ return Collections.emptyList();
+ });
gwMacResolver.sendArpRequestsToExtGateways(update);
}