[SEBA-144] Operational Status DHCP L2 Relay.
Change-Id: I58aab083152793af36dfd34fa91cd78385fd2ed7
Signed-off-by: Marcos Aurelio Carrero <mcarrero@furukawalatam.com>
diff --git a/api/pom.xml b/api/pom.xml
index 1401757..bb09f47 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>dhcpl2relay</artifactId>
<groupId>org.opencord</groupId>
- <version>1.6.1</version>
+ <version>1.6.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/api/src/main/java/org/opencord/dhcpl2relay/DhcpL2RelayEvent.java b/api/src/main/java/org/opencord/dhcpl2relay/DhcpL2RelayEvent.java
index 364197d..3a4054c 100644
--- a/api/src/main/java/org/opencord/dhcpl2relay/DhcpL2RelayEvent.java
+++ b/api/src/main/java/org/opencord/dhcpl2relay/DhcpL2RelayEvent.java
@@ -19,6 +19,9 @@
import org.onosproject.event.AbstractEvent;
import org.onosproject.net.ConnectPoint;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
/**
* Dhcp L2 relay event.
*/
@@ -26,6 +29,12 @@
private final ConnectPoint connectPoint;
+ private final Map.Entry<String, AtomicLong> countersEntry;
+
+ private final String dhcpCountersTopic;
+
+ private final String subscriberId;
+
/**
* Type of the event.
*/
@@ -38,7 +47,32 @@
/**
* DHCP lease was removed.
*/
- REMOVED
+ REMOVED,
+
+ /**
+ * DHCP stats update.
+ */
+ STATS_UPDATE
+ }
+
+ /**
+ * Creates a new event used for STATS.
+ *
+ * @param type type of the event
+ * @param allocationInfo DHCP allocation info
+ * @param connectPoint connect point the client is on
+ * @param countersEntry an entry that represents the counters (used for STATS events)
+ * @param dhcpCountersTopic Kafka topic where the dhcp counters are published
+ * @param subscriberId the subscriber identifier information
+ */
+ public DhcpL2RelayEvent(Type type, DhcpAllocationInfo allocationInfo, ConnectPoint connectPoint,
+ Map.Entry<String, AtomicLong> countersEntry,
+ String dhcpCountersTopic, String subscriberId) {
+ super(type, allocationInfo);
+ this.connectPoint = connectPoint;
+ this.countersEntry = countersEntry;
+ this.dhcpCountersTopic = dhcpCountersTopic;
+ this.subscriberId = subscriberId;
}
/**
@@ -51,6 +85,9 @@
public DhcpL2RelayEvent(Type type, DhcpAllocationInfo allocationInfo, ConnectPoint connectPoint) {
super(type, allocationInfo);
this.connectPoint = connectPoint;
+ this.countersEntry = null;
+ this.dhcpCountersTopic = null;
+ this.subscriberId = null;
}
/**
@@ -61,4 +98,31 @@
public ConnectPoint connectPoint() {
return connectPoint;
}
+
+ /**
+ * Gets the counters map entry.
+ *
+ * @return counters map entry
+ */
+ public Map.Entry<String, AtomicLong> getCountersEntry() {
+ return countersEntry;
+ }
+
+ /**
+ * Gets the Kafka topic where the dhcp counters are published.
+ *
+ * @return the dhcp kafka topic
+ */
+ public String getDhcpCountersTopic() {
+ return dhcpCountersTopic;
+ }
+
+ /**
+ * Gets the subscriber identifier information.
+ *
+ * @return the Id from subscriber
+ */
+ public String getSubscriberId() {
+ return subscriberId;
+ }
}