All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lontime.extpac4j.common.SessionStoreKind Maven / Gradle / Ivy

The newest version!
package com.github.lontime.extpac4j.common;

import com.github.lontime.extpac4j.configuration.OptionResolver;
import com.github.lontime.extpac4j.configuration.Options;
import com.github.lontime.extpac4j.impl.LocalJEESessionStore;
import org.pac4j.core.context.JEEContext;
import org.pac4j.core.context.session.SessionStore;

/**
 * SessionStoreKind.
 * @author lontime
 * @since 1.0
 */
public enum SessionStoreKind {
    /**
     * memory.
     */
    MEMORY,
    /**
     * redisson.
     */
    LOCAL;

    public SessionStore toJEESessionStore() {
        final Options options = OptionResolver.getInstance().getOptions();
        if (this == LOCAL) {
            return new LocalJEESessionStore(options.getRedissonName());
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy