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:
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
FieldsModifier and TypeFieldDescriptionprotected JdbcCacheConnectorConnects to SQL database and performs queriesFields 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(JdbcCacheConnector.JdbcResultRecord resultRecord, CertificateToken certificateToken, CertificateToken issuerCertificateToken) BuildsRevocationTokenfrom the obtainedResultSetvoidRemoves table from DBprotected RevocationToken<R>findRevocation(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken) Finds a RevocationToken in the cacheprotected abstract StringReturns CREATE_TABLE sql queryprotected abstract StringReturns an sql query to remove a table from DBprotected abstract StringReturns an sql query to get revocation data from DBprotected abstract StringReturns an sql query to remove a record from DBprotected abstract Collection<JdbcCacheConnector.JdbcResultRequest>Returns a request to find a revocation dataprotected abstract StringReturns an sql query to check table existencevoidInitialize 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
getRevocationToken, getRevocationToken, getRevocationTokenKey, initRevocationTokenKeys, insertRevocation, setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired, updateRevocation
-
Field Details
-
jdbcCacheConnector
Connects to SQL database and performs queries
-
-
Constructor Details
-
JdbcRevocationSource
protected JdbcRevocationSource()Default constructor instantiating object with null values
-
-
Method Details
-
getCreateTableQuery
Returns CREATE_TABLE sql query- Returns:
Stringsql query
-
getTableExistenceQuery
Returns an sql query to check table existence- Returns:
Stringsql query
-
getFindRevocationQuery
Returns an sql query to get revocation data from DB- Returns:
Stringsql query
-
getDeleteTableQuery
Returns an sql query to remove a table from DB- Returns:
Stringsql query
-
getRemoveRevocationTokenEntryQuery
Returns an sql query to remove a record from DB- Returns:
Stringsql query
-
buildRevocationTokenFromResult
protected abstract RevocationToken<R> buildRevocationTokenFromResult(JdbcCacheConnector.JdbcResultRecord resultRecord, CertificateToken certificateToken, CertificateToken issuerCertificateToken) throws DSSExternalResourceException BuildsRevocationTokenfrom the obtainedResultSet- Parameters:
resultRecord- represent the extract 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
-
setJdbcCacheConnector
Sets the SQL connection DataSource- Parameters:
jdbcCacheConnector-JdbcCacheConnector
-
findRevocation
protected RevocationToken<R> findRevocation(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken) Description copied from class:RepositoryRevocationSourceFinds a RevocationToken in the cache- Specified by:
findRevocationin classRepositoryRevocationSource<R extends Revocation>- Parameters:
key- the keyStringcertificateToken-CertificateTokenissuerCertificateToken-CertificateToken- Returns:
RevocationTokenobject
-
getRevocationDataExtractRequests
protected abstract Collection<JdbcCacheConnector.JdbcResultRequest> getRevocationDataExtractRequests()Returns a request to find a revocation data- Returns:
- a collection of
JdbcCacheConnector.JdbcResultRequest
-
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
-