summaryrefslogtreecommitdiffstats
path: root/dmaap-listener/src/main/java/org
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-11-13 10:04:11 -0500
committerDan Timoney <dtimoney@att.com>2017-11-13 10:04:11 -0500
commit32a9ecade35bc3e742dfbc9e86d887f25b5f49c9 (patch)
tree188d993b3380246e2ba0da6e2d956ebe3988b96f /dmaap-listener/src/main/java/org
parent024e6d1689ee38b37ac054636557b5dff8f26270 (diff)
Handle duplicate DHCP event
Handle case where 2 DHCP events received for same mac addr. Should use most recent IP address. Change-Id: I90399ce3c39e07c2472366c78115812a64e9124b Issue-ID: CCSDK-142 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'dmaap-listener/src/main/java/org')
-rw-r--r--dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java
index 666ed68e1..03560d309 100644
--- a/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java
+++ b/dmaap-listener/src/main/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncDhcpEventConsumer.java
@@ -124,8 +124,7 @@ public class SdncDhcpEventConsumer extends SdncDmaapConsumer {
try {
- jdbcDataSource.writeData("INSERT INTO DHCP_MAP(mac_addr, ip_addr) VALUES('" + macAddr + "','" + ipAddr + "')",
- null, null);
+ jdbcDataSource.writeData("INSERT INTO DHCP_MAP(mac_addr, ip_addr) VALUES('" + macAddr + "','" + ipAddr + "') ON DUPLICATE KEY UPDATE ip_addr = '"+ipAddr+"'", null, null);
} catch (SQLException e) {
LOG.error("Could not insert DHCP event data into the database ", e);