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:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected DataSourcedataSourceFields inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
proxiedSource -
Constructor Summary
Constructors Constructor Description JdbcRevocationSource() -
Method Summary
Modifier and Type Method Description protected abstract RevocationToken<R>buildRevocationTokenFromResult(ResultSet rs, CertificateToken certificateToken, CertificateToken issuerCertificateToken)BuildRevocationTokenfrom the obtainedResultSetprotected voidcloseQuietly(Connection c, Statement s, ResultSet rs)Close the statement and connection and resultset without throwing the exceptionvoiddestroyTable()Removes table from DBprotected RevocationToken<R>findRevocation(String key, CertificateToken certificateToken, CertificateToken issuerCertificateToken)Finds a RevocationToken in the cacheprotected abstract StringgetCreateTableQuery()Returns CREATE_TABLE sql queryprotected abstract StringgetDeleteTableQuery()Returns an sql query to remove a table from DBprotected abstract StringgetFindRevocationQuery()Returns an sql query to get revocation data from DBprotected abstract StringgetRemoveRevocationTokenEntryQuery()Returns an sql query to remove a record from DBprotected abstract StringgetTableExistenceQuery()Returns an sql query to check table existencevoidinitTable()Initialize the revocation token table by creating the table if it does not exist.booleanisTableExists()protected voidremoveRevocation(RevocationToken<R> token)Removes the RevocationToken from cacheprotected voidrollback(Connection c)Rollaback transaction for the givenConnectionvoidsetDataSource(DataSource dataSource)Methods inherited from class eu.europa.esig.dss.spi.x509.revocation.RepositoryRevocationSource
getRevocationToken, getRevocationToken, initRevocationTokenKey, insertRevocation, setDefaultNextUpdateDelay, setMaxNextUpdateDelay, setProxySource, setRemoveExpired, updateRevocation
-
Field Details
-
Constructor Details
-
JdbcRevocationSource
public JdbcRevocationSource()
-
-
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(ResultSet rs, CertificateToken certificateToken, CertificateToken issuerCertificateToken) throws RevocationExceptionBuildRevocationTokenfrom the obtainedResultSet- Parameters:
rs-ResultSetanswer from DBcertificateToken-CertificateTokenof certificate to get revocation data forissuerCertificateToken-CertificateTokenif issuer of the certificateToken- Returns:
RevocationToken- Throws:
RevocationException
-
setDataSource
- Parameters:
dataSource- the dataSource to set
-
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
-
removeRevocation
Description copied from class:RepositoryRevocationSourceRemoves the RevocationToken from cache- Specified by:
removeRevocationin classRepositoryRevocationSource<R extends Revocation>- Parameters:
token-RevocationToken
-
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() -
destroyTable
Removes table from DB- Throws:
SQLException- in case of error
-
rollback
Rollaback transaction for the givenConnection- Parameters:
c-Connection
-
closeQuietly
Close the statement and connection and resultset without throwing the exception- Parameters:
c- the connections- the statementrs- the ResultSet
-