com.cloudbees.hudson.plugins.folder.computed.ComputedFolder Java Examples

The following examples show how to use com.cloudbees.hudson.plugins.folder.computed.ComputedFolder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlueOceanUrlMapperImpl.java    From blueocean-plugin with MIT License 6 votes vote down vote up
private @CheckForNull BluePipeline getJobResource(ModelObject modelObject){
    BluePipeline blueResource = null;
    if(modelObject instanceof Job){
        ItemGroup parent = ((Job) modelObject).getParent();
        if(parent instanceof ComputedFolder){
            blueResource =  (BluePipeline) BluePipelineFactory
                    .resolve((ComputedFolder)parent);
            if(blueResource instanceof BlueMultiBranchPipeline){
                return blueResource;
            }
        }else {
            blueResource =  (BluePipeline) BluePipelineFactory
                    .resolve((Job)modelObject);
        }
    }
    return blueResource;
}
 
Example #2
Source File: BlueOceanUrlMapperImpl.java    From blueocean-plugin with MIT License 5 votes vote down vote up
private boolean isBranch(ModelObject modelObject){
    if(modelObject instanceof Job){
        ItemGroup parent = ((Job) modelObject).getParent();
        if(parent instanceof ComputedFolder){
            BluePipeline blueResource = (BluePipeline) BluePipelineFactory
                    .resolve((Job)modelObject);
            return (blueResource instanceof BlueMultiBranchPipeline);
        }
    }
    return false;
}
 
Example #3
Source File: BranchImpl.java    From blueocean-plugin with MIT License 5 votes vote down vote up
@Navigable
@Override
public BluePipelineScm getScm() {
    if(job instanceof WorkflowJob && job.getParent() instanceof ComputedFolder) {
        return new ScmResourceImpl((ComputedFolder) job.getParent(), (BuildableItem) job,this);
    }else{
        return null;
    }
}
 
Example #4
Source File: Functions.java    From github-integration-plugin with MIT License 5 votes vote down vote up
/**
 * Can be useful to ignore disabled jobs on reregistering hooks
 *
 * @return predicate with true on apply if item is buildable
 */
public static <ITEM extends Item> Predicate<ITEM> isBuildable() {
    return item -> {
        if (item instanceof Job) {
            return ((Job) item).isBuildable();
        } else if (item instanceof ComputedFolder) {
            return ((ComputedFolder) item).isBuildable();
        }

        return item instanceof BuildableItem;
    };
}