commit | efb75110ee3a77a7ae579ca9b28eb36b6ca58f08 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Fri May 13 15:24:34 2016 -0700 |
committer | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Fri May 13 15:24:34 2016 -0700 |
tree | e0fa6a927cc9e9f1dde0eba1cd1e8f4959ac4a93 | |
parent | 0a07c079d4a8f5ee9f68bc8c8cf0363df21b8b6c [diff] [blame] |
Move the resource allocation details into ContinuousResourceAllocation Change-Id: If5b6a86c92f27cc7acf65e6e397f72afd3a4cb41
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ContinuousResourceAllocation.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ContinuousResourceAllocation.java index c23866d..205a44d 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ContinuousResourceAllocation.java +++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ContinuousResourceAllocation.java
@@ -70,6 +70,13 @@ return allocations; } + ContinuousResourceAllocation allocate(ContinuousResource original, ResourceAllocation value) { + return new ContinuousResourceAllocation(original, ImmutableList.<ResourceAllocation>builder() + .addAll(allocations) + .add(value) + .build()); + } + ContinuousResourceAllocation release(ContinuousResource resource, ResourceConsumerId consumerId) { List<ResourceAllocation> nonMatched = allocations.stream() .filter(x -> !(x.consumerId().equals(consumerId) &&