Class PathCache
- java.lang.Object
-
- org.keycloak.adapters.authorization.PathCache
-
public class PathCache extends Object
A simple LRU cache implementation supporting expiration and maximum number of entries.- Author:
- Pedro Igor
-
-
Constructor Summary
Constructors Constructor Description PathCache(int maxEntries, long maxAge, Map<String,PolicyEnforcerConfig.PathConfig> paths)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(String uri)
PolicyEnforcerConfig.PathConfig
get(String uri)
void
put(String uri, PolicyEnforcerConfig.PathConfig newValue)
void
remove(String key)
int
size()
-
-
-
Constructor Detail
-
PathCache
public PathCache(int maxEntries, long maxAge, Map<String,PolicyEnforcerConfig.PathConfig> paths)
Creates a new instance.- Parameters:
maxEntries
- the maximum number of entries to keep in the cachemaxAge
- the time in milliseconds that an entry can stay in the cache. If-1
, entries never expirepaths
- the pre-configured paths
-
-
Method Detail
-
put
public void put(String uri, PolicyEnforcerConfig.PathConfig newValue)
-
containsKey
public boolean containsKey(String uri)
-
get
public PolicyEnforcerConfig.PathConfig get(String uri)
-
remove
public void remove(String key)
-
size
public int size()
-
-