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


Java HttpRedirect类代码示例

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


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

示例1: do_perform

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
/**
 *  Performs the notification on 'POST' action named "perform"
 *
 * @param req StaplerRequest
 * @param rsp StaplerResponse
 * @return HttpResponse
 */
public HttpResponse do_perform(final StaplerRequest req, final StaplerResponse rsp)  {
    // Only administrator can create a new site.
    Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

    // TODO: display the progression

    for(ResendProjectAction resendProjectAction: resendActions){
        try {
            final NotificationHandler notifHandler = new NotificationHandler(resendProjectAction.getConfig());
            for(Map.Entry<AbstractBuild<?,?>, List<ResendBuildAction>> resendBuildAction: resendProjectAction.getResendActionPerBuild().entrySet()){
                notifHandler.send(resendBuildAction.getKey(), resendBuildAction.getValue());
            }

        } catch (Exception e ){
            GrapesPlugin.getLogger().log(Level.SEVERE, "[GRAPES] Failed to re-send notification: ", e);
        }
    }

    refresh();

    return HttpRedirect.DOT;
}
 
开发者ID:Axway,项目名称:grapes-jenkins-plugin,代码行数:30,代码来源:AdministrateResendAction.java

示例2: doDoDelete

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
/**
 * When the slave is deleted, terminate the instance.
 */
@Override
public HttpResponse doDoDelete() throws IOException {
    checkPermission(DELETE);
    if (getNode() != null)
    	getNode().terminate();
    return new HttpRedirect("..");
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:11,代码来源:EC2Computer.java

示例3: doDisable

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
@SuppressWarnings(UNUSED)
@CLIMethod(name = "disable-job")
@RequirePOST
public HttpResponse doDisable() throws IOException, ServletException { // NOSONAR
    checkPermission(CONFIGURE);
    makeDisabled(true);
    return new HttpRedirect(".");
}
 
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:9,代码来源:TemplateDrivenMultiBranchProject.java

示例4: doEnable

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
@SuppressWarnings(UNUSED)
@CLIMethod(name = "enable-job")
@RequirePOST
public HttpResponse doEnable() throws IOException, ServletException { // NOSONAR
    checkPermission(CONFIGURE);
    makeDisabled(false);
    return new HttpRedirect(".");
}
 
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:9,代码来源:TemplateDrivenMultiBranchProject.java

示例5: doDoDelete

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
@Override
public HttpResponse doDoDelete() throws IOException {
  checkPermission(DELETE);
    MesosSlave node = getNode();
    if (node != null) {
        node.terminate();
    }
  return new HttpRedirect("..");
}
 
开发者ID:jenkinsci,项目名称:mesos-plugin,代码行数:10,代码来源:MesosComputer.java

示例6: doCommenceLogin

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
public HttpResponse doCommenceLogin(StaplerRequest request, StaplerResponse response,
		@Header("Referer") final String referer) throws IOException {
	request.getSession().setAttribute(REFERER_ATTRIBUTE, referer);

	String redirect = redirectUrl(request);

	String state = UUID.randomUUID().toString();

	String authUrl = getKeycloakDeployment().getAuthUrl().clone()
			.queryParam(OAuth2Constants.CLIENT_ID, getKeycloakDeployment().getResourceName())
			.queryParam(OAuth2Constants.REDIRECT_URI, redirect).queryParam(OAuth2Constants.STATE, state)
			.queryParam(OAuth2Constants.RESPONSE_TYPE, OAuth2Constants.CODE).build().toString();

	return new HttpRedirect(authUrl);

}
 
开发者ID:devlauer,项目名称:jenkins-keycloak-plugin,代码行数:17,代码来源:KeycloakSecurityRealm.java

示例7: doCommenceLogin

import org.kohsuke.stapler.HttpRedirect; //导入依赖的package包/类
public HttpResponse doCommenceLogin(StaplerRequest request, @Header("Referer") final String referer) throws IOException {
    request.getSession().setAttribute(REFERER_ATTRIBUTE, referer);
    DeepinOAuthApiService DeepinOAuthApiService = new DeepinOAuthApiService(clientID, clientSecret);
    return new HttpRedirect(DeepinOAuthApiService.createOAutuorizeURL());
}
 
开发者ID:Iceyer,项目名称:deepin-oauth-plugin,代码行数:6,代码来源:DeepinSecurityRealm.java


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