Merge "Bug 6110: Fixed bugs in statistics manager due to race condition." into stable...
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.java
index db07c8f8f8562d96f2db8ed18325c0521a277025..d55908b211b78f750c94a31e1d91179cde40a882 100644 (file)
@@ -8,73 +8,42 @@
 
 package org.opendaylight.openflowplugin.api.openflow.device;
 
-import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.CheckedFuture;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
+import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
 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.DeviceLifecycleSupervisor;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
 
 /**
  * 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.
  */
-public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor,
-        DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable, OFPManager {
-
+public interface DeviceManager extends
+        OFPManager,
+        DeviceConnectedHandler,
+        DeviceDisconnectedHandler,
+        TranslatorLibrarian,
+        EntityOwnershipListener {
 
     /**
      * invoked after all services injected
      */
     void initialize();
 
-    /**
-     * Method has to activate (MASTER) or deactivate (SLAVE) TransactionChainManager.
-     * TransactionChainManager represents possibility to write or delete Node subtree data
-     * for actual Controller Cluster Node. We are able to have an active TxManager only if
-     * newRole is {@link OfpRole#BECOMESLAVE}.
-     * Parameters are used as marker to be sure it is change to SLAVE from MASTER or from
-     * MASTER to SLAVE and the last parameter "cleanDataStore" is used for validation only.
-     *
-     * @param deviceInfo which device
-     * @param role - NewRole expect to be {@link OfpRole#BECOMESLAVE} or {@link OfpRole#BECOMEMASTER}
-     * @return RoleChangeTxChainManager future for activation/deactivation
-     */
-    ListenableFuture<Void> onClusterRoleChange(final DeviceInfo deviceInfo, final OfpRole role);
+    void setFlowRemovedNotificationOn(boolean value);
 
-    /**
-     * Register device synchronize listeners
-     * @param deviceSynchronizeListener are notified if device is synchronized or not
-     */
-    void addDeviceSynchronizeListener(final DeviceSynchronizeListener deviceSynchronizeListener);
+    boolean isFlowRemovedNotificationOn();
 
-    /**
-     * Notify all registered listeners about synchronized status
-     * @param deviceInfo which device
-     * @param deviceSynchronized true if device is synchronized
-     */
-    void notifyDeviceSynchronizeListeners(final DeviceInfo deviceInfo, final boolean deviceSynchronized);
-
-    /**
-     * Register device valid listeners
-     * @param deviceValidListener are notified if device is valid or not
-     */
-    void addDeviceValidListener(final DeviceValidListener deviceValidListener);
-
-    /**
-     * Notify all registered listeners about valid status
-     * @param deviceInfo which device
-     * @param deviceValid true if device is valid
-     */
-    void notifyDeviceValidListeners(final DeviceInfo deviceInfo, final boolean deviceValid);
+    void setSkipTableFeatures(boolean skipTableFeatures);
 
-    void setIsNotificationFlowRemovedOff(boolean value);
+    void setBarrierCountLimit(int barrierCountLimit);
 
-    boolean getIsNotificationFlowRemovedOff();
+    void setBarrierInterval(long barrierTimeoutLimit);
 
+    CheckedFuture<Void, TransactionCommitFailedException> removeDeviceFromOperationalDS(DeviceInfo deviceInfo);
 }