Initiate link discovery when device status is available

Based on device status links will be removed (device status: offline) or
initiate link discovery (device status: available)

Change-Id: Ibb6fbb8e8740fcae616090b1d13fe0088d29a7b4
diff --git a/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java b/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java
index 857c2d8..799b5b5 100644
--- a/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java
+++ b/providers/link/src/main/java/org/onosproject/provider/linkdiscovery/impl/LinkDiscoveryProvider.java
@@ -337,7 +337,9 @@
                     evaluateLinks(device.id(), Sets.newHashSet());
                     break;
                 case DEVICE_AVAILABILITY_CHANGED:
-                    if (!deviceService.isAvailable(device.id())) {
+                    if (deviceService.isAvailable(device.id())) {
+                        executor.execute(() -> discoverLinks(device));
+                    } else {
                         evaluateLinks(device.id(), Sets.newHashSet());
                     }
                     break;