Package org.pac4j.sql.profile.service
Class DbProfileService
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.profile.definition.ProfileDefinitionAware<U>
-
- org.pac4j.core.profile.service.AbstractProfileService<DbProfile>
-
- org.pac4j.sql.profile.service.DbProfileService
-
- All Implemented Interfaces:
Authenticator<UsernamePasswordCredentials>,ProfileService<DbProfile>
public class DbProfileService extends AbstractProfileService<DbProfile>
The DB profile service (which supersedes the DB authenticator).- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
-
Field Summary
Fields Modifier and Type Field Description protected org.skife.jdbi.v2.DBIdbi-
Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService
attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
-
-
Constructor Summary
Constructors Constructor Description DbProfileService()DbProfileService(DataSource dataSource)DbProfileService(DataSource dataSource, String attributes)DbProfileService(DataSource dataSource, String attributes, PasswordEncoder passwordEncoder)DbProfileService(DataSource dataSource, PasswordEncoder passwordEncoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringbuildAttributesList(List<String> names)protected voiddeleteById(String id)protected voidexecute(String query, Object... args)DataSourcegetDataSource()org.skife.jdbi.v2.DBIgetDbi()StringgetUsersTable()protected voidinsert(Map<String,Object> attributes)protected voidinternalInit()protected List<Map<String,Object>>query(String query, String key, String value)protected List<Map<String,Object>>read(List<String> names, String key, String value)voidsetDataSource(DataSource dataSource)voidsetUsersTable(String usersTable)StringtoString()protected voidupdate(Map<String,Object> attributes)-
Methods inherited from class org.pac4j.core.profile.service.AbstractProfileService
convertAttributesToProfile, convertProfileAndPasswordToAttributes, create, defineAttributesToRead, findById, findByLinkedId, getAttributes, getIdAttribute, getJavaSerializationHelper, getPasswordAttribute, getPasswordEncoder, getUsernameAttribute, isLegacyMode, remove, removeById, setAttributes, setIdAttribute, setJavaSerializationHelper, setPasswordAttribute, setPasswordEncoder, 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
-
-
-
-
Constructor Detail
-
DbProfileService
public DbProfileService()
-
DbProfileService
public DbProfileService(DataSource dataSource)
-
DbProfileService
public DbProfileService(DataSource dataSource, String attributes)
-
DbProfileService
public DbProfileService(DataSource dataSource, String attributes, PasswordEncoder passwordEncoder)
-
DbProfileService
public DbProfileService(DataSource dataSource, PasswordEncoder passwordEncoder)
-
-
Method Detail
-
internalInit
protected void internalInit()
- Overrides:
internalInitin classAbstractProfileService<DbProfile>
-
insert
protected void insert(Map<String,Object> attributes)
- Specified by:
insertin classAbstractProfileService<DbProfile>
-
update
protected void update(Map<String,Object> attributes)
- Specified by:
updatein classAbstractProfileService<DbProfile>
-
deleteById
protected void deleteById(String id)
- Specified by:
deleteByIdin classAbstractProfileService<DbProfile>
-
read
protected List<Map<String,Object>> read(List<String> names, String key, String value)
- Specified by:
readin classAbstractProfileService<DbProfile>
-
getDataSource
public DataSource getDataSource()
-
setDataSource
public void setDataSource(DataSource dataSource)
-
getUsersTable
public String getUsersTable()
-
setUsersTable
public void setUsersTable(String usersTable)
-
getDbi
public org.skife.jdbi.v2.DBI getDbi()
-
-