Update the code to use realtime connection 99/68299/1
authorMaharajh, Robby (rx2202) <rx2202@att.com>
Thu, 20 Sep 2018 22:44:26 +0000 (18:44 -0400)
committerMaharajh, Robby (rx2202) <rx2202@att.com>
Thu, 20 Sep 2018 22:44:26 +0000 (18:44 -0400)
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) <rx2202@att.com>
aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java
aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java
aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java

index d6ec93a..17f8f64 100644 (file)
@@ -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);
index 3c2754d..4e5b10b 100644 (file)
@@ -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();
index 1e6ab0c..03cfa8f 100644 (file)
@@ -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();