@RequirePOST
    public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
        checkPermission(CONFIGURE);

        String proposedName = Util.fixEmptyAndTrim(req.getSubmittedForm().getString("name"));
        Jenkins.checkGoodName(proposedName);

        Node node = getNode();
        if (node == null) {
            throw new ServletException("No such node " + nodeName);
        }

        if ((!proposedName.equals(nodeName))
                && Jenkins.getActiveInstance().getNode(proposedName) != null) {
            throw new FormException(Messages.ComputerSet_SlaveAlreadyExists(proposedName), "name");
        }

        String nExecutors = req.getSubmittedForm().getString("numExecutors");
        if (StringUtils.isBlank(nExecutors) || Integer.parseInt(nExecutors)<=0) {
            throw new FormException(Messages.Slave_InvalidConfig_Executors(nodeName), "numExecutors");
        }

        Node result = node.reconfigure(req, req.getSubmittedForm());
        Jenkins.getInstance().getNodesObject().replaceNode(this.getNode(), result);

        // take the user back to the agent top page.
        rsp.sendRedirect2("../" + result.getNodeName() + '/');
    }
@ RequirePOST public void doConfigSubmit ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException , FormException { checkPermission ( CONFIGURE ) ; String proposedName = Util . fixEmptyAndTrim ( req . getSubmittedForm ( ) . getString ( "name" ) ) ; Jenkins . checkGoodName ( proposedName ) ; Node node = getNode ( ) ; if ( node == null ) { throw new ServletException ( "No such node " + nodeName ) ; } if ( ( ! proposedName . equals ( nodeName ) ) && Jenkins . getActiveInstance ( ) . getNode ( proposedName ) != null ) { throw new FormException ( Messages . ComputerSet_SlaveAlreadyExists ( proposedName ) , "name" ) ; } String nExecutors = req . getSubmittedForm ( ) . getString ( "numExecutors" ) ; if ( StringUtils . isBlank ( nExecutors ) || Integer . parseInt ( nExecutors ) <= 0 ) { throw new FormException ( Messages . Slave_InvalidConfig_Executors ( nodeName ) , "numExecutors" ) ; } Node result = node . reconfigure ( req , req . getSubmittedForm ( ) ) ; Jenkins . getInstance ( ) . getNodesObject ( ) . replaceNode ( this . getNode ( ) , result ) ; rsp . sendRedirect2 ( "../" + result . getNodeName ( ) + '/' ) ; }
Accepts the update to the node configuration.