This was so we can use them conviently throughout the plugin.
Change-Id: I878780b84c6ecb57e352a419c3ef44b524a3e26b
Signed-off-by: Ed Warnicke <eaw@cisco.com>
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.openflowplugin.openflow.md.ModelDrivenSwitch;
import org.opendaylight.openflowplugin.openflow.md.SwitchInventory;
import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
private NotificationProviderService publishService;
+ private DataProviderService dataService;
+
public NotificationProviderService getPublishService() {
return publishService;
}
public void onSessionInitiated(ProviderContext session) {
this.providerContext = session;
this.publishService = session.getSALService(NotificationProviderService.class);
+ this.dataService = session.getSALService(DataProviderService.class);
// We register as listener for Session Manager
getSessionManager().registerSessionListener(this);
+ getSessionManager().setNotificationProviderService(publishService);
+ getSessionManager().setDataProviderService(dataService);
LOG.info("SalRegistrationManager initialized");
}
import java.util.Collection;
import java.util.Map;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
* @param translatorMapping
*/
public void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, DataObject>>> translatorMapping);
-
+
/**
* @return translator mapping
*/
public Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, DataObject>>> getTranslatorMapping();
+ /**
+ * @param notificationServiceProvider
+ */
+ public void setNotificationProviderService(NotificationProviderService notificationProviderService);
+
+ /**
+ * @return notificationServiceProvider
+ */
+ public DataProviderService getDataProviderService();
+
+ /**
+ * @param notificationServiceProvider
+ */
+ public void setDataProviderService(DataProviderService dataServiceProvider);
+
+ /**
+ * @return notificationServiceProvider
+ */
+ public NotificationProviderService getNotificationProviderService();
+
/**
* @param listener
* @return registration
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductor;
import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
private Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, DataObject>>> translatorMapping;
protected final ListenerRegistry<SessionListener> sessionListeners = new ListenerRegistry<>();
+ private NotificationProviderService notificationProviderService;
+
+ private DataProviderService dataProviderService;
/**
* @return singleton instance
return this.translatorMapping;
}
+ @Override
+ public void setNotificationProviderService(
+ NotificationProviderService notificationProviderService) {
+ this.notificationProviderService = notificationProviderService;
+
+ }
+
+ @Override
+ public DataProviderService getDataProviderService() {
+ return dataProviderService;
+ }
+
+ @Override
+ public void setDataProviderService(DataProviderService dataServiceProvider) {
+ this.dataProviderService = dataServiceProvider;
+
+ }
+
+ @Override
+ public NotificationProviderService getNotificationProviderService() {
+ return notificationProviderService;
+ }
+
}