Class PathCache


  • public class PathCache
    extends Object
    A simple LRU cache implementation supporting expiration and maximum number of entries.
    Author:
    Pedro Igor
    • Constructor Detail

      • PathCache

        public PathCache​(int maxEntries,
                         long maxAge,
                         Map<String,​org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig> paths)
        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
        paths - the pre-configured paths
    • Method Detail

      • put

        public void put​(String uri,
                        org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig newValue)
      • containsKey

        public boolean containsKey​(String uri)
      • get

        public org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig get​(String uri)
      • remove

        public void remove​(String key)
      • size

        public int size()