Improve cleanup after device disconnected event
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / lifecycle / LifecycleService.java
index c3e35491c18f09acd05d25939715d2caf2cd24ea..931aaf0cc14fa79fecffb351706dc57ce3bd7b7f 100644 (file)
@@ -8,18 +8,19 @@
 
 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
 
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import javax.annotation.CheckForNull;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.openflowplugin.api.openflow.OFPContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.ClusterInitializationPhaseHandler;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.ClusterLifecycleSupervisor;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler;
 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext;
 
 /**
  * Service for starting or stopping all services in plugin in cluster
  */
-public interface LifecycleService extends ClusterSingletonService, AutoCloseable, ClusterLifecycleSupervisor, ClusterInitializationPhaseHandler {
+public interface LifecycleService extends ClusterSingletonService, OFPContext {
 
     /**
      * This method registers lifecycle service to the given provider
@@ -27,6 +28,13 @@ public interface LifecycleService extends ClusterSingletonService, AutoCloseable
      */
     void registerService(final ClusterSingletonServiceProvider singletonServiceProvider);
 
+    /**
+     * This method registers device removed handler what will be executed when device should be removed
+     * from managers,
+     * @param deviceRemovedHandler device removed handler
+     */
+    void registerDeviceRemovedHandler(final @CheckForNull DeviceRemovedHandler deviceRemovedHandler);
+
     /**
      * Setter for device context
      * @param deviceContext actual device context created per device