Class CacheUserProfileService
java.lang.Object
org.forgerock.openig.tools.userprofile.CacheUserProfileService
- All Implemented Interfaces:
UserProfileService
Create a CacheUserProfileService which is responsible for managing the
UserProfile cache.
The cache is an AsyncCache, which loads entries asynchronously.-
Constructor Summary
ConstructorsConstructorDescriptionCacheUserProfileService(UserProfileService userProfileService, CaffeineAsyncCache.Builder<String, UserProfile, UserProfileException> cacheBuilder, Duration maximumTimeout) Creates a new CacheUserProfileService. -
Method Summary
Modifier and TypeMethodDescriptiongetUserProfile(Context context, String username) Returns a promise that will be completed with anUserProfileor with anUserProfileExceptionin case of errors.
-
Constructor Details
-
CacheUserProfileService
public CacheUserProfileService(UserProfileService userProfileService, CaffeineAsyncCache.Builder<String, UserProfile, UserProfileException> cacheBuilder, Duration maximumTimeout) Creates a new CacheUserProfileService.- Parameters:
userProfileService- TheUserProfileServiceto execute when aUserProfileis not found in the cachecacheBuilder- The cache builder to use. Cannot benull.maximumTimeout- The maximum time to cache a user profile. Cannot benull.
-
-
Method Details
-
getUserProfile
Description copied from interface:UserProfileServiceReturns a promise that will be completed with anUserProfileor with anUserProfileExceptionin case of errors.- Specified by:
getUserProfilein interfaceUserProfileService- Parameters:
context- The request context.username- The username that identifies the user to retrieve the profile attributes for.- Returns:
- a promise that will be completed with
UserProfileor with anResourceExceptionin case of errors.
-