Class CouchProfileService

  • All Implemented Interfaces:
    org.pac4j.core.credentials.authenticator.Authenticator, org.pac4j.core.profile.service.ProfileService<CouchProfile>

    public class CouchProfileService
    extends org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
    The CouchDB profile service.
    Since:
    2.0.0
    Author:
    Elie Roux
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String COUCH_ID  
      • Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService

        attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
    • Constructor Summary

      Constructors 
      Constructor Description
      CouchProfileService()  
      CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector)  
      CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector, java.lang.String attributes)  
      CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector, java.lang.String attributes, org.pac4j.core.credentials.password.PasswordEncoder passwordEncoder)  
      CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector, org.pac4j.core.credentials.password.PasswordEncoder passwordEncoder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void deleteById​(java.lang.String id)  
      org.ektorp.CouchDbConnector getCouchDbConnector()  
      com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()  
      protected void insert​(java.util.Map<java.lang.String,​java.lang.Object> attributes)  
      protected void internalInit​(boolean forceReinit)  
      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)  
      void setCouchDbConnector​(org.ektorp.CouchDbConnector couchDbConnector)  
      void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)  
      java.lang.String toString()  
      protected void update​(java.util.Map<java.lang.String,​java.lang.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

        afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CouchProfileService

        public CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector,
                                   java.lang.String attributes,
                                   org.pac4j.core.credentials.password.PasswordEncoder passwordEncoder)
      • CouchProfileService

        public CouchProfileService()
      • CouchProfileService

        public CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector)
      • CouchProfileService

        public CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector,
                                   java.lang.String attributes)
      • CouchProfileService

        public CouchProfileService​(org.ektorp.CouchDbConnector couchDbConnector,
                                   org.pac4j.core.credentials.password.PasswordEncoder passwordEncoder)
    • Method Detail

      • internalInit

        protected void internalInit​(boolean forceReinit)
        Overrides:
        internalInit in class org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
      • insert

        protected void insert​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        insert in class org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
      • update

        protected void update​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        update in class org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
      • deleteById

        protected void deleteById​(java.lang.String id)
        Specified by:
        deleteById in class org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
      • 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)
        Specified by:
        read in class org.pac4j.core.profile.service.AbstractProfileService<CouchProfile>
      • getCouchDbConnector

        public org.ektorp.CouchDbConnector getCouchDbConnector()
      • setCouchDbConnector

        public void setCouchDbConnector​(org.ektorp.CouchDbConnector couchDbConnector)
      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • setObjectMapper

        public void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object