private HwvtepDataChangeListener hwvtepDTListener;
public HwvtepSouthboundProvider(
- EntityOwnershipService entityOwnershipServiceDependency) {
+ EntityOwnershipService entityOwnershipServiceDependency,
+ OvsdbConnection ovsdbConnection) {
this.entityOwnershipService = entityOwnershipServiceDependency;
registration = null;
+ this.ovsdbConnection = ovsdbConnection;
+ LOG.info("HwvtepSouthboundProvider ovsdbConnectionService: {}", ovsdbConnection);
}
@Override
if (ownershipStateOpt.isPresent()) {
EntityOwnershipState ownershipState = ownershipStateOpt.get();
if (ownershipState.hasOwner() && !ownershipState.isOwner()) {
- if (ovsdbConnection == null) {
- ovsdbConnection = new OvsdbConnectionService();
- ovsdbConnection.registerConnectionListener(cm);
- ovsdbConnection.startOvsdbManager(HwvtepSouthboundConstants.DEFAULT_OVSDB_PORT);
- }
+ ovsdbConnection.registerConnectionListener(cm);
+ ovsdbConnection.startOvsdbManager(HwvtepSouthboundConstants.DEFAULT_OVSDB_PORT);
}
}
} catch (CandidateAlreadyRegisteredException e) {
} else {
LOG.info("*This* instance of HWVTEP southbound provider is set as a SLAVE instance");
}
- //TODO: How to make this co-exist with OvsdbSouthbound?
- if (ovsdbConnection == null) {
- ovsdbConnection = new OvsdbConnectionService();
- ovsdbConnection.registerConnectionListener(cm);
- ovsdbConnection.startOvsdbManager(HwvtepSouthboundConstants.DEFAULT_OVSDB_PORT);
- }
+ ovsdbConnection.registerConnectionListener(cm);
+ ovsdbConnection.startOvsdbManager(HwvtepSouthboundConstants.DEFAULT_OVSDB_PORT);
}
private class HwvtepsbPluginInstanceEntityOwnershipListener implements EntityOwnershipListener {