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