diff options
author | halil.cakal <halil.cakal@est.tech> | 2023-08-28 12:25:37 +0100 |
---|---|---|
committer | halil.cakal <halil.cakal@est.tech> | 2023-08-31 11:18:23 +0100 |
commit | 12ed2412adfb9ca6f0302b425dacf7fc8e4860c0 (patch) | |
tree | fd1ad03bbe7890cbb2a355fdb66aedb840988703 /cps-ncmp-service/src/main | |
parent | 7dbd1856887a3e8a315752a10d7a0bf83d7da077 (diff) |
Hazelcast cache config stroring trust level per dmi plugin
- Add Hazelcast cache config to store trust level
per dmi plugin
Issue-ID: CPS-1855
Change-Id: Ibe7f8393008ca7352aacddba99ecd19d6e1eb326
Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfig.java | 16 |
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"); + } } |