diff options
author | Steve Smokowski <ss835w@att.com> | 2020-11-30 14:49:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-11-30 14:49:48 +0000 |
commit | 0fb130d77336e7476bbc09cc453efabf6fa1b16e (patch) | |
tree | bc26a41332365895dd4c9949ff229fbd49f46a15 /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows | |
parent | aec0236281f227a0a68b38ca7b0e56e50ffa95b7 (diff) | |
parent | a16231657fe29334a589c98290ac8b6b2710a144 (diff) |
Merge "add caching to graph inventory client"
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; + } + }; + } } |