ASN IP列表中的 查询条件ASN IP Group从缓存中查询
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@@ -51,6 +52,18 @@ public class AsnCacheUtils{
|
||||
logger.warn("clear cache!");
|
||||
CacheUtils.getCacheManager().removeCache(ASN_NO_CACHE);
|
||||
}
|
||||
public static List<ConfigGroupInfo> getAllAsnGroup(){
|
||||
List<ConfigGroupInfo> configGroupInfos=Lists.newArrayList();
|
||||
Cache cache=getCache(ASN_NO_CACHE);
|
||||
for(Object key:cache.getKeys()) {
|
||||
Element element = getCache(ASN_NO_CACHE).get(key);
|
||||
if(element!=null) {
|
||||
Map<Long,ConfigGroupInfo> map=(Map<Long,ConfigGroupInfo>)element.getObjectValue();
|
||||
configGroupInfos.addAll(map.values());
|
||||
}
|
||||
}
|
||||
return configGroupInfos;
|
||||
}
|
||||
/**
|
||||
* 初始化缓存
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user