com.github.lontime.extpac4j.impl.HeaderSessionStore Maven / Gradle / Ivy
The newest version!
package com.github.lontime.extpac4j.impl;
import java.time.Duration;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import com.github.lontime.base.serial.GenericObjectSerializers;
import com.github.lontime.base.serial.MsgpackSerial;
import com.github.lontime.extredisson.RedissonInstance;
import com.github.lontime.extredisson.codec.StringBytesMapCodec;
import com.github.lontime.shaded.com.twitter.serial.serializer.Serializer;
import com.github.lontime.shaded.org.redisson.api.RedissonClient;
import org.pac4j.core.context.JEEContext;
import org.pac4j.core.profile.CommonProfile;
/**
* LocalJEESessionStore.
*
* @author lontime
* @since 1.0
*/
public class HeaderSessionStore extends HeaderSimpleSessionStore {
public static final HeaderSessionStore INSTANCE = new HeaderSessionStore();
private final RedissonClient redissonClient;
private final Duration expire;
public HeaderSessionStore(String headerName, String redissonName) {
super(headerName);
this.redissonClient = RedissonInstance.get().client(redissonName);
this.expire = Duration.ofMinutes(20);
}
public HeaderSessionStore(String redissonName) {
this(null, redissonName);
}
public HeaderSessionStore() {
this(null, null);
}
@Override
public Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy