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
ConstructorDescriptionConstructor for LocalCachingProfileCreator.LocalCachingProfileCreator
(ProfileCreator delegate, int cacheSize, int timeout, TimeUnit timeUnit) Constructor for LocalCachingProfileCreator.LocalCachingProfileCreator
(ProfileCreator delegate, Store<Credentials, UserProfile> store) Constructor for LocalCachingProfileCreator. -
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) isCached.void
removeFromCache
(Credentials credentials) removeFromCache.Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getNbAttempts, init, init, isInitialized, reinit, shouldInitialize
-
Constructor Details
-
LocalCachingProfileCreator
public LocalCachingProfileCreator()Constructor for LocalCachingProfileCreator.
-
LocalCachingProfileCreator
Constructor for LocalCachingProfileCreator.
- Parameters:
delegate
- aProfileCreator
objectstore
- aStore
object
-
LocalCachingProfileCreator
public LocalCachingProfileCreator(ProfileCreator delegate, int cacheSize, int timeout, TimeUnit timeUnit) Constructor for LocalCachingProfileCreator.
- Parameters:
delegate
- aProfileCreator
objectcacheSize
- a inttimeout
- a inttimeUnit
- aTimeUnit
object
-
-
Method Details
-
create
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) Internal initialization of the object.- Specified by:
internalInit
in classInitializableObject
- Parameters:
forceReinit
- a boolean
-
removeFromCache
removeFromCache.
- Parameters:
credentials
- aCredentials
object
-
isCached
isCached.
- Parameters:
credentials
- aCredentials
object- Returns:
- a boolean
-