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-CRLorOCSP
- 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
ConstructorsModifierConstructorDescriptionprotectedDefault constructor instantiating object with null values -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RevocationToken<R> buildRevocationTokenFromResult(SqlRecord response, CertificateToken certificateToken, CertificateToken issuerCertificateToken) BuildsRevocationTokenfrom the obtainedResultSetvoidRemoves table from DBprotected List<RevocationToken<R>> findRevocations(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken) Finds a list of RevocationTokens in the cache for the givencertificateTokenwith the correspondingkeyprotected abstract SqlQueryReturns CREATE_TABLE sql queryprotected abstract SqlQueryReturns an sql query to remove a table from DBprotected abstract SqlQueryReturns an SQL query to insert a new revocation token to a tableprotected JdbcCacheConnectorGets the SQL connection DataSourceprotected abstract SqlQueryReturns an sql query to remove a revocation token from DBprotected abstract SqlSelectQueryReturns a request to find a revocation dataprotected abstract SqlQueryReturns an sql query to check table existenceprotected abstract SqlQueryReturns an SQL query to update a revocation token in a tablevoidInitialize the revocation token table by creating the table if it does not exist.booleanVerifies if the table existsprotected voidremoveRevocation(String revocationTokenKey) Removes the RevocationToken from cache with the given keyvoidsetJdbcCacheConnector(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 BuildsRevocationTokenfrom the obtainedResultSet- Parameters:
response-SqlRecordrepresent the extracted record rowcertificateToken-CertificateTokenof certificate to get revocation data forissuerCertificateToken-CertificateTokenif 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:RepositoryRevocationSourceFinds a list of RevocationTokens in the cache for the givencertificateTokenwith the correspondingkey- Specified by:
findRevocationsin classRepositoryRevocationSource<R extends Revocation>- Parameters:
key- the keyStringcertificateToken-CertificateTokenissuerCertificateToken-CertificateToken- Returns:
- a list of
RevocationTokenobjects
-
getRevocationDataExtractQuery
Returns a request to find a revocation data- Returns:
SqlSelectQuery
-
removeRevocation
Description copied from class:RepositoryRevocationSourceRemoves the RevocationToken from cache with the given key- Specified by:
removeRevocationin 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
-