use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class LDAPCertificateStore method applyCachePolicy.
private void applyCachePolicy(CertStoreCachePolicy policy) {
if (getCache() != null) {
try {
ICompositeCacheAttributes attributes = cache.getCacheAttributes();
attributes.setMaxObjects(policy.getMaxItems());
attributes.setUseLateral(false);
attributes.setUseRemote(false);
cache.setCacheAttributes(attributes);
IElementAttributes eattributes = cache.getDefaultElementAttributes();
eattributes.setMaxLifeSeconds(policy.getSubjectTTL());
eattributes.setIsEternal(false);
eattributes.setIsLateral(false);
eattributes.setIsRemote(false);
cache.setDefaultElementAttributes(eattributes);
} catch (CacheException e) {
// TODO: Handle exception
}
}
}
Aggregations