Module jpms_dss_spi

Class JdbcRevocationSource<R extends eu.europa.esig.dss.model.x509.revocation.Revocation>

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

public abstract class JdbcRevocationSource<R extends eu.europa.esig.dss.model.x509.revocation.Revocation> extends RepositoryRevocationSource<R>
Abstract class to retrieve token from a JDBC datasource
See Also:
  • Constructor Details

    • JdbcRevocationSource

      protected JdbcRevocationSource()
      Default constructor instantiating object with null values
  • Method Details

    • getCreateTableQuery

      protected abstract SqlQuery getCreateTableQuery()
      Returns CREATE_TABLE sql query
      Returns:
      SqlQuery
    • getTableExistenceQuery

      protected abstract SqlQuery getTableExistenceQuery()
      Returns an sql query to check table existence
      Returns:
      SqlQuery
    • getDeleteTableQuery

      protected abstract SqlQuery getDeleteTableQuery()
      Returns an sql query to remove a table from DB
      Returns:
      SqlQuery
    • getInsertRevocationTokenEntryQuery

      protected abstract SqlQuery getInsertRevocationTokenEntryQuery()
      Returns an SQL query to insert a new revocation token to a table
      Returns:
      SqlQuery
    • getUpdateRevocationTokenEntryQuery

      protected abstract SqlQuery getUpdateRevocationTokenEntryQuery()
      Returns an SQL query to update a revocation token in a table
      Returns:
      SqlQuery
    • getRemoveRevocationTokenEntryQuery

      protected abstract SqlQuery getRemoveRevocationTokenEntryQuery()
      Returns an sql query to remove a revocation token from DB
      Returns:
      SqlQuery
    • buildRevocationTokenFromResult

      protected abstract RevocationToken<R> buildRevocationTokenFromResult(SqlRecord response, eu.europa.esig.dss.model.x509.CertificateToken certificateToken, eu.europa.esig.dss.model.x509.CertificateToken issuerCertificateToken) throws DSSExternalResourceException
      Builds RevocationToken from the obtained ResultSet
      Parameters:
      response - SqlRecord represent the extracted record row
      certificateToken - CertificateToken of certificate to get revocation data for
      issuerCertificateToken - CertificateToken if issuer of the certificateToken
      Returns:
      RevocationToken
      Throws:
      DSSExternalResourceException - if an exception occurs during the attempt to extract token
    • getJdbcCacheConnector

      protected JdbcCacheConnector getJdbcCacheConnector()
      Gets the SQL connection DataSource
      Returns:
      JdbcCacheConnector
    • setJdbcCacheConnector

      public void setJdbcCacheConnector(JdbcCacheConnector jdbcCacheConnector)
      Sets the SQL connection DataSource
      Parameters:
      jdbcCacheConnector - JdbcCacheConnector
    • findRevocations

      protected List<RevocationToken<R>> findRevocations(String key, eu.europa.esig.dss.model.x509.CertificateToken certificateToken, eu.europa.esig.dss.model.x509.CertificateToken issuerCertificateToken)
      Description copied from class: RepositoryRevocationSource
      Finds a list of RevocationTokens in the cache for the given certificateToken with the corresponding key
      Specified by:
      findRevocations in class RepositoryRevocationSource<R extends eu.europa.esig.dss.model.x509.revocation.Revocation>
      Parameters:
      key - the key String
      certificateToken - CertificateToken
      issuerCertificateToken - CertificateToken
      Returns:
      a list of RevocationToken objects
    • getRevocationDataExtractQuery

      protected abstract SqlSelectQuery getRevocationDataExtractQuery()
      Returns a request to find a revocation data
      Returns:
      SqlSelectQuery
    • removeRevocation

      protected void removeRevocation(String revocationTokenKey)
      Description copied from class: RepositoryRevocationSource
      Removes the RevocationToken from cache with the given key
      Specified by:
      removeRevocation in class RepositoryRevocationSource<R extends eu.europa.esig.dss.model.x509.revocation.Revocation>
      Parameters:
      revocationTokenKey - String
    • initTable

      public void initTable() throws SQLException
      Initialize the revocation token table by creating the table if it does not exist.
      Throws:
      SQLException - in case of SQL connection error
    • isTableExists

      public boolean isTableExists()
      Verifies if the table exists
      Returns:
      TRUE if the table exists, FALSE otherwise
    • destroyTable

      public void destroyTable() throws SQLException
      Removes table from DB
      Throws:
      SQLException - in case of error