Class FederationBatchInfoService
- java.lang.Object
-
- app.coronawarn.server.common.persistence.service.FederationBatchInfoService
-
@Component public class FederationBatchInfoService extends Object
-
-
Constructor Summary
Constructors Constructor Description FederationBatchInfoService(FederationBatchInfoRepository federationBatchInfoRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyRetentionPolicy(int daysToRetain)Deletes all federation batch information entries which have a date that is older than the specified number of days.List<FederationBatchInfo>findByStatus(FederationBatchStatus federationBatchStatus)voidsave(FederationBatchInfo federationBatchInfo)Persists theFederationBatchInfoinstance.voidupdateStatus(FederationBatchInfo federationBatchInfo, FederationBatchStatus status)Sets the status of the provided federation batch.
-
-
-
Constructor Detail
-
FederationBatchInfoService
public FederationBatchInfoService(FederationBatchInfoRepository federationBatchInfoRepository)
-
-
Method Detail
-
save
@Transactional public void save(FederationBatchInfo federationBatchInfo)
Persists theFederationBatchInfoinstance. If the data of a particular federation batch already exists in the database, this federation batch is not persisted.- Parameters:
federationBatchInfo- must not contain null.
-
updateStatus
public void updateStatus(FederationBatchInfo federationBatchInfo, FederationBatchStatus status)
Sets the status of the provided federation batch.
-
findByStatus
public List<FederationBatchInfo> findByStatus(FederationBatchStatus federationBatchStatus)
-
applyRetentionPolicy
@Transactional public void applyRetentionPolicy(int daysToRetain)
Deletes all federation batch information entries which have a date that is older than the specified number of days.- Parameters:
daysToRetain- the number of days until which batch information will be retained.- Throws:
IllegalArgumentException- ifdaysToRetainis negative.
-
-