Package org.apache.synapse.transport.certificatevalidation.crl

# Class CRLCache

java.lang.Object
org.apache.synapse.transport.certificatevalidation.crl.CRLCache

All Implemented Interfaces:
  `ManageableCache`

public class CRLCache extends Object implements ManageableCache
Since a CRL maps to a CRL URL, the CRLCache should have x509CRL entries against CRL URLs. This cache is a Singleton since it is shared by any transport which needs SSL certificate validation and more than one CRLCache should not be allowed per system.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static CRLCache`
  `getCache(int cacheSize, int cacheDelayMins)`
  `int`
  `getCacheSize()`
  To get the current cache size (size of the hash map).
  `X509CRL`
  `getCacheValue(String crlUrl)`
  `ManageableCacheValue`
  `getNextCacheValue()`
  This method is needed by the cache Manager to go through the cache entries to remove invalid values or to remove LRU cache values if the cache has reached its max size.
  `void`
  `init(int size, int delay)`
  This initialize the Cache with a CacheManager.
  `void`
  `removeCacheValue(String crlUrl)`
  `void`
  `resetIterator()`
  `void`
  `setCacheValue(String crlUrl, X509CRL crl)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getCache

    public static CRLCache getCache(int cacheSize, int cacheDelayMins)

  - ### init

    public void init(int size, int delay)
    This initialize the Cache with a CacheManager. If this method is called, a cache manager will not be used.
    Parameters:
      `size` - max size of the cache
      `delay` - defines how frequently the CacheManager will be started

  - ### getNextCacheValue

    public ManageableCacheValue getNextCacheValue()
    This method is needed by the cache Manager to go through the cache entries to remove invalid values or to remove LRU cache values if the cache has reached its max size. Todo: Can move to an abstract class.
    Specified by:
      `getNextCacheValue` in interface `ManageableCache`
    Returns:
      next cache value of the cache.

  - ### getCacheSize

    public int getCacheSize()
    To get the current cache size (size of the hash map).
    Specified by:
      `getCacheSize` in interface `ManageableCache`

  - ### resetIterator

    public void resetIterator()
    Specified by:
      `resetIterator` in interface `ManageableCache`

  - ### getCacheValue

    public X509CRL getCacheValue(String crlUrl)

  - ### setCacheValue

    public void setCacheValue(String crlUrl, X509CRL crl)

  - ### removeCacheValue

    public void removeCacheValue(String crlUrl)