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

net.nemerosa.ontrack.model.support.AbstractBranchJob Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support;

import net.nemerosa.ontrack.job.Job;
import net.nemerosa.ontrack.model.structure.Branch;
import net.nemerosa.ontrack.model.structure.StructureService;

public abstract class AbstractBranchJob implements Job {

    private final StructureService structureService;
    private final Branch branch;

    protected AbstractBranchJob(StructureService structureService, Branch branch) {
        this.structureService = structureService;
        this.branch = branch;
    }

    @Override
    public boolean isDisabled() {
        return branch.isDisabled() || branch.getProject().isDisabled();
    }

    @Override
    public boolean isValid() {
        return structureService.findBranchByName(branch.getProject().getName(), branch.getName()).isPresent();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy