Class MongoAuthorizationSessionRepository

  • All Implemented Interfaces:
    com.rcore.domain.commons.port.CreateUpdateRepository<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity>, com.rcore.domain.commons.port.CRUDRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>, com.rcore.domain.commons.port.DeleteRepository<String>, com.rcore.domain.commons.port.ReadRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>, io.foodtechlab.common.domain.port.SafeDeleteCRUDRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>, io.foodtechlab.common.domain.port.SafeDeleteRepository<String>, io.foodtechlab.common.domain.port.SafeReadRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>, ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository

    @Repository
    public class MongoAuthorizationSessionRepository
    extends io.foodtechlab.common.mongo.port.AbstractMongoSafeDeleteRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​AuthSessionDoc,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>
    implements ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
    • Field Summary

      • Fields inherited from class com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository

        documentClass, mapper, mongoTemplate
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Long countByLoginDetailsAndTypeInHours​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails, ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)  
      Long countSessionsByDeviceTokenAndTypeInDay​(String deviceId, ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)  
      Long countSessionsByIpAndTypeInDay​(String ip, ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)  
      List<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findByClientInfoInDay​(ru.foodtechlab.lib.auth.service.domain.auth.entity.ClientInfo clientInfo)  
      List<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findByLoginDetailsInDay​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails)  
      Optional<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findPendingByAuthData​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails, ru.foodtechlab.lib.auth.service.domain.auth.entity.ClientInfo clientInfo)  
      protected com.rcore.database.mongo.commons.query.AbstractExampleQuery getSearchQuery​(ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters filters)  
      void incrementAttempts​(String authSessionId)  
      • Methods inherited from class io.foodtechlab.common.mongo.port.AbstractMongoSafeDeleteRepository

        delete, findById, forceFindById, permanentDelete, restore
      • Methods inherited from class com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository

        count, exist, find, findSearch, save
      • Methods inherited from interface com.rcore.domain.commons.port.CreateUpdateRepository

        save
      • Methods inherited from interface com.rcore.domain.commons.port.DeleteRepository

        delete
      • Methods inherited from interface com.rcore.domain.commons.port.ReadRepository

        count, exist, find, findById
      • Methods inherited from interface io.foodtechlab.common.domain.port.SafeDeleteRepository

        permanentDelete, restore
      • Methods inherited from interface io.foodtechlab.common.domain.port.SafeReadRepository

        forceFindById
    • Constructor Detail

      • MongoAuthorizationSessionRepository

        public MongoAuthorizationSessionRepository​(AuthorizationSessionDocMapper mapper,
                                                   org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
    • Method Detail

      • findPendingByAuthData

        public Optional<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findPendingByAuthData​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails,
                                                                                                                    ru.foodtechlab.lib.auth.service.domain.auth.entity.ClientInfo clientInfo)
        Specified by:
        findPendingByAuthData in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • countSessionsByDeviceTokenAndTypeInDay

        public Long countSessionsByDeviceTokenAndTypeInDay​(String deviceId,
                                                           ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)
        Specified by:
        countSessionsByDeviceTokenAndTypeInDay in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • countSessionsByIpAndTypeInDay

        public Long countSessionsByIpAndTypeInDay​(String ip,
                                                  ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)
        Specified by:
        countSessionsByIpAndTypeInDay in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • countByLoginDetailsAndTypeInHours

        public Long countByLoginDetailsAndTypeInHours​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails,
                                                      ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)
        Specified by:
        countByLoginDetailsAndTypeInHours in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • getSearchQuery

        protected com.rcore.database.mongo.commons.query.AbstractExampleQuery getSearchQuery​(ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters filters)
        Specified by:
        getSearchQuery in class com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<String,​ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity,​AuthSessionDoc,​ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters>
      • findByClientInfoInDay

        public List<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findByClientInfoInDay​(ru.foodtechlab.lib.auth.service.domain.auth.entity.ClientInfo clientInfo)
        Specified by:
        findByClientInfoInDay in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • findByLoginDetailsInDay

        public List<ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity> findByLoginDetailsInDay​(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails)
        Specified by:
        findByLoginDetailsInDay in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
      • incrementAttempts

        public void incrementAttempts​(String authSessionId)
        Specified by:
        incrementAttempts in interface ru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository