Class RepositoryRevocationSource<R extends Revocation>

java.lang.Object
eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource<R>
Type Parameters:
R - CRL or OCSP
All Implemented Interfaces:
RevocationSource<R>, Serializable
Direct Known Subclasses:
JdbcRevocationSource

public abstract class RepositoryRevocationSource<R extends Revocation>
extends Object
implements RevocationSource<R>
Allows storing and retrieving of revocation data to/from a repository (e.g. database)
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • RepositoryRevocationSource

      public RepositoryRevocationSource()
  • Method Details

    • initRevocationTokenKey

      public abstract List<String> initRevocationTokenKey​(CertificateToken certificateToken)
      Initialize a list of revocation token keys String from the given CertificateToken
      Parameters:
      certificateToken - CertificateToken
      Returns:
      list of String revocation keys
    • findRevocation

      protected abstract RevocationToken<R> findRevocation​(String key, CertificateToken certificateToken, CertificateToken issuerCertToken)
      Finds a RevocationToken in the cache
      Parameters:
      key - the key String
      certificateToken - CertificateToken
      issuerCertToken - CertificateToken
      Returns:
      RevocationToken object
    • insertRevocation

      protected abstract void insertRevocation​(RevocationToken<R> token)
      Inserts a new RevocationToken into the cache
      Parameters:
      token - RevocationToken
    • updateRevocation

      protected abstract void updateRevocation​(RevocationToken<R> token)
      Updates the RevocationToken into cache
      Parameters:
      token - RevocationToken
    • removeRevocation

      protected abstract void removeRevocation​(RevocationToken<R> 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<R> 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 RevocationToken<R> getRevocationToken​(CertificateToken certificateToken, CertificateToken issuerCertificateToken)
      Description copied from interface: RevocationSource
      This method retrieves a RevocationToken for the certificateToken
      Specified by:
      getRevocationToken in interface RevocationSource<R extends Revocation>
      Parameters:
      certificateToken - The CertificateToken for which the request is made
      issuerCertificateToken - The CertificateToken which is the issuer of the certificateToken
      Returns:
      an instance of RevocationToken
    • getRevocationToken

      public RevocationToken<R> getRevocationToken​(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh)
      Retrieves a revocation token for the given CertificateToken
      Parameters:
      certificateToken - CertificateToken
      issuerCertificateToken - CertificateToken of the issuer of certificateToken
      forceRefresh - if true, explicitly skips the cache
      Returns:
      RevocationToken