package cn.yunzhixue.ability.center.examsprint.application.report;

import java.time.Duration;

public class ExamSprintReportProperties {

    private Duration retention = Duration.ofDays(1);
    private Duration downloadExpiry = Duration.ofMinutes(15);
    private long cleanupIntervalMs = Duration.ofMinutes(10).toMillis();
    private final Async async = new Async();
    private final Storage storage = new Storage();

    public Duration getRetention() {
        return retention;
    }

    public void setRetention(Duration retention) {
        this.retention = retention;
    }

    public Duration getDownloadExpiry() {
        return downloadExpiry;
    }

    public void setDownloadExpiry(Duration downloadExpiry) {
        this.downloadExpiry = downloadExpiry;
    }

    public long getCleanupIntervalMs() {
        return cleanupIntervalMs;
    }

    public void setCleanupIntervalMs(long cleanupIntervalMs) {
        this.cleanupIntervalMs = cleanupIntervalMs;
    }

    public Async getAsync() {
        return async;
    }

    public Storage getStorage() {
        return storage;
    }

    public static class Async {
        private int corePoolSize = 2;
        private int maxPoolSize = 4;
        private int queueCapacity = 100;

        public int getCorePoolSize() {
            return corePoolSize;
        }

        public void setCorePoolSize(int corePoolSize) {
            this.corePoolSize = corePoolSize;
        }

        public int getMaxPoolSize() {
            return maxPoolSize;
        }

        public void setMaxPoolSize(int maxPoolSize) {
            this.maxPoolSize = maxPoolSize;
        }

        public int getQueueCapacity() {
            return queueCapacity;
        }

        public void setQueueCapacity(int queueCapacity) {
            this.queueCapacity = queueCapacity;
        }
    }

    public static class Storage {
        private String type = "memory";
        private String containerName = "exam-sprint-reports";
        private String downloadUrlPrefix;
        private String connectionString;
        private String endpoint;
        private String accountName;
        private String accountKey;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getContainerName() {
            return containerName;
        }

        public void setContainerName(String containerName) {
            this.containerName = containerName;
        }

        public String getDownloadUrlPrefix() {
            return downloadUrlPrefix;
        }

        public void setDownloadUrlPrefix(String downloadUrlPrefix) {
            this.downloadUrlPrefix = downloadUrlPrefix;
        }

        public String getConnectionString() {
            return connectionString;
        }

        public void setConnectionString(String connectionString) {
            this.connectionString = connectionString;
        }

        public String getEndpoint() {
            return endpoint;
        }

        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }

        public String getAccountName() {
            return accountName;
        }

        public void setAccountName(String accountName) {
            this.accountName = accountName;
        }

        public String getAccountKey() {
            return accountKey;
        }

        public void setAccountKey(String accountKey) {
            this.accountKey = accountKey;
        }
    }
}
