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
,RevocationSource<CRL>
,Serializable
public class JdbcCacheCRLSource extends JdbcRevocationSource<CRL> implements CRLSource
CRLSource that retrieve information from a JDBC datasource
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
proxiedSource
-
Constructor Summary
Constructors Constructor Description JdbcCacheCRLSource()
-
Method Summary
Modifier and Type Method Description protected RevocationToken<CRL>
buildRevocationTokenFromResult(ResultSet rs, CertificateToken certificateToken, CertificateToken issuerCert)
BuildRevocationToken
from the obtainedResultSet
protected String
getCreateTableQuery()
Returns CREATE_TABLE sql queryprotected String
getDeleteTableQuery()
Returns an sql query to remove a table from DBprotected String
getFindRevocationQuery()
Returns an sql query to get revocation data from DBprotected String
getRemoveRevocationTokenEntryQuery()
Returns an sql query to remove a record from DBCRLToken
getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken)
This method retrieves aRevocationToken
for the certificateTokenCRLToken
getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh)
Retrieves a revocation token for the givenCertificateToken
protected String
getTableExistenceQuery()
Returns an sql query to check table existenceList<String>
initRevocationTokenKey(CertificateToken certificateToken)
Returns a revocation token keyprotected void
insertRevocation(RevocationToken<CRL> token)
Insert a new CRL into the cacheprotected void
updateRevocation(RevocationToken<CRL> token)
Update the cache with the CRLMethods inherited from class eu.europa.esig.dss.spi.x509.revocation.JdbcRevocationSource
closeQuietly, destroyTable, findRevocation, initTable, isTableExists, removeRevocation, rollback, setDataSource
Methods inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired
-
Constructor Details
-
JdbcCacheCRLSource
public JdbcCacheCRLSource()
-
-
Method Details
-
getCreateTableQuery
Description copied from class:JdbcRevocationSource
Returns CREATE_TABLE sql query- Specified by:
getCreateTableQuery
in classJdbcRevocationSource<CRL>
- Returns:
String
sql query
-
getTableExistenceQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to check table existence- Specified by:
getTableExistenceQuery
in classJdbcRevocationSource<CRL>
- Returns:
String
sql query
-
getFindRevocationQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to get revocation data from DB- Specified by:
getFindRevocationQuery
in classJdbcRevocationSource<CRL>
- Returns:
String
sql query
-
getRemoveRevocationTokenEntryQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a record from DB- Specified by:
getRemoveRevocationTokenEntryQuery
in classJdbcRevocationSource<CRL>
- Returns:
String
sql query
-
getDeleteTableQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a table from DB- Specified by:
getDeleteTableQuery
in classJdbcRevocationSource<CRL>
- Returns:
String
sql query
-
initRevocationTokenKey
Returns a revocation token key- Specified by:
initRevocationTokenKey
in classRepositoryRevocationSource<CRL>
- Parameters:
certificateToken
-CertificateToken
- Returns:
- revocation token key
String
-
buildRevocationTokenFromResult
protected RevocationToken<CRL> buildRevocationTokenFromResult(ResultSet rs, CertificateToken certificateToken, CertificateToken issuerCert)Description copied from class:JdbcRevocationSource
BuildRevocationToken
from the obtainedResultSet
- Specified by:
buildRevocationTokenFromResult
in classJdbcRevocationSource<CRL>
- Parameters:
rs
-ResultSet
answer from DBcertificateToken
-CertificateToken
of certificate to get revocation data forissuerCert
-CertificateToken
if issuer of the certificateToken- Returns:
RevocationToken
-
insertRevocation
Insert a new CRL into the cache- Specified by:
insertRevocation
in classRepositoryRevocationSource<CRL>
- Parameters:
token
-CRLToken
-
updateRevocation
Update the cache with the CRL- Specified by:
updateRevocation
in classRepositoryRevocationSource<CRL>
- Parameters:
token
-CRLToken
-
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
-