Package org.pac4j.core.profile.service
Class InMemoryProfileService<U extends CommonProfile>
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.profile.definition.ProfileDefinitionAware<U>
-
- org.pac4j.core.profile.service.AbstractProfileService<U>
-
- org.pac4j.core.profile.service.InMemoryProfileService<U>
-
- All Implemented Interfaces:
Authenticator<UsernamePasswordCredentials>
,ProfileService<U>
public class InMemoryProfileService<U extends CommonProfile> extends AbstractProfileService<U>
In-memory profile service.- Since:
- 2.1.0
- Author:
- Elie Roux
-
-
Field Summary
Fields Modifier and Type Field Description ProfileFactory<U>
profileFactory
Map<String,Map<String,Object>>
profiles
-
Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService
attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
-
-
Constructor Summary
Constructors Constructor Description InMemoryProfileService(Map<String,Map<String,Object>> profiles, ProfileFactory<U> profileFactory)
InMemoryProfileService(ProfileFactory<U> profileFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteById(String id)
Delete a profile by its identifier in the storage.protected void
insert(Map<String,Object> attributes)
Insert the attributes in the storage.protected void
internalInit()
Internal initialization of the object.protected List<Map<String,Object>>
read(List<String> names, String key, String value)
Read the list of defined attributes in the storage for key=value query.protected void
update(Map<String,Object> attributes)
Update the attributes in the storage.-
Methods inherited from class org.pac4j.core.profile.service.AbstractProfileService
convertAttributesToProfile, convertProfileAndPasswordToAttributes, create, defineAttributesToRead, findById, findByLinkedId, getAttributes, getIdAttribute, getPasswordAttribute, getPasswordEncoder, getSerializer, getUsernameAttribute, isLegacyMode, remove, removeById, setAttributes, setIdAttribute, setPasswordAttribute, setPasswordEncoder, setSerializer, setUsernameAttribute, update, validate
-
Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware
defaultProfileDefinition, getProfileDefinition, setProfileDefinition
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Field Detail
-
profileFactory
public ProfileFactory<U extends CommonProfile> profileFactory
-
-
Constructor Detail
-
InMemoryProfileService
public InMemoryProfileService(ProfileFactory<U> profileFactory)
-
-
Method Detail
-
internalInit
protected void internalInit()
Description copied from class:InitializableObject
Internal initialization of the object.- Overrides:
internalInit
in classAbstractProfileService<U extends CommonProfile>
-
insert
protected void insert(Map<String,Object> attributes)
Description copied from class:AbstractProfileService
Insert the attributes in the storage.- Specified by:
insert
in classAbstractProfileService<U extends CommonProfile>
- Parameters:
attributes
- the attributes
-
update
protected void update(Map<String,Object> attributes)
Description copied from class:AbstractProfileService
Update the attributes in the storage.- Specified by:
update
in classAbstractProfileService<U extends CommonProfile>
- Parameters:
attributes
- the attributes
-
deleteById
protected void deleteById(String id)
Description copied from class:AbstractProfileService
Delete a profile by its identifier in the storage.- Specified by:
deleteById
in classAbstractProfileService<U extends CommonProfile>
- Parameters:
id
- the identifier
-
read
protected List<Map<String,Object>> read(List<String> names, String key, String value)
Description copied from class:AbstractProfileService
Read the list of defined attributes in the storage for key=value query.- Specified by:
read
in classAbstractProfileService<U extends CommonProfile>
- Parameters:
names
- the attribute names to readkey
- the key for the queryvalue
- the value for the query- Returns:
- the list of map of attributes
-
-