Skip to content
ArchiveJob.java 1.48 KiB
Newer Older
/*
 * This file is part of vospace-file-service
 * Copyright (C) 2021 Istituto Nazionale di Astrofisica
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package it.inaf.ia2.transfer.service;

import it.inaf.ia2.transfer.auth.TokenPrincipal;
import java.util.List;

public class ArchiveJob {

    public static enum Type {
        TAR,
        TGZ,
        ZIP;

        public String getExtension() {
            switch (this) {
                case TAR:
                    return "tar";
                case TGZ:
                    return "tar.gz";
                case ZIP:
                    return "zip";
                default:
                    throw new IllegalArgumentException("Extension not defined for type " + this);
            }
        }
    }

    private List<String> vosPaths;
    private TokenPrincipal tokenPrincipal;
    private String jobId;
    private Type type;

    public List<String> getVosPaths() {
        return vosPaths;
    }

    public void setVosPaths(List<String> vosPaths) {
        this.vosPaths = vosPaths;
    }

    public TokenPrincipal getPrincipal() {
        return tokenPrincipal;
    }

    public void setPrincipal(TokenPrincipal tokenPrincipal) {
        this.tokenPrincipal = tokenPrincipal;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public Type getType() {
        return type;
    }

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