import org.opendaylight.openflowplugin.openflow.md.core.extension.ExtensionConverterManagerImpl;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFRoleManager;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
+import org.opendaylight.openflowplugin.openflow.md.core.role.OfEntityManager;
import org.opendaylight.openflowplugin.statistics.MessageSpyCounterImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.common.config.impl.rev140326.OfpRole;
import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private OfpRole role;
private OFRoleManager roleManager;
+ private OfEntityManager entManager;
private DataBroker dataBroker;
private NotificationProviderService notificationService;
private RpcProviderRegistry rpcRegistry;
+ private EntityOwnershipService entityOwnershipService;
/**
* Initialization of services and msgSpy counter
messageCountProvider = new MessageSpyCounterImpl();
extensionConverterManager = new ExtensionConverterManagerImpl();
roleManager = new OFRoleManager(OFSessionUtil.getSessionManager());
+ entManager = new OfEntityManager(entityOwnershipService);
+ entManager.setDataBroker(dataBroker);
LOG.debug("dependencies gathered..");
registrationManager = new SalRegistrationManager();
registrationManager.setDataService(dataBroker);
registrationManager.setPublishService(notificationService);
registrationManager.setRpcProviderRegistry(rpcRegistry);
+ registrationManager.setOfEntityManager(entManager);
registrationManager.init();
mdController = new MDController();
}
/**
- * @param switchConnectionProvider
+ * @param switchConnectionProvider switch connection provider
*/
public void setSwitchConnectionProviders(Collection<SwitchConnectionProvider> switchConnectionProvider) {
this.switchConnectionProviders = switchConnectionProvider;
}
/**
- * @param newRole
+ * @param newRole new controller role
*/
public void fireRoleChange(OfpRole newRole) {
if (!role.equals(newRole)) {
- LOG.debug("my role was chaged from {} to {}", role, newRole);
+ LOG.debug("Controller role was changed from {} to {}", role, newRole);
role = newRole;
switch (role) {
case BECOMEMASTER:
this.rpcRegistry = rpcRegistry;
}
+ public void setEntityOwnershipService(EntityOwnershipService entityOwnershipService) {
+ this.entityOwnershipService = entityOwnershipService;
+ }
+
@VisibleForTesting
protected RpcProviderRegistry getRpcRegistry() {
return rpcRegistry;