Package org.pac4j.mongo.profile.service
Class MongoProfileService
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.profile.definition.ProfileDefinitionAware<U>
-
- org.pac4j.core.profile.service.AbstractProfileService<MongoProfile>
-
- org.pac4j.mongo.profile.service.MongoProfileService
-
- All Implemented Interfaces:
Authenticator<UsernamePasswordCredentials>,ProfileService<MongoProfile>
public class MongoProfileService extends AbstractProfileService<MongoProfile>
The MongoDB profile service (which supersedes the Mongo authenticator).- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
-
Field Summary
-
Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService
attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
-
-
Constructor Summary
Constructors Constructor Description MongoProfileService()MongoProfileService(com.mongodb.MongoClient mongoClient)MongoProfileService(com.mongodb.MongoClient mongoClient, String attributes)MongoProfileService(com.mongodb.MongoClient mongoClient, String attributes, PasswordEncoder passwordEncoder)MongoProfileService(com.mongodb.MongoClient mongoClient, PasswordEncoder passwordEncoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddeleteById(String id)protected com.mongodb.client.MongoCollection<org.bson.Document>getCollection()com.mongodb.MongoClientgetMongoClient()StringgetUsersCollection()StringgetUsersDatabase()protected voidinsert(Map<String,Object> attributes)protected voidinternalInit()protected List<Map<String,Object>>read(List<String> names, String key, String value)voidsetMongoClient(com.mongodb.MongoClient mongoClient)voidsetUsersCollection(String usersCollection)voidsetUsersDatabase(String usersDatabase)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, 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
-
-
-
-
Constructor Detail
-
MongoProfileService
public MongoProfileService()
-
MongoProfileService
public MongoProfileService(com.mongodb.MongoClient mongoClient)
-
MongoProfileService
public MongoProfileService(com.mongodb.MongoClient mongoClient, String attributes)
-
MongoProfileService
public MongoProfileService(com.mongodb.MongoClient mongoClient, String attributes, PasswordEncoder passwordEncoder)
-
MongoProfileService
public MongoProfileService(com.mongodb.MongoClient mongoClient, PasswordEncoder passwordEncoder)
-
-
Method Detail
-
internalInit
protected void internalInit()
- Overrides:
internalInitin classAbstractProfileService<MongoProfile>
-
insert
protected void insert(Map<String,Object> attributes)
- Specified by:
insertin classAbstractProfileService<MongoProfile>
-
update
protected void update(Map<String,Object> attributes)
- Specified by:
updatein classAbstractProfileService<MongoProfile>
-
deleteById
protected void deleteById(String id)
- Specified by:
deleteByIdin classAbstractProfileService<MongoProfile>
-
read
protected List<Map<String,Object>> read(List<String> names, String key, String value)
- Specified by:
readin classAbstractProfileService<MongoProfile>
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection()
-
getUsersDatabase
public String getUsersDatabase()
-
setUsersDatabase
public void setUsersDatabase(String usersDatabase)
-
getUsersCollection
public String getUsersCollection()
-
setUsersCollection
public void setUsersCollection(String usersCollection)
-
getMongoClient
public com.mongodb.MongoClient getMongoClient()
-
setMongoClient
public void setMongoClient(com.mongodb.MongoClient mongoClient)
-
-