Java Code Examples for org.apache.shiro.cache.Cache#keys()

The following examples show how to use org.apache.shiro.cache.Cache#keys() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShiroCustomRealm.java    From phone with Apache License 2.0 6 votes vote down vote up
/**
 * 清除所有用户授权信息缓存.
 */
public void clearAllCachedAuthorizationInfo() {
	if (logger.isDebugEnabled()) {
		logger.debug("clearAllCachedAuthorizationInfo() - start"); //$NON-NLS-1$
	}

	Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
	if (cache != null) {
		for (Object key : cache.keys()) {
			cache.remove(key);
		}
	}

	if (logger.isDebugEnabled()) {
		logger.debug("clearAllCachedAuthorizationInfo() - end"); //$NON-NLS-1$
	}
}
 
Example 2
Source File: SSORealm.java    From kafka-eagle with Apache License 2.0 5 votes vote down vote up
public void clearAllCached() {
	Cache<Object, AuthorizationInfo> cache = this.getAuthorizationCache();
	if (cache != null) {
		for (Object key : cache.keys()) {
			cache.remove(key);
		}
	}
	LOG.info("SSOReaml - Clear all cached principal.");
}
 
Example 3
Source File: CacheUtils.java    From easyweb with Apache License 2.0 5 votes vote down vote up
/**
 * 从缓存中移除所有
 * @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);
}
 
Example 4
Source File: shiroDbRealm.java    From PhrackCTF-Platform-Team with Apache License 2.0 5 votes vote down vote up
/**
 * 清除所有用户授权信息缓存.
 */
public void clearAllCachedAuthorizationInfo() {
	Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
	if (cache != null) {
		for (Object key : cache.keys()) {
			cache.remove(key);
		}
	}
}
 
Example 5
Source File: shiroDbRealm.java    From PhrackCTF-Platform-Personal with Apache License 2.0 5 votes vote down vote up
/**
 * 清除所有用户授权信息缓存.
 */
public void clearAllCachedAuthorizationInfo() {
	Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
	if (cache != null) {
		for (Object key : cache.keys()) {
			cache.remove(key);
		}
	}
}
 
Example 6
Source File: ShiroJdbcRealm.java    From jee-universal-bms with Apache License 2.0 5 votes vote down vote up
/**
 * 清除所有用户授权信息缓存.
 */
public void clearAllCachedAuthorizationInfo() {
    Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
    if (cache != null) {
        for (Object key : cache.keys()) {
            cache.remove(key);
        }
    }
}