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


Java ParameterizedJobMixIn类代码示例

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


ParameterizedJobMixIn类属于jenkins.model包,在下文中一共展示了ParameterizedJobMixIn类的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: startJob

import jenkins.model.ParameterizedJobMixIn; //导入依赖的package包/类
/**
 * Invoked when a tag-related event is received.
 *
 * @param cause build cause
 * @return task future, or {@code null} if it could not be scheduled.
 */
public QueueTaskFuture startJob(@Nonnull TagCause cause) {
    LOGGER.info(cause.getShortDescription());

    ArrayList<ParameterValue> values = getDefaultParameters();
    values.add(new StringParameterValue("GH_PUSHER", cause.getPusher()));
    values.add(new StringParameterValue("GIT_TAG", cause.getTag()));
    values.add(new StringParameterValue("GIT_REF", cause.getRef()));

    ParameterizedJobMixIn pjob = asParameterizedJobMixIn(job);
    return pjob.scheduleBuild2(3, new CauseAction(cause), new ParametersAction(values));
}
 
开发者ID:Affirm,项目名称:jenkins-plugins,代码行数:18,代码来源:TagTrigger.java

示例6: 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

示例7: 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

示例8: 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

示例9: schedule

import jenkins.model.ParameterizedJobMixIn; //导入依赖的package包/类
public static QueueTaskFuture schedule(Job<?, ?> job, int number, String param, int queuetPeriod) {
    ParameterizedJobMixIn jobMixIn = JobInfoHelpers.asParameterizedJobMixIn(job);
    GitHubPRCause cause = newGitHubPRCause().withNumber(number);
    ParametersAction parametersAction = new ParametersAction(
            Collections.<ParameterValue>singletonList(new StringParameterValue("value", param))
    );
    return jobMixIn.scheduleBuild2(queuetPeriod, new CauseAction(cause), parametersAction);
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:9,代码来源:JobRunnerForCauseTest.java

示例10: retrieveScheduleJob

import jenkins.model.ParameterizedJobMixIn; //导入依赖的package包/类
private ParameterizedJobMixIn retrieveScheduleJob(final Job<?, ?> job) {
    // TODO 1.621+ use standard method
    return new ParameterizedJobMixIn() {
        @Override
        protected Job asJob() {
            return job;
        }
    };
}
 
开发者ID:nishio-dens,项目名称:bitbucket-pullrequest-builder-plugin,代码行数:10,代码来源:BitbucketBuildTrigger.java

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: build

import jenkins.model.ParameterizedJobMixIn; //导入依赖的package包/类
/**
 * Schedule build
 *
 * @param job Jenkins Job
 * @throws IOException push up stack
 */
private void build(final Job<?, ?> job) throws IOException {

	SCMTriggerCause cause = new SCMTriggerCause(getLogFile(job));

	@SuppressWarnings("rawtypes")
	ParameterizedJobMixIn pJob = new ParameterizedJobMixIn() {
		@Override
		protected Job asJob() {
			return job;
		}
	};

	pJob.scheduleBuild(cause);
}
 
开发者ID:p4paul,项目名称:p4-jenkins,代码行数:21,代码来源:P4Trigger.java


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