Java Code Examples for net.sf.ehcache.Cache#getAll()

The following examples show how to use net.sf.ehcache.Cache#getAll() . 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: BounceProxyEhcacheAdapter.java    From joynr with Apache License 2.0 6 votes vote down vote up
@Override
public List<BounceProxyRecord> getAssignableBounceProxies() {

    if (log.isTraceEnabled()) {
        log.trace("Retrieving assignable bounce proxies from cache {}", cacheName);
        tracePeers();
    }

    List<BounceProxyRecord> result = new LinkedList<BounceProxyRecord>();

    Cache cache = manager.getCache(cacheName);

    @SuppressWarnings("rawtypes")
    List keys = cache.getKeys();
    Map<Object, Element> elements = cache.getAll(keys);

    for (Element element : elements.values()) {
        BounceProxyRecord bounceProxyRecord = getBounceProxyRecordFromElement(element);
        if (bounceProxyRecord.getStatus().isAssignable()) {
            result.add(bounceProxyRecord);
        }
    }

    return result;
}
 
Example 2
Source File: BounceProxyEhcacheAdapter.java    From joynr with Apache License 2.0 6 votes vote down vote up
@Override
public List<BounceProxyStatusInformation> getBounceProxyStatusInformation() {

    if (log.isTraceEnabled()) {
        log.trace("getBounceProxyStatusInformation from cache {}", cacheName);
        tracePeers();
    }

    List<BounceProxyStatusInformation> result = new LinkedList<BounceProxyStatusInformation>();

    Cache cache = manager.getCache(cacheName);
    @SuppressWarnings("rawtypes")
    List keys = cache.getKeys();
    Map<Object, Element> elements = cache.getAll(keys);

    for (Element element : elements.values()) {
        result.add(getBounceProxyRecordFromElement(element));
    }

    return result;
}
 
Example 3
Source File: GlobalDomainAccessStoreAdminEhCache.java    From joynr with Apache License 2.0 5 votes vote down vote up
@Override
public List<MasterAccessControlEntry> getAllMasterAclEntries() {
    List<MasterAccessControlEntry> result = new ArrayList<MasterAccessControlEntry>();
    Cache aclCache = getCache(CacheId.MASTER_ACL);
    Map<Object, Element> aclMap = aclCache.getAll(aclCache.getKeys());
    Iterator<Map.Entry<Object, Element>> iterator = aclMap.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<Object, Element> thisMapEntry = iterator.next();
        Element thisElement = thisMapEntry.getValue();
        MasterAccessControlEntry objectValue = getElementValue(thisElement);
        result.add(objectValue);
    }
    return result;
}
 
Example 4
Source File: GlobalDomainAccessStoreAdminEhCache.java    From joynr with Apache License 2.0 5 votes vote down vote up
@Override
public List<OwnerAccessControlEntry> getAllOwnerAclEntries() {
    List<OwnerAccessControlEntry> result = new ArrayList<OwnerAccessControlEntry>();
    Cache aclCache = getCache(CacheId.OWNER_ACL);
    Map<Object, Element> aclMap = aclCache.getAll(aclCache.getKeys());
    Iterator<Map.Entry<Object, Element>> iterator = aclMap.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<Object, Element> thisMapEntry = iterator.next();
        Element thisElement = thisMapEntry.getValue();
        OwnerAccessControlEntry objectValue = getElementValue(thisElement);
        result.add(objectValue);
    }
    return result;
}
 
Example 5
Source File: GlobalDomainAccessStoreAdminEhCache.java    From joynr with Apache License 2.0 5 votes vote down vote up
@Override
public List<DomainRoleEntry> getAllDomainRoleEntries() {
    List<DomainRoleEntry> result = new ArrayList<>();
    Cache roleCache = getCache(CacheId.DOMAIN_ROLES);
    Map<Object, Element> roleMap = roleCache.getAll(roleCache.getKeys());
    Iterator<Map.Entry<Object, Element>> iterator = roleMap.entrySet().iterator();
    while (iterator.hasNext()) {
        Element thisElement = iterator.next().getValue();
        DomainRoleEntry objectValue = getElementValue(thisElement);
        result.add(objectValue);
    }
    return result;
}