Second set of after review changes
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.java
index 83c87ecb4606ed6f94d7f61e2270cf01d0275e68..55f68da8b7efe3689563127cd383cae4a10ff3a8 100644 (file)
@@ -18,8 +18,6 @@ import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTermin
 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole;
 
-import javax.annotation.CheckForNull;
-
 /**
  * This interface is responsible for instantiating DeviceContext and
  * registering transaction chain for each DeviceContext. Each device
@@ -42,12 +40,37 @@ public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnecte
      * 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
+     * @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);
 
+    /**
+     * Register device synchronize listeners
+     * @param deviceSynchronizeListener are notified if device is synchronized or not
+     */
+    void addDeviceSynchronizeListener(final DeviceSynchronizeListener deviceSynchronizeListener);
+
+    /**
+     * 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);
 
 }