/** * Clears the cache and calls the implementation to close their resources * @see PrincipalProvider#close() */ public synchronized void close() { checkInitialized(); cache.clear(); initialized = false; } }
/** * Clears the cache and calls the implementation to close their resources * @see PrincipalProvider#close() */ public synchronized void close() { checkInitialized(); cache.clear(); initialized = false; } }
/** * {@inheritDoc} * * {@link #providePrincipal(String)} is called, if no matching entry * is present in the cache.<br> * NOTE: If the cache is enabled to contain negative entries (see * {@link #NEGATIVE_ENTRY_KEY} configuration option), the cache will also * store negative matches (as <code>null</code> values) in the principal cache. */ public synchronized Principal getPrincipal(String principalName) { checkInitialized(); if (cache.containsKey(principalName)) { return (Principal) cache.get(principalName); } else { Principal principal = providePrincipal(principalName); if (principal != null || includeNegative) { cache.put(principalName, principal); } return principal; } }
/** * {@inheritDoc} * * {@link #providePrincipal(String)} is called, if no matching entry * is present in the cache.<br> * NOTE: If the cache is enabled to contain negative entries (see * {@link #NEGATIVE_ENTRY_KEY} configuration option), the cache will also * store negative matches (as <code>null</code> values) in the principal cache. */ public synchronized Principal getPrincipal(String principalName) { checkInitialized(); if (cache.containsKey(principalName)) { return (Principal) cache.get(principalName); } else { Principal principal = providePrincipal(principalName); if (principal != null || includeNegative) { cache.put(principalName, principal); } return principal; } }