Yuta HIGUCHI
Committed by Gerrit Code Review

LinkManager: log only if link actually disappeared

resolves ONOS-474

Change-Id: I61ec56795eca18b11c61b8fe5722729928bb370c
...@@ -255,7 +255,7 @@ public class LinkManager ...@@ -255,7 +255,7 @@ public class LinkManager
255 checkNotNull(connectPoint, "Connect point cannot be null"); 255 checkNotNull(connectPoint, "Connect point cannot be null");
256 checkValidity(); 256 checkValidity();
257 257
258 - log.info("Links for connection point {} vanished", connectPoint); 258 + log.debug("Links for connection point {} vanished", connectPoint);
259 // FIXME: This will remove links registered by other providers 259 // FIXME: This will remove links registered by other providers
260 removeLinks(getLinks(connectPoint), true); 260 removeLinks(getLinks(connectPoint), true);
261 } 261 }
...@@ -265,7 +265,7 @@ public class LinkManager ...@@ -265,7 +265,7 @@ public class LinkManager
265 checkNotNull(deviceId, DEVICE_ID_NULL); 265 checkNotNull(deviceId, DEVICE_ID_NULL);
266 checkValidity(); 266 checkValidity();
267 267
268 - log.info("Links for device {} vanished", deviceId); 268 + log.debug("Links for device {} vanished", deviceId);
269 removeLinks(getDeviceLinks(deviceId), true); 269 removeLinks(getDeviceLinks(deviceId), true);
270 } 270 }
271 } 271 }
...@@ -276,9 +276,12 @@ public class LinkManager ...@@ -276,9 +276,12 @@ public class LinkManager
276 LinkEvent event = isSoftRemove ? 276 LinkEvent event = isSoftRemove ?
277 store.removeOrDownLink(link.src(), link.dst()) : 277 store.removeOrDownLink(link.src(), link.dst()) :
278 store.removeLink(link.src(), link.dst()); 278 store.removeLink(link.src(), link.dst());
279 + if (event != null) {
280 + log.info("Link {} removed/vanished", event.subject());
279 post(event); 281 post(event);
280 } 282 }
281 } 283 }
284 + }
282 285
283 // Posts the specified event to the local event dispatcher. 286 // Posts the specified event to the local event dispatcher.
284 private void post(LinkEvent event) { 287 private void post(LinkEvent event) {
......