Adding ability to synchronize topology clusters' broadcast trees.

Proxy ARP now supports deferred ARP replies until instance learns of the subject host location.

Change-Id: Ib3ee97c0812858b5b4972d945e9e6d2bd397d4c5
diff --git a/core/common/src/main/java/org/onosproject/common/DefaultTopology.java b/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
index 579f336..bdf7d73 100644
--- a/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
+++ b/core/common/src/main/java/org/onosproject/common/DefaultTopology.java
@@ -15,6 +15,7 @@
  */
 package org.onosproject.common;
 
+import com.google.common.base.Function;
 import com.google.common.base.Supplier;
 import com.google.common.base.Suppliers;
 import com.google.common.collect.ImmutableMap;
@@ -77,17 +78,20 @@
     private final Supplier<ImmutableMap<ClusterId, TopologyCluster>> clusters;
     private final Supplier<ImmutableSet<ConnectPoint>> infrastructurePoints;
     private final Supplier<ImmutableSetMultimap<ClusterId, ConnectPoint>> broadcastSets;
-
+    private final Function<ConnectPoint, Boolean> broadcastFunction;
     private final Supplier<ClusterIndexes> clusterIndexes;
 
     /**
      * Creates a topology descriptor attributed to the specified provider.
      *
-     * @param providerId  identity of the provider
-     * @param description data describing the new topology
+     * @param providerId        identity of the provider
+     * @param description       data describing the new topology
+     * @param broadcastFunction broadcast point function
      */
-    public DefaultTopology(ProviderId providerId, GraphDescription description) {
+    public DefaultTopology(ProviderId providerId, GraphDescription description,
+                           Function<ConnectPoint, Boolean> broadcastFunction) {
         super(providerId);
+        this.broadcastFunction = broadcastFunction;
         this.time = description.timestamp();
         this.creationTime = description.creationTime();
 
@@ -106,6 +110,16 @@
         this.computeCost = Math.max(0, System.nanoTime() - time);
     }
 
+    /**
+     * Creates a topology descriptor attributed to the specified provider.
+     *
+     * @param providerId  identity of the provider
+     * @param description data describing the new topology
+     */
+    public DefaultTopology(ProviderId providerId, GraphDescription description) {
+        this(providerId, description, null);
+    }
+
     @Override
     public long time() {
         return time;
@@ -223,6 +237,10 @@
      * @return true if in broadcast set
      */
     public boolean isBroadcastPoint(ConnectPoint connectPoint) {
+        if (broadcastFunction != null) {
+            return broadcastFunction.apply(connectPoint);
+        }
+
         // Any non-infrastructure, i.e. edge points are assumed to be OK.
         if (!isInfrastructure(connectPoint)) {
             return true;