commit | d28842c563960446f431c1636ebb147bc711b39b | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Aug 20 11:42:43 2015 -0700 |
committer | Gerrit Code Review <gerrit@onlab.us> | Thu Aug 20 21:52:44 2015 +0000 |
tree | c46488c38b215e19982296a9b4e0279c4d5916fd | |
parent | e2292843e7287c374206aa48fc0c891d21a8ee39 [diff] |
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)); + } }