From 8f0c12b8d7311eeeccbf5483901182747cb813e2 Mon Sep 17 00:00:00 2001 From: "Maharajh, Robby (rx2202)" Date: Thu, 20 Sep 2018 18:44:26 -0400 Subject: Update the code to use realtime connection for PUT/PATCH/DELETE to make it less likely to cause duplicates in the AAI Database Issue-ID: AAI-1667 Change-Id: I029c505193ff6d9533743732375e9a669ed9d1ca Signed-off-by: Maharajh, Robby (rx2202) --- aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java | 2 +- .../src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java | 8 ++++---- .../org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java b/aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java index d6ec93a..17f8f64 100644 --- a/aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java +++ b/aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java @@ -126,7 +126,7 @@ public abstract class BulkConsumer extends RESTAPI { Response response = null; try { - DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime); + DBConnectionType type = DBConnectionType.REALTIME; String serviceName = req.getMethod() + " " + req.getRequestURI().toString(); LoggingContext.requestId(transId); diff --git a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java index 3c2754d..4e5b10b 100644 --- a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java +++ b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java @@ -131,7 +131,7 @@ public class LegacyMoxyConsumer extends RESTAPI { try { validateRequest(info); SchemaVersion version = new SchemaVersion(versionParam); - DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime); + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class); traversalUriHttpEntry.setHttpEntryProperties(version, type); loader = traversalUriHttpEntry.getLoader(); @@ -352,7 +352,7 @@ public class LegacyMoxyConsumer extends RESTAPI { validateRequest(info); SchemaVersion version = new SchemaVersion(versionParam); - DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime); + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class); traversalUriHttpEntry.setHttpEntryProperties(version, type); dbEngine = traversalUriHttpEntry.getDbEngine(); @@ -426,7 +426,7 @@ public class LegacyMoxyConsumer extends RESTAPI { try { this.validateRequest(info); SchemaVersion version = new SchemaVersion(versionParam); - DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime); + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class); traversalUriHttpEntry.setHttpEntryProperties(version, type); loader = traversalUriHttpEntry.getLoader(); @@ -535,7 +535,7 @@ public class LegacyMoxyConsumer extends RESTAPI { validateRequest(info); version = new SchemaVersion(versionParam); - DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime); + DBConnectionType type = DBConnectionType.REALTIME; HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class); traversalUriHttpEntry.setHttpEntryProperties(version, type); loader = traversalUriHttpEntry.getLoader(); diff --git a/aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java b/aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java index 1e6ab0c..03cfa8f 100644 --- a/aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java +++ b/aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java @@ -74,7 +74,7 @@ public class BulkSingleTransactionConsumer extends RESTAPI { initLogging(req, transId, sourceOfTruth); try { - type = this.determineConnectionType(sourceOfTruth, realTime); + type = DBConnectionType.REALTIME; // unmarshall the payload. Gson gson = new Gson(); -- cgit 1.2.3-korg