Merge branch 'optical-integration' of ssh://gerrit.onlab.us:29418/onos-next into optical-integration
Showing
10 changed files
with
155 additions
and
61 deletions
1 | +/* | ||
2 | + * Licensed to the Apache Software Foundation (ASF) under one | ||
3 | + * or more contributor license agreements. See the NOTICE file | ||
4 | + * distributed with this work for additional information | ||
5 | + * regarding copyright ownership. The ASF licenses this file | ||
6 | + * to you under the Apache License, Version 2.0 (the | ||
7 | + * "License"); you may not use this file except in compliance | ||
8 | + * with the License. You may obtain a copy of the License at | ||
9 | + * | ||
10 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | + * | ||
12 | + * Unless required by applicable law or agreed to in writing, | ||
13 | + * software distributed under the License is distributed on an | ||
14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
15 | + * KIND, either express or implied. See the License for the | ||
16 | + * specific language governing permissions and limitations | ||
17 | + * under the License. | ||
18 | + */ | ||
19 | +package org.onlab.onos.cli.net; | ||
20 | + | ||
21 | +import static org.onlab.onos.net.DeviceId.deviceId; | ||
22 | +import static org.onlab.onos.net.PortNumber.portNumber; | ||
23 | + | ||
24 | +import org.apache.karaf.shell.commands.Argument; | ||
25 | +import org.apache.karaf.shell.commands.Command; | ||
26 | +import org.onlab.onos.net.ConnectPoint; | ||
27 | +import org.onlab.onos.net.DeviceId; | ||
28 | +import org.onlab.onos.net.PortNumber; | ||
29 | +import org.onlab.onos.net.intent.Intent; | ||
30 | +import org.onlab.onos.net.intent.IntentService; | ||
31 | +import org.onlab.onos.net.intent.OpticalConnectivityIntent; | ||
32 | + | ||
33 | +/** | ||
34 | + * Installs optical connectivity intents. | ||
35 | + */ | ||
36 | +@Command(scope = "onos", name = "add-optical-intent", | ||
37 | + description = "Installs optical connectivity intent") | ||
38 | +public class AddOpticalIntentCommand extends ConnectivityIntentCommand { | ||
39 | + | ||
40 | + @Argument(index = 0, name = "ingressDevice", | ||
41 | + description = "Ingress Device/Port Description", | ||
42 | + required = true, multiValued = false) | ||
43 | + String ingressDeviceString = null; | ||
44 | + | ||
45 | + @Argument(index = 1, name = "egressDevice", | ||
46 | + description = "Egress Device/Port Description", | ||
47 | + required = true, multiValued = false) | ||
48 | + String egressDeviceString = null; | ||
49 | + | ||
50 | + @Override | ||
51 | + protected void execute() { | ||
52 | + IntentService service = get(IntentService.class); | ||
53 | + | ||
54 | + DeviceId ingressDeviceId = deviceId(getDeviceId(ingressDeviceString)); | ||
55 | + PortNumber ingressPortNumber = portNumber(getPortNumber(ingressDeviceString)); | ||
56 | + ConnectPoint ingress = new ConnectPoint(ingressDeviceId, ingressPortNumber); | ||
57 | + | ||
58 | + DeviceId egressDeviceId = deviceId(getDeviceId(egressDeviceString)); | ||
59 | + PortNumber egressPortNumber = portNumber(getPortNumber(egressDeviceString)); | ||
60 | + ConnectPoint egress = new ConnectPoint(egressDeviceId, egressPortNumber); | ||
61 | + | ||
62 | + Intent intent = new OpticalConnectivityIntent(appId(), ingress, egress); | ||
63 | + service.submit(intent); | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * Extracts the port number portion of the ConnectPoint. | ||
68 | + * | ||
69 | + * @param deviceString string representing the device/port | ||
70 | + * @return port number as a string, empty string if the port is not found | ||
71 | + */ | ||
72 | + private String getPortNumber(String deviceString) { | ||
73 | + int slash = deviceString.indexOf('/'); | ||
74 | + if (slash <= 0) { | ||
75 | + return ""; | ||
76 | + } | ||
77 | + return deviceString.substring(slash + 1, deviceString.length()); | ||
78 | + } | ||
79 | + | ||
80 | + /** | ||
81 | + * Extracts the device ID portion of the ConnectPoint. | ||
82 | + * | ||
83 | + * @param deviceString string representing the device/port | ||
84 | + * @return device ID string | ||
85 | + */ | ||
86 | + private String getDeviceId(String deviceString) { | ||
87 | + int slash = deviceString.indexOf('/'); | ||
88 | + if (slash <= 0) { | ||
89 | + return ""; | ||
90 | + } | ||
91 | + return deviceString.substring(0, slash); | ||
92 | + } | ||
93 | +} |
... | @@ -119,6 +119,14 @@ | ... | @@ -119,6 +119,14 @@ |
119 | </optional-completers> | 119 | </optional-completers> |
120 | </command> | 120 | </command> |
121 | <command> | 121 | <command> |
122 | + <action class="org.onlab.onos.cli.net.AddOpticalIntentCommand"/> | ||
123 | + <completers> | ||
124 | + <ref component-id="connectPointCompleter"/> | ||
125 | + <ref component-id="connectPointCompleter"/> | ||
126 | + <null/> | ||
127 | + </completers> | ||
128 | + </command> | ||
129 | + <command> | ||
122 | <action class="org.onlab.onos.cli.net.GetStatistics"/> | 130 | <action class="org.onlab.onos.cli.net.GetStatistics"/> |
123 | <completers> | 131 | <completers> |
124 | <ref component-id="connectPointCompleter"/> | 132 | <ref component-id="connectPointCompleter"/> | ... | ... |
... | @@ -6,46 +6,45 @@ import org.onlab.onos.ApplicationId; | ... | @@ -6,46 +6,45 @@ import org.onlab.onos.ApplicationId; |
6 | import org.onlab.onos.net.ConnectPoint; | 6 | import org.onlab.onos.net.ConnectPoint; |
7 | import org.onlab.onos.net.Link; | 7 | import org.onlab.onos.net.Link; |
8 | import org.onlab.onos.net.Path; | 8 | import org.onlab.onos.net.Path; |
9 | -import org.onlab.onos.net.flow.TrafficSelector; | ||
10 | -import org.onlab.onos.net.flow.TrafficTreatment; | ||
11 | 9 | ||
12 | import com.google.common.base.MoreObjects; | 10 | import com.google.common.base.MoreObjects; |
13 | 11 | ||
14 | -public class OpticalPathIntent extends OpticalConnectivityIntent { | 12 | +public class OpticalPathIntent extends ConnectivityIntent { |
13 | + | ||
14 | + private final ConnectPoint src; | ||
15 | + private final ConnectPoint dst; | ||
15 | private final Path path; | 16 | private final Path path; |
16 | - // private final TrafficSelector opticalMatch; | 17 | + |
17 | - // private final TrafficTreatment opticalAction; | ||
18 | 18 | ||
19 | public OpticalPathIntent(ApplicationId appId, | 19 | public OpticalPathIntent(ApplicationId appId, |
20 | ConnectPoint src, | 20 | ConnectPoint src, |
21 | ConnectPoint dst, | 21 | ConnectPoint dst, |
22 | - TrafficSelector match, | ||
23 | - TrafficTreatment action, | ||
24 | Path path) { | 22 | Path path) { |
25 | - super(appId, src, dst); | 23 | + super(id(OpticalPathIntent.class, src, dst), |
26 | - // this.opticalMatch = match; | 24 | + appId, resources(path.links()), null, null); |
27 | - // this.opticalAction = action; | 25 | + this.src = src; |
26 | + this.dst = dst; | ||
28 | this.path = path; | 27 | this.path = path; |
29 | } | 28 | } |
30 | 29 | ||
31 | protected OpticalPathIntent() { | 30 | protected OpticalPathIntent() { |
32 | - // this.opticalMatch = null; | 31 | + this.src = null; |
33 | - // this.opticalAction = null; | 32 | + this.dst = null; |
34 | this.path = null; | 33 | this.path = null; |
35 | } | 34 | } |
36 | 35 | ||
37 | - public Path path() { | 36 | + public ConnectPoint src() { |
38 | - return path; | 37 | + return src; |
39 | } | 38 | } |
40 | -/* | 39 | + |
41 | - public TrafficSelector selector() { | 40 | + public ConnectPoint dst() { |
42 | - // return opticalMatch; | 41 | + return dst; |
43 | } | 42 | } |
44 | 43 | ||
45 | - public TrafficTreatment treatment() { | 44 | + public Path path() { |
46 | - // return opticalAction; | 45 | + return path; |
47 | } | 46 | } |
48 | -*/ | 47 | + |
49 | @Override | 48 | @Override |
50 | public boolean isInstallable() { | 49 | public boolean isInstallable() { |
51 | return true; | 50 | return true; |
... | @@ -55,10 +54,8 @@ public class OpticalPathIntent extends OpticalConnectivityIntent { | ... | @@ -55,10 +54,8 @@ public class OpticalPathIntent extends OpticalConnectivityIntent { |
55 | public String toString() { | 54 | public String toString() { |
56 | return MoreObjects.toStringHelper(getClass()) | 55 | return MoreObjects.toStringHelper(getClass()) |
57 | .add("id", id()) | 56 | .add("id", id()) |
58 | - //.add("match", opticalMatch) | 57 | + .add("ingressPort", src) |
59 | - //.add("action", opticalAction) | 58 | + .add("egressPort", dst) |
60 | - .add("ingressPort", this.getSrcConnectPoint()) | ||
61 | - .add("egressPort", this.getDst()) | ||
62 | .add("path", path) | 59 | .add("path", path) |
63 | .toString(); | 60 | .toString(); |
64 | } | 61 | } | ... | ... |
... | @@ -36,7 +36,7 @@ public interface LinkResourceService { | ... | @@ -36,7 +36,7 @@ public interface LinkResourceService { |
36 | * @param intentId the target Intent's id | 36 | * @param intentId the target Intent's id |
37 | * @return allocated resources for Intent | 37 | * @return allocated resources for Intent |
38 | */ | 38 | */ |
39 | - LinkResourceAllocations getAllocation(IntentId intentId); | 39 | + LinkResourceAllocations getAllocations(IntentId intentId); |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Returns all allocated resources to given link. | 42 | * Returns all allocated resources to given link. | ... | ... |
... | @@ -5,10 +5,4 @@ package org.onlab.onos.net.resource; | ... | @@ -5,10 +5,4 @@ package org.onlab.onos.net.resource; |
5 | */ | 5 | */ |
6 | public interface ResourceAllocation extends ResourceRequest { | 6 | public interface ResourceAllocation extends ResourceRequest { |
7 | 7 | ||
8 | - /** | ||
9 | - * Returns the type of the allocated resource. | ||
10 | - * | ||
11 | - * @return the type of the allocated resource | ||
12 | - */ | ||
13 | - ResourceType type(); | ||
14 | } | 8 | } | ... | ... |
... | @@ -14,16 +14,11 @@ import org.apache.felix.scr.annotations.Reference; | ... | @@ -14,16 +14,11 @@ import org.apache.felix.scr.annotations.Reference; |
14 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 14 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
15 | import org.onlab.onos.CoreService; | 15 | import org.onlab.onos.CoreService; |
16 | import org.onlab.onos.net.ConnectPoint; | 16 | import org.onlab.onos.net.ConnectPoint; |
17 | - | ||
18 | import org.onlab.onos.net.Link; | 17 | import org.onlab.onos.net.Link; |
19 | import org.onlab.onos.net.Path; | 18 | import org.onlab.onos.net.Path; |
20 | -import org.onlab.onos.net.flow.TrafficSelector; | ||
21 | -import org.onlab.onos.net.flow.TrafficTreatment; | ||
22 | - | ||
23 | import org.onlab.onos.net.intent.Intent; | 19 | import org.onlab.onos.net.intent.Intent; |
24 | import org.onlab.onos.net.intent.IntentCompiler; | 20 | import org.onlab.onos.net.intent.IntentCompiler; |
25 | import org.onlab.onos.net.intent.IntentExtensionService; | 21 | import org.onlab.onos.net.intent.IntentExtensionService; |
26 | - | ||
27 | import org.onlab.onos.net.intent.OpticalConnectivityIntent; | 22 | import org.onlab.onos.net.intent.OpticalConnectivityIntent; |
28 | import org.onlab.onos.net.intent.OpticalPathIntent; | 23 | import org.onlab.onos.net.intent.OpticalPathIntent; |
29 | import org.onlab.onos.net.provider.ProviderId; | 24 | import org.onlab.onos.net.provider.ProviderId; |
... | @@ -32,7 +27,6 @@ import org.onlab.onos.net.topology.LinkWeight; | ... | @@ -32,7 +27,6 @@ import org.onlab.onos.net.topology.LinkWeight; |
32 | import org.onlab.onos.net.topology.PathService; | 27 | import org.onlab.onos.net.topology.PathService; |
33 | import org.onlab.onos.net.topology.Topology; | 28 | import org.onlab.onos.net.topology.Topology; |
34 | import org.onlab.onos.net.topology.TopologyEdge; | 29 | import org.onlab.onos.net.topology.TopologyEdge; |
35 | - | ||
36 | import org.onlab.onos.net.topology.TopologyService; | 30 | import org.onlab.onos.net.topology.TopologyService; |
37 | import org.slf4j.Logger; | 31 | import org.slf4j.Logger; |
38 | 32 | ||
... | @@ -88,15 +82,10 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -88,15 +82,10 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
88 | links.addAll(path.links()); | 82 | links.addAll(path.links()); |
89 | //links.add(DefaultEdgeLink.createEdgeLink(intent.getDst(), false)); | 83 | //links.add(DefaultEdgeLink.createEdgeLink(intent.getDst(), false)); |
90 | 84 | ||
91 | - TrafficSelector opticalSelector = null; | ||
92 | - TrafficTreatment opticalTreatment = null; | ||
93 | - | ||
94 | // create a new opticalPathIntent | 85 | // create a new opticalPathIntent |
95 | Intent newIntent = new OpticalPathIntent(intent.appId(), | 86 | Intent newIntent = new OpticalPathIntent(intent.appId(), |
96 | path.src(), | 87 | path.src(), |
97 | path.dst(), | 88 | path.dst(), |
98 | - opticalSelector, | ||
99 | - opticalTreatment, | ||
100 | path); | 89 | path); |
101 | 90 | ||
102 | retList.add(newIntent); | 91 | retList.add(newIntent); | ... | ... |
... | @@ -3,7 +3,6 @@ package org.onlab.onos.net.intent.impl; | ... | @@ -3,7 +3,6 @@ package org.onlab.onos.net.intent.impl; |
3 | import static org.onlab.onos.net.flow.DefaultTrafficTreatment.builder; | 3 | import static org.onlab.onos.net.flow.DefaultTrafficTreatment.builder; |
4 | import static org.slf4j.LoggerFactory.getLogger; | 4 | import static org.slf4j.LoggerFactory.getLogger; |
5 | 5 | ||
6 | - | ||
7 | import java.util.List; | 6 | import java.util.List; |
8 | 7 | ||
9 | import org.apache.felix.scr.annotations.Activate; | 8 | import org.apache.felix.scr.annotations.Activate; |
... | @@ -20,11 +19,11 @@ import org.onlab.onos.net.flow.DefaultTrafficSelector; | ... | @@ -20,11 +19,11 @@ import org.onlab.onos.net.flow.DefaultTrafficSelector; |
20 | import org.onlab.onos.net.flow.DefaultTrafficTreatment; | 19 | import org.onlab.onos.net.flow.DefaultTrafficTreatment; |
21 | import org.onlab.onos.net.flow.FlowRule; | 20 | import org.onlab.onos.net.flow.FlowRule; |
22 | import org.onlab.onos.net.flow.FlowRuleBatchEntry; | 21 | import org.onlab.onos.net.flow.FlowRuleBatchEntry; |
22 | +import org.onlab.onos.net.flow.FlowRuleBatchEntry.FlowRuleOperation; | ||
23 | import org.onlab.onos.net.flow.FlowRuleBatchOperation; | 23 | import org.onlab.onos.net.flow.FlowRuleBatchOperation; |
24 | import org.onlab.onos.net.flow.FlowRuleService; | 24 | import org.onlab.onos.net.flow.FlowRuleService; |
25 | import org.onlab.onos.net.flow.TrafficSelector; | 25 | import org.onlab.onos.net.flow.TrafficSelector; |
26 | import org.onlab.onos.net.flow.TrafficTreatment; | 26 | import org.onlab.onos.net.flow.TrafficTreatment; |
27 | -import org.onlab.onos.net.flow.FlowRuleBatchEntry.FlowRuleOperation; | ||
28 | import org.onlab.onos.net.intent.IntentExtensionService; | 27 | import org.onlab.onos.net.intent.IntentExtensionService; |
29 | import org.onlab.onos.net.intent.IntentInstaller; | 28 | import org.onlab.onos.net.intent.IntentInstaller; |
30 | import org.onlab.onos.net.intent.OpticalPathIntent; | 29 | import org.onlab.onos.net.intent.OpticalPathIntent; |
... | @@ -86,12 +85,12 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -86,12 +85,12 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
86 | LinkResourceAllocations allocations = assignWavelength(intent); | 85 | LinkResourceAllocations allocations = assignWavelength(intent); |
87 | 86 | ||
88 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); | 87 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); |
89 | - selectorBuilder.matchInport(intent.getSrcConnectPoint().port()); | 88 | + selectorBuilder.matchInport(intent.src().port()); |
90 | 89 | ||
91 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); | 90 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); |
92 | 91 | ||
93 | List<FlowRuleBatchEntry> rules = Lists.newLinkedList(); | 92 | List<FlowRuleBatchEntry> rules = Lists.newLinkedList(); |
94 | - ConnectPoint prev = intent.getSrcConnectPoint(); | 93 | + ConnectPoint prev = intent.src(); |
95 | 94 | ||
96 | //TODO throw exception if the lambda was not assigned successfully | 95 | //TODO throw exception if the lambda was not assigned successfully |
97 | for (Link link : intent.path().links()) { | 96 | for (Link link : intent.path().links()) { |
... | @@ -109,7 +108,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -109,7 +108,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
109 | } | 108 | } |
110 | 109 | ||
111 | treatmentBuilder.setOutput(link.src().port()); | 110 | treatmentBuilder.setOutput(link.src().port()); |
112 | - //treatmentBuilder.setLambda(la.toInt()); | 111 | + treatmentBuilder.setLambda((short) la.toInt()); |
113 | 112 | ||
114 | FlowRule rule = new DefaultFlowRule(prev.deviceId(), | 113 | FlowRule rule = new DefaultFlowRule(prev.deviceId(), |
115 | selectorBuilder.build(), | 114 | selectorBuilder.build(), |
... | @@ -122,13 +121,13 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -122,13 +121,13 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
122 | 121 | ||
123 | prev = link.dst(); | 122 | prev = link.dst(); |
124 | selectorBuilder.matchInport(link.dst().port()); | 123 | selectorBuilder.matchInport(link.dst().port()); |
125 | - //selectorBuilder.setLambda(la.toInt()); | 124 | + selectorBuilder.matchLambda((short) la.toInt()); |
126 | } | 125 | } |
127 | 126 | ||
128 | // build the last T port rule | 127 | // build the last T port rule |
129 | TrafficTreatment treatmentLast = builder() | 128 | TrafficTreatment treatmentLast = builder() |
130 | - .setOutput(intent.getDst().port()).build(); | 129 | + .setOutput(intent.dst().port()).build(); |
131 | - FlowRule rule = new DefaultFlowRule(intent.getDst().deviceId(), | 130 | + FlowRule rule = new DefaultFlowRule(intent.dst().deviceId(), |
132 | selectorBuilder.build(), | 131 | selectorBuilder.build(), |
133 | treatmentLast, | 132 | treatmentLast, |
134 | 100, | 133 | 100, |
... | @@ -187,15 +186,15 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -187,15 +186,15 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
187 | 186 | ||
188 | @Override | 187 | @Override |
189 | public List<FlowRuleBatchOperation> uninstall(OpticalPathIntent intent) { | 188 | public List<FlowRuleBatchOperation> uninstall(OpticalPathIntent intent) { |
190 | - LinkResourceAllocations allocations = resourceService.getAllocation(intent.id()); | 189 | + LinkResourceAllocations allocations = resourceService.getAllocations(intent.id()); |
191 | 190 | ||
192 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); | 191 | TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); |
193 | - selectorBuilder.matchInport(intent.getSrcConnectPoint().port()); | 192 | + selectorBuilder.matchInport(intent.src().port()); |
194 | 193 | ||
195 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); | 194 | TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); |
196 | 195 | ||
197 | List<FlowRuleBatchEntry> rules = Lists.newLinkedList(); | 196 | List<FlowRuleBatchEntry> rules = Lists.newLinkedList(); |
198 | - ConnectPoint prev = intent.getSrcConnectPoint(); | 197 | + ConnectPoint prev = intent.src(); |
199 | 198 | ||
200 | //TODO throw exception if the lambda was not retrieved successfully | 199 | //TODO throw exception if the lambda was not retrieved successfully |
201 | for (Link link : intent.path().links()) { | 200 | for (Link link : intent.path().links()) { |
... | @@ -213,7 +212,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -213,7 +212,7 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
213 | } | 212 | } |
214 | 213 | ||
215 | treatmentBuilder.setOutput(link.src().port()); | 214 | treatmentBuilder.setOutput(link.src().port()); |
216 | - //treatmentBuilder.setLambda(la.toInt()); | 215 | + treatmentBuilder.setLambda((short) la.toInt()); |
217 | 216 | ||
218 | FlowRule rule = new DefaultFlowRule(prev.deviceId(), | 217 | FlowRule rule = new DefaultFlowRule(prev.deviceId(), |
219 | selectorBuilder.build(), | 218 | selectorBuilder.build(), |
... | @@ -226,13 +225,13 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn | ... | @@ -226,13 +225,13 @@ public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIn |
226 | 225 | ||
227 | prev = link.dst(); | 226 | prev = link.dst(); |
228 | selectorBuilder.matchInport(link.dst().port()); | 227 | selectorBuilder.matchInport(link.dst().port()); |
229 | - //selectorBuilder.setLambda(la.toInt()); | 228 | + selectorBuilder.matchLambda((short) la.toInt()); |
230 | } | 229 | } |
231 | 230 | ||
232 | // build the last T port rule | 231 | // build the last T port rule |
233 | TrafficTreatment treatmentLast = builder() | 232 | TrafficTreatment treatmentLast = builder() |
234 | - .setOutput(intent.getDst().port()).build(); | 233 | + .setOutput(intent.dst().port()).build(); |
235 | - FlowRule rule = new DefaultFlowRule(intent.getDst().deviceId(), | 234 | + FlowRule rule = new DefaultFlowRule(intent.dst().deviceId(), |
236 | selectorBuilder.build(), | 235 | selectorBuilder.build(), |
237 | treatmentLast, | 236 | treatmentLast, |
238 | 100, | 237 | 100, | ... | ... |
1 | -package org.onlab.onos.net.resource; | 1 | +package org.onlab.onos.net.resource.impl; |
2 | 2 | ||
3 | import java.util.Collection; | 3 | import java.util.Collection; |
4 | import java.util.Collections; | 4 | import java.util.Collections; |
... | @@ -7,6 +7,11 @@ import java.util.Set; | ... | @@ -7,6 +7,11 @@ import java.util.Set; |
7 | 7 | ||
8 | import org.onlab.onos.net.Link; | 8 | import org.onlab.onos.net.Link; |
9 | import org.onlab.onos.net.intent.IntentId; | 9 | import org.onlab.onos.net.intent.IntentId; |
10 | +import org.onlab.onos.net.resource.LinkResourceAllocations; | ||
11 | +import org.onlab.onos.net.resource.LinkResourceRequest; | ||
12 | +import org.onlab.onos.net.resource.ResourceAllocation; | ||
13 | +import org.onlab.onos.net.resource.ResourceRequest; | ||
14 | +import org.onlab.onos.net.resource.ResourceType; | ||
10 | 15 | ||
11 | /** | 16 | /** |
12 | * Implementation of {@link LinkResourceAllocations}. | 17 | * Implementation of {@link LinkResourceAllocations}. | ... | ... |
1 | -package org.onlab.onos.net.resource; | 1 | +package org.onlab.onos.net.resource.impl; |
2 | 2 | ||
3 | import static org.slf4j.LoggerFactory.getLogger; | 3 | import static org.slf4j.LoggerFactory.getLogger; |
4 | 4 | ||
... | @@ -12,6 +12,15 @@ import org.apache.felix.scr.annotations.Deactivate; | ... | @@ -12,6 +12,15 @@ import org.apache.felix.scr.annotations.Deactivate; |
12 | import org.apache.felix.scr.annotations.Service; | 12 | import org.apache.felix.scr.annotations.Service; |
13 | import org.onlab.onos.net.Link; | 13 | import org.onlab.onos.net.Link; |
14 | import org.onlab.onos.net.intent.IntentId; | 14 | import org.onlab.onos.net.intent.IntentId; |
15 | +import org.onlab.onos.net.resource.BandwidthResourceAllocation; | ||
16 | +import org.onlab.onos.net.resource.BandwidthResourceRequest; | ||
17 | +import org.onlab.onos.net.resource.Lambda; | ||
18 | +import org.onlab.onos.net.resource.LambdaResourceAllocation; | ||
19 | +import org.onlab.onos.net.resource.LinkResourceAllocations; | ||
20 | +import org.onlab.onos.net.resource.LinkResourceRequest; | ||
21 | +import org.onlab.onos.net.resource.LinkResourceService; | ||
22 | +import org.onlab.onos.net.resource.ResourceAllocation; | ||
23 | +import org.onlab.onos.net.resource.ResourceRequest; | ||
15 | import org.slf4j.Logger; | 24 | import org.slf4j.Logger; |
16 | 25 | ||
17 | import com.google.common.collect.Sets; | 26 | import com.google.common.collect.Sets; |
... | @@ -76,7 +85,7 @@ public class LinkResourceManager implements LinkResourceService { | ... | @@ -76,7 +85,7 @@ public class LinkResourceManager implements LinkResourceService { |
76 | } | 85 | } |
77 | 86 | ||
78 | @Override | 87 | @Override |
79 | - public LinkResourceAllocations getAllocation(IntentId intentId) { | 88 | + public LinkResourceAllocations getAllocations(IntentId intentId) { |
80 | // TODO Auto-generated method stub | 89 | // TODO Auto-generated method stub |
81 | return null; | 90 | return null; |
82 | } | 91 | } | ... | ... |
-
Please register or login to post a comment