org.keycloak.authorization.policy.provider.js

## Class ScriptCache

- java.lang.Object
- - org.keycloak.authorization.policy.provider.js.ScriptCache

-     public class ScriptCache
      extends Object

  Author:
    Pedro Igor

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptCache(int maxEntries)` Creates a new instance.
    `ScriptCache(int maxEntries, long maxAge)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EvaluatableScriptAdapter` | `computeIfAbsent(String id, Function<String,EvaluatableScriptAdapter> function)`
    `void` | `remove(String key)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 cache
        `maxAge` - the time in milliseconds that an entry can stay in the cache. If `-1`, entries never expire

  - ### Method Detail

    - #### computeIfAbsent

          public EvaluatableScriptAdapter computeIfAbsent(String id,
                                                          Function<String,EvaluatableScriptAdapter> function)

    - #### remove

          public void remove(String key)

Copyright © 2020 JBoss by Red Hat. All rights reserved.