protected void updateComputerList() { updateComputerList(AUTOMATIC_SLAVE_LAUNCH); }
@Override public void run() { for (Iterator<Map.Entry<String, Node>> i = nodes.entrySet().iterator(); i.hasNext(); ) { if (!(i.next().getValue() instanceof EphemeralNode)) { i.remove(); } } nodes.putAll(newNodes); jenkins.updateComputerList(); jenkins.trimLabels(); } });
/** * Sets a number of executors. * @param n Number of executors * @throws IOException Failed to save the configuration * @throws IllegalArgumentException Negative value has been passed */ public void setNumExecutors(@Nonnegative int n) throws IOException, IllegalArgumentException { if (n < 0) { throw new IllegalArgumentException("Incorrect field \"# of executors\": " + n +". It should be a non-negative number."); } if (this.numExecutors != n) { this.numExecutors = n; updateComputerList(); save(); } }
@Override public void run() { Set<String> toRemove = new HashSet<String>(Nodes.this.nodes.keySet()); for (Node n : nodes) { final String name = n.getNodeName(); toRemove.remove(name); Nodes.this.nodes.put(name, n); } Nodes.this.nodes.keySet().removeAll(toRemove); // directory clean up will be handled by save jenkins.updateComputerList(); jenkins.trimLabels(); } });
@Override public void run() { nodes.put(node.getNodeName(), node); jenkins.updateComputerList(); jenkins.trimLabels(); } });
public void run() { Nodes.this.nodes.remove(oldOne.getNodeName()); Nodes.this.nodes.put(newOne.getNodeName(), newOne); jenkins.updateComputerList(); jenkins.trimLabels(); } });
@Override public void run() { nodes.compute(node.getNodeName(), (ignoredNodeName, ignoredNode) -> oldNode); jenkins.updateComputerList(); jenkins.trimLabels(); } });
@Override public void run() { Computer c = node.toComputer(); if (c != null) { c.recordTermination(); c.disconnect(OfflineCause.create(hudson.model.Messages._Hudson_NodeBeingRemoved())); } if (node == nodes.remove(node.getNodeName())) { jenkins.updateComputerList(); jenkins.trimLabels(); } } });
/** * Accepts submission from the node configuration page. */ @RequirePOST public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page }
/** * Accepts submission from the configuration page. */ @RequirePOST public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { BulkChange bc = new BulkChange(this); try { checkPermission(ADMINISTER); JSONObject json = req.getSubmittedForm(); systemMessage = Util.nullify(req.getParameter("system_message")); boolean result = true; for (Descriptor<?> d : Functions.getSortedDescriptorsForGlobalConfigUnclassified()) result &= configureDescriptor(req,json,d); save(); updateComputerList(); if(result) FormApply.success(req.getContextPath()+'/').generateResponse(req, rsp, null); else FormApply.success("configure").generateResponse(req, rsp, null); // back to config } finally { bc.commit(); } }
protected void updateComputerList() { updateComputerList(AUTOMATIC_SLAVE_LAUNCH); }
@Override public void run() { for (Iterator<Map.Entry<String, Node>> i = nodes.entrySet().iterator(); i.hasNext(); ) { if (!(i.next().getValue() instanceof EphemeralNode)) { i.remove(); } } nodes.putAll(newNodes); jenkins.updateComputerList(); jenkins.trimLabels(); } });
public void setNumExecutors(int n) throws IOException { if (this.numExecutors != n) { this.numExecutors = n; updateComputerList(); save(); } }
@Override public void run() { Set<String> toRemove = new HashSet<String>(Nodes.this.nodes.keySet()); for (Node n : nodes) { final String name = n.getNodeName(); toRemove.remove(name); Nodes.this.nodes.put(name, n); } Nodes.this.nodes.keySet().removeAll(toRemove); // directory clean up will be handled by save jenkins.updateComputerList(); jenkins.trimLabels(); } });
@Override public void run() { nodes.put(node.getNodeName(), node); jenkins.updateComputerList(); jenkins.trimLabels(); } });
public void run() { Nodes.this.nodes.remove(oldOne.getNodeName()); Nodes.this.nodes.put(newOne.getNodeName(), newOne); jenkins.updateComputerList(); jenkins.trimLabels(); } });
@Override public void run() { Computer c = node.toComputer(); if (c != null) { c.recordTermination(); c.disconnect(OfflineCause.create(hudson.model.Messages._Hudson_NodeBeingRemoved())); } if (node == nodes.remove(node.getNodeName())) { jenkins.updateComputerList(); jenkins.trimLabels(); } } });
/** * Accepts submission from the configuration page. */ @RequirePOST public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { BulkChange bc = new BulkChange(this); try { checkPermission(ADMINISTER); JSONObject json = req.getSubmittedForm(); workspaceDir = json.getString("rawWorkspaceDir"); buildsDir = json.getString("rawBuildsDir"); systemMessage = Util.nullify(req.getParameter("system_message")); boolean result = true; for (Descriptor<?> d : Functions.getSortedDescriptorsForGlobalConfigUnclassified()) result &= configureDescriptor(req,json,d); save(); updateComputerList(); if(result) FormApply.success(req.getContextPath()+'/').generateResponse(req, rsp, null); else FormApply.success("configure").generateResponse(req, rsp, null); // back to config } finally { bc.commit(); } }
/** * Accepts submission from the node configuration page. */ @RequirePOST public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class); if (mbc!=null) mbc.configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page }