Class JdbcRevocationSource<R extends 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
orOCSP
- All Implemented Interfaces:
MultipleRevocationSource<R>
,RevocationSource<R>
,Serializable
- Direct Known Subclasses:
JdbcCacheCRLSource
,JdbcCacheOCSPSource
public abstract class JdbcRevocationSource<R extends Revocation>
extends RepositoryRevocationSource<R>
Abstract class to retrieve token from a JDBC datasource
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
proxiedSource
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor instantiating object with null values -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RevocationToken
<R> buildRevocationTokenFromResult
(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCertificateToken) BuildsRevocationToken
from the obtainedResultSet
void
Removes table from DBprotected List
<RevocationToken<R>> findRevocations
(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken) Finds a list of RevocationTokens in the cache for the givencertificateToken
with the correspondingkey
protected abstract SqlQuery
Returns CREATE_TABLE sql queryprotected abstract SqlQuery
Returns an sql query to remove a table from DBprotected abstract SqlQuery
Returns an SQL query to insert a new revocation token to a tableprotected JdbcCacheConnector
Gets the SQL connection DataSourceprotected abstract SqlQuery
Returns an sql query to remove a revocation token from DBprotected abstract SqlSelectQuery
Returns a request to find a revocation dataprotected abstract SqlQuery
Returns an sql query to check table existenceprotected abstract SqlQuery
Returns an SQL query to update a revocation token in a tablevoid
Initialize the revocation token table by creating the table if it does not exist.boolean
Verifies if the table existsprotected void
removeRevocation
(String revocationTokenKey) Removes the RevocationToken from cache with the given keyvoid
setJdbcCacheConnector
(JdbcCacheConnector jdbcCacheConnector) Sets the SQL connection DataSourceMethods inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
getRevocationAccessUrls, getRevocationSourceUrl, getRevocationToken, getRevocationToken, getRevocationTokenKey, getRevocationTokens, getRevocationTokens, initRevocationTokenKeys, insertRevocation, isNotExpired, setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired, updateRevocation
-
Constructor Details
-
JdbcRevocationSource
protected JdbcRevocationSource()Default constructor instantiating object with null values
-
-
Method Details
-
getCreateTableQuery
-
getTableExistenceQuery
-
getDeleteTableQuery
-
getInsertRevocationTokenEntryQuery
-
getUpdateRevocationTokenEntryQuery
-
getRemoveRevocationTokenEntryQuery
-
buildRevocationTokenFromResult
protected abstract RevocationToken<R> buildRevocationTokenFromResult(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCertificateToken) throws DSSExternalResourceException BuildsRevocationToken
from the obtainedResultSet
- 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
-
getJdbcCacheConnector
Gets the SQL connection DataSource- Returns:
JdbcCacheConnector
-
setJdbcCacheConnector
Sets the SQL connection DataSource- Parameters:
jdbcCacheConnector
-JdbcCacheConnector
-
findRevocations
protected List<RevocationToken<R>> findRevocations(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from class:RepositoryRevocationSource
Finds a list of RevocationTokens in the cache for the givencertificateToken
with the correspondingkey
- Specified by:
findRevocations
in classRepositoryRevocationSource<R extends Revocation>
- Parameters:
key
- the keyString
certificateToken
-CertificateToken
issuerCertificateToken
-CertificateToken
- Returns:
- a list of
RevocationToken
objects
-
getRevocationDataExtractQuery
Returns a request to find a revocation data- Returns:
SqlSelectQuery
-
removeRevocation
Description copied from class:RepositoryRevocationSource
Removes the RevocationToken from cache with the given key- Specified by:
removeRevocation
in classRepositoryRevocationSource<R extends Revocation>
- Parameters:
revocationTokenKey
-String
-
initTable
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
Removes table from DB- Throws:
SQLException
- in case of error
-