Little refactor of BNG integration and new bng-api version
Change-Id: Id06008f4f0888e8e81c134a368e3c5ea54291a5d
diff --git a/pom.xml b/pom.xml
index ce0cff7..83eb9f4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,7 @@
<aaa.api.version>2.0.0</aaa.api.version>
<olt.api.version>4.0.0</olt.api.version>
<dhcpl2relay.api.version>2.0.0</dhcpl2relay.api.version>
- <bng.api.version>1.0-SNAPSHOT</bng.api.version>
+ <bng.api.version>1.0.0-SNAPSHOT</bng.api.version>
<sadis.api.version>4.0.1</sadis.api.version>
</properties>
diff --git a/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java b/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java
index ea91c8d..17b7088 100644
--- a/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java
+++ b/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java
@@ -40,6 +40,16 @@
@Component(immediate = true)
public class BngPppoeKafkaIntegration extends AbstractKafkaIntegration {
+ @Reference(cardinality = ReferenceCardinality.MANDATORY)
+ protected EventBusService eventBusService;
+
+ @Reference(cardinality = ReferenceCardinality.OPTIONAL,
+ policy = ReferencePolicy.DYNAMIC,
+ bind = "bindPppoeBngControl",
+ unbind = "unbindPppoeBngControl")
+ protected volatile PppoeBngControlHandler ignore;
+ private final AtomicReference<PppoeBngControlHandler> pppoeBngControlRef = new AtomicReference<>();
+
private static final String TOPIC_PPPOE = "bng.pppoe";
private static final String TIMESTAMP = "timestamp";
private static final String EVENT_TYPE = "eventType";
@@ -52,17 +62,6 @@
private final PppoeEventListener pppoeEventListener = new InternalPppoeListener();
- private final AtomicReference<PppoeBngControlHandler> pppoeBngControlRef = new AtomicReference<>();
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected EventBusService eventBusService;
-
- @Reference(cardinality = ReferenceCardinality.OPTIONAL,
- policy = ReferencePolicy.DYNAMIC,
- bind = "bindPppoeBngControl",
- unbind = "unbindPppoeBngControl")
- protected volatile PppoeBngControlHandler pppoeBngControlHandler;
-
protected void bindPppoeBngControl(PppoeBngControlHandler incomingService) {
bindAndAddListener(incomingService, pppoeBngControlRef, pppoeEventListener);
}
diff --git a/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java b/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java
index e7cffd8..e20ecbb 100644
--- a/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java
+++ b/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java
@@ -46,12 +46,22 @@
@Component(immediate = true)
public class BngStatsKafkaIntegration extends AbstractKafkaIntegration {
+ @Reference(cardinality = ReferenceCardinality.MANDATORY)
+ protected EventBusService eventBusService;
+
+ @Reference(cardinality = ReferenceCardinality.OPTIONAL,
+ policy = ReferencePolicy.DYNAMIC,
+ bind = "bindBngStatsService",
+ unbind = "unbindBngStatsService")
+ protected volatile BngStatsService ignore;
+ private final AtomicReference<BngStatsService> bngStatsServiceRef = new AtomicReference<>();
+
private static final String TOPIC_STATS = "bng.stats";
private static final String SUBSCRIBER_S_TAG = "sTag";
private static final String SUBSCRIBER_C_TAG = "cTag";
- private static final String UP_TX_BYTES = "upTermBytes";
- private static final String UP_TX_PACKETS = "upTermPackets";
+ private static final String UP_TX_BYTES = "upTxBytes";
+ private static final String UP_TX_PACKETS = "upTxPackets";
private static final String UP_RX_BYTES = "upRxBytes";
private static final String UP_RX_PACKETS = "upRxPackets";
@@ -92,18 +102,6 @@
private final BngStatsEventListener statsListener = new InternalStatsListener();
- private final AtomicReference<BngStatsService> bngStatsServiceRef = new AtomicReference<>();
-
- @Reference(cardinality = ReferenceCardinality.OPTIONAL,
- policy = ReferencePolicy.DYNAMIC,
- bind = "bindBngStatsService",
- unbind = "unbindBngStatsService")
- protected volatile BngStatsService bngStatsService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected EventBusService eventBusService;
-
-
protected void bindBngStatsService(BngStatsService incomingService) {
bindAndAddListener(incomingService, bngStatsServiceRef, statsListener);
}