Added breadcrumbs array to topo2CurrentLayout response.
Included Region name in "closed region" data structures.
Change-Id: I1d4c223255b7ea8239f38c63d4caebe1bdeddf32
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoSession.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoSession.java
index 44ea910..f6552dd 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoSession.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/UiTopoSession.java
@@ -30,6 +30,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -134,6 +135,25 @@
}
/**
+ * Returns the breadcrumb trail from current layout to root. That is,
+ * element 0 of the list will be the current layout; the last element
+ * of the list will be the root layout. This list is guaranteed to have
+ * size of at least 1.
+ *
+ * @return breadcrumb trail
+ */
+ public List<UiTopoLayout> breadCrumbs() {
+ UiTopoLayout current = currentLayout;
+ List<UiTopoLayout> crumbs = new ArrayList<>();
+ crumbs.add(current);
+ while (!current.isRoot()) {
+ current = layoutService.getLayout(current.parent());
+ crumbs.add(current);
+ }
+ return crumbs;
+ }
+
+ /**
* Changes the current layout context to the specified layout.
*
* @param topoLayout new topology layout context