Search in sources :

Example 1 with SearchAttribute

use of net.sf.ehcache.config.SearchAttribute in project joynr by bmwcarit.

the class DomainAccessControlStoreEhCache method createDrtCache.

private Cache createDrtCache() {
    // configure cache as searchable
    CacheConfiguration cacheConfig = new CacheConfiguration(CacheId.DOMAIN_ROLES.getIdAsString(), 0).eternal(true);
    Searchable searchable = new Searchable();
    cacheConfig.addSearchable(searchable);
    // register searchable attributes
    searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.USER_ID));
    searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.ROLE));
    cacheManager.addCache(new Cache(cacheConfig));
    return cacheManager.getCache(CacheId.DOMAIN_ROLES.getIdAsString());
}
Also used : SearchAttribute(net.sf.ehcache.config.SearchAttribute) Searchable(net.sf.ehcache.config.Searchable) CacheConfiguration(net.sf.ehcache.config.CacheConfiguration) Cache(net.sf.ehcache.Cache)

Example 2 with SearchAttribute

use of net.sf.ehcache.config.SearchAttribute in project joynr by bmwcarit.

the class DomainAccessControlStoreEhCache method createAclCache.

private Cache createAclCache(CacheId cacheId) {
    // configure cache as searchable
    CacheConfiguration cacheConfig = new CacheConfiguration(cacheId.getIdAsString(), 0).eternal(true);
    Searchable searchable = new Searchable();
    cacheConfig.addSearchable(searchable);
    // register searchable attributes
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.USER_ID));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.DOMAIN));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.INTERFACE));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.OPERATION));
    cacheManager.addCache(new Cache(cacheConfig));
    return cacheManager.getCache(cacheId.getIdAsString());
}
Also used : SearchAttribute(net.sf.ehcache.config.SearchAttribute) Searchable(net.sf.ehcache.config.Searchable) CacheConfiguration(net.sf.ehcache.config.CacheConfiguration) Cache(net.sf.ehcache.Cache)

Aggregations

Cache (net.sf.ehcache.Cache)2 CacheConfiguration (net.sf.ehcache.config.CacheConfiguration)2 SearchAttribute (net.sf.ehcache.config.SearchAttribute)2 Searchable (net.sf.ehcache.config.Searchable)2