Class FederationBatchProcessor
- java.lang.Object
-
- app.coronawarn.server.services.download.FederationBatchProcessor
-
@Component public class FederationBatchProcessor extends Object
Responsible for downloading and storing batch information from the federation gateway.
-
-
Constructor Summary
Constructors Constructor Description FederationBatchProcessor(FederationBatchInfoService batchInfoService, DiagnosisKeyService diagnosisKeyService, FederationGatewayDownloadService federationGatewayDownloadService, DownloadServiceConfig config, ValidFederationKeyFilter federationKeyValidator)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkIfDownloadShouldBeForced(LocalDate date)
The Federation Batch Info stores information about which batches have already been processed to not download them again.void
processErrorFederationBatches()
Downloads and processes all batches from the federation gateway that have previously been marked with the status valueFederationBatchStatus.ERROR
.void
processUnprocessedFederationBatches()
Downloads and processes all batches from the federation gateway that have previously been marked with status valueFederationBatchStatus.UNPROCESSED
.void
saveFirstBatchInfoForDate(LocalDate date)
Stores the batch info for the specified date.
-
-
-
Constructor Detail
-
FederationBatchProcessor
public FederationBatchProcessor(FederationBatchInfoService batchInfoService, DiagnosisKeyService diagnosisKeyService, FederationGatewayDownloadService federationGatewayDownloadService, DownloadServiceConfig config, ValidFederationKeyFilter federationKeyValidator)
Constructor.- Parameters:
batchInfoService
- AFederationBatchInfoService
for accessing diagnosis key batch information.diagnosisKeyService
- ADiagnosisKeyService
for storing retrieved diagnosis keys.federationGatewayDownloadService
- AFederationGatewayDownloadService
for retrieving federation diagnosis key batches.config
- ADownloadServiceConfig
for retrieving federation configuration.federationKeyValidator
- AValidFederationKeyFilter
for validating keys in the downloaded batches
-
-
Method Detail
-
saveFirstBatchInfoForDate
public void saveFirstBatchInfoForDate(LocalDate date)
Stores the batch info for the specified date. Its status is set toFederationBatchStatus.UNPROCESSED
.- Parameters:
date
- The date for which the first batch info is stored.
-
checkIfDownloadShouldBeForced
public void checkIfDownloadShouldBeForced(LocalDate date)
The Federation Batch Info stores information about which batches have already been processed to not download them again. The batches for the current day might change constantly when national backends upload keys, hence there is the need to download the batches for today again. Hence, the entries in federation batch info with the current day need to be removed. There is a parameter 'efgs-repeat-download-offset-days' with default 0 for that.- Parameters:
date
- The date the download was triggered for
-
processErrorFederationBatches
public void processErrorFederationBatches()
Downloads and processes all batches from the federation gateway that have previously been marked with the status valueFederationBatchStatus.ERROR
.
-
processUnprocessedFederationBatches
public void processUnprocessedFederationBatches()
Downloads and processes all batches from the federation gateway that have previously been marked with status valueFederationBatchStatus.UNPROCESSED
.
-
-