/** * 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; }
/** * When the slave is deleted, terminate the instance. */ @Override public HttpResponse doDoDelete() throws IOException { checkPermission(DELETE); if (getNode() != null) getNode().terminate(); return new HttpRedirect(".."); }
@SuppressWarnings(UNUSED) @CLIMethod(name = "disable-job") @RequirePOST public HttpResponse doDisable() throws IOException, ServletException { // NOSONAR checkPermission(CONFIGURE); makeDisabled(true); return new HttpRedirect("."); }
@SuppressWarnings(UNUSED) @CLIMethod(name = "enable-job") @RequirePOST public HttpResponse doEnable() throws IOException, ServletException { // NOSONAR checkPermission(CONFIGURE); makeDisabled(false); return new HttpRedirect("."); }
@Override public HttpResponse doDoDelete() throws IOException { checkPermission(DELETE); MesosSlave node = getNode(); if (node != null) { node.terminate(); } return new HttpRedirect(".."); }
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); }
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()); }