Class S3RetentionPolicy
- java.lang.Object
-
- app.coronawarn.server.services.distribution.objectstore.S3RetentionPolicy
-
@Component public class S3RetentionPolicy extends Object
Creates an S3RetentionPolicy object, which applies the retention policy to the S3 compatible storage.
-
-
Constructor Summary
Constructors Constructor Description S3RetentionPolicy(ObjectStoreAccess objectStoreAccess, DistributionServiceConfig distributionServiceConfig, FailedObjectStoreOperationsCounter failedOperationsCounter)
Creates anS3RetentionPolicy
instance with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyRetentionPolicy(int retentionDays)
Deletes all diagnosis-key files from S3 that are older than retentionDays.void
deleteDiagnosisKey(S3Object diagnosisKey)
Java stream do not support checked exceptions within streams.
-
-
-
Constructor Detail
-
S3RetentionPolicy
public S3RetentionPolicy(ObjectStoreAccess objectStoreAccess, DistributionServiceConfig distributionServiceConfig, FailedObjectStoreOperationsCounter failedOperationsCounter)
Creates anS3RetentionPolicy
instance with the specified parameters.
-
-
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.
-
-