ONOS-7821 Adding on-startup download of any missing application bits from cluster peers.

Change-Id: I8dbcb326636f7cf5fdf38b7a0c06218f3fd5ce9b
diff --git a/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java b/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
index 3793099..7c0a4a9 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
@@ -206,6 +206,7 @@
         apps.addStatusChangeListener(statusChangeListener);
         coreAppId = getId(CoreService.CORE_APP_NAME);
 
+        downloadMissingApplications();
         activateExistingApplications();
         log.info("Started");
     }
@@ -243,6 +244,13 @@
     }
 
     /**
+     * Downloads any missing bits for installed applications.
+     */
+    private void downloadMissingApplications() {
+        apps.asJavaMap().forEach((appId, holder) -> fetchBitsIfNeeded(holder.app));
+    }
+
+    /**
      * Activates applications that should be activated according to the distributed store.
      */
     private void activateExistingApplications() {