Fixing an issue where intents fail to re-route after a node is restarted; caused by failure to register intent resources correctly.

Change-Id: I239e3b538d5b9134422fa629514e095e4914bb0c
diff --git a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
index 9412dac..683d058 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/intent/impl/GossipIntentStore.java
@@ -288,11 +288,16 @@
     private final class InternalCurrentListener implements
             EventuallyConsistentMapListener<Key, IntentData> {
         @Override
-        public void event(
-                EventuallyConsistentMapEvent<Key, IntentData> event) {
-            if (event.type() == EventuallyConsistentMapEvent.Type.PUT) {
-                IntentData intentData = event.value();
+        public void event(EventuallyConsistentMapEvent<Key, IntentData> event) {
+            IntentData intentData = event.value();
 
+            if (event.type() == EventuallyConsistentMapEvent.Type.PUT) {
+                // The current intents map has been updated. If we are master for
+                // this intent's partition, notify the Manager that it should
+                // emit notifications about updated tracked resources.
+                if (delegate != null && isMaster(event.value().intent().key())) {
+                    delegate.onUpdate(new IntentData(intentData)); // copy for safety, likely unnecessary
+                }
                 notifyDelegateIfNotNull(IntentEvent.getEvent(intentData));
             }
         }