Class MongoAuthorizationSessionRepository
- java.lang.Object
-
- com.rcore.database.mongo.commons.port.impl.AbstractMongoRepository<ID,E,D,F>
-
- 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>
-
- ru.foodtechlab.lib.auth.service.infrastructure.database.mongo.authorizationSession.port.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
-
-
Constructor Summary
Constructors Constructor Description MongoAuthorizationSessionRepository(AuthorizationSessionDocMapper mapper, org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongcountByLoginDetailsAndTypeInHours(ru.foodtechlab.lib.auth.service.domain.auth.entity.LoginDetails loginDetails, ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)LongcountSessionsByDeviceTokenAndTypeInDay(String deviceId, ru.foodtechlab.lib.auth.service.domain.auth.entity.AuthSessionEntity.Type type)LongcountSessionsByIpAndTypeInDay(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.AbstractExampleQuerygetSearchQuery(ru.foodtechlab.lib.auth.service.domain.auth.port.filter.AuthorizationSessionFilters filters)voidincrementAttempts(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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.rcore.domain.commons.port.ReadRepository
count, exist, find, findById
-
-
-
-
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:
findPendingByAuthDatain interfaceru.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:
countSessionsByDeviceTokenAndTypeInDayin interfaceru.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:
countSessionsByIpAndTypeInDayin interfaceru.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:
countByLoginDetailsAndTypeInHoursin interfaceru.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:
getSearchQueryin classcom.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:
findByClientInfoInDayin interfaceru.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:
findByLoginDetailsInDayin interfaceru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
-
incrementAttempts
public void incrementAttempts(String authSessionId)
- Specified by:
incrementAttemptsin interfaceru.foodtechlab.lib.auth.service.domain.auth.port.AuthorizationSessionRepository
-
-