Package org.pac4j.mongo.profile.service
Class MongoProfileService
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.profile.definition.ProfileDefinitionAware
org.pac4j.core.profile.service.AbstractProfileService<MongoProfile>
org.pac4j.mongo.profile.service.MongoProfileService
- All Implemented Interfaces:
Authenticator,ProfileService<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_PROFILEFields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE, NEVER_VALIDATE -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for MongoProfileService.MongoProfileService(com.mongodb.client.MongoClient mongoClient) Constructor for MongoProfileService.MongoProfileService(com.mongodb.client.MongoClient mongoClient, String attributes) Constructor for MongoProfileService.MongoProfileService(com.mongodb.client.MongoClient mongoClient, String attributes, PasswordEncoder passwordEncoder) Constructor for MongoProfileService.MongoProfileService(com.mongodb.client.MongoClient mongoClient, PasswordEncoder passwordEncoder) Constructor for MongoProfileService. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteById(String id) protected com.mongodb.client.MongoCollection<org.bson.Document>getCollection.protected voidprotected voidinternalInit(boolean forceReinit) protected voidMethods 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, validateMethods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware
getProfileDefinition, setProfileDefinition, setProfileDefinitionIfUndefinedMethods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString
-
Constructor Details
-
MongoProfileService
public MongoProfileService()Constructor for MongoProfileService.
-
MongoProfileService
public MongoProfileService(com.mongodb.client.MongoClient mongoClient) Constructor for MongoProfileService.
- Parameters:
mongoClient- aMongoClientobject
-
MongoProfileService
Constructor for MongoProfileService.
- Parameters:
mongoClient- aMongoClientobjectattributes- aStringobject
-
MongoProfileService
public MongoProfileService(com.mongodb.client.MongoClient mongoClient, String attributes, PasswordEncoder passwordEncoder) Constructor for MongoProfileService.
- Parameters:
mongoClient- aMongoClientobjectattributes- aStringobjectpasswordEncoder- aPasswordEncoderobject
-
MongoProfileService
public MongoProfileService(com.mongodb.client.MongoClient mongoClient, PasswordEncoder passwordEncoder) Constructor for MongoProfileService.
- Parameters:
mongoClient- aMongoClientobjectpasswordEncoder- aPasswordEncoderobject
-
-
Method Details
-
internalInit
protected void internalInit(boolean forceReinit) - Overrides:
internalInitin classAbstractProfileService<MongoProfile>
-
insert
- Specified by:
insertin classAbstractProfileService<MongoProfile>
-
update
- Specified by:
updatein classAbstractProfileService<MongoProfile>
-
deleteById
- Specified by:
deleteByIdin classAbstractProfileService<MongoProfile>
-
read
- Specified by:
readin classAbstractProfileService<MongoProfile>
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection()getCollection.
- Returns:
- a
MongoCollectionobject
-