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


Java TriggerDescriptor类代码示例

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


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

示例1: fixBuildTriggers

import hudson.triggers.TriggerDescriptor; //导入依赖的package包/类
private static void fixBuildTriggers(AbstractProject implementationProject, Map<TriggerDescriptor, Trigger> oldTriggers) {
    List<Trigger<?>> triggersToReplace = ProjectUtils.getTriggers(implementationProject);
    if (triggersToReplace == null) {
        throw new NullPointerException("triggersToReplace");
    }

    if (!triggersToReplace.isEmpty() || !oldTriggers.isEmpty()) {
        //noinspection SynchronizationOnLocalVariableOrMethodParameter
        synchronized (triggersToReplace) {
            triggersToReplace.clear();
            for (Trigger trigger : oldTriggers.values()) {
                triggersToReplace.add(trigger);
            }
        }
    }
}
 
开发者ID:JoelJ,项目名称:ez-templates,代码行数:17,代码来源:TemplateUtils.java

示例2: getTrigger

import hudson.triggers.TriggerDescriptor; //导入依赖的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

示例3: getParameter

import hudson.triggers.TriggerDescriptor; //导入依赖的package包/类
/**
 * Overrides certain parameter names with certain values needed when setting the configuration for
 * template projects.  Otherwise, relies on the standard implementation.
 * <br>
 * {@inheritDoc}
 */
@Override
public String getParameter(String name) {
    // Sanitize the following parameters
    if ("name".equals(name)) {
        // Don't set the name
        return null;
    } else if ("description".equals(name)) {
        // Don't set the description
        return null;
    } else if ("disable".equals(name)) {
        // Mark disabled
        return "";
    }

    /*
     * Parameters for conflicting triggers should return null if the
     * corresponding JSON was not provided.  Otherwise, NPEs occur when
     * trying to update the triggers for the template project.
     */
    DescriptorExtensionList<Trigger<?>, TriggerDescriptor> triggerDescriptors = Trigger.all();
    for (TriggerDescriptor triggerDescriptor : triggerDescriptors) {
        String safeName = triggerDescriptor.getJsonSafeClassName();

        try {
            if (name.equals(safeName) && getSubmittedForm().getJSONObject(safeName).isNullObject()) {
                return null;
            }
        } catch (ServletException e) {
            throw new IllegalStateException("Exception getting data from submitted JSON", e);
        }
    }

    // Fallback to standard functionality
    return super.getParameter(name);
}
 
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:42,代码来源:TemplateStaplerRequestWrapper.java

示例4: getRawTriggers

import hudson.triggers.TriggerDescriptor; //导入依赖的package包/类
public Map<TriggerDescriptor,Trigger<?>> getRawTriggers() {
	return super.getTriggers();
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:4,代码来源:InheritanceProject.java

示例5: getTriggers

import hudson.triggers.TriggerDescriptor; //导入依赖的package包/类
/**
 * Returns all triggers defined on this project; or if detected to be
 * necessary, also all parents.
 * <p>
 * @return a map of triggers, might be empty, but never null
 */
@Override
public Map<TriggerDescriptor,Trigger<?>> getTriggers() {
	return this.getTriggers(IMode.AUTO);
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:11,代码来源:InheritanceProject.java


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