*/
package org.opendaylight.ovsdb.openstack.netvirt.impl;
-import org.opendaylight.controller.networkconfig.neutron.INeutronNetworkCRUD;
-import org.opendaylight.controller.networkconfig.neutron.INeutronPortCRUD;
-import org.opendaylight.controller.networkconfig.neutron.NeutronNetwork;
-import org.opendaylight.controller.networkconfig.neutron.NeutronPort;
-import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.neutron.spi.INeutronNetworkCRUD;
+import org.opendaylight.neutron.spi.INeutronPortCRUD;
+import org.opendaylight.neutron.spi.NeutronNetwork;
+import org.opendaylight.neutron.spi.NeutronPort;
import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
-import org.opendaylight.ovsdb.plugin.IConnectionServiceInternal;
-import org.opendaylight.ovsdb.plugin.OvsdbConfigService;
+import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
+import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.ovsdb.schema.openvswitch.Port;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import com.google.common.base.Preconditions;
import org.slf4j.Logger;
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile NetworkingProviderManager networkingProviderManager;
- private volatile OvsdbConfigService ovsdbConfigService;
- private volatile IConnectionServiceInternal connectionService;
+ private volatile OvsdbConfigurationService ovsdbConfigurationService;
+ private volatile OvsdbConnectionService connectionService;
private volatile INeutronNetworkCRUD neutronNetworkCache;
private volatile INeutronPortCRUD neutronPortCache;
private volatile VlanConfigurationCache vlanConfigurationCache;
public void reclaimInternalVlan(Node node, String portUUID, NeutronNetwork network) {
int vlan = vlanConfigurationCache.reclaimInternalVlan(node, network.getID());
if (vlan <= 0) {
- logger.error("Unable to get an internalVlan for Network {}", network);
+ logger.debug("Unable to get an internalVlan for Network {}", network);
return;
}
logger.debug("Removed Vlan {} on {}", vlan, portUUID);
@Override
public void programInternalVlan(Node node, String portUUID, NeutronNetwork network) {
- Preconditions.checkNotNull(ovsdbConfigService);
+ Preconditions.checkNotNull(ovsdbConfigurationService);
int vlan = vlanConfigurationCache.getInternalVlan(node, network.getID());
logger.debug("Programming Vlan {} on {}", vlan, portUUID);
if (vlan <= 0) {
- logger.error("Unable to get an internalVlan for Network {}", network);
+ logger.debug("Unable to get an internalVlan for Network {}", network);
return;
}
- Port port = ovsdbConfigService.createTypedRow(node, Port.class);
+ Port port = ovsdbConfigurationService.createTypedRow(node, Port.class);
OvsdbSet<Long> tags = new OvsdbSet<>();
tags.add((long) vlan);
port.setTag(tags);
- ovsdbConfigService.updateRow(node, port.getSchema().getName(), null, portUUID, port.getRow());
+ ovsdbConfigurationService.updateRow(node, port.getSchema().getName(), null, portUUID, port.getRow());
}
@Override
public boolean isTenantNetworkPresentInNode(Node node, String segmentationId) {
- Preconditions.checkNotNull(ovsdbConfigService);
+ Preconditions.checkNotNull(ovsdbConfigurationService);
String networkId = this.getNetworkId(segmentationId);
if (networkId == null) {
}
*/
// External-id based more accurate VM Location identification
- Map<String, Row> ifTable = ovsdbConfigService.getRows(node, ovsdbConfigService.getTableName(node, Interface.class));
+ Map<String, Row> ifTable = ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, Interface.class));
if (ifTable == null) {
logger.debug("Interface table is null for Node {} ", node);
return false;
}
for (Row row : ifTable.values()) {
- Interface intf = ovsdbConfigService.getTypedRow(node, Interface.class, row);
+ Interface intf = ovsdbConfigurationService.getTypedRow(node, Interface.class, row);
Map<String, String> externalIds = intf.getExternalIdsColumn().getData();
if (externalIds != null && externalIds.get(Constants.EXTERNAL_ID_INTERFACE_ID) != null) {
if (this.isInterfacePresentInTenantNetwork(externalIds.get(Constants.EXTERNAL_ID_INTERFACE_ID), networkId)) {