summaryrefslogtreecommitdiffstats
path: root/aai-resources/src
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2018-10-04 11:47:13 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2018-10-05 19:59:22 -0400
commita5ba121a22259c14aa92c5180c944c60ef8cd10a (patch)
tree50fd3298d43fc510dde3b526360e66f0539a580b /aai-resources/src
parent0d31b9f1bc33abb2152bf028c80e5f0fd10e57d8 (diff)
Update resources to use realtime connection1.3.0
as the default and change it via config later to disable or enable this Issue-ID: AAI-1705 Change-Id: Ie0526e642ffa1c06d480d6ff1b5dd93ab87a7bb2 Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src')
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/BulkConsumer.java7
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java37
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumer.java6
3 files changed, 42 insertions, 8 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 17f8f64..8033278 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,12 @@ public abstract class BulkConsumer extends RESTAPI {
Response response = null;
try {
- DBConnectionType type = DBConnectionType.REALTIME;
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, 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 4e5b10b..7f73362 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
@@ -65,8 +65,8 @@ import org.onap.aai.rest.util.ValidateEncoding;
import org.onap.aai.restcore.HttpMethod;
import org.onap.aai.restcore.RESTAPI;
import org.onap.aai.serialization.engines.TransactionalGraphEngine;
+import org.onap.aai.util.AAIConfig;
import org.onap.aai.util.AAIConstants;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.att.eelf.configuration.EELFLogger;
@@ -131,7 +131,12 @@ public class LegacyMoxyConsumer extends RESTAPI {
try {
validateRequest(info);
SchemaVersion version = new SchemaVersion(versionParam);
- DBConnectionType type = DBConnectionType.REALTIME;
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, realTime);
+ }
HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
traversalUriHttpEntry.setHttpEntryProperties(version, type);
loader = traversalUriHttpEntry.getLoader();
@@ -253,7 +258,12 @@ public class LegacyMoxyConsumer extends RESTAPI {
try {
validateRequest(info);
SchemaVersion version = new SchemaVersion(versionParam);
- DBConnectionType type = this.determineConnectionType(sourceOfTruth, realTime);
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, realTime);
+ }
final HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
traversalUriHttpEntry.setHttpEntryProperties(version, type);
dbEngine = traversalUriHttpEntry.getDbEngine();
@@ -352,7 +362,12 @@ public class LegacyMoxyConsumer extends RESTAPI {
validateRequest(info);
SchemaVersion version = new SchemaVersion(versionParam);
- DBConnectionType type = DBConnectionType.REALTIME;
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, realTime);
+ }
HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
traversalUriHttpEntry.setHttpEntryProperties(version, type);
dbEngine = traversalUriHttpEntry.getDbEngine();
@@ -426,7 +441,12 @@ public class LegacyMoxyConsumer extends RESTAPI {
try {
this.validateRequest(info);
SchemaVersion version = new SchemaVersion(versionParam);
- DBConnectionType type = DBConnectionType.REALTIME;
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, realTime);
+ }
HttpEntry traversalUriHttpEntry = SpringContextAware.getBean("traversalUriHttpEntry", HttpEntry.class);
traversalUriHttpEntry.setHttpEntryProperties(version, type);
loader = traversalUriHttpEntry.getLoader();
@@ -535,7 +555,12 @@ public class LegacyMoxyConsumer extends RESTAPI {
validateRequest(info);
version = new SchemaVersion(versionParam);
- DBConnectionType type = DBConnectionType.REALTIME;
+ DBConnectionType type = null;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, 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 03cfa8f..674c1b4 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,11 @@ public class BulkSingleTransactionConsumer extends RESTAPI {
initLogging(req, transId, sourceOfTruth);
try {
- type = DBConnectionType.REALTIME;
+ if(AAIConfig.get("aai.use.realtime", "true").equals("true")){
+ type = DBConnectionType.REALTIME;
+ } else {
+ type = this.determineConnectionType(sourceOfTruth, realTime);
+ }
// unmarshall the payload.
Gson gson = new Gson();