Class CacheUserProfileService
- java.lang.Object
 - 
- org.forgerock.openig.tools.userprofile.CacheUserProfileService
 
 
- 
- All Implemented Interfaces:
 UserProfileService
public class CacheUserProfileService extends Object implements UserProfileService
Create a CacheUserProfileService which is responsible for managing theUserProfilecache. The cache is anAsyncCache, which loads entries asynchronously. 
- 
- 
Constructor Summary
Constructors Constructor Description CacheUserProfileService(UserProfileService userProfileService, com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine, Duration maximumTimeout)Creates a new CacheUserProfileService. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<UserProfile,UserProfileException>getUserProfile(Context context, String username)Returns a promise that will be completed with anUserProfileor with anUserProfileExceptionin case of errors. 
 - 
 
- 
- 
Constructor Detail
- 
CacheUserProfileService
public CacheUserProfileService(UserProfileService userProfileService, com.github.benmanes.caffeine.cache.Caffeine<Object,Object> caffeine, Duration maximumTimeout)
Creates a new CacheUserProfileService.- Parameters:
 userProfileService- TheUserProfileServiceto execute when aUserProfileis not found in the cachecaffeine- The parameters of the underlying cachemaximumTimeout- The maximum time to cache a user profile. Cannot benull.
 
 - 
 
- 
Method Detail
- 
getUserProfile
public Promise<UserProfile,UserProfileException> getUserProfile(Context context, String username)
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. 
 
 - 
 
 -