import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.ovsdb.openstack.netvirt.api.MdsalConsumer;
+import org.opendaylight.ovsdb.openstack.netvirt.api.MdsalConsumerListener;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.ovsdb.schema.openvswitch.OpenVSwitch;
import java.util.concurrent.ConcurrentMap;
public class SouthboundHandler extends AbstractHandler
- implements NodeCacheListener, OvsdbInventoryListener {
+ implements NodeCacheListener, /*OvsdbInventoryListener,*/ MdsalConsumerListener {
static final Logger logger = LoggerFactory.getLogger(SouthboundHandler.class);
//private Thread eventThread;
private volatile BridgeConfigurationManager bridgeConfigurationManager;
private volatile TenantNetworkManager tenantNetworkManager;
private volatile NetworkingProviderManager networkingProviderManager;
- private volatile OvsdbConfigurationService ovsdbConfigurationService;
- private volatile OvsdbConnectionService connectionService;
+ //private volatile OvsdbConfigurationService ovsdbConfigurationService;
+ //private volatile OvsdbConnectionService connectionService;
+ private volatile MdsalConsumer mdsalConsumer; // TODO SB_MIGRATION
private volatile NeutronL3Adapter neutronL3Adapter;
void init() {
+ logger.info(">>>>> init");
}
void start() {
- this.triggerUpdates();
+ logger.info(">>>>> started");
+ this.triggerUpdates(); // TODO SB_MIGRATION
}
@Override
- public void nodeAdded(Node node, InetAddress address, int port) {
+ public void ovsdbNodeAdded(Node node) {
logger.info("nodeAdded: {}", node);
this.enqueueEvent(new SouthboundEvent(node, Action.ADD));
}
@Override
- public void nodeRemoved(Node node) {
+ public void ovsdbNodeRemoved(Node node) {
this.enqueueEvent(new SouthboundEvent(node, Action.DELETE));
}
*/
private boolean isUpdateOfInterest(Node node, Row oldRow, Row newRow) {
+ /* TODO SB_MIGRATION
if (oldRow == null) return true;
if (newRow.getTableSchema().getName().equals(ovsdbConfigurationService.getTableName(node, Interface.class))) {
// We are NOT interested in Stats only updates
} else if (newRow.getTableSchema().getName().equals(ovsdbConfigurationService.getTableName(node, OpenVSwitch.class))) {
OpenVSwitch oldOpenvSwitch = ovsdbConfigurationService.getTypedRow(node, OpenVSwitch.class, oldRow);
if (oldOpenvSwitch.getOtherConfigColumn()== null) {
- /* we are only interested in other_config field change */
+ *//* we are only interested in other_config field change *//*
return false;
}
- }
+ }*/
return true;
}
private void processRowUpdate(Node node, String tableName, String uuid, Row row,
Object context, Action action) {
+ /* TODO SB_MIGRATION
if (action == Action.DELETE) {
if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Interface.class))) {
logger.debug("Processing update of {}. Deleted node: {}, uuid: {}, row: {}", tableName, node, uuid, row);
if (deletedIntf.getTypeColumn().getData().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VXLAN) ||
deletedIntf.getTypeColumn().getData().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_GRE) ||
phyIfName.contains(deletedIntf.getName())) {
- /* delete tunnel interfaces or physical interfaces */
+ *//* delete tunnel interfaces or physical interfaces *//*
this.handleInterfaceDelete(node, uuid, deletedIntf, false, null);
} else if (network != null && !network.getRouterExternal()) {
logger.debug("Processing update of {}:{} node {} intf {} network {}",
networkingProvider.notifyFlowCapableNodeEvent(StringConvertor.dpidStringToLong(dpid), action);
}
}
- }
+ }*/
}
private void handleInterfaceUpdate (Node node, String uuid, Interface intf) {
}
private String getPortIdForInterface (Node node, String uuid, Interface intf) {
+ /* TODO SB_MIGRATION
try {
Map<String, Row> ports = this.ovsdbConfigurationService.getRows(node, ovsdbConfigurationService.getTableName(node, Port.class));
if (ports == null) return null;
}
} catch (Exception e) {
logger.debug("Failed to get Port tag for for Intf " + intf, e);
- }
+ }*/
return null;
}
private void triggerUpdates() {
+ /* TODO SB_MIGRATION
List<Node> nodes = connectionService.getNodes();
if (nodes == null) return;
for (Node node : nodes) {
} catch (Exception e) {
logger.error("Exception during OVSDB Southbound update trigger", e);
}
- }
+ }*/
}
/**