Class DiagnosisKeyService


  • @Component
    public class DiagnosisKeyService
    extends Object
    • Method Detail

      • saveDiagnosisKeys

        @Transactional
        public void saveDiagnosisKeys​(Collection<DiagnosisKey> diagnosisKeys)
        Persists the specified collection of DiagnosisKey instances. If the key data of a particular diagnosis key already exists in the database, this diagnosis key is not persisted.
        Parameters:
        diagnosisKeys - must not contain null.
        Throws:
        IllegalArgumentException - in case the given collection contains null.
      • getDiagnosisKeys

        public List<DiagnosisKey> getDiagnosisKeys()
        Returns all valid persisted diagnosis keys, sorted by their submission timestamp.
      • applyRetentionPolicy

        @Transactional
        public void applyRetentionPolicy​(int daysToRetain)
        Deletes all diagnosis key entries which have a submission timestamp that is older than the specified number of days.
        Parameters:
        daysToRetain - the number of days until which diagnosis keys will be retained.
        Throws:
        IllegalArgumentException - if daysToRetain is negative.