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 handleNeutronPortCreated(Port port) {
if (!NeutronUtils.isPortVnicTypeNormal(port)) {
+ nvpnManager.updateSubnetmapNodeWithPorts(port.getFixedIps().get(0).getSubnetId(), null, port.getUuid());
LOG.info("Port {} is not a NORMAL VNIC Type port; OF Port interfaces are not created",
port.getUuid().getValue());
return;
}
private void handleNeutronPortDeleted(Port port) {
+ if (!NeutronUtils.isPortVnicTypeNormal(port)) {
+ nvpnManager.removePortsFromSubnetmapNode(port.getFixedIps().get(0).getSubnetId(), null, port.getUuid());
+ LOG.info("Port {} is not a NORMAL VNIC Type port; OF Port interfaces are not created",
+ port.getUuid().getValue());
+ return;
+ }
//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);
LOG.debug("fixedIp-name map for neutron port with fixedIp: {}, name: {} added to NeutronPortData DS",
ipValue, infName);
subnetId = ip.getSubnetId();
- subnetmap = nvpnManager.updateSubnetNode(subnetId, null, null, null, null, null, port.getUuid());
+ subnetmap = nvpnManager.updateSubnetmapNodeWithPorts(subnetId, port.getUuid(), null);
if (subnetmap != null) {
vpnId = subnetmap.getVpnId();
}
MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, id);
LOG.debug("fixedIp-name map for neutron port with fixedIp: {} deleted from NeutronPortData DS", ipValue);
subnetId = ip.getSubnetId();
- subnetmap = nvpnManager.removeFromSubnetNode(subnetId, null, null, null, port.getUuid());
+ subnetmap = nvpnManager.removePortsFromSubnetmapNode(subnetId, port.getUuid(), null);
if (subnetmap != null) {
vpnId = subnetmap.getVpnId();
}