ONOS-4326: Working on topology topo2start processing.
- Added getPeers() to UiTopoLayoutService.
- Fixed wipe-out command to leave the default layout alone.
- Fixed handling of null-region (associated with default layout).
- Added refresh() method to model cache.
- Fixed regions-topo-2 device IDs

Change-Id: Iee49b47ff6702bed9751be7b63392577422d4763
diff --git a/core/api/src/main/java/org/onosproject/ui/model/topo/UiTopology.java b/core/api/src/main/java/org/onosproject/ui/model/topo/UiTopology.java
index 5ce91da..dd601eb 100644
--- a/core/api/src/main/java/org/onosproject/ui/model/topo/UiTopology.java
+++ b/core/api/src/main/java/org/onosproject/ui/model/topo/UiTopology.java
@@ -61,6 +61,9 @@
     private final Map<HostId, UiHost> hostLookup = new HashMap<>();
     private final Map<UiLinkId, UiLink> linkLookup = new HashMap<>();
 
+    // a container for devices, hosts, etc. belonging to no region
+    private final UiRegion nullRegion = new UiRegion(this, null);
+
 
     @Override
     public String toString() {
@@ -89,6 +92,8 @@
         deviceLookup.clear();
         hostLookup.clear();
         linkLookup.clear();
+
+        nullRegion.destroy();
     }
 
 
@@ -145,6 +150,16 @@
     }
 
     /**
+     * Returns a reference to the null-region. That is, the container for
+     * devices, hosts, and links that belong to no region.
+     *
+     * @return the null-region
+     */
+    public UiRegion nullRegion() {
+        return nullRegion;
+    }
+
+    /**
      * Returns the region with the specified identifier, or null if
      * no such region exists.
      *
@@ -186,6 +201,15 @@
     }
 
     /**
+     * Returns all devices in the model.
+     *
+     * @return all devices
+     */
+    public Set<UiDevice> allDevices() {
+        return new HashSet<>(deviceLookup.values());
+    }
+
+    /**
      * Returns the device with the specified identifier, or null if
      * no such device exists.
      *