SEBA-991-A new API needed to remove specific sources from a McastRoute
Change-Id: Ia7e6cf6939c517743d5adc6bc3869decdf64609f
diff --git a/apps/mcast/impl/src/main/java/org/onosproject/mcast/impl/MulticastRouteManager.java b/apps/mcast/impl/src/main/java/org/onosproject/mcast/impl/MulticastRouteManager.java
index a004c8d..51d4207 100644
--- a/apps/mcast/impl/src/main/java/org/onosproject/mcast/impl/MulticastRouteManager.java
+++ b/apps/mcast/impl/src/main/java/org/onosproject/mcast/impl/MulticastRouteManager.java
@@ -172,6 +172,25 @@
}
@Override
+ public void removeSources(McastRoute route, Set<ConnectPoint> connectPoints) {
+ checkNotNull(route, "Route cannot be null");
+ checkNotNull(connectPoints, "ConnectPoints cannot be null");
+ if (checkRoute(route)) {
+ store.removeSources(route, connectPoints);
+ }
+ }
+
+ @Override
+ public void removeSources(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints) {
+ checkNotNull(route, "Route cannot be null");
+ checkNotNull(hostId, "HostId cannot be null");
+ checkNotNull(connectPoints, "ConnectPoints cannot be null");
+ if (checkRoute(route)) {
+ store.removeSources(route, hostId, connectPoints);
+ }
+ }
+
+ @Override
public void addSink(McastRoute route, HostId hostId) {
if (checkRoute(route)) {
Set<ConnectPoint> sinks = new HashSet<>();
@@ -303,7 +322,7 @@
if ((event.prevSubject() != null && event.subject() != null)) {
//we compute the difference between old locations and new ones and remove the previous
Set<HostLocation> removedConnectPoint = Sets.difference(event.prevSubject().locations(),
- event.subject().locations()).immutableCopy();
+ event.subject().locations()).immutableCopy();
if (!removedConnectPoint.isEmpty()) {
if (!routesForSource.isEmpty()) {
eventRemoveSources(hostId, removedConnectPoint, routesForSource);
@@ -313,7 +332,7 @@
}
}
Set<HostLocation> addedConnectPoints = Sets.difference(event.subject().locations(),
- event.prevSubject().locations()).immutableCopy();
+ event.prevSubject().locations()).immutableCopy();
//if the host now has some new locations we add them to the sinks set
if (!addedConnectPoints.isEmpty()) {
if (!routesForSource.isEmpty()) {