import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.ovsdb.openstack.netvirt.api.MdsalConsumer;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.plugin.api.StatusCode;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
+import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
+import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile ConfigurationService configurationService;
private volatile NetworkingProviderManager networkingProviderManager;
- private volatile OvsdbConfigurationService ovsdbConfigurationService;
+ //private volatile OvsdbConfigurationService ovsdbConfigurationService;
+ private volatile MdsalConsumer mdsalConsumer;
public BridgeConfigurationManagerImpl() {
}
@Override
public String getBridgeUuid(Node node, String bridgeName) {
- Preconditions.checkNotNull(ovsdbConfigurationService);
+ Preconditions.checkNotNull(mdsalConsumer);
+ /*
+ return mdsalConsumer.getBridgeUUID(bridgeName);
try {
Map<String, Row> bridgeTable =
ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, Bridge.class));
}
} catch (Exception e) {
LOGGER.error("Error getting Bridge Identifier for {} / {}", node, bridgeName, e);
- }
+ }*/
return null;
}
@Override
public boolean isNodeOverlayReady(Node node) {
+ /* TODO SB_MIGRATION
Preconditions.checkNotNull(ovsdbConfigurationService);
return this.isNodeNeutronReady(node)
&& this.getBridgeUuid(node, configurationService.getNetworkBridgeName()) != null;
+ */
+ return false;
}
@Override
public boolean isPortOnBridge (Node node, Bridge bridge, String portName) {
+ /* TODO SB_MIGRATION
Preconditions.checkNotNull(ovsdbConfigurationService);
for (UUID portsUUID : bridge.getPortsColumn().getData()) {
try {
LOGGER.error("Error getting port {} for bridge domain {}/{}", portsUUID, node, bridge.getName(), e);
}
}
-
+ */
return false;
}
@Override
public boolean isNodeVlanReady(Node node, NeutronNetwork network) {
- Preconditions.checkNotNull(ovsdbConfigurationService);
+ /* TODO SB_MIGRATION */
+ //Preconditions.checkNotNull(ovsdbConfigurationService);
Preconditions.checkNotNull(networkingProviderManager);
/* is br-int created */
@Override
public String getPhysicalInterfaceName (Node node, String physicalNetwork) {
String phyIf = null;
+ /* TODO SB_MIGRATION
try {
Map<String, Row> ovsTable =
ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, OpenVSwitch.class));
LOGGER.error("Physical interface not found for Node: {}, Network {}",
node, physicalNetwork);
}
-
+*/
return phyIf;
}
@Override
public List<String> getAllPhysicalInterfaceNames(Node node) {
List<String> phyIfName = Lists.newArrayList();
-
+ /* TODO SB_MIGRATION
try {
Map<String, Row> ovsTable =
ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, OpenVSwitch.class));
LOGGER.debug("Physical interface for Node: {}, If: {}",
node, phyIfName);
-
+ */
return phyIfName;
}
* Returns the Bridge for a given node and bridgeName
*/
public Bridge getBridge (Node node, String bridgeName) {
+ /* TODO SB_MIGRATION
Preconditions.checkNotNull(ovsdbConfigurationService);
try {
Map<String, Row> bridgeTable =
} catch (Exception e) {
LOGGER.error("Error getting Bridge Identifier for {} / {}", node, bridgeName, e);
}
+ */
return null;
}
* Add a Port to a Bridge
*/
private Status addPortToBridge (Node node, String bridgeName, String portName) throws Exception {
+ /* TODO SB_MIGRATION
Preconditions.checkNotNull(ovsdbConfigurationService);
LOGGER.debug("addPortToBridge: Adding port: {} to Bridge {}, Node {}", portName, bridgeName, node);
return new Status(StatusCode.NOTFOUND, "Could not find "+bridgeName+" in "+node);
}
- /* Check if the port already exists. */
- Row row = ovsdbConfigurationService
+ *//* Check if the port already exists. */
+ /*Row row = ovsdbConfigurationService
.getRow(node, ovsdbConfigurationService.getTableName(node, Bridge.class), bridgeUUID);
Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, row);
if (bridge != null) {
LOGGER.error("addPortToBridge: Cannot identify Interface for port {}/{}", portName, portUUID);
return new Status(StatusCode.INTERNALERROR);
}
-
+*/
return new Status(StatusCode.SUCCESS);
}
* Add a Patch Port to a Bridge
*/
private Status addPatchPort (Node node, String bridgeUUID, String portName, String peerPortName) throws Exception {
+ return new Status(StatusCode.SUCCESS);
+ /* TODO SB_MIGRATION
Preconditions.checkNotNull(ovsdbConfigurationService);
LOGGER.debug("addPatchPort: node: {}, bridgeUUID: {}, port: {}, peer: {}",
node, bridgeUUID, portName, peerPortName);
- /* Check if the port already exists. */
+ *//* Check if the port already exists. *//*
Row bridgeRow = ovsdbConfigurationService.getRow(node,
ovsdbConfigurationService.getTableName(node, Bridge.class), bridgeUUID);
Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, bridgeRow);
patchPortUUID,
interfaceUUID,
intf.getRow());
+ */
}
/**
*/
private Status addBridge(Node node, String bridgeName,
String localPatchName, String remotePatchName) throws Exception {
- Preconditions.checkNotNull(ovsdbConfigurationService);
+ /*Preconditions.checkNotNull(mdsalConsumer);
Preconditions.checkNotNull(networkingProviderManager);
- String bridgeUUID = this.getBridgeUuid(node, bridgeName);
+ String bridgeUUID = getBridgeUuid(node, bridgeName);
Bridge bridge = ovsdbConfigurationService.createTypedRow(node, Bridge.class);
Set<String> failMode = new HashSet<>();
failMode.add("secure");
Set<String> protocols = new HashSet<>();
- /* ToDo: Plugin should expose an easy way to get the OVS Version or Schema Version
+ *//* ToDo: Plugin should expose an easy way to get the OVS Version or Schema Version
* or, alternatively it should not attempt to add set unsupported fields
- */
+ *//*
try {
protocols.add(Constants.OPENFLOW13);
remotePatchName != null &&
networkingProviderManager.getProvider(node).hasPerTenantTunneling()) {
return addPatchPort(node, bridgeUUID, localPatchName, remotePatchName);
- }
+ }*/
return new Status(StatusCode.SUCCESS);
}