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

com.gooddata.dataload.processes.ProcessExecution Maven / Gradle / Ivy

package com.gooddata.dataload.processes;

import static com.gooddata.util.Validate.notEmpty;
import static com.gooddata.util.Validate.notNull;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

import java.util.HashMap;
import java.util.Map;

/**
 * Dataload process execution. Serialization only.
 */
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonTypeName("execution")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProcessExecution {

    private final String executionsUri;

    private final String executable;
    private final Map params;
    private final Map hiddenParams;

    public ProcessExecution(DataloadProcess process, String executable) {
        this(process, executable, new HashMap(), new HashMap());
    }

    public ProcessExecution(DataloadProcess process, String executable, Map params) {
        this(process, executable, params, new HashMap());
    }

    public ProcessExecution(DataloadProcess process, String executable, Map params, Map hiddenParams) {
        notNull(process, "process");
        this.executionsUri = notEmpty(process.getExecutionsLink(), "process executions link");
        this.executable = executable;
        this.params = notNull(params, "params");
        this.hiddenParams = notNull(hiddenParams, "hiddenParams");

        process.validateExecutable(executable);
    }

    public String getExecutable() {
        return executable;
    }

    public Map getParams() {
        return params;
    }

    public Map getHiddenParams() {
        return hiddenParams;
    }

    @JsonIgnore
    String getExecutionsUri() {
        return executionsUri;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy