Implement CLI commands to view and delete SR internal stores
sr-next-dst (renamed from sr-next-hops)
sr-next-port
sr-next-vlan
sr-next-mcast (renamed from sr-mcast-next)
sr-next-pw
sr-next-xconnect
sr-next-invalidate <next-id>
Change-Id: Id5178f786bb97e26ddb86015105dd19604ac0817
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
index fbefb76..21a8761 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/DefaultL2TunnelHandler.java
@@ -16,6 +16,7 @@
package org.onosproject.segmentrouting.pwaas;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.RandomUtils;
@@ -263,6 +264,39 @@
return configurationValidity(newPseudowires);
}
+ @Override
+ public ImmutableMap<String, NextObjective> getInitNext() {
+ if (l2InitiationNextObjStore != null) {
+ return ImmutableMap.copyOf(l2InitiationNextObjStore.asJavaMap());
+ } else {
+ return ImmutableMap.of();
+ }
+ }
+
+ @Override
+ public ImmutableMap<String, NextObjective> getTermNext() {
+ if (l2TerminationNextObjStore != null) {
+ return ImmutableMap.copyOf(l2TerminationNextObjStore.asJavaMap());
+ } else {
+ return ImmutableMap.of();
+ }
+ }
+
+ @Override
+ public void removeNextId(int nextId) {
+ l2InitiationNextObjStore.entrySet().forEach(e -> {
+ if (e.getValue().value().id() == nextId) {
+ l2InitiationNextObjStore.remove(e.getKey());
+ }
+ });
+
+ l2TerminationNextObjStore.entrySet().forEach(e -> {
+ if (e.getValue().value().id() == nextId) {
+ l2TerminationNextObjStore.remove(e.getKey());
+ }
+ });
+ }
+
/**
* Returns the new vlan id for an ingress point of a
* pseudowire. For double tagged, it is the outer,