Class S3RetentionPolicy


  • @Component
    public class S3RetentionPolicy
    extends Object
    Creates an S3RetentionPolicy object, which applies the retention policy to the S3 compatible storage.
    • Method Detail

      • applyRetentionPolicy

        public void applyRetentionPolicy​(int retentionDays)
        Deletes all diagnosis-key files from S3 that are older than retentionDays.
        Parameters:
        retentionDays - the number of days, that files should be retained on S3.
      • deleteDiagnosisKey

        public void deleteDiagnosisKey​(S3Object diagnosisKey)
        Java stream do not support checked exceptions within streams. This helper method rethrows them as unchecked expressions, so they can be passed up to the Retention Policy.
        Parameters:
        diagnosisKey - the diagnosis key, that should be deleted.