
com.github.kaizen4j.shiro.cache.ShiroRedisCache Maven / Gradle / Ivy
The newest version!
package com.github.kaizen4j.shiro.cache;
import com.github.kaizen4j.util.JsonUtils;
import java.time.Duration;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.subject.PrincipalCollection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.util.Base64Utils;
import org.springframework.util.ClassUtils;
import org.xerial.snappy.Snappy;
/**
* @author liuguowen
*/
@SuppressWarnings("unchecked")
public class ShiroRedisCache implements Cache {
private static final Logger logger = LoggerFactory.getLogger(ShiroRedisCache.class);
private RedisTemplate redisTemplate;
private long expireMillis;
private String cacheKeyPrefix;
private RedisSerializer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy