summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java/org
diff options
context:
space:
mode:
authorBenjamin, Max <max.benjamin@att.com>2020-11-19 18:12:50 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-11-19 18:12:51 -0500
commita16231657fe29334a589c98290ac8b6b2710a144 (patch)
tree475dc51d396789aff10d5a63143350a4b8a2d762 /bpmn/MSOCommonBPMN/src/main/java/org
parentb029a27f327851e73ceff94595cbb1e099da8998 (diff)
add caching to graph inventory client
add caching to graph inventory client updated properties files to read cache properties Issue-ID: SO-3398 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Ib3e67ae014b6668c9b004aae1e8b5d49b9ce6b06
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java
index f67af20ef1..98a14fc0e5 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java
@@ -25,6 +25,7 @@ import java.net.URL;
import org.onap.aaiclient.client.aai.AAIProperties;
import org.onap.aaiclient.client.aai.AAIVersion;
import org.onap.so.bpmn.core.UrnPropertiesReader;
+import org.onap.so.client.CacheProperties;
import org.springframework.stereotype.Component;
@Component
@@ -34,6 +35,9 @@ public class AAIPropertiesImpl implements AAIProperties {
public static final String AAI_AUTH = "aai.auth";
public static final String AAI_ENDPOINT = "aai.endpoint";
public static final String AAI_READ_TIMEOUT = "aai.readTimeout";
+ public static final String AAI_ENABLE_CACHING = "aai.caching.enable";
+ public static final String AAI_CACHE_MAX_AGE = "aai.caching.maxAge";
+
private UrnPropertiesReader reader;
@Override
@@ -66,4 +70,19 @@ public class AAIPropertiesImpl implements AAIProperties {
return Long.valueOf(reader.getVariable(AAI_READ_TIMEOUT, "60000"));
}
+ @Override
+ public boolean isCachingEnabled() {
+ return Boolean.parseBoolean(reader.getVariable(AAI_ENABLE_CACHING, "false"));
+ }
+
+ @Override
+ public CacheProperties getCacheProperties() {
+ return new AAICacheProperties() {
+ @Override
+ public Long getMaxAge() {
+ return Long.valueOf(reader.getVariable(AAI_CACHE_MAX_AGE, "60000"));
+ }
+ };
+ }
+
}