diff options
author | Benjamin, Max <max.benjamin@att.com> | 2020-11-19 18:12:50 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-11-19 18:12:51 -0500 |
commit | a16231657fe29334a589c98290ac8b6b2710a144 (patch) | |
tree | 475dc51d396789aff10d5a63143350a4b8a2d762 /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows | |
parent | b029a27f327851e73ceff94595cbb1e099da8998 (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 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows')
-rw-r--r-- | so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java index 910d5fa75c..0aa14c711f 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java @@ -22,6 +22,7 @@ package org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.aai; import org.onap.aaiclient.client.aai.AAIProperties; import org.onap.aaiclient.client.aai.AAIVersion; +import org.onap.so.client.CacheProperties; import org.onap.so.spring.SpringContextHelper; import org.springframework.context.ApplicationContext; import java.net.MalformedURLException; @@ -34,6 +35,8 @@ public class AaiPropertiesImpl implements AAIProperties { private final String encryptionKey; private final String aaiVersion; private final Long readTimeout; + private final boolean enableCaching; + private final Long cacheMaxAge; public AaiPropertiesImpl() { final ApplicationContext context = SpringContextHelper.getAppContext(); @@ -42,6 +45,8 @@ public class AaiPropertiesImpl implements AAIProperties { this.encryptionKey = context.getEnvironment().getProperty("mso.key"); this.aaiVersion = context.getEnvironment().getProperty("aai.version"); this.readTimeout = context.getEnvironment().getProperty("aai.readTimeout", Long.class, new Long(60000)); + this.enableCaching = context.getEnvironment().getProperty("aai.caching.enabled", Boolean.class, false); + this.cacheMaxAge = context.getEnvironment().getProperty("aai.caching.maxAge", Long.class, 60000L); } @Override @@ -79,4 +84,19 @@ public class AaiPropertiesImpl implements AAIProperties { public Long getReadTimeout() { return this.readTimeout; } + + @Override + public boolean isCachingEnabled() { + return this.enableCaching; + } + + @Override + public CacheProperties getCacheProperties() { + return new AAICacheProperties() { + @Override + public Long getMaxAge() { + return cacheMaxAge; + } + }; + } } |