All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qiniu.service.qoss.UpdateLifecycle Maven / Gradle / Ivy

There is a newer version: 8.4.8
Show newest version
package com.qiniu.service.qoss;

import com.qiniu.storage.BucketManager.*;
import com.qiniu.service.interfaces.ILineProcess;
import com.qiniu.storage.Configuration;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class UpdateLifecycle extends OperationBase implements ILineProcess>, Cloneable {

    final private int days;

    public UpdateLifecycle(String accessKey, String secretKey, Configuration configuration, String bucket, int days,
                           String savePath, int saveIndex) throws IOException {
        super("lifecycle", accessKey, secretKey, configuration, bucket, savePath, saveIndex);
        this.days = days;
    }

    public UpdateLifecycle(String accessKey, String secretKey, Configuration configuration, String bucket, int days,
                           String savePath) throws IOException {
        this(accessKey, secretKey, configuration, bucket, days, savePath, 0);
    }

    synchronized public BatchOperations getOperations(List> lineList) {
        batchOperations.clearOps();
        lineList.forEach(line -> {
            if (line.get("key") == null)
                errorLineList.add(String.valueOf(line) + "\tno target key in the line map.");
            else
                batchOperations.addDeleteAfterDaysOps(bucket, days, line.get("key"));
        });
        return batchOperations;
    }

    public String getInputParams(Map line) {
        return line.get("key");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy