Rename Lambda in org.onosproject.net.resource to LambdaResource
To avoid naming conflict with Lambda in org.onosproject.net
Change-Id: Ic8a670e7e2fb022f44f5a83cf4805f3ce0f29694
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
index 3e193ac..e6a20f7 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
@@ -37,7 +37,7 @@
import org.onosproject.net.intent.OpticalPathIntent;
import org.onosproject.net.intent.impl.IntentCompilationException;
import org.onosproject.net.resource.DefaultLinkResourceRequest;
-import org.onosproject.net.resource.Lambda;
+import org.onosproject.net.resource.LambdaResource;
import org.onosproject.net.resource.LambdaResourceAllocation;
import org.onosproject.net.resource.LinkResourceAllocations;
import org.onosproject.net.resource.LinkResourceRequest;
@@ -110,7 +110,7 @@
.filter(x -> x.type() == ResourceType.LAMBDA)
.findFirst()
.orElseThrow(() -> new IntentCompilationException("Lambda was not assigned successfully"));
- Lambda la = ((LambdaResourceAllocation) allocation).lambda();
+ LambdaResource la = ((LambdaResourceAllocation) allocation).lambda();
TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder();
treatmentBuilder.setLambda((short) la.toInt());
diff --git a/core/net/src/main/java/org/onosproject/net/resource/impl/LinkResourceManager.java b/core/net/src/main/java/org/onosproject/net/resource/impl/LinkResourceManager.java
index d60dee2..ff120fe 100644
--- a/core/net/src/main/java/org/onosproject/net/resource/impl/LinkResourceManager.java
+++ b/core/net/src/main/java/org/onosproject/net/resource/impl/LinkResourceManager.java
@@ -28,7 +28,7 @@
import org.onosproject.net.resource.BandwidthResourceAllocation;
import org.onosproject.net.resource.BandwidthResourceRequest;
import org.onosproject.net.resource.DefaultLinkResourceAllocations;
-import org.onosproject.net.resource.Lambda;
+import org.onosproject.net.resource.LambdaResource;
import org.onosproject.net.resource.LambdaResourceAllocation;
import org.onosproject.net.resource.LambdaResourceRequest;
import org.onosproject.net.resource.LinkResourceAllocations;
@@ -92,13 +92,13 @@
* @param link the link
* @return available lambdas on specified link
*/
- private Set<Lambda> getAvailableLambdas(Link link) {
+ private Set<LambdaResource> getAvailableLambdas(Link link) {
checkNotNull(link);
Set<ResourceAllocation> resAllocs = store.getFreeResources(link);
if (resAllocs == null) {
return Collections.emptySet();
}
- Set<Lambda> lambdas = new HashSet<>();
+ Set<LambdaResource> lambdas = new HashSet<>();
for (ResourceAllocation res : resAllocs) {
if (res.type() == ResourceType.LAMBDA) {
lambdas.add(((LambdaResourceAllocation) res).lambda());
@@ -114,11 +114,11 @@
* @param links the links
* @return available lambdas on specified links
*/
- private Iterable<Lambda> getAvailableLambdas(Iterable<Link> links) {
+ private Iterable<LambdaResource> getAvailableLambdas(Iterable<Link> links) {
checkNotNull(links);
Iterator<Link> i = links.iterator();
checkArgument(i.hasNext());
- Set<Lambda> lambdas = new HashSet<>(getAvailableLambdas(i.next()));
+ Set<LambdaResource> lambdas = new HashSet<>(getAvailableLambdas(i.next()));
while (i.hasNext()) {
lambdas.retainAll(getAvailableLambdas(i.next()));
}
@@ -162,7 +162,7 @@
allocs.add(new BandwidthResourceAllocation(br.bandwidth()));
break;
case LAMBDA:
- Iterator<Lambda> lambdaIterator =
+ Iterator<LambdaResource> lambdaIterator =
getAvailableLambdas(req.links()).iterator();
if (lambdaIterator.hasNext()) {
allocs.add(new LambdaResourceAllocation(lambdaIterator.next()));
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompilerTest.java
index fb318e1..a890b6a 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompilerTest.java
@@ -34,7 +34,7 @@
import org.onosproject.net.intent.constraint.LambdaConstraint;
import org.onosproject.net.intent.impl.PathNotFoundException;
import org.onosproject.net.resource.Bandwidth;
-import org.onosproject.net.resource.Lambda;
+import org.onosproject.net.resource.LambdaResource;
import org.onosproject.net.resource.LinkResourceService;
import java.util.Arrays;
@@ -271,7 +271,7 @@
@Test
public void testLambdaConstrainedIntentSuccess() {
- final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(Lambda.valueOf(1)));
+ final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1)));
final LinkResourceService resourceService =
IntentTestsMocks.MockResourceService.makeLambdaResourceService(1);
@@ -294,7 +294,7 @@
@Test
public void testLambdaConstrainedIntentFailure() {
- final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(Lambda.valueOf(1)));
+ final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1)));
final LinkResourceService resourceService =
IntentTestsMocks.MockResourceService.makeBandwidthResourceService(10.0);
try {