Skip to content

Commit 80432b4

Browse files
committed
Refactor SdxL3 app for version 1.12 of ONOS
Change-Id: Ic978062e30d5a47af264a45a68d031ed6f04d1b3
1 parent 798da4b commit 80432b4

File tree

11 files changed

+83
-84
lines changed

11 files changed

+83
-84
lines changed

sdx-l3/app.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
<app name="org.onosproject.sdxl3" origin="GEANT" version="${project.version}"
2020
category="Traffic Steering" title="SDX-L3 App"
2121
featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
22-
features="${project.artifactId}">
22+
features="${project.artifactId}"
23+
apps="org.onosproject.intentsynchronizer,org.onosproject.route-service">
2324
<description>${project.description}</description>
2425
<readme>Application controlling SDN-based L3 Internet Exchange Points.</readme>
2526
<artifact>mvn:${project.groupId}/onos-apps-routing-api/${onos.version}</artifact>
26-
<artifact>mvn:${project.groupId}/onos-apps-routing/${onos.version}</artifact>
27+
<artifact>mvn:${project.groupId}/onos-apps-route-service-api/${onos.version}</artifact>
28+
<artifact>mvn:${project.groupId}/onos-apps-intentsync/${onos.version}</artifact>
2729
<artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
2830
</app>

sdx-l3/features.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
description="${project.description}">
2222
<feature>onos-api</feature>
2323
<bundle>mvn:${project.groupId}/onos-apps-routing-api/${onos.version}</bundle>
24-
<bundle>mvn:${project.groupId}/onos-apps-routing/${onos.version}</bundle>
24+
<bundle>mvn:${project.groupId}/onos-apps-route-service-api/${onos.version}</bundle>
2525
<bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
2626
</feature>
2727
</features>

