org.nhindirect.stagent.cert
Class DefaultCertStoreCachePolicy

java.lang.Object
  extended by org.nhindirect.stagent.cert.DefaultCertStoreCachePolicy
All Implemented Interfaces:
CertStoreCachePolicy

public class DefaultCertStoreCachePolicy
extends java.lang.Object
implements CertStoreCachePolicy

Default implementation of a cache policy.

Author:
Greg Meyer

Constructor Summary
DefaultCertStoreCachePolicy()
          Constructs a policy with default settings: MaxItems: 1000 Subject TTL: 1 day
 
Method Summary
 int getMaxItems()
          The maximum number of items that can be held in the cache.
 int getSubjectTTL()
          The maximum amount of time a subject's certificates can remain in the cache before getting purged.
 void setMaxItems(int maxItems)
          Sets the maximum number items allowed in the cache.
 void setSubjectTTL(int subjectTTL)
          Sets the maximum amount of time a subject will remain in the cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCertStoreCachePolicy

public DefaultCertStoreCachePolicy()
Constructs a policy with default settings: MaxItems: 1000 Subject TTL: 1 day

Method Detail

getMaxItems

public int getMaxItems()
The maximum number of items that can be held in the cache. Items will be trimmed according to cache policy. By default the policy will purged based on least recently used.

Specified by:
getMaxItems in interface CertStoreCachePolicy

setMaxItems

public void setMaxItems(int maxItems)
Sets the maximum number items allowed in the cache.

Parameters:
maxItems - The maximum number items allowed in the cache.

setSubjectTTL

public void setSubjectTTL(int subjectTTL)
Sets the maximum amount of time a subject will remain in the cache.

Parameters:
subjectTTL - The maximum amount of time in seconds a subject will remain in the cache.

getSubjectTTL

public int getSubjectTTL()
The maximum amount of time a subject's certificates can remain in the cache before getting purged. To maintain coherency, this setting is independent of the number of times a cache hit occurs per subject.

Specified by:
getSubjectTTL in interface CertStoreCachePolicy
Returns:
The maxiumum amount of time in seconds that a subject's certificates will remain in the cache before being purged.


Copyright © 2010-2011 HNIN Direct. All Rights Reserved.