Class OCSPCache
java.lang.Object
org.apache.synapse.transport.certificatevalidation.ocsp.OCSPCache
- All Implemented Interfaces:
ManageableCache
This is a cache to store OSCP responses against Certificate Serial Number since an OCSP response depends on
the certificate. This is a singleton since more than one cache of this kind should not be allowed. This cache
can be shared by many transports which need SSL validation through OCSP.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OCSPCachegetCache(int cacheSize, int cacheDelayMins) intorg.bouncycastle.cert.ocsp.SingleRespgetCacheValue(BigInteger serialNumber) 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.voidinit(int size, int delay) This lazy initializes the Cache with a CacheManager.voidremoveCacheValue(BigInteger serialNumber) voidvoidsetCacheValue(BigInteger serialNumber, org.bouncycastle.cert.ocsp.SingleResp singleResp, org.bouncycastle.cert.ocsp.OCSPReq request, String serviceUrl)
-
Method Details
-
getCache
-
init
public void init(int size, int delay) This lazy initializes the Cache with a CacheManager. If this method is not called, a cache manager will not be used.- Parameters:
size- max size of the cachedelay- defines how frequently the CacheManager will be started
-
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:
getNextCacheValuein interfaceManageableCache- Returns:
- next cache value of the cache.
-
getCacheSize
public int getCacheSize()- Specified by:
getCacheSizein interfaceManageableCache- Returns:
- the current cache size (size of the hash map)
-
resetIterator
public void resetIterator()- Specified by:
resetIteratorin interfaceManageableCache
-
getCacheValue
-
setCacheValue
public void setCacheValue(BigInteger serialNumber, org.bouncycastle.cert.ocsp.SingleResp singleResp, org.bouncycastle.cert.ocsp.OCSPReq request, String serviceUrl) -
removeCacheValue
-