DeviceState changes
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.java
index f68e98926f4b54a6e0be70dec42fcdc07518492d..0e199c26f8adb591e564a9982342c4241b72d6ba 100644 (file)
@@ -9,11 +9,11 @@
 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.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;
 
 /**
@@ -22,17 +22,8 @@ import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrari
  * has its own device context managed by this manager.
  * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
  */
-public interface DeviceManager extends DeviceConnectedHandler,
-        TranslatorLibrarian,
-        DeviceInitializator,
-        DeviceInitializationPhaseHandler, DeviceContextClosedHandler {
-
-    /**
-     * Sets notification receiving service
-     *
-     * @param notificationService
-     */
-    void setNotificationService(NotificationService notificationService);
+public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor,
+        DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable {
 
     /**
      * Sets notification publish service
@@ -45,5 +36,16 @@ public interface DeviceManager extends DeviceConnectedHandler,
      * 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
+     */
+    DeviceContext getDeviceContextFromNodeId(DeviceInfo deviceInfo);
+
+    void setStatisticsRpcEnabled(boolean isStatisticsRpcEnabled);
 }