Modified intent compilers to only chose paths that are appropriate to the type o…
…f intent, i.e. packet or optical.
Showing
11 changed files
with
51 additions
and
180 deletions
... | @@ -28,8 +28,14 @@ | ... | @@ -28,8 +28,14 @@ |
28 | <servlet-name>JAX-RS Service</servlet-name> | 28 | <servlet-name>JAX-RS Service</servlet-name> |
29 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | 29 | <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> |
30 | <init-param> | 30 | <init-param> |
31 | - <param-name>com.sun.jersey.config.property.packages</param-name> | 31 | + <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> |
32 | - <param-value>org.onlab.onos.tvue</param-value> | 32 | + <param-value>com.sun.jersey.api.core.ClassNamesResourceConfig</param-value> |
33 | + </init-param> | ||
34 | + <init-param> | ||
35 | + <!--param-name>com.sun.jersey.config.property.packages</param-name> | ||
36 | + <param-value>org.onlab.onos.tvue</param-value--> | ||
37 | + <param-name>com.sun.jersey.config.property.classnames</param-name> | ||
38 | + <param-value>org.onlab.onos.tvue.TopologyResource</param-value> | ||
33 | </init-param> | 39 | </init-param> |
34 | <load-on-startup>10</load-on-startup> | 40 | <load-on-startup>10</load-on-startup> |
35 | </servlet> | 41 | </servlet> | ... | ... |
... | @@ -22,6 +22,7 @@ import org.apache.felix.scr.annotations.Reference; | ... | @@ -22,6 +22,7 @@ import org.apache.felix.scr.annotations.Reference; |
22 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 22 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
23 | import org.onlab.onos.net.Host; | 23 | import org.onlab.onos.net.Host; |
24 | import org.onlab.onos.net.HostId; | 24 | import org.onlab.onos.net.HostId; |
25 | +import org.onlab.onos.net.Link; | ||
25 | import org.onlab.onos.net.Path; | 26 | import org.onlab.onos.net.Path; |
26 | import org.onlab.onos.net.flow.TrafficSelector; | 27 | import org.onlab.onos.net.flow.TrafficSelector; |
27 | import org.onlab.onos.net.host.HostService; | 28 | import org.onlab.onos.net.host.HostService; |
... | @@ -30,7 +31,9 @@ import org.onlab.onos.net.intent.Intent; | ... | @@ -30,7 +31,9 @@ import org.onlab.onos.net.intent.Intent; |
30 | import org.onlab.onos.net.intent.IntentCompiler; | 31 | import org.onlab.onos.net.intent.IntentCompiler; |
31 | import org.onlab.onos.net.intent.IntentExtensionService; | 32 | import org.onlab.onos.net.intent.IntentExtensionService; |
32 | import org.onlab.onos.net.intent.PathIntent; | 33 | import org.onlab.onos.net.intent.PathIntent; |
34 | +import org.onlab.onos.net.topology.LinkWeight; | ||
33 | import org.onlab.onos.net.topology.PathService; | 35 | import org.onlab.onos.net.topology.PathService; |
36 | +import org.onlab.onos.net.topology.TopologyEdge; | ||
34 | 37 | ||
35 | import java.util.Arrays; | 38 | import java.util.Arrays; |
36 | import java.util.List; | 39 | import java.util.List; |
... | @@ -86,7 +89,13 @@ public class HostToHostIntentCompiler | ... | @@ -86,7 +89,13 @@ public class HostToHostIntentCompiler |
86 | } | 89 | } |
87 | 90 | ||
88 | private Path getPath(HostId one, HostId two) { | 91 | private Path getPath(HostId one, HostId two) { |
89 | - Set<Path> paths = pathService.getPaths(one, two); | 92 | + Set<Path> paths = pathService.getPaths(one, two, new LinkWeight() { |
93 | + @Override | ||
94 | + public double weight(TopologyEdge edge) { | ||
95 | + return edge.link().type() == Link.Type.OPTICAL ? -1 : +1; | ||
96 | + } | ||
97 | + }); | ||
98 | + | ||
90 | if (paths.isEmpty()) { | 99 | if (paths.isEmpty()) { |
91 | throw new PathNotFoundException("No path from host " + one + " to " + two); | 100 | throw new PathNotFoundException("No path from host " + one + " to " + two); |
92 | } | 101 | } | ... | ... |
... | @@ -15,19 +15,12 @@ | ... | @@ -15,19 +15,12 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.onos.net.intent.impl; | 16 | package org.onlab.onos.net.intent.impl; |
17 | 17 | ||
18 | -import static org.slf4j.LoggerFactory.getLogger; | 18 | +import com.google.common.collect.ImmutableList; |
19 | - | ||
20 | -import java.util.ArrayList; | ||
21 | -import java.util.Iterator; | ||
22 | -import java.util.List; | ||
23 | -import java.util.Set; | ||
24 | - | ||
25 | import org.apache.felix.scr.annotations.Activate; | 19 | import org.apache.felix.scr.annotations.Activate; |
26 | import org.apache.felix.scr.annotations.Component; | 20 | import org.apache.felix.scr.annotations.Component; |
27 | import org.apache.felix.scr.annotations.Deactivate; | 21 | import org.apache.felix.scr.annotations.Deactivate; |
28 | import org.apache.felix.scr.annotations.Reference; | 22 | import org.apache.felix.scr.annotations.Reference; |
29 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 23 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
30 | -import org.onlab.onos.core.CoreService; | ||
31 | import org.onlab.onos.net.ConnectPoint; | 24 | import org.onlab.onos.net.ConnectPoint; |
32 | import org.onlab.onos.net.Link; | 25 | import org.onlab.onos.net.Link; |
33 | import org.onlab.onos.net.Path; | 26 | import org.onlab.onos.net.Path; |
... | @@ -36,41 +29,26 @@ import org.onlab.onos.net.intent.IntentCompiler; | ... | @@ -36,41 +29,26 @@ import org.onlab.onos.net.intent.IntentCompiler; |
36 | import org.onlab.onos.net.intent.IntentExtensionService; | 29 | import org.onlab.onos.net.intent.IntentExtensionService; |
37 | import org.onlab.onos.net.intent.OpticalConnectivityIntent; | 30 | import org.onlab.onos.net.intent.OpticalConnectivityIntent; |
38 | import org.onlab.onos.net.intent.OpticalPathIntent; | 31 | import org.onlab.onos.net.intent.OpticalPathIntent; |
39 | -import org.onlab.onos.net.provider.ProviderId; | ||
40 | -import org.onlab.onos.net.resource.LinkResourceService; | ||
41 | import org.onlab.onos.net.topology.LinkWeight; | 32 | import org.onlab.onos.net.topology.LinkWeight; |
42 | -import org.onlab.onos.net.topology.PathService; | ||
43 | import org.onlab.onos.net.topology.Topology; | 33 | import org.onlab.onos.net.topology.Topology; |
44 | import org.onlab.onos.net.topology.TopologyEdge; | 34 | import org.onlab.onos.net.topology.TopologyEdge; |
45 | import org.onlab.onos.net.topology.TopologyService; | 35 | import org.onlab.onos.net.topology.TopologyService; |
46 | -import org.slf4j.Logger; | 36 | + |
37 | +import java.util.List; | ||
38 | +import java.util.Set; | ||
47 | 39 | ||
48 | /** | 40 | /** |
49 | - * Optical compiler for OpticalConnectivityIntent. | 41 | + * An intent compiler for {@link org.onlab.onos.net.intent.OpticalConnectivityIntent}. |
50 | - * It firstly computes K-shortest paths in the optical-layer, then choose the optimal one to assign a wavelength. | ||
51 | - * Finally, it generates one or more opticalPathintent(s) with opticalMatchs and opticalActions. | ||
52 | */ | 42 | */ |
53 | @Component(immediate = true) | 43 | @Component(immediate = true) |
54 | public class OpticalConnectivityIntentCompiler implements IntentCompiler<OpticalConnectivityIntent> { | 44 | public class OpticalConnectivityIntentCompiler implements IntentCompiler<OpticalConnectivityIntent> { |
55 | 45 | ||
56 | - private final Logger log = getLogger(getClass()); | ||
57 | - private static final ProviderId PID = new ProviderId("core", "org.onlab.onos.core", true); | ||
58 | - | ||
59 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 46 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
60 | protected IntentExtensionService intentManager; | 47 | protected IntentExtensionService intentManager; |
61 | 48 | ||
62 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 49 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
63 | - protected PathService pathService; | ||
64 | - | ||
65 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
66 | protected TopologyService topologyService; | 50 | protected TopologyService topologyService; |
67 | 51 | ||
68 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
69 | - protected LinkResourceService resourceService; | ||
70 | - | ||
71 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
72 | - protected CoreService coreService; | ||
73 | - | ||
74 | @Activate | 52 | @Activate |
75 | public void activate() { | 53 | public void activate() { |
76 | intentManager.registerCompiler(OpticalConnectivityIntent.class, this); | 54 | intentManager.registerCompiler(OpticalConnectivityIntent.class, this); |
... | @@ -84,31 +62,12 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -84,31 +62,12 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
84 | @Override | 62 | @Override |
85 | public List<Intent> compile(OpticalConnectivityIntent intent) { | 63 | public List<Intent> compile(OpticalConnectivityIntent intent) { |
86 | // TODO: compute multiple paths using the K-shortest path algorithm | 64 | // TODO: compute multiple paths using the K-shortest path algorithm |
87 | - List<Intent> retList = new ArrayList<>(); | ||
88 | - log.info("The system is comipling the OpticalConnectivityIntent:" + intent.toString()); | ||
89 | Path path = calculateOpticalPath(intent.getSrcConnectPoint(), intent.getDst()); | 65 | Path path = calculateOpticalPath(intent.getSrcConnectPoint(), intent.getDst()); |
90 | - if (path == null) { | ||
91 | - return retList; | ||
92 | - } else { | ||
93 | - log.info("the computed lightpath is : {}.", path.toString()); | ||
94 | - } | ||
95 | - | ||
96 | - List<Link> links = new ArrayList<>(); | ||
97 | - // links.add(DefaultEdgeLink.createEdgeLink(intent.getSrcConnectPoint(), true)); | ||
98 | - links.addAll(path.links()); | ||
99 | - //links.add(DefaultEdgeLink.createEdgeLink(intent.getDst(), false)); | ||
100 | - | ||
101 | - // create a new opticalPathIntent | ||
102 | Intent newIntent = new OpticalPathIntent(intent.appId(), | 66 | Intent newIntent = new OpticalPathIntent(intent.appId(), |
103 | intent.getSrcConnectPoint(), | 67 | intent.getSrcConnectPoint(), |
104 | intent.getDst(), | 68 | intent.getDst(), |
105 | path); | 69 | path); |
106 | - | 70 | + return ImmutableList.of(newIntent); |
107 | - log.info("a new OpticalPathIntent was created: " + newIntent.toString()); | ||
108 | - | ||
109 | - retList.add(newIntent); | ||
110 | - | ||
111 | - return retList; | ||
112 | } | 71 | } |
113 | 72 | ||
114 | private Path calculateOpticalPath(ConnectPoint start, ConnectPoint end) { | 73 | private Path calculateOpticalPath(ConnectPoint start, ConnectPoint end) { |
... | @@ -117,36 +76,18 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical | ... | @@ -117,36 +76,18 @@ public class OpticalConnectivityIntentCompiler implements IntentCompiler<Optical |
117 | LinkWeight weight = new LinkWeight() { | 76 | LinkWeight weight = new LinkWeight() { |
118 | @Override | 77 | @Override |
119 | public double weight(TopologyEdge edge) { | 78 | public double weight(TopologyEdge edge) { |
120 | - Link.Type lt = edge.link().type(); | 79 | + return edge.link().type() == Link.Type.OPTICAL ? +1 : -1; |
121 | - if (lt == Link.Type.OPTICAL) { | ||
122 | - return 1.0; | ||
123 | - } else { | ||
124 | - return 1000.0; | ||
125 | - } | ||
126 | } | 80 | } |
127 | }; | 81 | }; |
128 | 82 | ||
129 | - Set<Path> paths = topologyService.getPaths(topology, | 83 | + Set<Path> paths = topologyService.getPaths(topology, start.deviceId(), |
130 | - start.deviceId(), | 84 | + end.deviceId(), weight); |
131 | - end.deviceId(), | 85 | + if (paths.isEmpty()) { |
132 | - weight); | ||
133 | - | ||
134 | - ArrayList<Path> localPaths = new ArrayList<>(); | ||
135 | - Iterator<Path> itr = paths.iterator(); | ||
136 | - while (itr.hasNext()) { | ||
137 | - Path path = itr.next(); | ||
138 | - if (path.cost() >= 1000) { | ||
139 | - continue; | ||
140 | - } | ||
141 | - localPaths.add(path); | ||
142 | - } | ||
143 | - | ||
144 | - if (localPaths.isEmpty()) { | ||
145 | throw new PathNotFoundException("No fiber path from " + start + " to " + end); | 86 | throw new PathNotFoundException("No fiber path from " + start + " to " + end); |
146 | - } else { | ||
147 | - return localPaths.iterator().next(); | ||
148 | } | 87 | } |
149 | 88 | ||
89 | + // TODO: let's be more intelligent about this eventually | ||
90 | + return paths.iterator().next(); | ||
150 | } | 91 | } |
151 | 92 | ||
152 | } | 93 | } | ... | ... |
... | @@ -15,11 +15,7 @@ | ... | @@ -15,11 +15,7 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.onos.net.intent.impl; | 16 | package org.onlab.onos.net.intent.impl; |
17 | 17 | ||
18 | -import static org.onlab.onos.net.flow.DefaultTrafficTreatment.builder; | 18 | +import com.google.common.collect.Lists; |
19 | -import static org.slf4j.LoggerFactory.getLogger; | ||
20 | - | ||
21 | -import java.util.List; | ||
22 | - | ||
23 | import org.apache.felix.scr.annotations.Activate; | 19 | import org.apache.felix.scr.annotations.Activate; |
24 | import org.apache.felix.scr.annotations.Component; | 20 | import org.apache.felix.scr.annotations.Component; |
25 | import org.apache.felix.scr.annotations.Deactivate; | 21 | import org.apache.felix.scr.annotations.Deactivate; |
... | @@ -53,14 +49,14 @@ import org.onlab.onos.net.resource.ResourceType; | ... | @@ -53,14 +49,14 @@ import org.onlab.onos.net.resource.ResourceType; |
53 | import org.onlab.onos.net.topology.TopologyService; | 49 | import org.onlab.onos.net.topology.TopologyService; |
54 | import org.slf4j.Logger; | 50 | import org.slf4j.Logger; |
55 | 51 | ||
56 | -import com.google.common.collect.Lists; | 52 | +import java.util.List; |
53 | + | ||
54 | +import static org.onlab.onos.net.flow.DefaultTrafficTreatment.builder; | ||
55 | +import static org.slf4j.LoggerFactory.getLogger; | ||
57 | 56 | ||
58 | /** | 57 | /** |
59 | - * OpticaliIntentInstaller for optical path intents. | 58 | + * Installer for {@link org.onlab.onos.net.intent.OpticalPathIntent optical path connectivity intents}. |
60 | - * It essentially generates optical FlowRules and | ||
61 | - * call the flowRule service to execute them. | ||
62 | */ | 59 | */ |
63 | - | ||
64 | @Component(immediate = true) | 60 | @Component(immediate = true) |
65 | public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIntent> { | 61 | public class OpticalPathIntentInstaller implements IntentInstaller<OpticalPathIntent> { |
66 | private final Logger log = getLogger(getClass()); | 62 | private final Logger log = getLogger(getClass()); | ... | ... |
... | @@ -46,7 +46,7 @@ import org.slf4j.Logger; | ... | @@ -46,7 +46,7 @@ import org.slf4j.Logger; |
46 | import com.google.common.collect.Lists; | 46 | import com.google.common.collect.Lists; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | - * Installer for {@link PathIntent path connectivity intents}. | 49 | + * Installer for {@link PathIntent packet path connectivity intents}. |
50 | */ | 50 | */ |
51 | @Component(immediate = true) | 51 | @Component(immediate = true) |
52 | public class PathIntentInstaller implements IntentInstaller<PathIntent> { | 52 | public class PathIntentInstaller implements IntentInstaller<PathIntent> { | ... | ... |
... | @@ -25,7 +25,6 @@ import org.onlab.onos.net.DefaultEdgeLink; | ... | @@ -25,7 +25,6 @@ import org.onlab.onos.net.DefaultEdgeLink; |
25 | import org.onlab.onos.net.DefaultPath; | 25 | import org.onlab.onos.net.DefaultPath; |
26 | import org.onlab.onos.net.Link; | 26 | import org.onlab.onos.net.Link; |
27 | import org.onlab.onos.net.Path; | 27 | import org.onlab.onos.net.Path; |
28 | -import org.onlab.onos.net.host.HostService; | ||
29 | import org.onlab.onos.net.intent.Intent; | 28 | import org.onlab.onos.net.intent.Intent; |
30 | import org.onlab.onos.net.intent.IntentCompiler; | 29 | import org.onlab.onos.net.intent.IntentCompiler; |
31 | import org.onlab.onos.net.intent.IntentExtensionService; | 30 | import org.onlab.onos.net.intent.IntentExtensionService; |
... | @@ -33,23 +32,18 @@ import org.onlab.onos.net.intent.PathIntent; | ... | @@ -33,23 +32,18 @@ import org.onlab.onos.net.intent.PathIntent; |
33 | import org.onlab.onos.net.intent.PointToPointIntent; | 32 | import org.onlab.onos.net.intent.PointToPointIntent; |
34 | import org.onlab.onos.net.provider.ProviderId; | 33 | import org.onlab.onos.net.provider.ProviderId; |
35 | import org.onlab.onos.net.topology.LinkWeight; | 34 | import org.onlab.onos.net.topology.LinkWeight; |
36 | -//import org.onlab.onos.net.topology.LinkWeight; | ||
37 | -import org.onlab.onos.net.topology.PathService; | ||
38 | import org.onlab.onos.net.topology.Topology; | 35 | import org.onlab.onos.net.topology.Topology; |
39 | import org.onlab.onos.net.topology.TopologyEdge; | 36 | import org.onlab.onos.net.topology.TopologyEdge; |
40 | -//import org.onlab.onos.net.topology.Topology; | ||
41 | -//import org.onlab.onos.net.topology.TopologyEdge; | ||
42 | import org.onlab.onos.net.topology.TopologyService; | 37 | import org.onlab.onos.net.topology.TopologyService; |
43 | 38 | ||
44 | import java.util.ArrayList; | 39 | import java.util.ArrayList; |
45 | -import java.util.Arrays; | ||
46 | -import java.util.Iterator; | ||
47 | -//import java.util.Iterator; | ||
48 | import java.util.List; | 40 | import java.util.List; |
49 | import java.util.Set; | 41 | import java.util.Set; |
50 | 42 | ||
43 | +import static java.util.Arrays.asList; | ||
44 | + | ||
51 | /** | 45 | /** |
52 | - * A intent compiler for {@link org.onlab.onos.net.intent.HostToHostIntent}. | 46 | + * An intent compiler for {@link org.onlab.onos.net.intent.PointToPointIntent}. |
53 | */ | 47 | */ |
54 | @Component(immediate = true) | 48 | @Component(immediate = true) |
55 | public class PointToPointIntentCompiler | 49 | public class PointToPointIntentCompiler |
... | @@ -60,12 +54,6 @@ public class PointToPointIntentCompiler | ... | @@ -60,12 +54,6 @@ public class PointToPointIntentCompiler |
60 | protected IntentExtensionService intentManager; | 54 | protected IntentExtensionService intentManager; |
61 | 55 | ||
62 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 56 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
63 | - protected PathService pathService; | ||
64 | - | ||
65 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
66 | - protected HostService hostService; | ||
67 | - | ||
68 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
69 | protected TopologyService topologyService; | 57 | protected TopologyService topologyService; |
70 | 58 | ||
71 | @Activate | 59 | @Activate |
... | @@ -87,9 +75,8 @@ public class PointToPointIntentCompiler | ... | @@ -87,9 +75,8 @@ public class PointToPointIntentCompiler |
87 | links.addAll(path.links()); | 75 | links.addAll(path.links()); |
88 | links.add(DefaultEdgeLink.createEdgeLink(intent.egressPoint(), false)); | 76 | links.add(DefaultEdgeLink.createEdgeLink(intent.egressPoint(), false)); |
89 | 77 | ||
90 | - return Arrays.asList(createPathIntent(new DefaultPath(PID, links, path.cost() + 2, | 78 | + return asList(createPathIntent(new DefaultPath(PID, links, path.cost() + 2, |
91 | - path.annotations()), | 79 | + path.annotations()), intent)); |
92 | - intent)); | ||
93 | } | 80 | } |
94 | 81 | ||
95 | /** | 82 | /** |
... | @@ -114,39 +101,21 @@ public class PointToPointIntentCompiler | ... | @@ -114,39 +101,21 @@ public class PointToPointIntentCompiler |
114 | * @throws PathNotFoundException if a path cannot be found | 101 | * @throws PathNotFoundException if a path cannot be found |
115 | */ | 102 | */ |
116 | private Path getPath(ConnectPoint one, ConnectPoint two) { | 103 | private Path getPath(ConnectPoint one, ConnectPoint two) { |
117 | - // Set<Path> paths = pathService.getPaths(one.deviceId(), two.deviceId()); | ||
118 | Topology topology = topologyService.currentTopology(); | 104 | Topology topology = topologyService.currentTopology(); |
119 | LinkWeight weight = new LinkWeight() { | 105 | LinkWeight weight = new LinkWeight() { |
120 | @Override | 106 | @Override |
121 | public double weight(TopologyEdge edge) { | 107 | public double weight(TopologyEdge edge) { |
122 | - Link.Type lt = edge.link().type(); | 108 | + return edge.link().type() == Link.Type.OPTICAL ? -1 : +1; |
123 | - if (lt == Link.Type.OPTICAL) { | ||
124 | - return 1000.0; | ||
125 | - } else { | ||
126 | - return Double.MIN_VALUE; | ||
127 | - } | ||
128 | } | 109 | } |
129 | }; | 110 | }; |
130 | 111 | ||
131 | - Set<Path> paths = topologyService.getPaths(topology, | 112 | + Set<Path> paths = topologyService.getPaths(topology, one.deviceId(), |
132 | - one.deviceId(), | 113 | + two.deviceId(), weight); |
133 | - two.deviceId(), | 114 | + if (paths.isEmpty()) { |
134 | - weight); | ||
135 | - | ||
136 | - ArrayList<Path> localPaths = new ArrayList<>(); | ||
137 | - Iterator<Path> itr = paths.iterator(); | ||
138 | - while (itr.hasNext()) { | ||
139 | - Path path = itr.next(); | ||
140 | - if (path.cost() >= 1000) { | ||
141 | - continue; | ||
142 | - } | ||
143 | - localPaths.add(path); | ||
144 | - } | ||
145 | - | ||
146 | - if (localPaths.isEmpty()) { | ||
147 | throw new PathNotFoundException("No packet path from " + one + " to " + two); | 115 | throw new PathNotFoundException("No packet path from " + one + " to " + two); |
148 | } | 116 | } |
117 | + | ||
149 | // TODO: let's be more intelligent about this eventually | 118 | // TODO: let's be more intelligent about this eventually |
150 | - return localPaths.iterator().next(); | 119 | + return paths.iterator().next(); |
151 | } | 120 | } |
152 | } | 121 | } | ... | ... |
core/net/src/main/java/org/onlab/onos/net/intent/impl/UnavailableIdException.java
deleted
100644 → 0
1 | -/* | ||
2 | - * Copyright 2014 Open Networking Laboratory | ||
3 | - * | ||
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | - * you may not use this file except in compliance with the License. | ||
6 | - * You may obtain a copy of the License at | ||
7 | - * | ||
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - * | ||
10 | - * Unless required by applicable law or agreed to in writing, software | ||
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | - * See the License for the specific language governing permissions and | ||
14 | - * limitations under the License. | ||
15 | - */ | ||
16 | -package org.onlab.onos.net.intent.impl; | ||
17 | - | ||
18 | -/** | ||
19 | - * Represents that there is no available IDs. | ||
20 | - */ | ||
21 | -public class UnavailableIdException extends RuntimeException { | ||
22 | - | ||
23 | - private static final long serialVersionUID = -2287403908433720122L; | ||
24 | - | ||
25 | - /** | ||
26 | - * Constructs an exception with no message and no underlying cause. | ||
27 | - */ | ||
28 | - public UnavailableIdException() { | ||
29 | - } | ||
30 | - | ||
31 | - /** | ||
32 | - * Constructs an exception with the specified message. | ||
33 | - * | ||
34 | - * @param message the message describing the specific nature of the error | ||
35 | - */ | ||
36 | - public UnavailableIdException(String message) { | ||
37 | - super(message); | ||
38 | - } | ||
39 | - | ||
40 | - /** | ||
41 | - * Constructs an exception with the specified message and the underlying cause. | ||
42 | - * | ||
43 | - * @param message the message describing the specific nature of the error | ||
44 | - * @param cause the underlying cause of this error | ||
45 | - */ | ||
46 | - public UnavailableIdException(String message, Throwable cause) { | ||
47 | - super(message, cause); | ||
48 | - } | ||
49 | -} |
... | @@ -212,7 +212,6 @@ public class LinkManager | ... | @@ -212,7 +212,6 @@ public class LinkManager |
212 | checkNotNull(linkDescription, LINK_DESC_NULL); | 212 | checkNotNull(linkDescription, LINK_DESC_NULL); |
213 | checkValidity(); | 213 | checkValidity(); |
214 | 214 | ||
215 | - | ||
216 | LinkEvent event = store.createOrUpdateLink(provider().id(), | 215 | LinkEvent event = store.createOrUpdateLink(provider().id(), |
217 | linkDescription); | 216 | linkDescription); |
218 | if (event != null) { | 217 | if (event != null) { | ... | ... |
... | @@ -68,7 +68,7 @@ public class TestPointToPointIntentCompiler { | ... | @@ -68,7 +68,7 @@ public class TestPointToPointIntentCompiler { |
68 | private PointToPointIntentCompiler makeCompiler(String[] hops) { | 68 | private PointToPointIntentCompiler makeCompiler(String[] hops) { |
69 | PointToPointIntentCompiler compiler = | 69 | PointToPointIntentCompiler compiler = |
70 | new PointToPointIntentCompiler(); | 70 | new PointToPointIntentCompiler(); |
71 | - compiler.pathService = new IntentTestsMocks.MockPathService(hops); | 71 | +// compiler.topologyService = new IntentTestsMocks.MockPathService(hops); |
72 | return compiler; | 72 | return compiler; |
73 | } | 73 | } |
74 | 74 | ... | ... |
... | @@ -8,4 +8,4 @@ export OC2="192.168.56.102" | ... | @@ -8,4 +8,4 @@ export OC2="192.168.56.102" |
8 | export OCN="192.168.56.103" | 8 | export OCN="192.168.56.103" |
9 | export OCI="${OC1}" | 9 | export OCI="${OC1}" |
10 | 10 | ||
11 | -export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-openflow,onos-app-fwd,onos-app-proxyarp,onos-app-tvue}" | 11 | +export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core,onos-cli,onos-openflow,onos-rest,onos-app-fwd,onos-app-proxyarp,onos-app-tvue}" | ... | ... |
... | @@ -7,4 +7,4 @@ export OC1="192.168.56.101" | ... | @@ -7,4 +7,4 @@ export OC1="192.168.56.101" |
7 | export OCN="192.168.56.103" | 7 | export OCN="192.168.56.103" |
8 | export OCI="${OC1}" | 8 | export OCI="${OC1}" |
9 | 9 | ||
10 | -export ONOS_FEATURES="${ONOS_FEATURES:-webconsole,onos-api,onos-core-trivial,onos-cli,onos-rest,onos-openflow,onos-app-fwd,onos-app-proxyarp,onos-app-tvue}" | 10 | +export ONOS_FEATURES=webconsole,onos-api,onos-core-trivial,onos-cli,onos-rest,onos-openflow,onos-app-fwd,onos-app-proxyarp,onos-app-tvue | ... | ... |
-
Please register or login to post a comment