Example usage for org.apache.shiro.cache Cache keys

List of usage examples for org.apache.shiro.cache Cache keys

Introduction

In this page you can find the example usage for org.apache.shiro.cache Cache keys.

Prototype

public Set<K> keys();

Source Link

Document

Returns a view of all the keys for entries contained in this cache.

Usage

From source file:apm.modules.sys.security.SystemAuthorizingRealm.java

License:Open Source License

/**
 * ??/*from  www . j  a va 2 s  .  c om*/
 */
public void clearAllCachedAuthorizationInfo() {
    Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
    if (cache != null) {
        for (Object key : cache.keys()) {
            cache.remove(key);
        }
    }
}

From source file:com.aistor.modules.sys.security.SystemRealm.java

License:Open Source License

/**
 * ??//  w  w  w .  j av a  2 s  .c  o  m
 */
public void clearAllCachedAuthorizationInfo() {
    Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
    if (cache != null) {
        for (Object key : cache.keys()) {
            cache.remove(key);
        }
    }
    UserUtils.removeCache("menuList");
    UserUtils.removeCache("categoryList");
}

From source file:com.funtl.framework.core.utils.CacheUtils.java

License:Apache License

/**
 * //from  w  ww. j av a 2  s. co m
 *
 * @param cacheName
 */
public static void removeAll(String cacheName) {
    Cache<String, Object> cache = getCache(cacheName);
    Set<String> keys = cache.keys();
    for (Iterator<String> it = keys.iterator(); it.hasNext();) {
        cache.remove(it.next());
    }
    logger.info("? {} => {}", cacheName, keys);
}

From source file:com.zht.common.shiro.realm.ShiroDbRealm.java

License:Apache License

/**
 * ??.//from   ww  w.j a va 2  s .  c  om
 */
public void clearAllCachedAuthorizationInfo() {
    Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
    if (cache != null && cache.size() > 0) {
        Set<?> keys = cache.keys();
        for (Object key : keys) {
            cache.remove(key);
        }
    }
}

From source file:org.smartloli.kafka.eagle.web.sso.filter.SSORealm.java

License:Apache License

public void clearAllCached() {
    Cache<Object, AuthorizationInfo> cache = this.getAuthorizationCache();
    if (cache != null) {
        for (Object key : cache.keys()) {
            cache.remove(key);/*from  w  w  w . j  a v  a  2 s.  com*/
        }
    }
    LOG.info("SSOReaml - Clear all cached principal.");
}