Notifying the delegate about the RESTORED event on the mastership of a given device.
In turn the DeviceManager checks the role and sends the proper one down to the provider to be applied.

Change-Id: Icab9ac30b6e269d8acf9d14896c9858beaedb6da
diff --git a/core/api/src/main/java/org/onosproject/mastership/MastershipEvent.java b/core/api/src/main/java/org/onosproject/mastership/MastershipEvent.java
index e7c0169..2b0d82b 100644
--- a/core/api/src/main/java/org/onosproject/mastership/MastershipEvent.java
+++ b/core/api/src/main/java/org/onosproject/mastership/MastershipEvent.java
@@ -49,7 +49,13 @@
          * Signifies that the underlying storage for the Mastership state
          * of this device is unavailable.
          */
-        SUSPENDED
+        SUSPENDED,
+
+        /**
+         * Signifies that the underlying storage for the Mastership state
+         * of this device became available again.
+         */
+        RESTORED
     }
 
     private final MastershipInfo mastershipInfo;
diff --git a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java
index 826665d..41adfde 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/mastership/impl/ConsistentDeviceMastershipStore.java
@@ -18,6 +18,7 @@
 import static org.onlab.util.Tools.groupedThreads;
 import static org.onosproject.mastership.MastershipEvent.Type.BACKUPS_CHANGED;
 import static org.onosproject.mastership.MastershipEvent.Type.MASTER_CHANGED;
+import static org.onosproject.mastership.MastershipEvent.Type.RESTORED;
 import static org.onosproject.mastership.MastershipEvent.Type.SUSPENDED;
 import static org.slf4j.LoggerFactory.getLogger;
 import static com.google.common.base.Preconditions.checkArgument;
@@ -356,7 +357,7 @@
                     notifyDelegate(new MastershipEvent(SUSPENDED, deviceId, mastershipInfo));
                     break;
                 case SERVICE_RESTORED:
-                    // Do nothing, wait for updates from peers
+                    notifyDelegate(new MastershipEvent(RESTORED, deviceId, mastershipInfo));
                     break;
                 default:
                     return;