Rename: use plural according to the returned type
Change-Id: I7db9ae2fda2f7240d69ad7dbd028ccc0ea8a8fd8
diff --git a/core/api/src/main/java/org/onosproject/net/newresource/ResourceService.java b/core/api/src/main/java/org/onosproject/net/newresource/ResourceService.java
index 124205d..e0c7fd7 100644
--- a/core/api/src/main/java/org/onosproject/net/newresource/ResourceService.java
+++ b/core/api/src/main/java/org/onosproject/net/newresource/ResourceService.java
@@ -133,7 +133,7 @@
* If the resource is not allocated, the return value is an empty list.
*/
// TODO: need to change the argument type to ResourceId
- List<ResourceAllocation> getResourceAllocation(Resource resource);
+ List<ResourceAllocation> getResourceAllocations(Resource resource);
/**
* Returns allocated resources being as children of the specified parent and being the specified resource type.
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
index 9bcd7a9..5d47658 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
@@ -312,7 +312,7 @@
if (ochCP != null) {
OchPort ochPort = (OchPort) deviceService.getPort(ochCP.deviceId(), ochCP.port());
Optional<IntentId> intentId =
- resourceService.getResourceAllocation(Resource.discrete(ochCP.deviceId(), ochCP.port()))
+ resourceService.getResourceAllocations(Resource.discrete(ochCP.deviceId(), ochCP.port()))
.stream()
.map(ResourceAllocation::consumer)
.filter(x -> x instanceof IntentId)
@@ -333,7 +333,7 @@
}
Optional<IntentId> intentId =
- resourceService.getResourceAllocation(Resource.discrete(oduPort.deviceId(), port.number()))
+ resourceService.getResourceAllocations(Resource.discrete(oduPort.deviceId(), port.number()))
.stream()
.map(ResourceAllocation::consumer)
.filter(x -> x instanceof IntentId)
diff --git a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
index ae7c7f4..b4badb8 100644
--- a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
+++ b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceManager.java
@@ -114,7 +114,7 @@
}
@Override
- public List<ResourceAllocation> getResourceAllocation(Resource resource) {
+ public List<ResourceAllocation> getResourceAllocations(Resource resource) {
checkNotNull(resource);
List<ResourceConsumer> consumers = store.getConsumers(resource);
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
index a41616b..7e3beca 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
@@ -68,7 +68,7 @@
}
@Override
- public List<ResourceAllocation> getResourceAllocation(Resource resource) {
+ public List<ResourceAllocation> getResourceAllocations(Resource resource) {
return Optional.ofNullable(assignment.get(resource))
.map(x -> ImmutableList.of(new ResourceAllocation(resource, x)))
.orElse(ImmutableList.of());
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 758b933..2ab2611 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
@@ -115,13 +115,13 @@
checkArgument(resource instanceof DiscreteResource || resource instanceof ContinuousResource);
if (resource instanceof DiscreteResource) {
- return getConsumer((DiscreteResource) resource);
+ return getConsumers((DiscreteResource) resource);
} else {
- return getConsumer((ContinuousResource) resource);
+ return getConsumers((ContinuousResource) resource);
}
}
- private List<ResourceConsumer> getConsumer(DiscreteResource resource) {
+ private List<ResourceConsumer> getConsumers(DiscreteResource resource) {
Versioned<ResourceConsumer> consumer = discreteConsumers.get(resource);
if (consumer == null) {
return ImmutableList.of();
@@ -130,7 +130,7 @@
return ImmutableList.of(consumer.value());
}
- private List<ResourceConsumer> getConsumer(ContinuousResource resource) {
+ private List<ResourceConsumer> getConsumers(ContinuousResource resource) {
Versioned<ContinuousResourceAllocation> allocations = continuousConsumers.get(resource.id());
if (allocations == null) {
return ImmutableList.of();
@@ -337,7 +337,7 @@
if (resource instanceof DiscreteResource) {
// check if already consumed
- return getConsumer((DiscreteResource) resource).isEmpty();
+ return getConsumers((DiscreteResource) resource).isEmpty();
} else {
ContinuousResource requested = (ContinuousResource) resource;
ContinuousResource registered = v.value().stream()