summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java
diff options
context:
space:
mode:
authorPriyank Maheshwari <priyank.maheshwari@est.tech>2023-08-31 16:03:36 +0000
committerGerrit Code Review <gerrit@onap.org>2023-08-31 16:03:36 +0000
commit17d14293823ec280e646071988be211184d1f7ce (patch)
tree8dfdb53cca422cf53c83f979054be53ec04f7a48 /cps-ncmp-service/src/main/java
parent6c5d5792f50ac734d6603e111dfe835c15b9d84f (diff)
parent12ed2412adfb9ca6f0302b425dacf7fc8e4860c0 (diff)
Merge "Hazelcast cache config stroring trust level per dmi plugin"
Diffstat (limited to 'cps-ncmp-service/src/main/java')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java
index 816fc50675..66f61906da 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java
@@ -21,8 +21,11 @@
package org.onap.cps.ncmp.api.impl.config.embeddedcache;
import com.hazelcast.collection.ISet;
+import com.hazelcast.config.MapConfig;
import com.hazelcast.config.SetConfig;
+import com.hazelcast.map.IMap;
import org.onap.cps.cache.HazelcastCacheConfig;
+import org.onap.cps.ncmp.api.impl.trustlevel.TrustLevel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -42,5 +45,18 @@ public class TrustLevelCacheConfig extends HazelcastCacheConfig {
"untrustworthyCmHandlesSet");
}
+ private static final MapConfig trustLevelPerDmiPluginCacheConfig =
+ createMapConfig("trustLevelPerDmiPluginCacheConfig");
+
+ /**
+ * Distributed instance of trust level cache that contains dmi-plugin name by trust level.
+ *
+ * @return configured map of dmi-plugin name as keys to trust-level for values.
+ */
+ @Bean
+ public IMap<String, TrustLevel> trustLevelPerDmiPlugin() {
+ return createHazelcastInstance("hazelcastInstanceTrustLevelPerDmiPluginMap",
+ trustLevelPerDmiPluginCacheConfig).getMap("trustLevelPerDmiPlugin");
+ }
}