commit | e7f4f3f1c3ecf331d542fafa22f982242ec5e316 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Tue Oct 13 16:27:25 2015 -0700 |
committer | Ray Milkey <ray@onlab.us> | Thu Oct 29 09:01:54 2015 -0700 |
tree | 7eb9a64b63aba0f028f42c4399267dad5e320b50 | |
parent | 0e99e2ba4082099e560939faa821aa3513092993 [diff] [blame] |
Define and implement a method to query available resources Change-Id: I49fbcdf215e402603ea15f469d41e572f1cce1c6
diff --git a/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java index d466c95..687576c 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java
@@ -239,6 +239,18 @@ } @Override + public Collection<ResourcePath> getChildResources(ResourcePath parent) { + checkNotNull(parent); + + Versioned<List<ResourcePath>> children = childMap.get(parent); + if (children == null) { + return Collections.emptyList(); + } + + return children.value(); + } + + @Override public <T> Collection<ResourcePath> getAllocatedResources(ResourcePath parent, Class<T> cls) { checkNotNull(parent); checkNotNull(cls);