ONOS-5419 Implementing new VPLS CLI
Change-Id: Id6a7ef785def15f5fcdc8d5ab8f9ab0f9a173065
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/config/VplsConfigService.java b/apps/vpls/src/main/java/org/onosproject/vpls/config/VplsConfigService.java
index 7500a08..2d2a576 100644
--- a/apps/vpls/src/main/java/org/onosproject/vpls/config/VplsConfigService.java
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/config/VplsConfigService.java
@@ -91,24 +91,25 @@
// TODO Remove this function after the intent framework race condition has been fixed
/**
- * Retrieves the interfaces from the VPLS configuration.
+ * Retrieves the interfaces without IP configured, so compatible with VPLS,
+ * from the interface service.
*
- * @return a set of interfaces contained in the VPLS configuration
+ * @return the set of interfaces configured, compatible with VPLS
*/
Set<Interface> allIfaces();
/**
- * Retrieves the interfaces from the VPLS configuration.
+ * Retrieves the interfaces associated to a VPLS.
*
- * @return a set of interfaces belonging to the VPLS
+ * @return the set of interfaces associated to a VPLS
*/
Set<Interface> ifaces();
/**
- * Retrieves the interfaces belonging to the VPLS.
+ * Retrieves the interfaces associated to the VPLS specified.
*
* @param vplsName the name of the VPLS
- * @return a set of interfaces belonging to the VPLS
+ * @return the set of interfaces associated to the VPLS specified
*/
Set<Interface> ifaces(String vplsName);
@@ -125,7 +126,7 @@
* @return a set of VPLS names
*/
Set<String> vplsNamesOld();
- // TODO Removes this function after intent framework fix race condition
+ // TODO Removes this function after the race condition gets fixed in IF
/**
* Returns the VPLS names and associated interfaces from the configuration.
diff --git a/apps/vpls/src/main/java/org/onosproject/vpls/config/impl/VplsConfigImpl.java b/apps/vpls/src/main/java/org/onosproject/vpls/config/impl/VplsConfigImpl.java
index 658a27d..ad1c707 100644
--- a/apps/vpls/src/main/java/org/onosproject/vpls/config/impl/VplsConfigImpl.java
+++ b/apps/vpls/src/main/java/org/onosproject/vpls/config/impl/VplsConfigImpl.java
@@ -207,16 +207,19 @@
@Override
public Set<Interface> allIfaces() {
- Set<Interface> allVplsInterfaces = new HashSet<>();
- interfaceService.getInterfaces().forEach(allVplsInterfaces::add);
- return allVplsInterfaces;
+ Set<Interface> interfaces = new HashSet<>();
+ interfaceService.getInterfaces().stream()
+ .filter(iface -> iface.ipAddressesList() == null ||
+ iface.ipAddressesList().isEmpty())
+ .forEach(interfaces::add);
+ return interfaces;
}
@Override
public Set<Interface> ifaces() {
- Set<Interface> allVplsInterfaces = new HashSet<>();
- vplsIfaces.values().forEach(allVplsInterfaces::add);
- return allVplsInterfaces;
+ Set<Interface> interfaces = new HashSet<>();
+ vplsIfaces.values().forEach(interfaces::add);
+ return interfaces;
}
@Override