class S3BinaryStore extends AbstractBinaryStore {

    @Override
    public void removeValuesUnusedLongerThan(long minimumAge, TimeUnit timeUnit) throws BinaryStoreException {
        try {
            updateBucketLifecycle();
            if (deleteUnusedNatively) {
                return;
            }
            Date deadline = new Date(System.currentTimeMillis() - timeUnit.toMillis(minimumAge));
    
            // There is no capacity in S3 to query on object properties. This must be done
            // by straight iteration, so may take a very long time for large data sets.
            // Here we attempt parallel iteration; see #supplyObjects()
    
            supplyObjects().get().map(S3ObjectSummary::getKey).filter(k ->
                    s3Client.getObjectTagging(new GetObjectTaggingRequest(bucketName, k)).getTagSet().stream().anyMatch(
                            t -> UNUSED_TAG_KEY.equals(t.getKey()) && Boolean.parseBoolean(t.getValue()))
                                    && s3Client.getObjectMetadata(bucketName, k).getLastModified().before(deadline)).forEach(k -> {
                try {
                    s3Client.deleteObject(bucketName, k);
                } catch (AmazonClientException e) {
                    Logger.getLogger(getClass()).warn(e, JcrI18n.unableToDeleteTemporaryFile, e.getMessage());
                }
            });
        } catch (AmazonClientException e) {
            throw new BinaryStoreException(e);
        }
    }

    public  S3BinaryStore(String accessKey, String secretKey, String bucketName);
    public  S3BinaryStore(String accessKey, String secretKey, String bucketName, String endPoint);
    public  S3BinaryStore( String accessKey,
                          String secretKey,
                          String bucketName,
                          String endPoint,
                          Boolean deleteUnusedNatively );
    protected  S3BinaryStore(String bucketName, AmazonS3 s3Client, boolean deleteUnusedNatively);

}