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 java.lang.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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CRLCache` | `getCache()`
    `int` | `getCacheSize()` To get the current cache size (size of the hash map).
    `java.security.cert.X509CRL` | `getCacheValue(java.lang.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(java.lang.String crlUrl)`
    `void` | `resetIterator()`
    `void` | `setCacheValue(java.lang.String crlUrl, java.security.cert.X509CRL crl)`

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

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

- - ### Method Detail

    - #### getCache

          public static CRLCache getCache()

    - #### 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 java.security.cert.X509CRL getCacheValue(java.lang.String crlUrl)

    - #### setCacheValue

          public void setCacheValue(java.lang.String crlUrl,
                                    java.security.cert.X509CRL crl)

    - #### removeCacheValue

          public void removeCacheValue(java.lang.String crlUrl)

Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.