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


Java HttpResponses.ok方法代码示例

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


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

示例1: execute

import hudson.util.HttpResponses; //导入方法依赖的package包/类
public void execute() {
    if (pushHook.getRepository() != null && pushHook.getRepository().getUrl() == null) {
        LOGGER.log(Level.WARNING, "No repository url found.");
        return;
    }

    if (project instanceof Job<?, ?>) {
        ACL.impersonate(ACL.SYSTEM, new TriggerNotifier(project, secretToken, Jenkins.getAuthentication()) {
            @Override
            protected void performOnPost(GitLabPushTrigger trigger) {
                trigger.onPost(pushHook);
            }
        });
        throw HttpResponses.ok();
    }
    if (project instanceof SCMSourceOwner) {
        ACL.impersonate(ACL.SYSTEM, new SCMSourceOwnerNotifier());
        throw HttpResponses.ok();
    }
    throw HttpResponses.errorWithoutStack(409, "Push Hook is not supported for this project");
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:22,代码来源:PushBuildAction.java

示例2: execute

import hudson.util.HttpResponses; //导入方法依赖的package包/类
void execute() {
    if (!(project instanceof Job<?, ?>)) {
        throw HttpResponses.errorWithoutStack(409, "Pipeline Hook is not supported for this project");
    }
    ACL.impersonate(ACL.SYSTEM, new TriggerNotifier(project, secretToken, Jenkins.getAuthentication()) {
        @Override
        protected void performOnPost(GitLabPushTrigger trigger) {
            trigger.onPost(pipelineBuildHook);
        }
    });
    throw HttpResponses.ok();
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:13,代码来源:PipelineBuildAction.java

示例3: execute

import hudson.util.HttpResponses; //导入方法依赖的package包/类
public void execute(StaplerResponse response) {
    if (!(project instanceof Job<?, ?>)) {
        throw HttpResponses.errorWithoutStack(409, "Note Hook is not supported for this project");
    }
    ACL.impersonate(ACL.SYSTEM, new BuildWebHookAction.TriggerNotifier(project, secretToken, Jenkins.getAuthentication()) {
        @Override
        protected void performOnPost(GitLabPushTrigger trigger) {
            trigger.onPost(noteHook);
        }
    });
    throw HttpResponses.ok();
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:13,代码来源:NoteBuildAction.java

示例4: execute

import hudson.util.HttpResponses; //导入方法依赖的package包/类
public void execute() {
    if (!(project instanceof Job<?, ?>)) {
        throw HttpResponses.errorWithoutStack(409, "Merge Request Hook is not supported for this project");
    }
    ACL.impersonate(ACL.SYSTEM, new TriggerNotifier(project, secretToken, Jenkins.getAuthentication()) {
        @Override
        protected void performOnPost(GitLabPushTrigger trigger) {
            trigger.onPost(mergeRequestHook);
        }
    });
    throw HttpResponses.ok();
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:13,代码来源:MergeRequestBuildAction.java


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