Class RepositoryRevocationSource<T extends RevocationToken>
- java.lang.Object
-
- eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource<T>
-
- All Implemented Interfaces:
RevocationSource<T>,Serializable
- Direct Known Subclasses:
JdbcRevocationSource
public abstract class RepositoryRevocationSource<T extends RevocationToken> extends Object implements RevocationSource<T>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OnlineRevocationSource<T>proxiedSource
-
Constructor Summary
Constructors Constructor Description RepositoryRevocationSource()
-
Method Summary
Modifier and Type Method Description protected abstract TfindRevocation(String key, CertificateToken certificateToken, CertificateToken issuerCertToken)Finds a RevocationToken in the cacheTgetRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken)Retrieves a revocation token for the givenCertificateTokenTgetRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh)Retrieves a revocation token for the givenCertificateTokenabstract List<String>initRevocationTokenKey(CertificateToken certificateToken)Initialize a list of revocation token keysStringfrom the givenCertificateTokenprotected abstract voidinsertRevocation(T token)Inserts a new RevocationToken into the cacheprotected abstract voidremoveRevocation(T token)Removes the RevocationToken from cachevoidsetDefaultNextUpdateDelay(Long defaultNextUpdateDelay)Sets the default next update delay for the cached files in seconds.voidsetMaxNextUpdateDelay(Long maxNextUpdateDelay)Sets the maximum allowed nextUpdate delay for cached files in seconds.voidsetProxySource(OnlineRevocationSource<T> proxiedSource)The proxied revocation source to be called if the data is not available in the cachevoidsetRemoveExpired(boolean removeExpired)protected abstract voidupdateRevocation(T token)Updates the RevocationToken into cache
-
-
-
Field Detail
-
proxiedSource
protected OnlineRevocationSource<T extends RevocationToken> proxiedSource
-
-
Method Detail
-
initRevocationTokenKey
public abstract List<String> initRevocationTokenKey(CertificateToken certificateToken)
Initialize a list of revocation token keysStringfrom the givenCertificateToken- Parameters:
certificateToken-CertificateToken- Returns:
- list of
Stringrevocation keys
-
findRevocation
protected abstract T findRevocation(String key, CertificateToken certificateToken, CertificateToken issuerCertToken)
Finds a RevocationToken in the cache- Parameters:
key- the keyStringcertificateToken-CertificateTokenissuerCertToken-CertificateToken- Returns:
RevocationTokenobject
-
insertRevocation
protected abstract void insertRevocation(T token)
Inserts a new RevocationToken into the cache- Parameters:
token-RevocationToken
-
updateRevocation
protected abstract void updateRevocation(T token)
Updates the RevocationToken into cache- Parameters:
token-RevocationToken
-
removeRevocation
protected abstract void removeRevocation(T token)
Removes the RevocationToken from cache- Parameters:
token-RevocationToken
-
setDefaultNextUpdateDelay
public void setDefaultNextUpdateDelay(Long defaultNextUpdateDelay)
Sets the default next update delay for the cached files in seconds. If more time has passed from the revocation token's thisUpdate and next update time is not specified, then a fresh copy is downloaded and cached, otherwise a cached copy is used.If revocation.nextUpdate = null, then nextUpdate = revocation.thisUpdate + defaultNextUpdateDelay- Parameters:
defaultNextUpdateDelay- long value (seconds)
-
setMaxNextUpdateDelay
public void setMaxNextUpdateDelay(Long maxNextUpdateDelay)
Sets the maximum allowed nextUpdate delay for cached files in seconds. Allows to force refresh in case of long periods between revocation publication (eg : 6 months for ARL).If revocation.nextUpdate > revocation.thisUpdate + maxNextUpdateDelay, then nextUpdate = revocation.thisUpdate + maxNextUpdateDelay- Parameters:
maxNextUpdateDelay- long value (seconds)
-
setProxySource
public void setProxySource(OnlineRevocationSource<T> proxiedSource)
The proxied revocation source to be called if the data is not available in the cache- Parameters:
proxiedSource- the proxiedSource to set
-
setRemoveExpired
public void setRemoveExpired(boolean removeExpired)
- Parameters:
removeExpired- the removeExpired to set
-
getRevocationToken
public T getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken)
Retrieves a revocation token for the givenCertificateToken- Specified by:
getRevocationTokenin interfaceRevocationSource<T extends RevocationToken>- Parameters:
certificateToken-CertificateTokenissuerCertificateToken-CertificateTokenof the issuer of certificateToken- Returns:
- an instance of
RevocationToken
-
getRevocationToken
public T getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh)
Retrieves a revocation token for the givenCertificateToken- Parameters:
certificateToken-CertificateTokenissuerCertificateToken-CertificateTokenof the issuer of certificateTokenforceRefresh- if true, explicitly skips the cache
-
-