use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class CertCacheFactory method applyCachePolicy.
/*
* Apply a policy to the cache
*/
private void applyCachePolicy(JCS cache, CertStoreCachePolicy policy) throws CacheException {
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);
}
use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class CacheableKeyStoreManagerCertificateStore 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) {
// no-op
}
}
}
use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class DNSCertificateStore 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
}
}
}
use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class ConfigServiceCertificateStore 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
}
}
}
use of org.apache.jcs.engine.behavior.IElementAttributes in project nhin-d by DirectProject.
the class ConfigServiceRESTCertificateStore 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