当前位置: 首页>>代码示例>>Java>>正文


Java ParameterizedJobMixIn.ParameterizedJob方法代码示例

本文整理汇总了Java中jenkins.model.ParameterizedJobMixIn.ParameterizedJob方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterizedJobMixIn.ParameterizedJob方法的具体用法?Java ParameterizedJobMixIn.ParameterizedJob怎么用?Java ParameterizedJobMixIn.ParameterizedJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jenkins.model.ParameterizedJobMixIn的用法示例。


在下文中一共展示了ParameterizedJobMixIn.ParameterizedJob方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: filter

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public List<TopLevelItem> filter(List<TopLevelItem> added, List<TopLevelItem> all, View filteringView) {
    List<Pattern> patterns = getCompiled();
    List<TopLevelItem> workList = added.isEmpty() ? all : added;
    List<TopLevelItem> filtered = new LinkedList<TopLevelItem>();

    for (TopLevelItem item : workList) {
        if (item instanceof ParameterizedJobMixIn.ParameterizedJob) {
            DockerHubTrigger trigger = DockerHubTrigger.getTrigger((ParameterizedJobMixIn.ParameterizedJob)item);
            if (trigger != null) {
                if (patterns.isEmpty()) {
                    filtered.add(item);
                } else {
                    for (String name : trigger.getAllRepoNames()) {
                        if(matches(name)) {
                            filtered.add(item);
                        }
                    }
                }
            }
        }
    }
    return filtered;
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:25,代码来源:TriggerViewFilter.java

示例2: triggerFrom

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
/**
 * support matrix plugin.
 *
 * @see JobInfoHelpers#triggerFrom(hudson.model.Job, java.lang.Class)
 */
@CheckForNull
public static <T extends Trigger> T triggerFrom(final Job<?, ?> job, Class<T> tClass) {
    Job<?, ?> guessJob;
    if (job instanceof MatrixConfiguration) {
        guessJob = ((MatrixConfiguration) job).getParent();
    } else {
        guessJob = job;
    }

    if (guessJob instanceof AbstractProject<?, ?>) {
        final AbstractProject<?, ?> abstractProject = (AbstractProject<?, ?>) guessJob;
        return abstractProject.getTrigger(tClass);
    } else if (guessJob instanceof ParameterizedJobMixIn.ParameterizedJob) {
        ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) guessJob;

        for (Trigger candidate : pJob.getTriggers().values()) {
            if (tClass.isInstance(candidate)) {
                return tClass.cast(candidate);
            }
        }
    }
    return null;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:29,代码来源:JobHelper.java

示例3: builds

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
private BitbucketBuilds builds(Run<?, ?> r) {
    BitbucketBuildTrigger trigger = null;
    if (r instanceof AbstractBuild) {
        trigger = BitbucketBuildTrigger.getTrigger(((AbstractBuild) r).getProject());
    } else {
        Job job = r.getParent();
        if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {

            for (Trigger<?> t : ((ParameterizedJobMixIn.ParameterizedJob) job).getTriggers().values()) {
                if (t instanceof BitbucketBuildTrigger) {
                    trigger = (BitbucketBuildTrigger) t;
                }
            }
        }
    }
    return trigger == null ? null : trigger.getBuilder().getBuilds();
}
 
开发者ID:nishio-dens,项目名称:bitbucket-pullrequest-builder-plugin,代码行数:18,代码来源:BitbucketBuildListener.java

示例4: probeJobs

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
private void probeJobs(@CheckForNull String port, List<Job> jobs) throws IOException {
	for (Job<?, ?> job : jobs) {
		P4Trigger trigger = null;
		LOGGER.fine("P4: trying: " + job.getName());

		if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
			ParameterizedJobMixIn.ParameterizedJob pJob = (ParameterizedJobMixIn.ParameterizedJob) job;
			for (Trigger<?> t : pJob.getTriggers().values()) {
				if (t instanceof P4Trigger) {
					trigger = (P4Trigger) t;
					break;
				}
			}
		}

		if (trigger != null) {
			LOGGER.info("P4: probing: " + job.getName());
			trigger.poke(job, port);
		} else {
			LOGGER.fine("P4: trigger not set: " + job.getName());
		}
	}
}
 
开发者ID:p4paul,项目名称:p4-jenkins,代码行数:24,代码来源:P4Hook.java

