protected void configureTicketExpirationInstant(final Ticket ticket, final String redisKeyPattern) {
        if (ticket.getExpirationPolicy() instanceof final IdleExpirationPolicy iep) {
            val expirationInstant = iep.getIdleExpirationTime(ticket).toInstant();
            casRedisTemplates.getTicketsRedisTemplate().expireAt(redisKeyPattern, expirationInstant);
            LOGGER.debug("Ticket [{}] will expire at [{}]", ticket.getId(), expirationInstant);
        } else {
            val timeoutSeconds = RedisKeyGenerator.getTicketExpirationInSeconds(ticket);
            casRedisTemplates.getTicketsRedisTemplate().expire(redisKeyPattern, timeoutSeconds, TimeUnit.SECONDS);
            LOGGER.debug("Ticket [{}] will expire in [{}] second(s)", ticket.getId(), timeoutSeconds);
        }
    }
Key-value ticket registry implementation that stores tickets in redis.

@author Misagh Moayyed
@author Jerome Leleu
@since 5.1.0
support/cas-server-support-redis-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/RedisTicketRegistry.java