Class JdbcCacheAIASource

java.lang.Object
eu.europa.esig.dss.spi.x509.aia.RepositoryAIASource
eu.europa.esig.dss.service.x509.aia.JdbcCacheAIASource
All Implemented Interfaces:
AIASource, Serializable

public class JdbcCacheAIASource extends RepositoryAIASource
The class represents a JDBC cached AIA Source
See Also:
  • Field Details

    • jdbcCacheConnector

      protected transient JdbcCacheConnector jdbcCacheConnector
      Connection to database
  • Constructor Details

    • JdbcCacheAIASource

      public JdbcCacheAIASource()
      Default constructor with null JdbcCacheConnector
  • Method Details

    • setJdbcCacheConnector

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

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

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

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

      protected SqlQuery getInsertCertificateTokenEntryQuery()
      Returns an SQL query to insert a new CRL to a table
      Returns:
      SqlQuery
    • getRemoveCertificateTokenEntryQuery

      protected SqlQuery getRemoveCertificateTokenEntryQuery()
      Returns an sql query to remove a record from DB
      Returns:
      SqlQuery
    • getAIACertificatesExtractQuery

      protected SqlSelectQuery getAIACertificatesExtractQuery()
      Returns an SQL query to extract AIA certificates from a table
      Returns:
      SqlSelectQuery
    • getAIAKeysExtractQuery

      protected SqlSelectQuery getAIAKeysExtractQuery()
      Returns an SQL query to extract stored AIA keys in a table
      Returns:
      SqlSelectQuery
    • findCertificates

      protected Set<CertificateToken> findCertificates(String key)
      Description copied from class: RepositoryAIASource
      This method returns a set of certificates from a DB with the given key
      Specified by:
      findCertificates in class RepositoryAIASource
      Parameters:
      key - String the aiaKey to extract certificates by
      Returns:
      a set of CertificateTokens
    • insertCertificates

      protected void insertCertificates(String aiaUrl, Collection<CertificateToken> certificateTokens)
      Description copied from class: RepositoryAIASource
      This method allows inserting of a certificate into the DB
      Specified by:
      insertCertificates in class RepositoryAIASource
      Parameters:
      aiaUrl - String AIA Url used to download the certificates
      certificateTokens - a collection of CertificateTokens to insert
    • removeCertificates

      protected void removeCertificates(String aiaKey)
      Description copied from class: RepositoryAIASource
      This method removes the certificates from DB with the given aiaKey
      Specified by:
      removeCertificates in class RepositoryAIASource
      Parameters:
      aiaKey - String representing an AIA URL identifier
    • getExistingAIAKeys

      protected List<String> getExistingAIAKeys()
      Description copied from class: RepositoryAIASource
      Returns a list of all existing AIA keys present in the DB
      Specified by:
      getExistingAIAKeys in class RepositoryAIASource
      Returns:
      a list of String AIA keys
    • initTable

      public void initTable() throws SQLException
      Initialize the table.
      Throws:
      SQLException - in case of SQL connection error
    • isTableExists

      public boolean isTableExists()
      Checks of the table is created
      Returns:
      TRUE if the table is created, FALSE otherwise
    • destroyTable

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