ONOS-2693: Unregister a link from resources when it is removed

Change-Id: I69a8070898f28d7d1fb006383a96c3ef1538146e
diff --git a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceLinkListener.java b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceLinkListener.java
index e2bcb2a..bdd2f67 100644
--- a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceLinkListener.java
+++ b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceLinkListener.java
@@ -52,6 +52,9 @@
             case LINK_ADDED:
                 registerLinkResource(link);
                 break;
+            case LINK_REMOVED:
+                unregisterLinkResource(link);
+                break;
             default:
                 break;
         }
@@ -61,4 +64,9 @@
         LinkKey linkKey = LinkKey.linkKey(link);
         executor.submit(() -> adminService.registerResources(ResourcePath.ROOT, linkKey));
     }
+
+    private void unregisterLinkResource(Link link) {
+        LinkKey linkKey = LinkKey.linkKey(link);
+        executor.submit(() -> adminService.unregisterResources(ResourcePath.ROOT, linkKey));
+    }
 }