@RequirePOST public HttpResponse doDelete() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); file.delete(); owner.files.remove(this); return HttpResponses.redirectTo("../.."); } }
/** * Deletes the credentials. * * @param req the request. * @return the response. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doDoDelete(StaplerRequest req) throws IOException { getStore().checkPermission(DELETE); if (getStore().removeCredentials(domain.getDomain(), credentials)) { return HttpResponses.redirectTo("../.."); } return HttpResponses.redirectToDot(); }
/** * Deletes the credentials. * * @param req the request. * @return the response. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doDoDelete(StaplerRequest req) throws IOException { getStore().checkPermission(DELETE); if (getStore().removeCredentials(domain.getDomain(), credentials)) { return HttpResponses.redirectTo("../.."); } return HttpResponses.redirectToDot(); }
/** * Making the installation web bound. */ @RequirePOST public HttpResponse doInstall() throws IOException { deploy(false); return HttpResponses.redirectTo("../.."); }
/** * Updates the credentials. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doUpdateSubmit(StaplerRequest req) throws ServletException, IOException { getStore().checkPermission(UPDATE); JSONObject data = req.getSubmittedForm(); Credentials credentials = req.bindJSON(Credentials.class, data); if (!getStore().updateCredentials(this.domain.domain, this.credentials, credentials)) { return HttpResponses.redirectTo("concurrentModification"); } return HttpResponses.redirectToDot(); }
/** * Performs the downgrade of the plugin. */ @RequirePOST public HttpResponse doDowngrade() throws IOException { deployBackup(); return HttpResponses.redirectTo("../.."); } }
/** * Updates the credentials. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doUpdateSubmit(StaplerRequest req) throws ServletException, IOException { getStore().checkPermission(UPDATE); JSONObject data = req.getSubmittedForm(); Credentials credentials = req.bindJSON(Credentials.class, data); if (!getStore().updateCredentials(this.domain.domain, this.credentials, credentials)) { return HttpResponses.redirectTo("concurrentModification"); } return HttpResponses.redirectToDot(); }
@RequirePOST public HttpResponse doInstallNow() throws IOException { deploy(true); return HttpResponses.redirectTo("../.."); }
/** * Deletes a domain. * * @param req the request. * @return the response. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doDoDelete(StaplerRequest req) throws IOException { if (!getStore().isDomainsModifiable()) { return HttpResponses.status(400); } getStore().checkPermission(MANAGE_DOMAINS); if (getStore().removeDomain(domain)) { return HttpResponses.redirectTo("../.."); } return HttpResponses.redirectToDot(); }
/** * Making the installation web bound. */ @RequirePOST public HttpResponse doInstall() throws IOException { deploy(false); return HttpResponses.redirectTo("../.."); }
/** * Deletes a domain. * * @param req the request. * @return the response. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doDoDelete(StaplerRequest req) throws IOException { if (!getStore().isDomainsModifiable()) { return HttpResponses.status(400); } getStore().checkPermission(MANAGE_DOMAINS); if (getStore().removeDomain(domain)) { return HttpResponses.redirectTo("../.."); } return HttpResponses.redirectToDot(); }
@RequirePOST public HttpResponse doDelete() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); file.delete(); owner.files.remove(this); return HttpResponses.redirectTo("../.."); } }
/** * Updates the domain configuration. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doConfigSubmit(StaplerRequest req) throws ServletException, IOException { if (!getStore().isDomainsModifiable()) { return HttpResponses.status(400); } getStore().checkPermission(MANAGE_DOMAINS); JSONObject data = req.getSubmittedForm(); Domain domain = req.bindJSON(Domain.class, data); String domainName = domain.getName(); if (domainName != null && getStore().updateDomain(this.domain, domain)) { return HttpResponses.redirectTo("../../domain/" + Util.rawEncode(domainName)); } return HttpResponses.redirectToDot(); }
@RequirePOST public HttpResponse doInstallNow() throws IOException { deploy(true); return HttpResponses.redirectTo("../.."); }
/** * Updates the domain configuration. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @RequirePOST @Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler web method public HttpResponse doConfigSubmit(StaplerRequest req) throws ServletException, IOException { if (!getStore().isDomainsModifiable()) { return HttpResponses.status(400); } getStore().checkPermission(MANAGE_DOMAINS); JSONObject data = req.getSubmittedForm(); Domain domain = req.bindJSON(Domain.class, data); String domainName = domain.getName(); if (domainName != null && getStore().updateDomain(this.domain, domain)) { return HttpResponses.redirectTo("../../domain/" + Util.rawEncode(domainName)); } return HttpResponses.redirectToDot(); }
/** * Performs the downgrade of the plugin. */ @RequirePOST public HttpResponse doDowngrade() throws IOException { deployBackup(); return HttpResponses.redirectTo("../.."); } }
/** * Submits the Oracle account username/password. */ @RequirePOST public HttpResponse doPostCredential(@QueryParameter String username, @QueryParameter String password) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); this.username = username; this.password = Secret.fromString(password); save(); return HttpResponses.redirectTo("credentialOK"); } }
/** * Called from the form via browser to submit/abort this input step. */ @RequirePOST public HttpResponse doSubmit(StaplerRequest request) throws IOException, ServletException, InterruptedException { if (request.getParameter("proceed")!=null) { doProceed(request); } else { doAbort(); } // go back to the Run console page return HttpResponses.redirectTo("../../console"); }
Credentials credentials = req.bindJSON(Credentials.class, data.getJSONObject("credentials")); getStore().addCredentials(domain, credentials); return HttpResponses.redirectTo("../../domain/" + getUrlName());
/** * Called when lenient shutdown for a specific node is activated. * @return redirect response * @throws IOException if something goes wrong */ public HttpResponse doIndex() throws IOException { final PluginImpl plugin = PluginImpl.getInstance(); final String nodeName = computer.getName(); if (plugin.isNodeShuttingDown(nodeName)) { computer.checkPermission(Computer.CONNECT); plugin.toggleNodeShuttingDown(nodeName); } else { computer.checkPermission(Computer.DISCONNECT); PluginImpl.getInstance().setNodeOffline(computer); } return HttpResponses.redirectTo("../"); }