本文整理汇总了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");
}
示例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();
}
示例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();
}
示例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();
}