DeviceState changes
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.java
index 0283bcef393b9331060d07dce192ed85a69a2839..0e199c26f8adb591e564a9982342c4241b72d6ba 100644 (file)
@@ -9,38 +9,43 @@
 package org.opendaylight.openflowplugin.api.openflow.device;
 
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializator;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
 
 /**
  * This interface is responsible for instantiating DeviceContext and
  * registering transaction chain for each DeviceContext. Each device
  * has its own device context managed by this manager.
- * <p>
  * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
-public interface DeviceManager extends DeviceConnectedHandler,
-        TranslatorLibrarian,
-        DeviceInitializator,
-        DeviceInitializationPhaseHandler, DeviceContextClosedHandler {
+public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor,
+        DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable {
 
     /**
-     * Sets notification receiving service
-     * @param notificationService
+     * Sets notification publish service
+     *
+     * @param notificationPublishService
      */
-    void setNotificationService(NotificationService notificationService);
+    void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
     /**
-     * Sets notification publish service
-     * @param notificationPublishService
+     * invoked after all services injected
+     */
+    void initialize();
+
+    /**
+     * Returning device context from map maintained in device manager
+     * This prevent to send whole device context to another context
+     * If device context not exists for nodeId it will return null
+     *
+     * @param deviceInfo@return device context or null
      */
-    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
+    DeviceContext getDeviceContextFromNodeId(DeviceInfo deviceInfo);
 
+    void setStatisticsRpcEnabled(boolean isStatisticsRpcEnabled);
 }