Implement host probing retry with major refactoring
- Implement probe retry
- Switch to typical core/provider design pattern for HostProbingService
and as a result decoupling the dependency between SR and HostLocationProvider
Change-Id: I33a15af580677ea376b421ac3e26f9821dcca844
diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java b/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java
index 998f7df..31e8904 100644
--- a/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java
+++ b/core/net/src/main/java/org/onosproject/net/host/impl/HostManager.java
@@ -29,7 +29,6 @@
import org.onlab.packet.VlanId;
import org.onlab.util.Tools;
import org.onosproject.cfg.ComponentConfigService;
-import org.onosproject.net.host.HostLocationProbingService.ProbeMode;
import org.onosproject.net.intf.Interface;
import org.onosproject.net.intf.InterfaceService;
import org.onosproject.net.HostLocation;
@@ -442,6 +441,20 @@
}
@Override
+ public void addLocationToHost(HostId hostId, HostLocation location) {
+ checkNotNull(hostId, HOST_ID_NULL);
+ checkValidity();
+
+ if (!allowedToChange(hostId)) {
+ log.info("Request to remove {} from {} is ignored due to provider mismatch",
+ location, hostId);
+ return;
+ }
+
+ store.appendLocation(hostId, location);
+ }
+
+ @Override
public void removeLocationFromHost(HostId hostId, HostLocation location) {
checkNotNull(hostId, HOST_ID_NULL);
checkValidity();
@@ -455,16 +468,6 @@
store.removeLocation(hostId, location);
}
- @Override
- public MacAddress addPendingHostLocation(HostId hostId, ConnectPoint connectPoint, ProbeMode probeMode) {
- return store.addPendingHostLocation(hostId, connectPoint, probeMode);
- }
-
- @Override
- public void removePendingHostLocation(MacAddress probeMac) {
- store.removePendingHostLocation(probeMac);
- }
-
/**
* Providers should only be able to remove a host that is provided by itself,
* or a host that is not configured.