sdx-l3/pom.xml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
~ Copyright 2016 - present Open Networking Foundation
54
~
@@ -19,96 +18,88 @@
1918
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2019
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2120
<modelVersion>4.0.0</modelVersion>
22-
2321
<parent>
2422
<groupId>org.onosproject</groupId>
2523
<artifactId>onos-dependencies</artifactId>
26-
<version>1.7.0</version>
24+
<version>1.12.0</version>
2725
<relativePath/>
2826
</parent>
29-
3027
<artifactId>onos-app-sdx-l3</artifactId>
31-
<version>1.9.0-SNAPSHOT</version>
28+
<version>1.12.0-SNAPSHOT</version>
3229
<packaging>bundle</packaging>
33-
3430
<description>SDX-L3 application for GEANT</description>
35-
3631
<properties>
37-
<onos.version>1.7.0</onos.version>
32+
<onos.version>1.12.0</onos.version>
3833
</properties>
39-
4034
<dependencies>
41-
<dependency>
42-
<groupId>com.google.guava</groupId>
43-
<artifactId>guava</artifactId>
44-
</dependency>
45-
4635
<dependency>
4736
<groupId>org.onosproject</groupId>
4837
<artifactId>onlab-junit</artifactId>
4938
<version>${onos.version}</version>
5039
<scope>test</scope>
5140
</dependency>
52-
5341
<dependency>
5442
<groupId>org.onosproject</groupId>
5543
<artifactId>onos-api</artifactId>
5644
<version>${onos.version}</version>
5745
<scope>test</scope>
5846
<classifier>tests</classifier>
5947
</dependency>
60-
6148
<dependency>
6249
<groupId>org.onosproject</groupId>
6350
<artifactId>onos-incubator-api</artifactId>
6451
<version>${onos.version}</version>
6552
<scope>test</scope>
6653
<classifier>tests</classifier>
6754
</dependency>
68-
6955
<dependency>
7056
<groupId>org.onosproject</groupId>
71-
<artifactId>onos-apps-routing</artifactId>
57+
<artifactId>onos-apps-intentsync</artifactId>
7258
<version>${onos.version}</version>
7359
</dependency>
74-
7560
<dependency>
7661
<groupId>org.onosproject</groupId>
7762
<artifactId>onos-apps-routing-api</artifactId>
7863
<version>${onos.version}</version>
7964
</dependency>
80-
8165
<dependency>
8266
<groupId>org.onosproject</groupId>
8367
<artifactId>onos-apps-routing-api</artifactId>
8468
<scope>test</scope>
8569
<classifier>tests</classifier>
8670
<version>${onos.version}</version>
8771
</dependency>
88-
72+
<dependency>
73+
<groupId>org.onosproject</groupId>
74+
<artifactId>onos-apps-route-service-api</artifactId>
75+
<version>${onos.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.onosproject</groupId>
79+
<artifactId>onos-apps-route-service-api</artifactId>
80+
<scope>test</scope>
81+
<classifier>tests</classifier>
82+
<version>${onos.version}</version>
83+
</dependency>
8984
<dependency>
9085
<groupId>org.onosproject</groupId>
9186
<artifactId>onos-cli</artifactId>
9287
<version>${onos.version}</version>
9388
</dependency>
94-
9589
<dependency>
9690
<groupId>org.apache.karaf.shell</groupId>
9791
<artifactId>org.apache.karaf.shell.console</artifactId>
9892
</dependency>
99-
10093
<dependency>
10194
<groupId>org.osgi</groupId>
10295
<artifactId>org.osgi.core</artifactId>
10396
</dependency>
104-
10597
<dependency>
10698
<groupId>org.easymock</groupId>
10799
<artifactId>easymock</artifactId>
108100
<scope>test</scope>
109101
</dependency>
110102
</dependencies>
111-
112103
<build>
113104
<plugins>
114105
<plugin>
@@ -125,5 +116,4 @@
125116
</plugin>
126117
</plugins>
127118
</build>
128-
129119
</project>

sdx-l3/src/main/java/org/onosproject/sdxl3/SdxL3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import org.onosproject.app.ApplicationService;
2525
import org.onosproject.core.ApplicationId;
2626
import org.onosproject.core.CoreService;
27-
import org.onosproject.incubator.component.ComponentService;
28-
import org.onosproject.routing.IntentSynchronizationService;
27+
import org.onosproject.component.ComponentService;
28+
import org.onosproject.intentsync.IntentSynchronizationService;
2929
import org.slf4j.Logger;
3030

3131
import java.util.ArrayList;

sdx-l3/src/main/java/org/onosproject/sdxl3/SdxL3Fib.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
import org.onlab.packet.VlanId;
3131
import org.onosproject.core.ApplicationId;
3232
import org.onosproject.core.CoreService;
33-
import org.onosproject.incubator.net.intf.Interface;
34-
import org.onosproject.incubator.net.intf.InterfaceEvent;
35-
import org.onosproject.incubator.net.intf.InterfaceListener;
36-
import org.onosproject.incubator.net.intf.InterfaceService;
37-
import org.onosproject.incubator.net.routing.ResolvedRoute;
38-
import org.onosproject.incubator.net.routing.RouteEvent;
39-
import org.onosproject.incubator.net.routing.RouteListener;
40-
import org.onosproject.incubator.net.routing.RouteService;
33+
import org.onosproject.net.intf.Interface;
34+
import org.onosproject.net.intf.InterfaceEvent;
35+
import org.onosproject.net.intf.InterfaceListener;
36+
import org.onosproject.net.intf.InterfaceService;
37+
import org.onosproject.routeservice.ResolvedRoute;
38+
import org.onosproject.routeservice.RouteEvent;
39+
import org.onosproject.routeservice.RouteListener;
40+
import org.onosproject.routeservice.RouteService;
4141
import org.onosproject.net.ConnectPoint;
4242
import org.onosproject.net.flow.DefaultTrafficSelector;
4343
import org.onosproject.net.flow.DefaultTrafficTreatment;
@@ -47,7 +47,7 @@
4747
import org.onosproject.net.intent.Key;
4848
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
4949
import org.onosproject.net.intent.constraint.PartialFailureConstraint;
50-
import org.onosproject.routing.IntentSynchronizationService;
50+
import org.onosproject.intentsync.IntentSynchronizationService;
5151
import org.slf4j.Logger;
5252
import org.slf4j.LoggerFactory;
5353

sdx-l3/src/main/java/org/onosproject/sdxl3/SdxL3PeerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package org.onosproject.sdxl3;
1818

1919
import org.onlab.packet.IpAddress;
20-
import org.onosproject.incubator.net.intf.Interface;
20+
import org.onosproject.net.intf.Interface;
2121
import org.onosproject.net.ConnectPoint;
2222
import org.onosproject.routing.config.BgpConfig;
2323
import org.onosproject.sdxl3.config.SdxParticipantsConfig;

sdx-l3/src/main/java/org/onosproject/sdxl3/impl/SdxL3NeighbourHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import org.onlab.packet.VlanId;
2727
import org.onosproject.core.ApplicationId;
2828
import org.onosproject.core.CoreService;
29-
import org.onosproject.incubator.net.intf.Interface;
30-
import org.onosproject.incubator.net.intf.InterfaceService;
31-
import org.onosproject.incubator.net.neighbour.NeighbourMessageContext;
32-
import org.onosproject.incubator.net.neighbour.NeighbourMessageHandler;
33-
import org.onosproject.incubator.net.neighbour.NeighbourResolutionService;
29+
import org.onosproject.net.intf.Interface;
30+
import org.onosproject.net.intf.InterfaceService;
31+
import org.onosproject.net.neighbour.NeighbourMessageContext;
32+
import org.onosproject.net.neighbour.NeighbourMessageHandler;
33+
import org.onosproject.net.neighbour.NeighbourResolutionService;
3434
import org.onosproject.net.ConnectPoint;
3535
import org.onosproject.net.Host;
3636
import org.onosproject.net.config.NetworkConfigEvent;
@@ -177,7 +177,7 @@ private void handleMessageForSpeaker(NeighbourMessageContext context, HostServic
177177
// address on this port. Drop all other requests.
178178
interfaceService.getInterfacesByPort(context.inPort())
179179
.stream()
180-
.filter(intf -> intf.ipAddresses()
180+
.filter(intf -> intf.ipAddressesList()
181181
.stream()
182182
.anyMatch(ia -> ia.ipAddress().equals(context.target()) &&
183183
ia.subnetAddress().contains(context.sender())))

sdx-l3/src/main/java/org/onosproject/sdxl3/impl/SdxL3PeerManager.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
import org.onlab.util.ItemNotFoundException;
3434
import org.onosproject.core.ApplicationId;
3535
import org.onosproject.core.CoreService;
36-
import org.onosproject.incubator.net.intf.Interface;
37-
import org.onosproject.incubator.net.intf.InterfaceEvent;
38-
import org.onosproject.incubator.net.intf.InterfaceListener;
39-
import org.onosproject.incubator.net.intf.InterfaceService;
36+
import org.onosproject.net.intf.Interface;
37+
import org.onosproject.net.intf.InterfaceEvent;
38+
import org.onosproject.net.intf.InterfaceListener;
39+
import org.onosproject.net.intf.InterfaceService;
4040
import org.onosproject.net.ConnectPoint;
4141
import org.onosproject.net.config.ConfigFactory;
4242
import org.onosproject.net.config.NetworkConfigEvent;
@@ -52,9 +52,10 @@
5252
import org.onosproject.net.intent.IntentUtils;
5353
import org.onosproject.net.intent.Key;
5454
import org.onosproject.net.intent.PointToPointIntent;
55-
import org.onosproject.routing.IntentSynchronizationService;
55+
import org.onosproject.intentsync.IntentSynchronizationService;
5656
import org.onosproject.routing.RoutingService;
5757
import org.onosproject.routing.config.BgpConfig;
58+
import org.onosproject.routing.config.RoutingConfiguration;
5859
import org.onosproject.sdxl3.SdxL3;
5960
import org.onosproject.sdxl3.SdxL3PeerService;
6061
import org.onosproject.sdxl3.config.SdxParticipantsConfig;
@@ -124,8 +125,10 @@ public SdxParticipantsConfig createConfig() {
124125

125126
@Activate
126127
public void activate() {
127-
sdxAppId = coreService.getAppId(SdxL3.SDX_L3_APP);
128-
routerAppId = coreService.getAppId(RoutingService.ROUTER_APP_ID);
128+
sdxAppId = coreService.registerApplication(SdxL3.SDX_L3_APP);
129+
routerAppId = coreService.registerApplication(RoutingService.ROUTER_APP_ID);
130+
131+
RoutingConfiguration.register(registry);
129132

130133
registry.registerConfigFactory(configFactory);
131134

sdx-l3/src/test/java/org/onosproject/sdxl3/SdxL3FibTest.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@
2929
import org.onosproject.TestApplicationId;
3030
import org.onosproject.core.ApplicationId;
3131
import org.onosproject.core.CoreServiceAdapter;
32-
import org.onosproject.incubator.net.intf.Interface;
33-
import org.onosproject.incubator.net.intf.InterfaceListener;
34-
import org.onosproject.incubator.net.intf.InterfaceService;
35-
import org.onosproject.incubator.net.intf.InterfaceServiceAdapter;
36-
import org.onosproject.incubator.net.routing.ResolvedRoute;
37-
import org.onosproject.incubator.net.routing.RouteEvent;
38-
import org.onosproject.incubator.net.routing.RouteListener;
39-
import org.onosproject.incubator.net.routing.RouteServiceAdapter;
32+
import org.onosproject.net.intf.Interface;
33+
import org.onosproject.net.intf.InterfaceListener;
34+
import org.onosproject.net.intf.InterfaceService;
35+
import org.onosproject.net.intf.InterfaceServiceAdapter;
36+
import org.onosproject.routeservice.ResolvedRoute;
37+
import org.onosproject.routeservice.Route;
38+
import org.onosproject.routeservice.RouteEvent;
39+
import org.onosproject.routeservice.RouteListener;
40+
import org.onosproject.routeservice.RouteServiceAdapter;
4041
import org.onosproject.net.ConnectPoint;
4142
import org.onosproject.net.DeviceId;
4243
import org.onosproject.net.PortNumber;
@@ -48,7 +49,7 @@
4849
import org.onosproject.net.intent.AbstractIntentTest;
4950
import org.onosproject.net.intent.Key;
5051
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
51-
import org.onosproject.routing.IntentSynchronizationService;
52+
import org.onosproject.intentsync.IntentSynchronizationService;
5253

5354
import java.util.ArrayList;
5455
import java.util.Collections;
@@ -121,7 +122,7 @@ public class SdxL3FibTest extends AbstractIntentTest {
121122

122123
@Override
123124
@Before
124-
public void setUp() throws Exception {
125+
public void setUp() {
125126
super.setUp();
126127

127128
interfaceService = createMock(InterfaceService.class);
@@ -234,8 +235,8 @@ private void setUpBgpPeers() {
234235
@Test
235236
public void testRouteAdd() {
236237
Ip4Prefix prefix = Ip4Prefix.valueOf("1.1.1.0/24");
237-
ResolvedRoute resRoute = new ResolvedRoute(prefix,
238-
Ip4Address.valueOf(PEER1_IP),
238+
ResolvedRoute resRoute = new ResolvedRoute(new Route(Route.Source.STATIC, prefix,
239+
Ip4Address.valueOf(PEER1_IP)),
239240
MacAddress.valueOf(MAC1));
240241

241242
// Construct a MultiPointToSinglePointIntent intent
@@ -282,8 +283,9 @@ public void testRouteAdd() {
282283
@Test
283284
public void testRouteAddWithVlan() {
284285
Ip4Prefix prefix = Ip4Prefix.valueOf("1.1.1.0/24");
285-
ResolvedRoute resRoute = new ResolvedRoute(prefix,
286-
Ip4Address.valueOf(PEER3_IP),
286+
ResolvedRoute resRoute = new ResolvedRoute(new Route(Route.Source.STATIC,
287+
prefix,
288+
Ip4Address.valueOf(PEER3_IP)),
287289
MacAddress.valueOf(MAC1));
288290

289291
// Construct a MultiPointToSinglePointIntent intent
@@ -337,8 +339,9 @@ public void testRouteUpdate() {
337339
testRouteAdd();
338340

339341
Ip4Prefix prefix = Ip4Prefix.valueOf("1.1.1.0/24");
340-
ResolvedRoute resRoute = new ResolvedRoute(prefix,
341-
Ip4Address.valueOf(PEER2_IP),
342+
ResolvedRoute resRoute = new ResolvedRoute(new Route(Route.Source.STATIC,
343+
prefix,
344+
Ip4Address.valueOf(PEER2_IP)),
342345
MacAddress.valueOf(MAC1));
343346

344347
// Construct a new MultiPointToSinglePointIntent intent
@@ -394,8 +397,9 @@ public void testRouteDelete() {
394397

395398
IpPrefix prefix = Ip4Prefix.valueOf("1.1.1.0/24");
396399
// Construct the existing route entry
397-
ResolvedRoute resRoute = new ResolvedRoute(prefix, null, null);
398-
400+
ResolvedRoute resRoute = new ResolvedRoute(
401+
new Route(Route.Source.STATIC, prefix, Ip4Address.valueOf(PEER1_IP)),
402+
MacAddress.valueOf(MAC1));
399403
// Construct the existing MultiPointToSinglePoint intent
400404
TrafficSelector.Builder selectorBuilder =
401405
DefaultTrafficSelector.builder();

sdx-l3/src/test/java/org/onosproject/sdxl3/impl/SdxL3PeerAdministrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import org.onosproject.core.ApplicationId;
3030
import org.onosproject.core.CoreService;
3131
import org.onosproject.core.CoreServiceAdapter;
32-
import org.onosproject.incubator.net.intf.Interface;
33-
import org.onosproject.incubator.net.intf.InterfaceListener;
34-
import org.onosproject.incubator.net.intf.InterfaceService;
32+
import org.onosproject.net.intf.Interface;
33+
import org.onosproject.net.intf.InterfaceListener;
34+
import org.onosproject.net.intf.InterfaceService;
3535
import org.onosproject.net.ConnectPoint;
3636
import org.onosproject.net.DeviceId;
3737
import org.onosproject.net.PortNumber;
@@ -43,7 +43,7 @@
4343
import org.onosproject.net.host.InterfaceIpAddress;
4444
import org.onosproject.net.intent.AbstractIntentTest;
4545
import org.onosproject.net.intent.PointToPointIntent;
46-
import org.onosproject.routing.IntentSynchronizationService;
46+
import org.onosproject.intentsync.IntentSynchronizationService;
4747
import org.onosproject.routing.RoutingService;
4848
import org.onosproject.routing.config.BgpConfig;
4949
import org.onosproject.sdxl3.SdxL3;
@@ -138,7 +138,7 @@ public class SdxL3PeerAdministrationTest extends AbstractIntentTest {
138138

139139
@Override
140140
@Before
141-
public void setUp() throws Exception {
141+
public void setUp() {
142142
super.setUp();
143143
// Setup services and configurations
144144
setupEnvironment();
@@ -182,7 +182,7 @@ public TestCoreService() {
182182
}
183183

184184
@Override
185-
public ApplicationId getAppId(String name) {
185+
public ApplicationId registerApplication(String name) {
186186
return registeredApps.get(name);
187187
}
188188
}

0 commit comments

Comments
 (0)