示例5: getImageNames

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
public Collection<String> getImageNames(TopLevelItem item) {
    if (item instanceof ParameterizedJobMixIn.ParameterizedJob) {
        DockerHubTrigger trigger = DockerHubTrigger.getTrigger((ParameterizedJobMixIn.ParameterizedJob)item);
        if (trigger != null) {
            Set<String> names = trigger.getAllRepoNames();
            if (showMax <= 0 || names.size() <= showMax) {
                return names;
            } else {
                String[] array = names.toArray(new String[names.size()]);
                return Arrays.asList(Arrays.copyOf(array, showMax));
            }
        }
    }
    return Collections.emptySet();
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:16,代码来源:TriggerListViewColumn.java

示例6: getTrigger

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@CheckForNull
public static DockerHubTrigger getTrigger(ParameterizedJobMixIn.ParameterizedJob job) {
    Jenkins jenkins = Jenkins.getInstance();
    if (jenkins != null) {
        DockerHubTrigger.DescriptorImpl descriptor = jenkins.getDescriptorByType(DockerHubTrigger.DescriptorImpl.class);
        if (descriptor != null) {
            Map<TriggerDescriptor, Trigger<?>> triggers = job.getTriggers();
            return (DockerHubTrigger)triggers.get(descriptor);
        }
    }
    return null;
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:13,代码来源:DockerHubTrigger.java

示例7: getDockerImagesUsedByJob

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Nonnull
@Override
public Collection<String> getDockerImagesUsedByJob(@Nonnull Job<?,?> job) {
    if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
        DockerHubTrigger trigger = DockerHubTrigger.getTrigger((ParameterizedJobMixIn.ParameterizedJob)job);
        if (trigger != null) {
            for (TriggerOption option : trigger.getOptions()) {
                if (option instanceof TriggerOnSpecifiedImageNames) {
                    return ((TriggerOnSpecifiedImageNames)option).getRepoNames();
                }
            }
        }
    }
    return Collections.emptySet();
}
 
开发者ID:jenkinsci,项目名称:dockerhub-notification-plugin,代码行数:16,代码来源:TriggerImageExtractor.java

示例8: getFromJob

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
public static GitLabPushTrigger getFromJob(Job<?, ?> job) {
    GitLabPushTrigger trigger = null;
    if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
        ParameterizedJobMixIn.ParameterizedJob p = (ParameterizedJobMixIn.ParameterizedJob) job;
        for (Trigger t : p.getTriggers().values()) {
            if (t instanceof GitLabPushTrigger) {
                trigger = (GitLabPushTrigger) t;
            }
        }
    }
    return trigger;
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:13,代码来源:GitLabPushTrigger.java

示例9: handle

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public void handle(Job<?, ?> job, PushHook hook, boolean ciSkip, BranchFilter branchFilter, MergeRequestLabelFilter mergeRequestLabelFilter) {
	try {
        if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
            ParameterizedJob project = (ParameterizedJobMixIn.ParameterizedJob) job;
            GitLabConnectionProperty property = job.getProperty(GitLabConnectionProperty.class);
            for (Trigger t : project.getTriggers().values()) {
            	if (t instanceof GitLabPushTrigger) {
            		final GitLabPushTrigger trigger = (GitLabPushTrigger) t;
                    Integer projectId = hook.getProjectId();
                    if (property != null && property.getClient() != null && projectId != null && trigger != null) {
                        GitLabClient client = property.getClient();
                        for (MergeRequest mergeRequest : getOpenMergeRequests(client, projectId.toString())) {
                            if (mergeRequestLabelFilter.isMergeRequestAllowed(mergeRequest.getLabels())) {
                            	handleMergeRequest(job, hook, ciSkip, branchFilter, client, mergeRequest);
                            }
                        }
                    }
            	}
            }
            
        } else {
        	LOGGER.log(Level.FINE, "Not a ParameterizedJob: {0}",LoggerUtil.toArray(job.getClass().getName()));
        }
    } catch (WebApplicationException | ProcessingException e) {
        LOGGER.log(Level.WARNING, "Failed to communicate with gitlab server to determine if this is an update for a merge request: " + e.getMessage(), e);
    }
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:29,代码来源:OpenMergeRequestPushHookTriggerHandler.java

示例10: scheduleBuild

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
private void scheduleBuild(Job<?, ?> job, Action[] actions) {
    int projectBuildDelay = 0;
    if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
        ParameterizedJobMixIn.ParameterizedJob abstractProject = (ParameterizedJobMixIn.ParameterizedJob) job;
        if (abstractProject.getQuietPeriod() > projectBuildDelay) {
            projectBuildDelay = abstractProject.getQuietPeriod();
        }
    }
    retrieveScheduleJob(job).scheduleBuild2(projectBuildDelay, actions);
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:11,代码来源:OpenMergeRequestPushHookTriggerHandler.java

示例11: scheduleBuild

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
protected void scheduleBuild(Job<?, ?> job, Action[] actions) {
    int projectBuildDelay = 0;
    if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
        ParameterizedJobMixIn.ParameterizedJob abstractProject = (ParameterizedJobMixIn.ParameterizedJob) job;
        if (abstractProject.getQuietPeriod() > projectBuildDelay) {
            projectBuildDelay = abstractProject.getQuietPeriod();
        }
    }
    retrieveScheduleJob(job).scheduleBuild2(projectBuildDelay, actions);
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:11,代码来源:AbstractWebHookTriggerHandler.java

示例12: isApplicable

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public boolean isApplicable(Item item) {
    return item instanceof Job &&
            SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(item) != null &&
            item instanceof ParameterizedJobMixIn.ParameterizedJob;
}
 
开发者ID:Affirm,项目名称:jenkins-plugins,代码行数:7,代码来源:TagTrigger.java

示例13: isApplicable

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public boolean isApplicable(Item item) {
    return item instanceof Job && nonNull(SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(item))
            && item instanceof ParameterizedJobMixIn.ParameterizedJob;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:6,代码来源:GitHubTriggerDescriptor.java

示例14: isApplicable

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public boolean isApplicable(Item item) {
    return item instanceof Job && item instanceof ParameterizedJobMixIn.ParameterizedJob;
}
 
开发者ID:nishio-dens,项目名称:bitbucket-pullrequest-builder-plugin,代码行数:5,代码来源:BitbucketBuildTrigger.java

示例15: isApplicable

import jenkins.model.ParameterizedJobMixIn; //导入方法依赖的package包/类
@Override
public boolean isApplicable(Item item) {
    return item instanceof Job
            && SCMTriggerItems.asSCMTriggerItem(item) != null
            && item instanceof ParameterizedJobMixIn.ParameterizedJob;
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:7,代码来源:GitLabPushTrigger.java


注:本文中的jenkins.model.ParameterizedJobMixIn.ParameterizedJob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。