Package eu.europa.esig.dss.service.ocsp
Class JdbcCacheOCSPSource
java.lang.Object
eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource<OCSP>
eu.europa.esig.dss.spi.x509.revocation.JdbcRevocationSource<OCSP>
eu.europa.esig.dss.service.ocsp.JdbcCacheOCSPSource
- All Implemented Interfaces:
MultipleRevocationSource<OCSP>
,OCSPSource
,RevocationSource<OCSP>
,Serializable
OCSPSource that retrieve information from a JDBC data-source.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Represents an OCSP 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
<OCSP> buildRevocationTokenFromResult
(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCert) 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 DBgetRevocationAccessUrls
(CertificateToken certificateToken) Returns a revocation access URLs of the given revocation type for the providedCertificateToken
protected 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) Initialize a list of revocation token keysString
from the givenCertificateToken
protected void
insertRevocation
(String revocationKey, RevocationToken<OCSP> token) Inserts a new RevocationToken into the cacheprotected void
updateRevocation
(String revocationKey, RevocationToken<OCSP> token) Updates the currently stored OCSP token for the givenkey
with suppliedtoken
.Methods 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
getRevocationSourceUrl, getRevocationTokens, getRevocationTokens, isNotExpired, setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired
-
Constructor Details
-
JdbcCacheOCSPSource
public JdbcCacheOCSPSource()Default constructor
-
-
Method Details
-
getCreateTableQuery
Description copied from class:JdbcRevocationSource
Returns CREATE_TABLE sql query- Specified by:
getCreateTableQuery
in classJdbcRevocationSource<OCSP>
- Returns:
SqlQuery
-
getTableExistenceQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to check table existence- Specified by:
getTableExistenceQuery
in classJdbcRevocationSource<OCSP>
- Returns:
SqlQuery
-
getDeleteTableQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a table from DB- Specified by:
getDeleteTableQuery
in classJdbcRevocationSource<OCSP>
- 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<OCSP>
- 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<OCSP>
- Returns:
SqlQuery
-
getRemoveRevocationTokenEntryQuery
Description copied from class:JdbcRevocationSource
Returns an sql query to remove a revocation token from DB- Specified by:
getRemoveRevocationTokenEntryQuery
in classJdbcRevocationSource<OCSP>
- Returns:
SqlQuery
-
getRevocationDataExtractQuery
Description copied from class:JdbcRevocationSource
Returns a request to find a revocation data- Specified by:
getRevocationDataExtractQuery
in classJdbcRevocationSource<OCSP>
- Returns:
SqlSelectQuery
-
initRevocationTokenKeys
Description copied from class:RepositoryRevocationSource
Initialize a list of revocation token keysString
from the givenCertificateToken
- Specified by:
initRevocationTokenKeys
in classRepositoryRevocationSource<OCSP>
- Parameters:
certificateToken
-CertificateToken
- Returns:
- list of
String
revocation keys
-
buildRevocationTokenFromResult
protected RevocationToken<OCSP> buildRevocationTokenFromResult(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCert) throws DSSExternalResourceException Description copied from class:JdbcRevocationSource
BuildsRevocationToken
from the obtainedResultSet
- Specified by:
buildRevocationTokenFromResult
in classJdbcRevocationSource<OCSP>
- Parameters:
response
-SqlRecord
represent the extracted record rowcertificateToken
-CertificateToken
of certificate to get revocation data forissuerCert
-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<OCSP>
- Parameters:
revocationKey
-String
token
-RevocationToken
-
updateRevocation
Updates the currently stored OCSP token for the givenkey
with suppliedtoken
.- Specified by:
updateRevocation
in classRepositoryRevocationSource<OCSP>
- Parameters:
revocationKey
-String
the key of the revocation data to be updatedtoken
- new OCSP token
-
getRevocationToken
public OCSPToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from interface:RevocationSource
This method retrieves aRevocationToken
for the certificateToken- Specified by:
getRevocationToken
in interfaceOCSPSource
- Specified by:
getRevocationToken
in interfaceRevocationSource<OCSP>
- Overrides:
getRevocationToken
in classRepositoryRevocationSource<OCSP>
- Parameters:
certificateToken
- TheCertificateToken
for which the request is madeissuerCertificateToken
- TheCertificateToken
which is the issuer of the certificateToken- Returns:
- an instance of
RevocationToken
-
getRevocationToken
public OCSPToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken, boolean forceRefresh) Description copied from class:RepositoryRevocationSource
Retrieves a revocation token for the givenCertificateToken
- Overrides:
getRevocationToken
in classRepositoryRevocationSource<OCSP>
- Parameters:
certificateToken
-CertificateToken
issuerCertificateToken
-CertificateToken
of the issuer of certificateTokenforceRefresh
- if true, explicitly skips the cache- Returns:
RevocationToken
-
getRevocationAccessUrls
Description copied from class:RepositoryRevocationSource
Returns a revocation access URLs of the given revocation type for the providedCertificateToken
- Specified by:
getRevocationAccessUrls
in classRepositoryRevocationSource<OCSP>
- Parameters:
certificateToken
-CertificateToken
to get revocation URLs for- Returns:
- a list of
String
URLs
-
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<OCSP>
- Parameters:
certificateToken
-CertificateToken
urlString
-String
representing a URL used to download the revocation token from- Returns:
String
revocation token key
-