Package org.pac4j.core.profile.creator
Class LocalCachingProfileCreator
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.profile.creator.LocalCachingProfileCreator
- All Implemented Interfaces:
ProfileCreator
A profile creator that caches the result of a profile creation based on the credentials.
Add the
guava
dependency to use this class.- Since:
- 5.7.0
- Author:
- Jerome LELEU
-
Constructor Summary
ConstructorDescriptionLocalCachingProfileCreator
(ProfileCreator delegate, int cacheSize, int timeout, TimeUnit timeUnit) LocalCachingProfileCreator
(ProfileCreator delegate, Store<Credentials, UserProfile> store) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(CallContext ctx, Credentials credentials) Create a profile from a credentials.protected void
internalInit
(boolean forceReinit) Internal initialization of the object.boolean
isCached
(Credentials credentials) void
removeFromCache
(Credentials credentials) Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getNbAttempts, init, init, isInitialized, reinit, shouldInitialize
-
Constructor Details
-
LocalCachingProfileCreator
public LocalCachingProfileCreator() -
LocalCachingProfileCreator
-
LocalCachingProfileCreator
public LocalCachingProfileCreator(ProfileCreator delegate, int cacheSize, int timeout, TimeUnit timeUnit)
-
-
Method Details
-
create
Description copied from interface:ProfileCreator
Create a profile from a credentials.- Specified by:
create
in interfaceProfileCreator
- Parameters:
ctx
- the contextcredentials
- the given credentials- Returns:
- the created profile (optional)
-
internalInit
protected void internalInit(boolean forceReinit) Description copied from class:InitializableObject
Internal initialization of the object.- Specified by:
internalInit
in classInitializableObject
-
removeFromCache
-
isCached
-