Class NestedGroupsCacheProvider
java.lang.Object
com.atlassian.crowd.manager.directory.nestedgroups.NestedGroupsCacheProvider
Cache provider for
CachedMultipleGroupsProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<NestedGroupsCacheProvider>
Returns provider configured according to system properties orOptional.empty()
, if not configured.getGroupsCache
(long directoryId, GroupType type) Returns cache for a given set of parameters.getSubgroupsCache
(long directoryId, boolean isChildrenQuery, GroupType type) Returns cache for a given set of parameters.
-
Constructor Details
-
NestedGroupsCacheProvider
public NestedGroupsCacheProvider(long expiryMs, int maxSize)
-
-
Method Details
-
getSubgroupsCache
protected com.google.common.cache.Cache<String,String[]> getSubgroupsCache(long directoryId, boolean isChildrenQuery, GroupType type) Returns cache for a given set of parameters. The same cache instance will be returned for the same parameters, if subsequent calls do not exceed configured expiration time. Cache entries of the returned cache are expired after write with configured expiry time. -
getGroupsCache
protected com.google.common.cache.Cache<String,Group> getGroupsCache(long directoryId, GroupType type) Returns cache for a given set of parameters. The same cache instance will be returned for the same parameters, if subsequent calls do not exceed configured expiration time plus margin described below. Cache entries of the returned cache are expired after write with configured expiry time plus margin. Comparing togetSubgroupsCache(long, boolean, GroupType)
expiration times are extended byGROUPS_CACHE_MARGIN_MS
to make sure that values that are pointed at are not expired. -
createFromSystemProperties
Returns provider configured according to system properties orOptional.empty()
, if not configured. Please note that the cache is experimental and that's why it's disabled by default.
-