public class LotlService extends Object implements AutoCloseable
| Constructor and Description |
|---|
LotlService(LotlFetchingProperties lotlFetchingProperties)
Creates a new instance of
LotlService. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancelTimer()
Cancels timer, if it was already set up.
|
void |
close()
.
|
static LotlService |
getGlobalService()
Gets global static instance of
LotlService. |
void |
initializeCache()
Initializes the cache with the latest Lotl data and related resources.
|
static void |
initializeGlobalCache(LotlFetchingProperties lotlFetchingProperties)
Initializes the global cache with the provided LotlFetchingProperties.
|
protected void |
setupTimer()
Sets up a timer to periodically refresh the LOTL cache.
|
protected void |
tryAndRefreshCache()
This method is intended to refresh the cache, it will try to download the latest LOTL data and update the
cache accordingly.
|
LotlService |
withCountrySpecificLotlFetcher(CountrySpecificLotlFetcher countrySpecificLotlFetcher)
Sets the country-specific Lotl fetcher for the Lotl service.
|
LotlService |
withCustomResourceRetriever(com.itextpdf.io.resolver.resource.IResourceRetriever resourceRetriever)
Sets a custom resource retriever for fetching resources.
|
LotlService |
withEuropeanLotlFetcher(EuropeanLotlFetcher fetcher)
Sets the European List of Trusted Lists (Lotl) byte fetcher for the Lotl service.
|
LotlService |
withEuropeanResourceFetcher(EuropeanResourceFetcher europeanResourceFetcher)
Sets the European Resource Fetcher for the LotlService.
|
LotlService |
withLotlServiceCache(LotlServiceCache cache)
Sets the cache for the LotlService.
|
LotlService |
withLotlValidator(Supplier<LotlValidator> lotlValidatorFactory)
Sets up factory which is responsible for
LotlValidator creation. |
LotlService |
withPivotFetcher(PivotFetcher pivotFetcher)
Sets the pivot fetcher for the Lotl service.
|
LotlService |
withXmlSignatureValidator(Function<TrustedCertificatesStore,XmlSignatureValidator> xmlSignatureValidatorFactory)
Sets up factory which is responsible for
XmlSignatureValidator creation. |
public LotlService(LotlFetchingProperties lotlFetchingProperties)
LotlService.lotlFetchingProperties - LotlFetchingProperties to configure the way in which LOTL will be fetchedpublic static void initializeGlobalCache(LotlFetchingProperties lotlFetchingProperties)
If you are using a custom implementation of LotlService you can use the instance method.
lotlFetchingProperties - the LotlFetchingProperties to use for initializing the cachepublic static LotlService getGlobalService()
LotlService.LotlServicepublic LotlService withLotlServiceCache(LotlServiceCache cache)
This method allows you to provide a custom implementation of LotlServiceCache to be used
for caching Lotl data, pivot files, and country-specific Lotls.
cache - the custom cache to be used for caching Lotl dataLotlService for method chainingpublic final LotlService withCustomResourceRetriever(com.itextpdf.io.resolver.resource.IResourceRetriever resourceRetriever)
This method allows you to provide a custom implementation of IResourceRetriever to be used
for fetching resources such as the Lotl XML, pivot files, and country-specific Lotls.
resourceRetriever - the custom resource retriever to be used for fetching resourcesLotlService for method chainingpublic void initializeCache()
public LotlService withPivotFetcher(PivotFetcher pivotFetcher)
pivotFetcher - the pivot fetcher to be used for fetching and validating pivot filesLotlService for method chainingpublic LotlService withCountrySpecificLotlFetcher(CountrySpecificLotlFetcher countrySpecificLotlFetcher)
countrySpecificLotlFetcher - the country-specific Lotl fetcher to be used for fetching and validating
country-specific LotlsLotlService for method chainingpublic LotlService withEuropeanLotlFetcher(EuropeanLotlFetcher fetcher)
fetcher - the fetcher to be used for fetching the Lotl XML dataLotlService for method chainingpublic LotlService withXmlSignatureValidator(Function<TrustedCertificatesStore,XmlSignatureValidator> xmlSignatureValidatorFactory)
XmlSignatureValidator creation.xmlSignatureValidatorFactory - factory responsible for XmlSignatureValidator creationLotlService for method chainingpublic LotlService withLotlValidator(Supplier<LotlValidator> lotlValidatorFactory)
LotlValidator creation.lotlValidatorFactory - factory responsible for LotlValidator creationLotlServicepublic LotlService withEuropeanResourceFetcher(EuropeanResourceFetcher europeanResourceFetcher)
europeanResourceFetcher - the European Resource Fetcher to be used for fetching EU journal certificatesLotlService for method chainingpublic void close()
close in interface AutoCloseableprotected void setupTimer()
The timer will use the refresh interval calculated based on the stale-ness of the cache.
If the cache is null, it will create a new instance of InMemoryLotlServiceCache.
protected void cancelTimer()
protected void tryAndRefreshCache()
The rules taken into account are:
Country specific LOTL files will be fetched, validated and updated per country. If country fails to fetch,
LotlFetchingProperties.getOnCountryFetchFailureStrategy() will be used to perform corresponding action.
For the main LOTL file, if the fetch fails, the cache will not be updated. Also, we will NOT proceed to update the pivot files. If the main LOTL file is fetched successfully, the pivot files will be fetched, validated and stored in the cache.
Copyright © 1998–2025 Apryse Group NV. All rights reserved.