Committed by
Gerrit Code Review
Rename Lambda in org.onosproject.net.resource to LambdaResource
To avoid naming conflict with Lambda in org.onosproject.net Change-Id: Ic8a670e7e2fb022f44f5a83cf4805f3ce0f29694
Showing
17 changed files
with
52 additions
and
52 deletions
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | package org.onosproject.net.intent.constraint; | 16 | package org.onosproject.net.intent.constraint; |
17 | 17 | ||
18 | import org.onosproject.net.Link; | 18 | import org.onosproject.net.Link; |
19 | -import org.onosproject.net.resource.Lambda; | 19 | +import org.onosproject.net.resource.LambdaResource; |
20 | import org.onosproject.net.resource.LinkResourceService; | 20 | import org.onosproject.net.resource.LinkResourceService; |
21 | import org.onosproject.net.resource.ResourceRequest; | 21 | import org.onosproject.net.resource.ResourceRequest; |
22 | import org.onosproject.net.resource.ResourceType; | 22 | import org.onosproject.net.resource.ResourceType; |
... | @@ -30,14 +30,14 @@ import static com.google.common.base.MoreObjects.toStringHelper; | ... | @@ -30,14 +30,14 @@ import static com.google.common.base.MoreObjects.toStringHelper; |
30 | */ | 30 | */ |
31 | public class LambdaConstraint extends BooleanConstraint { | 31 | public class LambdaConstraint extends BooleanConstraint { |
32 | 32 | ||
33 | - private final Lambda lambda; | 33 | + private final LambdaResource lambda; |
34 | 34 | ||
35 | /** | 35 | /** |
36 | * Creates a new optical lambda constraint. | 36 | * Creates a new optical lambda constraint. |
37 | * | 37 | * |
38 | * @param lambda optional lambda to indicate a specific lambda | 38 | * @param lambda optional lambda to indicate a specific lambda |
39 | */ | 39 | */ |
40 | - public LambdaConstraint(Lambda lambda) { | 40 | + public LambdaConstraint(LambdaResource lambda) { |
41 | this.lambda = lambda; | 41 | this.lambda = lambda; |
42 | } | 42 | } |
43 | 43 | ||
... | @@ -61,7 +61,7 @@ public class LambdaConstraint extends BooleanConstraint { | ... | @@ -61,7 +61,7 @@ public class LambdaConstraint extends BooleanConstraint { |
61 | * | 61 | * |
62 | * @return required lambda | 62 | * @return required lambda |
63 | */ | 63 | */ |
64 | - public Lambda lambda() { | 64 | + public LambdaResource lambda() { |
65 | return lambda; | 65 | return lambda; |
66 | } | 66 | } |
67 | 67 | ... | ... |
... | @@ -20,7 +20,7 @@ import java.util.Objects; | ... | @@ -20,7 +20,7 @@ import java.util.Objects; |
20 | /** | 20 | /** |
21 | * Representation of lambda resource. | 21 | * Representation of lambda resource. |
22 | */ | 22 | */ |
23 | -public final class Lambda extends LinkResource { | 23 | +public final class LambdaResource extends LinkResource { |
24 | 24 | ||
25 | private final int lambda; | 25 | private final int lambda; |
26 | 26 | ||
... | @@ -29,12 +29,12 @@ public final class Lambda extends LinkResource { | ... | @@ -29,12 +29,12 @@ public final class Lambda extends LinkResource { |
29 | * | 29 | * |
30 | * @param lambda lambda value to be assigned | 30 | * @param lambda lambda value to be assigned |
31 | */ | 31 | */ |
32 | - private Lambda(int lambda) { | 32 | + private LambdaResource(int lambda) { |
33 | this.lambda = lambda; | 33 | this.lambda = lambda; |
34 | } | 34 | } |
35 | 35 | ||
36 | // Constructor for serialization | 36 | // Constructor for serialization |
37 | - private Lambda() { | 37 | + private LambdaResource() { |
38 | this.lambda = 0; | 38 | this.lambda = 0; |
39 | } | 39 | } |
40 | 40 | ||
... | @@ -42,10 +42,10 @@ public final class Lambda extends LinkResource { | ... | @@ -42,10 +42,10 @@ public final class Lambda extends LinkResource { |
42 | * Creates a new instance with given lambda. | 42 | * Creates a new instance with given lambda. |
43 | * | 43 | * |
44 | * @param lambda lambda value to be assigned | 44 | * @param lambda lambda value to be assigned |
45 | - * @return {@link Lambda} instance with given lambda | 45 | + * @return {@link LambdaResource} instance with given lambda |
46 | */ | 46 | */ |
47 | - public static Lambda valueOf(int lambda) { | 47 | + public static LambdaResource valueOf(int lambda) { |
48 | - return new Lambda(lambda); | 48 | + return new LambdaResource(lambda); |
49 | } | 49 | } |
50 | 50 | ||
51 | /** | 51 | /** |
... | @@ -59,8 +59,8 @@ public final class Lambda extends LinkResource { | ... | @@ -59,8 +59,8 @@ public final class Lambda extends LinkResource { |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | public boolean equals(Object obj) { | 61 | public boolean equals(Object obj) { |
62 | - if (obj instanceof Lambda) { | 62 | + if (obj instanceof LambdaResource) { |
63 | - Lambda that = (Lambda) obj; | 63 | + LambdaResource that = (LambdaResource) obj; |
64 | return Objects.equals(this.lambda, that.lambda); | 64 | return Objects.equals(this.lambda, that.lambda); |
65 | } | 65 | } |
66 | return false; | 66 | return false; | ... | ... |
... | @@ -24,7 +24,7 @@ import java.util.Objects; | ... | @@ -24,7 +24,7 @@ import java.util.Objects; |
24 | */ | 24 | */ |
25 | public class LambdaResourceAllocation extends LambdaResourceRequest | 25 | public class LambdaResourceAllocation extends LambdaResourceRequest |
26 | implements ResourceAllocation { | 26 | implements ResourceAllocation { |
27 | - private final Lambda lambda; | 27 | + private final LambdaResource lambda; |
28 | 28 | ||
29 | @Override | 29 | @Override |
30 | public ResourceType type() { | 30 | public ResourceType type() { |
... | @@ -32,12 +32,12 @@ public class LambdaResourceAllocation extends LambdaResourceRequest | ... | @@ -32,12 +32,12 @@ public class LambdaResourceAllocation extends LambdaResourceRequest |
32 | } | 32 | } |
33 | 33 | ||
34 | /** | 34 | /** |
35 | - * Creates a new {@link LambdaResourceAllocation} with {@link Lambda} | 35 | + * Creates a new {@link LambdaResourceAllocation} with {@link LambdaResource} |
36 | * object. | 36 | * object. |
37 | * | 37 | * |
38 | * @param lambda allocated lambda | 38 | * @param lambda allocated lambda |
39 | */ | 39 | */ |
40 | - public LambdaResourceAllocation(Lambda lambda) { | 40 | + public LambdaResourceAllocation(LambdaResource lambda) { |
41 | this.lambda = lambda; | 41 | this.lambda = lambda; |
42 | } | 42 | } |
43 | 43 | ||
... | @@ -46,7 +46,7 @@ public class LambdaResourceAllocation extends LambdaResourceRequest | ... | @@ -46,7 +46,7 @@ public class LambdaResourceAllocation extends LambdaResourceRequest |
46 | * | 46 | * |
47 | * @return the lambda resource | 47 | * @return the lambda resource |
48 | */ | 48 | */ |
49 | - public Lambda lambda() { | 49 | + public LambdaResource lambda() { |
50 | return lambda; | 50 | return lambda; |
51 | } | 51 | } |
52 | 52 | ... | ... |
... | @@ -37,7 +37,7 @@ import org.onosproject.net.flow.instructions.Instruction; | ... | @@ -37,7 +37,7 @@ import org.onosproject.net.flow.instructions.Instruction; |
37 | import org.onosproject.net.flow.instructions.Instructions; | 37 | import org.onosproject.net.flow.instructions.Instructions; |
38 | import org.onosproject.net.resource.Bandwidth; | 38 | import org.onosproject.net.resource.Bandwidth; |
39 | import org.onosproject.net.resource.BandwidthResourceRequest; | 39 | import org.onosproject.net.resource.BandwidthResourceRequest; |
40 | -import org.onosproject.net.resource.Lambda; | 40 | +import org.onosproject.net.resource.LambdaResource; |
41 | import org.onosproject.net.resource.LambdaResourceAllocation; | 41 | import org.onosproject.net.resource.LambdaResourceAllocation; |
42 | import org.onosproject.net.resource.LambdaResourceRequest; | 42 | import org.onosproject.net.resource.LambdaResourceRequest; |
43 | import org.onosproject.net.resource.LinkResourceAllocations; | 43 | import org.onosproject.net.resource.LinkResourceAllocations; |
... | @@ -179,7 +179,7 @@ public class IntentTestsMocks { | ... | @@ -179,7 +179,7 @@ public class IntentTestsMocks { |
179 | @Override | 179 | @Override |
180 | public Set<ResourceAllocation> getResourceAllocation(Link link) { | 180 | public Set<ResourceAllocation> getResourceAllocation(Link link) { |
181 | return ImmutableSet.of( | 181 | return ImmutableSet.of( |
182 | - new LambdaResourceAllocation(Lambda.valueOf(77)), | 182 | + new LambdaResourceAllocation(LambdaResource.valueOf(77)), |
183 | new MplsLabelResourceAllocation(MplsLabel.valueOf(10))); | 183 | new MplsLabelResourceAllocation(MplsLabel.valueOf(10))); |
184 | } | 184 | } |
185 | 185 | ... | ... |
... | @@ -26,7 +26,7 @@ import org.onosproject.net.Link; | ... | @@ -26,7 +26,7 @@ import org.onosproject.net.Link; |
26 | import org.onosproject.net.NetTestTools; | 26 | import org.onosproject.net.NetTestTools; |
27 | import org.onosproject.net.flow.TrafficSelector; | 27 | import org.onosproject.net.flow.TrafficSelector; |
28 | import org.onosproject.net.intent.constraint.LambdaConstraint; | 28 | import org.onosproject.net.intent.constraint.LambdaConstraint; |
29 | -import org.onosproject.net.resource.Lambda; | 29 | +import org.onosproject.net.resource.LambdaResource; |
30 | 30 | ||
31 | import com.google.common.collect.ImmutableSet; | 31 | import com.google.common.collect.ImmutableSet; |
32 | import com.google.common.testing.EqualsTester; | 32 | import com.google.common.testing.EqualsTester; |
... | @@ -132,7 +132,7 @@ public class LinkCollectionIntentTest extends IntentTest { | ... | @@ -132,7 +132,7 @@ public class LinkCollectionIntentTest extends IntentTest { |
132 | final LinkedList<Constraint> constraints = new LinkedList<>(); | 132 | final LinkedList<Constraint> constraints = new LinkedList<>(); |
133 | 133 | ||
134 | links1.add(link("src", 1, "dst", 2)); | 134 | links1.add(link("src", 1, "dst", 2)); |
135 | - constraints.add(new LambdaConstraint(Lambda.valueOf(23))); | 135 | + constraints.add(new LambdaConstraint(LambdaResource.valueOf(23))); |
136 | final LinkCollectionIntent collectionIntent = | 136 | final LinkCollectionIntent collectionIntent = |
137 | LinkCollectionIntent.builder() | 137 | LinkCollectionIntent.builder() |
138 | .appId(APP_ID) | 138 | .appId(APP_ID) | ... | ... |
... | @@ -18,7 +18,7 @@ package org.onosproject.net.intent.constraint; | ... | @@ -18,7 +18,7 @@ package org.onosproject.net.intent.constraint; |
18 | import org.junit.Test; | 18 | import org.junit.Test; |
19 | import org.onosproject.net.Link; | 19 | import org.onosproject.net.Link; |
20 | import org.onosproject.net.resource.Bandwidth; | 20 | import org.onosproject.net.resource.Bandwidth; |
21 | -import org.onosproject.net.resource.Lambda; | 21 | +import org.onosproject.net.resource.LambdaResource; |
22 | 22 | ||
23 | import com.google.common.testing.EqualsTester; | 23 | import com.google.common.testing.EqualsTester; |
24 | 24 | ||
... | @@ -65,11 +65,11 @@ public class ConstraintObjectsTest { | ... | @@ -65,11 +65,11 @@ public class ConstraintObjectsTest { |
65 | // Lambda Constraint | 65 | // Lambda Constraint |
66 | 66 | ||
67 | final LambdaConstraint lambdaConstraint1 = | 67 | final LambdaConstraint lambdaConstraint1 = |
68 | - new LambdaConstraint(Lambda.valueOf(100)); | 68 | + new LambdaConstraint(LambdaResource.valueOf(100)); |
69 | final LambdaConstraint lambdaConstraintSameAs1 = | 69 | final LambdaConstraint lambdaConstraintSameAs1 = |
70 | - new LambdaConstraint(Lambda.valueOf(100)); | 70 | + new LambdaConstraint(LambdaResource.valueOf(100)); |
71 | final LambdaConstraint lambdaConstraint2 = | 71 | final LambdaConstraint lambdaConstraint2 = |
72 | - new LambdaConstraint(Lambda.valueOf(200)); | 72 | + new LambdaConstraint(LambdaResource.valueOf(200)); |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * Checks that the objects were created properly. | 75 | * Checks that the objects were created properly. | ... | ... |
... | @@ -47,7 +47,7 @@ import org.onosproject.net.intent.constraint.LatencyConstraint; | ... | @@ -47,7 +47,7 @@ import org.onosproject.net.intent.constraint.LatencyConstraint; |
47 | import org.onosproject.net.intent.constraint.ObstacleConstraint; | 47 | import org.onosproject.net.intent.constraint.ObstacleConstraint; |
48 | import org.onosproject.net.intent.constraint.WaypointConstraint; | 48 | import org.onosproject.net.intent.constraint.WaypointConstraint; |
49 | import org.onosproject.net.resource.Bandwidth; | 49 | import org.onosproject.net.resource.Bandwidth; |
50 | -import org.onosproject.net.resource.Lambda; | 50 | +import org.onosproject.net.resource.LambdaResource; |
51 | 51 | ||
52 | import com.fasterxml.jackson.databind.node.ObjectNode; | 52 | import com.fasterxml.jackson.databind.node.ObjectNode; |
53 | import com.google.common.collect.ImmutableList; | 53 | import com.google.common.collect.ImmutableList; |
... | @@ -146,7 +146,7 @@ public class IntentCodecTest extends AbstractIntentTest { | ... | @@ -146,7 +146,7 @@ public class IntentCodecTest extends AbstractIntentTest { |
146 | final List<Constraint> constraints = | 146 | final List<Constraint> constraints = |
147 | ImmutableList.of( | 147 | ImmutableList.of( |
148 | new BandwidthConstraint(Bandwidth.bps(1.0)), | 148 | new BandwidthConstraint(Bandwidth.bps(1.0)), |
149 | - new LambdaConstraint(Lambda.valueOf(3)), | 149 | + new LambdaConstraint(LambdaResource.valueOf(3)), |
150 | new AnnotationConstraint("key", 33.0), | 150 | new AnnotationConstraint("key", 33.0), |
151 | new AsymmetricPathConstraint(), | 151 | new AsymmetricPathConstraint(), |
152 | new LatencyConstraint(Duration.ofSeconds(2)), | 152 | new LatencyConstraint(Duration.ofSeconds(2)), | ... | ... |
... | @@ -37,7 +37,7 @@ import org.onosproject.net.intent.IntentExtensionService; | ... | @@ -37,7 +37,7 @@ import org.onosproject.net.intent.IntentExtensionService; |
37 | import org.onosproject.net.intent.OpticalPathIntent; | 37 | import org.onosproject.net.intent.OpticalPathIntent; |
38 | import org.onosproject.net.intent.impl.IntentCompilationException; | 38 | import org.onosproject.net.intent.impl.IntentCompilationException; |
39 | import org.onosproject.net.resource.DefaultLinkResourceRequest; | 39 | import org.onosproject.net.resource.DefaultLinkResourceRequest; |
40 | -import org.onosproject.net.resource.Lambda; | 40 | +import org.onosproject.net.resource.LambdaResource; |
41 | import org.onosproject.net.resource.LambdaResourceAllocation; | 41 | import org.onosproject.net.resource.LambdaResourceAllocation; |
42 | import org.onosproject.net.resource.LinkResourceAllocations; | 42 | import org.onosproject.net.resource.LinkResourceAllocations; |
43 | import org.onosproject.net.resource.LinkResourceRequest; | 43 | import org.onosproject.net.resource.LinkResourceRequest; |
... | @@ -110,7 +110,7 @@ public class OpticalPathIntentCompiler implements IntentCompiler<OpticalPathInte | ... | @@ -110,7 +110,7 @@ public class OpticalPathIntentCompiler implements IntentCompiler<OpticalPathInte |
110 | .filter(x -> x.type() == ResourceType.LAMBDA) | 110 | .filter(x -> x.type() == ResourceType.LAMBDA) |
111 | .findFirst() | 111 | .findFirst() |
112 | .orElseThrow(() -> new IntentCompilationException("Lambda was not assigned successfully")); | 112 | .orElseThrow(() -> new IntentCompilationException("Lambda was not assigned successfully")); |
113 | - Lambda la = ((LambdaResourceAllocation) allocation).lambda(); | 113 | + LambdaResource la = ((LambdaResourceAllocation) allocation).lambda(); |
114 | 114 | ||
115 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); | 115 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); |
116 | treatmentBuilder.setLambda((short) la.toInt()); | 116 | treatmentBuilder.setLambda((short) la.toInt()); | ... | ... |
... | @@ -28,7 +28,7 @@ import org.onosproject.net.intent.IntentId; | ... | @@ -28,7 +28,7 @@ import org.onosproject.net.intent.IntentId; |
28 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 28 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
29 | import org.onosproject.net.resource.BandwidthResourceRequest; | 29 | import org.onosproject.net.resource.BandwidthResourceRequest; |
30 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; | 30 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; |
31 | -import org.onosproject.net.resource.Lambda; | 31 | +import org.onosproject.net.resource.LambdaResource; |
32 | import org.onosproject.net.resource.LambdaResourceAllocation; | 32 | import org.onosproject.net.resource.LambdaResourceAllocation; |
33 | import org.onosproject.net.resource.LambdaResourceRequest; | 33 | import org.onosproject.net.resource.LambdaResourceRequest; |
34 | import org.onosproject.net.resource.LinkResourceAllocations; | 34 | import org.onosproject.net.resource.LinkResourceAllocations; |
... | @@ -92,13 +92,13 @@ public class LinkResourceManager implements LinkResourceService { | ... | @@ -92,13 +92,13 @@ public class LinkResourceManager implements LinkResourceService { |
92 | * @param link the link | 92 | * @param link the link |
93 | * @return available lambdas on specified link | 93 | * @return available lambdas on specified link |
94 | */ | 94 | */ |
95 | - private Set<Lambda> getAvailableLambdas(Link link) { | 95 | + private Set<LambdaResource> getAvailableLambdas(Link link) { |
96 | checkNotNull(link); | 96 | checkNotNull(link); |
97 | Set<ResourceAllocation> resAllocs = store.getFreeResources(link); | 97 | Set<ResourceAllocation> resAllocs = store.getFreeResources(link); |
98 | if (resAllocs == null) { | 98 | if (resAllocs == null) { |
99 | return Collections.emptySet(); | 99 | return Collections.emptySet(); |
100 | } | 100 | } |
101 | - Set<Lambda> lambdas = new HashSet<>(); | 101 | + Set<LambdaResource> lambdas = new HashSet<>(); |
102 | for (ResourceAllocation res : resAllocs) { | 102 | for (ResourceAllocation res : resAllocs) { |
103 | if (res.type() == ResourceType.LAMBDA) { | 103 | if (res.type() == ResourceType.LAMBDA) { |
104 | lambdas.add(((LambdaResourceAllocation) res).lambda()); | 104 | lambdas.add(((LambdaResourceAllocation) res).lambda()); |
... | @@ -114,11 +114,11 @@ public class LinkResourceManager implements LinkResourceService { | ... | @@ -114,11 +114,11 @@ public class LinkResourceManager implements LinkResourceService { |
114 | * @param links the links | 114 | * @param links the links |
115 | * @return available lambdas on specified links | 115 | * @return available lambdas on specified links |
116 | */ | 116 | */ |
117 | - private Iterable<Lambda> getAvailableLambdas(Iterable<Link> links) { | 117 | + private Iterable<LambdaResource> getAvailableLambdas(Iterable<Link> links) { |
118 | checkNotNull(links); | 118 | checkNotNull(links); |
119 | Iterator<Link> i = links.iterator(); | 119 | Iterator<Link> i = links.iterator(); |
120 | checkArgument(i.hasNext()); | 120 | checkArgument(i.hasNext()); |
121 | - Set<Lambda> lambdas = new HashSet<>(getAvailableLambdas(i.next())); | 121 | + Set<LambdaResource> lambdas = new HashSet<>(getAvailableLambdas(i.next())); |
122 | while (i.hasNext()) { | 122 | while (i.hasNext()) { |
123 | lambdas.retainAll(getAvailableLambdas(i.next())); | 123 | lambdas.retainAll(getAvailableLambdas(i.next())); |
124 | } | 124 | } |
... | @@ -162,7 +162,7 @@ public class LinkResourceManager implements LinkResourceService { | ... | @@ -162,7 +162,7 @@ public class LinkResourceManager implements LinkResourceService { |
162 | allocs.add(new BandwidthResourceAllocation(br.bandwidth())); | 162 | allocs.add(new BandwidthResourceAllocation(br.bandwidth())); |
163 | break; | 163 | break; |
164 | case LAMBDA: | 164 | case LAMBDA: |
165 | - Iterator<Lambda> lambdaIterator = | 165 | + Iterator<LambdaResource> lambdaIterator = |
166 | getAvailableLambdas(req.links()).iterator(); | 166 | getAvailableLambdas(req.links()).iterator(); |
167 | if (lambdaIterator.hasNext()) { | 167 | if (lambdaIterator.hasNext()) { |
168 | allocs.add(new LambdaResourceAllocation(lambdaIterator.next())); | 168 | allocs.add(new LambdaResourceAllocation(lambdaIterator.next())); | ... | ... |
... | @@ -34,7 +34,7 @@ import org.onosproject.net.intent.constraint.BandwidthConstraint; | ... | @@ -34,7 +34,7 @@ import org.onosproject.net.intent.constraint.BandwidthConstraint; |
34 | import org.onosproject.net.intent.constraint.LambdaConstraint; | 34 | import org.onosproject.net.intent.constraint.LambdaConstraint; |
35 | import org.onosproject.net.intent.impl.PathNotFoundException; | 35 | import org.onosproject.net.intent.impl.PathNotFoundException; |
36 | import org.onosproject.net.resource.Bandwidth; | 36 | import org.onosproject.net.resource.Bandwidth; |
37 | -import org.onosproject.net.resource.Lambda; | 37 | +import org.onosproject.net.resource.LambdaResource; |
38 | import org.onosproject.net.resource.LinkResourceService; | 38 | import org.onosproject.net.resource.LinkResourceService; |
39 | 39 | ||
40 | import java.util.Arrays; | 40 | import java.util.Arrays; |
... | @@ -271,7 +271,7 @@ public class PointToPointIntentCompilerTest extends AbstractIntentTest { | ... | @@ -271,7 +271,7 @@ public class PointToPointIntentCompilerTest extends AbstractIntentTest { |
271 | @Test | 271 | @Test |
272 | public void testLambdaConstrainedIntentSuccess() { | 272 | public void testLambdaConstrainedIntentSuccess() { |
273 | 273 | ||
274 | - final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(Lambda.valueOf(1))); | 274 | + final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1))); |
275 | final LinkResourceService resourceService = | 275 | final LinkResourceService resourceService = |
276 | IntentTestsMocks.MockResourceService.makeLambdaResourceService(1); | 276 | IntentTestsMocks.MockResourceService.makeLambdaResourceService(1); |
277 | 277 | ||
... | @@ -294,7 +294,7 @@ public class PointToPointIntentCompilerTest extends AbstractIntentTest { | ... | @@ -294,7 +294,7 @@ public class PointToPointIntentCompilerTest extends AbstractIntentTest { |
294 | @Test | 294 | @Test |
295 | public void testLambdaConstrainedIntentFailure() { | 295 | public void testLambdaConstrainedIntentFailure() { |
296 | 296 | ||
297 | - final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(Lambda.valueOf(1))); | 297 | + final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1))); |
298 | final LinkResourceService resourceService = | 298 | final LinkResourceService resourceService = |
299 | IntentTestsMocks.MockResourceService.makeBandwidthResourceService(10.0); | 299 | IntentTestsMocks.MockResourceService.makeBandwidthResourceService(10.0); |
300 | try { | 300 | try { | ... | ... |
... | @@ -25,7 +25,7 @@ import org.onosproject.net.intent.IntentId; | ... | @@ -25,7 +25,7 @@ import org.onosproject.net.intent.IntentId; |
25 | import org.onosproject.net.link.LinkService; | 25 | import org.onosproject.net.link.LinkService; |
26 | import org.onosproject.net.resource.Bandwidth; | 26 | import org.onosproject.net.resource.Bandwidth; |
27 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 27 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
28 | -import org.onosproject.net.resource.Lambda; | 28 | +import org.onosproject.net.resource.LambdaResource; |
29 | import org.onosproject.net.resource.LambdaResourceAllocation; | 29 | import org.onosproject.net.resource.LambdaResourceAllocation; |
30 | import org.onosproject.net.resource.LinkResourceAllocations; | 30 | import org.onosproject.net.resource.LinkResourceAllocations; |
31 | import org.onosproject.net.resource.LinkResourceEvent; | 31 | import org.onosproject.net.resource.LinkResourceEvent; |
... | @@ -138,7 +138,7 @@ public class ConsistentLinkResourceStore extends | ... | @@ -138,7 +138,7 @@ public class ConsistentLinkResourceStore extends |
138 | try { | 138 | try { |
139 | final int waves = Integer.parseInt(link.annotations().value(OPTICAL_WAVES)); | 139 | final int waves = Integer.parseInt(link.annotations().value(OPTICAL_WAVES)); |
140 | for (int i = 1; i <= waves; i++) { | 140 | for (int i = 1; i <= waves; i++) { |
141 | - allocations.add(new LambdaResourceAllocation(Lambda.valueOf(i))); | 141 | + allocations.add(new LambdaResourceAllocation(LambdaResource.valueOf(i))); |
142 | } | 142 | } |
143 | } catch (NumberFormatException e) { | 143 | } catch (NumberFormatException e) { |
144 | log.debug("No {} annotation on link {}", OPTICAL_WAVES, link); | 144 | log.debug("No {} annotation on link {}", OPTICAL_WAVES, link); | ... | ... |
... | @@ -38,7 +38,7 @@ import org.onosproject.net.intent.IntentId; | ... | @@ -38,7 +38,7 @@ import org.onosproject.net.intent.IntentId; |
38 | import org.onosproject.net.link.LinkService; | 38 | import org.onosproject.net.link.LinkService; |
39 | import org.onosproject.net.resource.Bandwidth; | 39 | import org.onosproject.net.resource.Bandwidth; |
40 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 40 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
41 | -import org.onosproject.net.resource.Lambda; | 41 | +import org.onosproject.net.resource.LambdaResource; |
42 | import org.onosproject.net.resource.LambdaResourceAllocation; | 42 | import org.onosproject.net.resource.LambdaResourceAllocation; |
43 | import org.onosproject.net.resource.LinkResourceAllocations; | 43 | import org.onosproject.net.resource.LinkResourceAllocations; |
44 | import org.onosproject.net.resource.LinkResourceEvent; | 44 | import org.onosproject.net.resource.LinkResourceEvent; |
... | @@ -157,7 +157,7 @@ public class HazelcastLinkResourceStore | ... | @@ -157,7 +157,7 @@ public class HazelcastLinkResourceStore |
157 | try { | 157 | try { |
158 | final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation)); | 158 | final int waves = Integer.parseInt(link.annotations().value(wavesAnnotation)); |
159 | for (int i = 1; i <= waves; i++) { | 159 | for (int i = 1; i <= waves; i++) { |
160 | - allocations.add(new LambdaResourceAllocation(Lambda.valueOf(i))); | 160 | + allocations.add(new LambdaResourceAllocation(LambdaResource.valueOf(i))); |
161 | } | 161 | } |
162 | } catch (NumberFormatException e) { | 162 | } catch (NumberFormatException e) { |
163 | log.debug("No {} annotation on link %s", wavesAnnotation, link); | 163 | log.debug("No {} annotation on link %s", wavesAnnotation, link); | ... | ... |
... | @@ -33,7 +33,7 @@ import org.onosproject.net.resource.Bandwidth; | ... | @@ -33,7 +33,7 @@ import org.onosproject.net.resource.Bandwidth; |
33 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 33 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
34 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; | 34 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; |
35 | import org.onosproject.net.resource.DefaultLinkResourceRequest; | 35 | import org.onosproject.net.resource.DefaultLinkResourceRequest; |
36 | -import org.onosproject.net.resource.Lambda; | 36 | +import org.onosproject.net.resource.LambdaResource; |
37 | import org.onosproject.net.resource.LambdaResourceAllocation; | 37 | import org.onosproject.net.resource.LambdaResourceAllocation; |
38 | import org.onosproject.net.resource.LinkResourceAllocations; | 38 | import org.onosproject.net.resource.LinkResourceAllocations; |
39 | import org.onosproject.net.resource.LinkResourceRequest; | 39 | import org.onosproject.net.resource.LinkResourceRequest; |
... | @@ -279,7 +279,7 @@ public class HazelcastLinkResourceStoreTest { | ... | @@ -279,7 +279,7 @@ public class HazelcastLinkResourceStoreTest { |
279 | ImmutableSet.of(link)) | 279 | ImmutableSet.of(link)) |
280 | .build(); | 280 | .build(); |
281 | final ResourceAllocation allocation = | 281 | final ResourceAllocation allocation = |
282 | - new LambdaResourceAllocation(Lambda.valueOf(33)); | 282 | + new LambdaResourceAllocation(LambdaResource.valueOf(33)); |
283 | final Set<ResourceAllocation> allocationSet = ImmutableSet.of(allocation); | 283 | final Set<ResourceAllocation> allocationSet = ImmutableSet.of(allocation); |
284 | 284 | ||
285 | final LinkResourceAllocations allocations = | 285 | final LinkResourceAllocations allocations = | ... | ... |
... | @@ -152,7 +152,7 @@ import org.onosproject.net.resource.BandwidthResourceAllocation; | ... | @@ -152,7 +152,7 @@ import org.onosproject.net.resource.BandwidthResourceAllocation; |
152 | import org.onosproject.net.resource.BandwidthResourceRequest; | 152 | import org.onosproject.net.resource.BandwidthResourceRequest; |
153 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; | 153 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; |
154 | import org.onosproject.net.resource.DefaultLinkResourceRequest; | 154 | import org.onosproject.net.resource.DefaultLinkResourceRequest; |
155 | -import org.onosproject.net.resource.Lambda; | 155 | +import org.onosproject.net.resource.LambdaResource; |
156 | import org.onosproject.net.resource.LambdaResourceAllocation; | 156 | import org.onosproject.net.resource.LambdaResourceAllocation; |
157 | import org.onosproject.net.resource.LambdaResourceRequest; | 157 | import org.onosproject.net.resource.LambdaResourceRequest; |
158 | import org.onosproject.net.resource.LinkResourceRequest; | 158 | import org.onosproject.net.resource.LinkResourceRequest; |
... | @@ -355,7 +355,7 @@ public final class KryoNamespaces { | ... | @@ -355,7 +355,7 @@ public final class KryoNamespaces { |
355 | DefaultLinkResourceRequest.class, | 355 | DefaultLinkResourceRequest.class, |
356 | BandwidthResourceRequest.class, | 356 | BandwidthResourceRequest.class, |
357 | LambdaResourceRequest.class, | 357 | LambdaResourceRequest.class, |
358 | - Lambda.class, | 358 | + LambdaResource.class, |
359 | Bandwidth.class, | 359 | Bandwidth.class, |
360 | DefaultLinkResourceAllocations.class, | 360 | DefaultLinkResourceAllocations.class, |
361 | BandwidthResourceAllocation.class, | 361 | BandwidthResourceAllocation.class, | ... | ... |
... | @@ -62,7 +62,7 @@ import org.onosproject.net.resource.Bandwidth; | ... | @@ -62,7 +62,7 @@ import org.onosproject.net.resource.Bandwidth; |
62 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 62 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
63 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; | 63 | import org.onosproject.net.resource.DefaultLinkResourceAllocations; |
64 | import org.onosproject.net.resource.DefaultLinkResourceRequest; | 64 | import org.onosproject.net.resource.DefaultLinkResourceRequest; |
65 | -import org.onosproject.net.resource.Lambda; | 65 | +import org.onosproject.net.resource.LambdaResource; |
66 | import org.onosproject.net.resource.LambdaResourceAllocation; | 66 | import org.onosproject.net.resource.LambdaResourceAllocation; |
67 | import org.onosproject.net.resource.LinkResourceRequest; | 67 | import org.onosproject.net.resource.LinkResourceRequest; |
68 | import org.onosproject.net.resource.ResourceAllocation; | 68 | import org.onosproject.net.resource.ResourceAllocation; |
... | @@ -355,7 +355,7 @@ public class KryoSerializerTest { | ... | @@ -355,7 +355,7 @@ public class KryoSerializerTest { |
355 | Map<Link, Set<ResourceAllocation>> allocations = new HashMap<>(); | 355 | Map<Link, Set<ResourceAllocation>> allocations = new HashMap<>(); |
356 | allocations.put(new DefaultLink(PID, CP1, CP2, Type.DIRECT), | 356 | allocations.put(new DefaultLink(PID, CP1, CP2, Type.DIRECT), |
357 | ImmutableSet.of(new BandwidthResourceAllocation(Bandwidth.bps(10.0)), | 357 | ImmutableSet.of(new BandwidthResourceAllocation(Bandwidth.bps(10.0)), |
358 | - new LambdaResourceAllocation(Lambda.valueOf(1)))); | 358 | + new LambdaResourceAllocation(LambdaResource.valueOf(1)))); |
359 | testSerializable(new DefaultLinkResourceAllocations(request, allocations)); | 359 | testSerializable(new DefaultLinkResourceAllocations(request, allocations)); |
360 | } | 360 | } |
361 | 361 | ||
... | @@ -367,7 +367,7 @@ public class KryoSerializerTest { | ... | @@ -367,7 +367,7 @@ public class KryoSerializerTest { |
367 | 367 | ||
368 | @Test | 368 | @Test |
369 | public void testLambdaConstraint() { | 369 | public void testLambdaConstraint() { |
370 | - testSerializable(new LambdaConstraint(Lambda.valueOf(1))); | 370 | + testSerializable(new LambdaConstraint(LambdaResource.valueOf(1))); |
371 | } | 371 | } |
372 | 372 | ||
373 | @Test | 373 | @Test | ... | ... |
... | @@ -33,7 +33,7 @@ import org.onosproject.net.Link; | ... | @@ -33,7 +33,7 @@ import org.onosproject.net.Link; |
33 | import org.onosproject.net.intent.IntentId; | 33 | import org.onosproject.net.intent.IntentId; |
34 | import org.onosproject.net.resource.Bandwidth; | 34 | import org.onosproject.net.resource.Bandwidth; |
35 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 35 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
36 | -import org.onosproject.net.resource.Lambda; | 36 | +import org.onosproject.net.resource.LambdaResource; |
37 | import org.onosproject.net.resource.LambdaResourceAllocation; | 37 | import org.onosproject.net.resource.LambdaResourceAllocation; |
38 | import org.onosproject.net.resource.LinkResourceAllocations; | 38 | import org.onosproject.net.resource.LinkResourceAllocations; |
39 | import org.onosproject.net.resource.LinkResourceEvent; | 39 | import org.onosproject.net.resource.LinkResourceEvent; |
... | @@ -90,7 +90,7 @@ public class SimpleLinkResourceStore implements LinkResourceStore { | ... | @@ -90,7 +90,7 @@ public class SimpleLinkResourceStore implements LinkResourceStore { |
90 | try { | 90 | try { |
91 | int waves = Integer.parseInt(annotations.value(AnnotationKeys.OPTICAL_WAVES)); | 91 | int waves = Integer.parseInt(annotations.value(AnnotationKeys.OPTICAL_WAVES)); |
92 | for (int i = 1; i <= waves; i++) { | 92 | for (int i = 1; i <= waves; i++) { |
93 | - allocations.add(new LambdaResourceAllocation(Lambda.valueOf(i))); | 93 | + allocations.add(new LambdaResourceAllocation(LambdaResource.valueOf(i))); |
94 | } | 94 | } |
95 | } catch (NumberFormatException e) { | 95 | } catch (NumberFormatException e) { |
96 | log.debug("No optical.wave annotation on link %s", link); | 96 | log.debug("No optical.wave annotation on link %s", link); | ... | ... |
core/store/trivial/src/test/java/org/onosproject/store/trivial/impl/SimpleLinkResourceStoreTest.java
... | @@ -32,7 +32,7 @@ import org.onosproject.net.intent.IntentId; | ... | @@ -32,7 +32,7 @@ import org.onosproject.net.intent.IntentId; |
32 | import org.onosproject.net.provider.ProviderId; | 32 | import org.onosproject.net.provider.ProviderId; |
33 | import org.onosproject.net.resource.Bandwidth; | 33 | import org.onosproject.net.resource.Bandwidth; |
34 | import org.onosproject.net.resource.BandwidthResourceAllocation; | 34 | import org.onosproject.net.resource.BandwidthResourceAllocation; |
35 | -import org.onosproject.net.resource.Lambda; | 35 | +import org.onosproject.net.resource.LambdaResource; |
36 | import org.onosproject.net.resource.LambdaResourceAllocation; | 36 | import org.onosproject.net.resource.LambdaResourceAllocation; |
37 | import org.onosproject.net.resource.LinkResourceAllocations; | 37 | import org.onosproject.net.resource.LinkResourceAllocations; |
38 | import org.onosproject.net.resource.LinkResourceStore; | 38 | import org.onosproject.net.resource.LinkResourceStore; |
... | @@ -220,7 +220,7 @@ public class SimpleLinkResourceStoreTest { | ... | @@ -220,7 +220,7 @@ public class SimpleLinkResourceStoreTest { |
220 | @Override | 220 | @Override |
221 | public Set<ResourceAllocation> getResourceAllocation(Link link) { | 221 | public Set<ResourceAllocation> getResourceAllocation(Link link) { |
222 | final ResourceAllocation allocation = | 222 | final ResourceAllocation allocation = |
223 | - new LambdaResourceAllocation(Lambda.valueOf(allocatedLambda)); | 223 | + new LambdaResourceAllocation(LambdaResource.valueOf(allocatedLambda)); |
224 | final Set<ResourceAllocation> allocations = new HashSet<>(); | 224 | final Set<ResourceAllocation> allocations = new HashSet<>(); |
225 | allocations.add(allocation); | 225 | allocations.add(allocation); |
226 | return allocations; | 226 | return allocations; | ... | ... |
-
Please register or login to post a comment