private LockManagerService lockManager;
private NotificationPublishService notificationPublishService;
private NotificationService notificationService;
- private NeutronFloatingToFixedIpMappingChangeListener floatingIpMapListener;
public NeutronPortChangeListener(final DataBroker db, NeutronvpnManager nVpnMgr,NeutronvpnNatManager nVpnNatMgr,
- NotificationPublishService notiPublishService, NotificationService notiService,
- NeutronFloatingToFixedIpMappingChangeListener neutronFloatingToFixedIpMappingChangeListener) {
+ NotificationPublishService notiPublishService, NotificationService notiService) {
super(Port.class);
broker = db;
nvpnManager = nVpnMgr;
nvpnNatManager = nVpnNatMgr;
notificationPublishService = notiPublishService;
notificationService = notiService;
- floatingIpMapListener = neutronFloatingToFixedIpMappingChangeListener;
registerListener(db);
}
private void handleNeutronPortDeleted(Port port) {
//dissociate fixedIP from floatingIP if associated
- floatingIpMapListener.dissociatefixedIPFromFloatingIP(port.getUuid().getValue());
+ nvpnManager.dissociatefixedIPFromFloatingIP(port.getUuid().getValue());
LOG.debug("Remove port from subnet");
// remove port from local Subnets DS
Uuid vpnId = removePortFromSubnets(port);
IMdsalApiManager mdsalUtil;
private NotificationPublishService notificationPublishService;
private NotificationService notificationService;
+ private NeutronFloatingToFixedIpMappingChangeListener floatingIpMapListener;
Boolean isExternalVpn;
/**
* @param mdsalManager - MDSAL Util API access
*/
public NeutronvpnManager(final DataBroker db, IMdsalApiManager mdsalManager,NotificationPublishService notiPublishService,
- NotificationService notiService, NeutronvpnNatManager vpnNatMgr) {
+ NotificationService notiService, NeutronvpnNatManager vpnNatMgr,
+ NeutronFloatingToFixedIpMappingChangeListener neutronFloatingToFixedIpMappingChangeListener) {
broker = db;
mdsalUtil = mdsalManager;
nvpnNatManager = vpnNatMgr;
notificationPublishService = notiPublishService;
notificationService = notiService;
+ floatingIpMapListener = neutronFloatingToFixedIpMappingChangeListener;
}
public void setLockManager(LockManagerService lockManager) {
}
}
+ protected void dissociatefixedIPFromFloatingIP(String fixedNeutronPortName) {
+ floatingIpMapListener.dissociatefixedIPFromFloatingIP(fixedNeutronPortName);
+ }
+
protected void associateRouterToInternalVpn(Uuid vpnId, Uuid routerId) {
List<Uuid> routerSubnets = NeutronvpnUtils.getNeutronRouterSubnetIds(broker, routerId);
logger.debug("Adding subnets to internal vpn {}", vpnId.getValue());
try {
final DataBroker dbx = session.getSALService(DataBroker.class);
nvNatManager = new NeutronvpnNatManager(dbx, mdsalManager);
+ floatingIpMapListener = new NeutronFloatingToFixedIpMappingChangeListener(dbx);
nvManager = new NeutronvpnManager(dbx, mdsalManager,notificationPublishService,notificationService,
- nvNatManager);
+ nvNatManager, floatingIpMapListener);
final BindingAwareBroker.RpcRegistration<NeutronvpnService> rpcRegistration =
getRpcProviderRegistry().addRpcImplementation(NeutronvpnService.class, nvManager);
bgpvpnListener = new NeutronBgpvpnChangeListener(dbx, nvManager);
networkListener = new NeutronNetworkChangeListener(dbx, nvManager, nvNatManager);
subnetListener = new NeutronSubnetChangeListener(dbx, nvManager);
routerListener = new NeutronRouterChangeListener(dbx, nvManager, nvNatManager);
- floatingIpMapListener = new NeutronFloatingToFixedIpMappingChangeListener(dbx);
portListener = new NeutronPortChangeListener(dbx, nvManager, nvNatManager,
- notificationPublishService,notificationService, floatingIpMapListener);
+ notificationPublishService,notificationService);
portListener.setLockManager(lockManager);
portListener.setLockManager(lockManager);
nvManager.setLockManager(lockManager);
thenReturn(Futures.immediateCheckedFuture(Optional.of(mockNetwork)));
neutronPortChangeListener = new NeutronPortChangeListener(dataBroker, nVpnMgr, nVpnNatMgr,
- notiPublishService, notiService, floatingIpMapListener);
+ notiPublishService, notiService);
}
@Test