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
-
- org.pac4j.core.profile.service.AbstractProfileService<U>
-
- org.pac4j.core.profile.service.InMemoryProfileService<U>
-
- All Implemented Interfaces:
Authenticator
,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
profileFactory
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>
profiles
-
Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService
attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
-
-
Constructor Summary
Constructors Constructor Description InMemoryProfileService(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> profiles, ProfileFactory profileFactory)
InMemoryProfileService(ProfileFactory profileFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteById(java.lang.String id)
Delete a profile by its identifier in the storage.protected void
insert(java.util.Map<java.lang.String,java.lang.Object> attributes)
Insert the attributes in the storage.protected void
internalInit(boolean forceReinit)
Internal initialization of the object.protected java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
read(java.util.List<java.lang.String> names, java.lang.String key, java.lang.String value)
Read the list of defined attributes in the storage for key=value query.protected void
update(java.util.Map<java.lang.String,java.lang.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
afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
-
-
-
-
Field Detail
-
profiles
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> profiles
-
profileFactory
public ProfileFactory profileFactory
-
-
Constructor Detail
-
InMemoryProfileService
public InMemoryProfileService(ProfileFactory profileFactory)
-
InMemoryProfileService
public InMemoryProfileService(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> profiles, ProfileFactory profileFactory)
-
-
Method Detail
-
internalInit
protected void internalInit(boolean forceReinit)
Description copied from class:InitializableObject
Internal initialization of the object.- Overrides:
internalInit
in classAbstractProfileService<U extends CommonProfile>
-
insert
protected void insert(java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,java.lang.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(java.lang.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 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> read(java.util.List<java.lang.String> names, java.lang.String key, java.lang.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
-
-