Class ScriptCache
java.lang.Object
org.keycloak.authorization.policy.provider.js.ScriptCache
- Author:
- Pedro Igor
-
Constructor Summary
ConstructorDescriptionScriptCache
(int maxEntries) Creates a new instance.ScriptCache
(int maxEntries, long maxAge) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncomputeIfAbsent
(String id, Function<String, EvaluatableScriptAdapter> function) void
-
Constructor Details
-
ScriptCache
public ScriptCache(int maxEntries) Creates a new instance.- Parameters:
maxEntries
- the maximum number of entries to keep in the cache
-
ScriptCache
public ScriptCache(int maxEntries, long maxAge) 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 expire
-
-
Method Details
-
computeIfAbsent
public EvaluatableScriptAdapter computeIfAbsent(String id, Function<String, EvaluatableScriptAdapter> function) -
remove
-