Class FederationUploadKeyService
- java.lang.Object
-
- app.coronawarn.server.common.persistence.service.FederationUploadKeyService
-
@Component public class FederationUploadKeyService extends Object
-
-
Constructor Summary
Constructors Constructor Description FederationUploadKeyService(FederationUploadKeyRepository keyRepository, ValidDiagnosisKeyFilter filter, KeySharingPoliciesChecker sharingPoliciesChecker)
Constructs the key upload service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FederationUploadKey>
getPendingUploadKeys(ExpirationPolicy policy)
Returns all valid persisted diagnosis keys which are ready to be uploaded to the external Federation Gateway service.void
updateBatchTagForKeys(Collection<FederationUploadKey> originalKeys, String batchTagId)
Updates only the batchTagId field of all given upload keys.
-
-
-
Constructor Detail
-
FederationUploadKeyService
public FederationUploadKeyService(FederationUploadKeyRepository keyRepository, ValidDiagnosisKeyFilter filter, KeySharingPoliciesChecker sharingPoliciesChecker)
Constructs the key upload service.
-
-
Method Detail
-
getPendingUploadKeys
public List<FederationUploadKey> getPendingUploadKeys(ExpirationPolicy policy)
Returns all valid persisted diagnosis keys which are ready to be uploaded to the external Federation Gateway service. Readiness of keys means:- Consent is given by the user (this should always be the case for keys in this table, but a safety check is performed anyway
- Key is expired conforming to the given policy
-
updateBatchTagForKeys
@Transactional public void updateBatchTagForKeys(Collection<FederationUploadKey> originalKeys, String batchTagId)
Updates only the batchTagId field of all given upload keys. The entities are not merged with the persisted ones, thus no other side effects are to be expected.
-
-