import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.groupbasedpolicy.neutron.mapper.util.IidFactory;
+import org.opendaylight.groupbasedpolicy.neutron.gbp.util.NeutronGbpIidFactory;
import org.opendaylight.groupbasedpolicy.neutron.mapper.util.Utils;
import org.opendaylight.groupbasedpolicy.util.DataStoreHelper;
import org.opendaylight.neutron.spi.INeutronFloatingIPAware;
if ((!oldFixedIPAddress.isEmpty() && newFixedIPAddress.isEmpty())
|| (!oldPortUUID.isEmpty() && newPortUUID.isEmpty())) {
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.internalPortByFloatingIpPortIid(floatingIpPortId), rwTx);
+ NeutronGbpIidFactory.internalPortByFloatingIpPortIid(floatingIpPortId), rwTx);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.floatingIpPortByInternalPortIid(new UniqueId(oldPortUUID)), rwTx);
+ NeutronGbpIidFactory.floatingIpPortByInternalPortIid(new UniqueId(oldPortUUID)), rwTx);
// TODO unregister EP representing floating ip port
} else if (!newFixedIPAddress.isEmpty() && !newPortUUID.isEmpty()) {
// workaround for https://bugs.opendaylight.org/show_bug.cgi?id=3368
.setInternalPortId(internalPortId)
.setInternalPortIpAddress(Utils.createIpAddress(newFixedIPAddress))
.build();
- rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.internalPortByFloatingIpPortIid(floatingIpPortId),
+ rwTx.put(LogicalDatastoreType.OPERATIONAL, NeutronGbpIidFactory.internalPortByFloatingIpPortIid(floatingIpPortId),
internalPortByFloatingIpPort, true);
- rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.floatingIpPortByInternalPortIid(internalPortId),
+ rwTx.put(LogicalDatastoreType.OPERATIONAL, NeutronGbpIidFactory.floatingIpPortByInternalPortIid(internalPortId),
new FloatingIpPortByInternalPortBuilder(internalPortByFloatingIpPort).build(), true);
}
boolean isSubmitToDsSuccessful = DataStoreHelper.submitToDs(rwTx);
} else if (isFloatingIpPort(port)) {
LOG.trace("Adding FloatingIpPort-Endpoint mapping for port {} and endpoint {}", port.getID(), epKey);
EndpointByFloatingIpPort endpointByPort = MappingFactory.createEndpointByFloatingIpPort(epKey, portId);
- rwTx.put(LogicalDatastoreType.OPERATIONAL, IidFactory.endpointByFloatingIpPortIid(portId),
+ rwTx.put(LogicalDatastoreType.OPERATIONAL, NeutronGbpIidFactory.endpointByFloatingIpPortIid(portId),
endpointByPort, true);
FloatingIpPortByEndpoint portByEndpoint = MappingFactory.createFloatingIpPortByEndpoint(portId, epKey);
rwTx.put(LogicalDatastoreType.OPERATIONAL,
- IidFactory.floatingIpPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()),
+ NeutronGbpIidFactory.floatingIpPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()),
portByEndpoint, true);
} else {
LOG.trace("Adding Port-Endpoint mapping for port {} (device owner {}) and endpoint {}", port.getID(),
if (isRouterInterfacePort(port)) {
LOG.trace("Adding RouterInterfacePort-Endpoint mapping for port {} and endpoint {}", port.getID(), epKey);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.endpointByRouterInterfacePortIid(portId), rwTx);
+ NeutronGbpIidFactory.endpointByRouterInterfacePortIid(portId), rwTx);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.routerInterfacePortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
+ NeutronGbpIidFactory.routerInterfacePortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
} else if (isRouterGatewayPort(port)) {
LOG.trace("Adding RouterGatewayPort-Endpoint mapping for port {} and endpoint {}", port.getID(), epKey);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.endpointByRouterGatewayPortIid(portId), rwTx);
+ NeutronGbpIidFactory.endpointByRouterGatewayPortIid(portId), rwTx);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.routerGatewayPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
+ NeutronGbpIidFactory.routerGatewayPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
} else if (isFloatingIpPort(port)) {
LOG.trace("Adding FloatingIpPort-Endpoint mapping for port {} and endpoint {}", port.getID(), epKey);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.endpointByFloatingIpPortIid(portId), rwTx);
+ NeutronGbpIidFactory.endpointByFloatingIpPortIid(portId), rwTx);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.floatingIpPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
+ NeutronGbpIidFactory.floatingIpPortByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
} else {
LOG.trace("Adding Port-Endpoint mapping for port {} (device owner {}) and endpoint {}", port.getID(),
port.getDeviceOwner(), epKey);
- DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL, IidFactory.endpointByPortIid(portId), rwTx);
+ DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL, NeutronGbpIidFactory.endpointByPortIid(portId), rwTx);
DataStoreHelper.removeIfExists(LogicalDatastoreType.OPERATIONAL,
- IidFactory.portByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
+ NeutronGbpIidFactory.portByEndpointIid(epKey.getL2Context(), epKey.getMacAddress()), rwTx);
}
}