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

com.github.houbbbbb.sso.nt.opt.CacheOpt Maven / Gradle / Ivy

The newest version!
package com.github.houbbbbb.sso.nt.opt;

import com.github.houbbbbb.sso.nt.constants.CacheConstants;

/**
 * @author: hbw
 * @date: 2020/9/29
 **/
public class CacheOpt {
    private CacheOpt() {}

    public static final String UPDATE_PREFIX = "update_";
    public static void offer(String sessionId){
        String update = UPDATE_PREFIX + sessionId;
        CacheConstants.CLEAR_CACHE.offer(update);
    }

    public static String getSession(String update){
        if(null == update){
            return null;
        }
        if(!update.startsWith(UPDATE_PREFIX)){
            return null;
        }
        return update.substring(7);
    }

    public static String setPrefix(String update){
        return UPDATE_PREFIX + update;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy