aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java')
-rw-r--r--framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java b/framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
index 5226967f..10fe75ea 100644
--- a/framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
+++ b/framework/src/onos/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
@@ -41,7 +41,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* An implementation of ResourceService.
*/
-@Component(immediate = true, enabled = false)
+@Component(immediate = true)
@Service
@Beta
public final class ResourceManager implements ResourceService, ResourceAdminService {
@@ -127,6 +127,17 @@ public final class ResourceManager implements ResourceService, ResourceAdminServ
}
@Override
+ public Collection<ResourcePath> getAvailableResources(ResourcePath parent) {
+ checkNotNull(parent);
+
+ Collection<ResourcePath> children = store.getChildResources(parent);
+ return children.stream()
+ // We access store twice in this method, then the store may be updated by others
+ .filter(x -> !store.getConsumer(x).isPresent())
+ .collect(Collectors.toList());
+ }
+
+ @Override
public boolean isAvailable(ResourcePath resource) {
checkNotNull(resource);