Class PurgeExpiredTokenService
java.lang.Object
es.kukenan.smartfi.microservice.clients.service.schedule.PurgeExpiredTokenService
Service for periodic purge of expired token.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AmqpControllerAMQP Controller (for event publishing).private StringCron service name.private LongValue of days for expire tokens.private KafkaControllerKafka Controller.private es.kukenan.smartfi.common.context.RequestContextManagerRequest/execution context manager.private UserDeviceRepositoryRepository of userdevice to update expired tokens. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPurge expired token from database with time condition.es.kukenan.smartfi.microservice.clients.events.tokendeleted.UserDeviceTokenDeletedEventuserDeviceTokenDeletedEvent(UserDevice userDevice) Create aUserDeviceTokenDeletedEventfor the given user in the given context.
-
Field Details
-
expiredTokenDays
Value of days for expire tokens. -
cronServiceName
Cron service name. -
amqpController
AMQP Controller (for event publishing). -
kafkaController
Kafka Controller. -
requestContextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager requestContextManagerRequest/execution context manager. -
userDeviceRepository
Repository of userdevice to update expired tokens.
-
-
Constructor Details
-
PurgeExpiredTokenService
public PurgeExpiredTokenService()
-
-
Method Details
-
purgeExpiredToken
@Scheduled(cron="${expired.token.days.cron}") public void purgeExpiredToken()Purge expired token from database with time condition. -
userDeviceTokenDeletedEvent
public es.kukenan.smartfi.microservice.clients.events.tokendeleted.UserDeviceTokenDeletedEvent userDeviceTokenDeletedEvent(UserDevice userDevice) Create aUserDeviceTokenDeletedEventfor the given user in the given context.- Parameters:
userDevice- user device data with expired tokens.- Returns:
- the event with user and device for delete.
-