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/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoLayoutManager.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoLayoutManager.java
index a597f24..28e345c 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoLayoutManager.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoLayoutManager.java
@@ -34,6 +34,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -110,6 +111,21 @@
}
@Override
+ public Set<UiTopoLayout> getPeers(UiTopoLayoutId layoutId) {
+ checkNotNull(layoutId, ID_NULL);
+ UiTopoLayout layout = layoutMap.get(layoutId);
+ if (layout == null) {
+ return Collections.emptySet();
+ }
+
+ UiTopoLayoutId parentId = layout.parent();
+ return layoutMap.values().stream()
+ .filter(l -> !Objects.equals(l.id(), layoutId) &&
+ Objects.equals(l.parent(), parentId))
+ .collect(Collectors.toSet());
+ }
+
+ @Override
public Set<UiTopoLayout> getChildren(UiTopoLayoutId layoutId) {
checkNotNull(layoutId, ID_NULL);
return layoutMap.values().stream()