DhcpL2Relay app must use the new SADIS interface and version
Change-Id: I7ddf2a86a49b144f6ed4b4050ea0dc7af6c1a6f6
diff --git a/pom.xml b/pom.xml
index 9d45924..ba11295 100755
--- a/pom.xml
+++ b/pom.xml
@@ -20,13 +20,13 @@
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-dependencies</artifactId>
- <version>1.13.1</version>
+ <version>1.13.6</version>
<relativePath></relativePath>
</parent>
<groupId>org.opencord</groupId>
<artifactId>dhcpl2relay</artifactId>
- <version>1.5.0</version>
+ <version>1.6.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<description>DHCP L2 Relay Agent</description>
@@ -43,8 +43,8 @@
<onos.app.requires>
org.opencord.sadis
</onos.app.requires>
- <onos.version>1.13.1</onos.version>
- <sadis.api.version>2.1.0</sadis.api.version>
+ <onos.version>1.13.6</onos.version>
+ <sadis.api.version>3.0.0</sadis.api.version>
</properties>
<dependencies>
diff --git a/src/main/java/org/opencord/dhcpl2relay/DhcpL2Relay.java b/src/main/java/org/opencord/dhcpl2relay/DhcpL2Relay.java
index 9f68554..33fd576 100755
--- a/src/main/java/org/opencord/dhcpl2relay/DhcpL2Relay.java
+++ b/src/main/java/org/opencord/dhcpl2relay/DhcpL2Relay.java
@@ -86,8 +86,9 @@
import org.onosproject.net.packet.PacketProcessor;
import org.onosproject.net.packet.PacketService;
import org.opencord.dhcpl2relay.packet.DhcpOption82;
+import org.opencord.sadis.BaseInformationService;
+import org.opencord.sadis.SadisService;
import org.opencord.sadis.SubscriberAndDeviceInformation;
-import org.opencord.sadis.SubscriberAndDeviceInformationService;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -140,7 +141,7 @@
protected ComponentConfigService componentConfigService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected SubscriberAndDeviceInformationService subsService;
+ protected SadisService sadisService;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DeviceService deviceService;
@@ -176,6 +177,8 @@
//Whether to use the uplink port of the OLTs to send/receive messages to the DHCP server
private boolean useOltUplink = false;
+ private BaseInformationService<SubscriberAndDeviceInformation> subsService;
+
@Activate
protected void activate(ComponentContext context) {
//start the dhcp relay agent
@@ -200,6 +203,8 @@
modified(context);
}
+ subsService = sadisService.getSubscriberInfoService();
+
log.info("DHCP-L2-RELAY Started");
}
diff --git a/src/test/java/org/opencord/dhcpl2relay/DhcpL2RelayTest.java b/src/test/java/org/opencord/dhcpl2relay/DhcpL2RelayTest.java
index b282728..1117804 100755
--- a/src/test/java/org/opencord/dhcpl2relay/DhcpL2RelayTest.java
+++ b/src/test/java/org/opencord/dhcpl2relay/DhcpL2RelayTest.java
@@ -62,7 +62,9 @@
import org.onosproject.net.provider.ProviderId;
import org.opencord.dhcpl2relay.packet.DhcpOption82;
import org.opencord.sadis.SubscriberAndDeviceInformation;
-import org.opencord.sadis.SubscriberAndDeviceInformationService;
+import org.opencord.sadis.BandwidthProfileInformation;
+import org.opencord.sadis.BaseInformationService;
+import org.opencord.sadis.SadisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -107,7 +109,7 @@
dhcpL2Relay.packetService = new MockPacketService();
dhcpL2Relay.componentConfigService = mockConfigService;
dhcpL2Relay.deviceService = new MockDeviceService();
- dhcpL2Relay.subsService = new MockSubService();
+ dhcpL2Relay.sadisService = new MockSadisService();
dhcpL2Relay.hostService = new MockHostService();
dhcpL2Relay.mastershipService = new MockMastershipService();
TestUtils.setField(dhcpL2Relay, "eventDispatcher", new TestEventDispatcher());
@@ -305,7 +307,19 @@
}
}
- private class MockSubService implements SubscriberAndDeviceInformationService {
+ private class MockSadisService implements SadisService {
+ @Override
+ public BaseInformationService<SubscriberAndDeviceInformation> getSubscriberInfoService() {
+ return new MockSubService();
+ }
+
+ @Override
+ public BaseInformationService<BandwidthProfileInformation> getBandwidthProfileService() {
+ return null;
+ }
+ }
+
+ private class MockSubService implements BaseInformationService<SubscriberAndDeviceInformation> {
MockSubscriberAndDeviceInformation device =
new MockSubscriberAndDeviceInformation(OLT_DEV_ID, VlanId.NONE, VlanId.NONE, null, null,
OLT_MAC_ADDRESS, Ip4Address.valueOf("10.10.10.10"));