Package eu.europa.esig.dss.service.crl
Class JdbcCacheCRLSource
java.lang.Object
eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource<R>
eu.europa.esig.dss.spi.x509.revocation.JdbcRevocationSource<CRL>
eu.europa.esig.dss.service.crl.JdbcCacheCRLSource
- All Implemented Interfaces:
CRLSource
,MultipleRevocationSource<CRL>
,RevocationSource<CRL>
,Serializable
CRLSource that retrieve information from a JDBC datasource
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Represents a CRL record extracted from the SQL database table -
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
proxiedSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected RevocationToken<CRL>
buildRevocationTokenFromResult
(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCertificateToken) BuildsRevocationToken
from the obtainedResultSet
protected SqlQuery
Returns CREATE_TABLE sql queryprotected SqlQuery
Returns an sql query to remove a table from DBprotected SqlQuery
Returns an SQL query to insert a new revocation token to a tableprotected SqlQuery
Returns an sql query to remove a revocation token from DBprotected SqlSelectQuery
Returns a request to find a revocation datagetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerCertificateToken) This method retrieves aRevocationToken
for the certificateTokengetRevocationToken
(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh) Retrieves a revocation token for the givenCertificateToken
protected String
getRevocationTokenKey
(CertificateToken certificateToken, String urlString) Gets a unique revocation token identifier used to store the revocation token for thiscertificateToken
within a repositoryprotected SqlQuery
Returns an sql query to check table existenceprotected SqlQuery
Returns an SQL query to update a revocation token in a tableinitRevocationTokenKeys
(CertificateToken certificateToken) Returns a revocation token keyprotected void
insertRevocation
(String revocationKey, RevocationToken<CRL> token) Inserts a new RevocationToken into the cacheprotected void
updateRevocation
(String revocationKey, RevocationToken<CRL> token) Updates the RevocationToken into cacheMethods inherited from class eu.europa.esig.dss.spi.x509.revocation.JdbcRevocationSource
destroyTable, findRevocations, getJdbcCacheConnector, initTable, isTableExists, removeRevocation, setJdbcCacheConnector
Methods inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
findRevocation, getRevocationTokens, getRevocationTokens, setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired
-
Constructor Details
-
JdbcCacheCRLSource
public JdbcCacheCRLSource()Default constructor
-
-
Method Details
-
getCreateTableQuery
Description copied from class:JdbcRevocationSource
Returns CREATE_TABLE sql query- Specified by:
getCreateTableQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getTableExistenceQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to check table existence- Specified by:
getTableExistenceQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getInsertRevocationTokenEntryQuery
Description copied from class:JdbcRevocationSource
Returns an SQL query to insert a new revocation token to a table- Specified by:
getInsertRevocationTokenEntryQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getUpdateRevocationTokenEntryQuery
Description copied from class:JdbcRevocationSource
Returns an SQL query to update a revocation token in a table- Specified by:
getUpdateRevocationTokenEntryQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getRemoveRevocationTokenEntryQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a revocation token from DB- Specified by:
getRemoveRevocationTokenEntryQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getDeleteTableQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a table from DB- Specified by:
getDeleteTableQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlQuery
-
getRevocationDataExtractQuery
Description copied from class:JdbcRevocationSource
Returns a request to find a revocation data- Specified by:
getRevocationDataExtractQuery
in classJdbcRevocationSource<CRL>
- Returns:
SqlSelectQuery
-
initRevocationTokenKeys
Returns a revocation token key- Specified by:
initRevocationTokenKeys
in classRepositoryRevocationSource<CRL>
- Parameters:
certificateToken
-CertificateToken
- Returns:
- revocation token key
String
-
buildRevocationTokenFromResult
protected RevocationToken<CRL> buildRevocationTokenFromResult(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCertificateToken) throws DSSExternalResourceException Description copied from class:JdbcRevocationSource
BuildsRevocationToken
from the obtainedResultSet
- Specified by:
buildRevocationTokenFromResult
in classJdbcRevocationSource<CRL>
- Parameters:
response
-SqlRecord
represent the extracted record rowcertificateToken
-CertificateToken
of certificate to get revocation data forissuerCertificateToken
-CertificateToken
if issuer of the certificateToken- Returns:
RevocationToken
- Throws:
DSSExternalResourceException
- if an exception occurs during the attempt to extract token
-
insertRevocation
Description copied from class:RepositoryRevocationSource
Inserts a new RevocationToken into the cache- Specified by:
insertRevocation
in classRepositoryRevocationSource<CRL>
- Parameters:
revocationKey
-String
token
-RevocationToken
-
updateRevocation
Description copied from class:RepositoryRevocationSource
Updates the RevocationToken into cache- Specified by:
updateRevocation
in classRepositoryRevocationSource<CRL>
- Parameters:
revocationKey
-String
token
-RevocationToken
-
getRevocationToken
public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from interface:RevocationSource
This method retrieves aRevocationToken
for the certificateToken- Specified by:
getRevocationToken
in interfaceCRLSource
- Specified by:
getRevocationToken
in interfaceRevocationSource<CRL>
- Overrides:
getRevocationToken
in classRepositoryRevocationSource<CRL>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerCertificateToken
- TheCertificateToken
which is the issuer of the certificateToken- Returns:
- an instance of
RevocationToken
-
getRevocationToken
public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh) Description copied from class:RepositoryRevocationSource
Retrieves a revocation token for the givenCertificateToken
- Overrides:
getRevocationToken
in classRepositoryRevocationSource<CRL>
- Parameters:
certificateToken
-CertificateToken
issuerCertificateToken
-CertificateToken
of the issuer of certificateTokenforceRefresh
- if true, explicitly skips the cache- Returns:
RevocationToken
-
getRevocationTokenKey
Description copied from class:RepositoryRevocationSource
Gets a unique revocation token identifier used to store the revocation token for thiscertificateToken
within a repository- Specified by:
getRevocationTokenKey
in classRepositoryRevocationSource<CRL>
- Parameters:
certificateToken
-CertificateToken
urlString
-String
representing a URL used to download the revocation token from- Returns:
String
revocation token key
-