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

ai.databand.azkaban.AgentAzkabanLinks Maven / Gradle / Ivy

There is a newer version: 1.0.26.1
Show newest version
/*
 * © Copyright Databand.ai, an IBM Company 2022
 */

package ai.databand.azkaban;

import ai.databand.azkaban.links.AzkabanLinks;
import ai.databand.azkaban.links.DefaultAzkabanLinks;
import azkaban.executor.ExecutableFlow;
import azkaban.server.AzkabanServer;
import azkaban.utils.Props;

import java.util.Map;

public class AgentAzkabanLinks implements AzkabanLinks {

    private final AzkabanLinks origin;

    public AgentAzkabanLinks(ExecutableFlow execFlow) {
        Props systemProps = AzkabanServer.getAzkabanProperties();

        String hostName = systemProps.get("server.hostname");
        String port = systemProps.get("server.port");
        String protocol = Boolean.TRUE.toString().equalsIgnoreCase(systemProps.get("jetty.use.ssl")) ? "https" : "http";

        this.origin = new DefaultAzkabanLinks(
            execFlow.getProjectName(),
            execFlow.getId(),
            String.valueOf(execFlow.getExecutionId()),
            protocol,
            hostName,
            port
        );
    }

    public Map flowLinks() {
        return origin.flowLinks();
    }

    public Map jobLinks(String jobId) {
        return origin.jobLinks(jobId);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy