private void processConfig(final HttpServerExchange exchange, final RequestData requestData) {

        // Get the node builder
        List<String> hosts = null;
        List<String> contexts = null;
        final Balancer.BalancerBuilder balancer = Balancer.builder();
        final NodeConfig.NodeBuilder node = NodeConfig.builder(modCluster);
        final Iterator<HttpString> i = requestData.iterator();
        while (i.hasNext()) {
            final HttpString name = i.next();
            final String value = requestData.getFirst(name);

            UndertowLogger.ROOT_LOGGER.mcmpKeyValue(name, value);
            if (!checkString(value)) {
                processError(TYPESYNTAX, SBADFLD + name + SBADFLD1, exchange);
                return;
            }

            if (BALANCER.equals(name)) {
                node.setBalancer(value);
                balancer.setName(value);
            } else if (MAXATTEMPTS.equals(name)) {
                balancer.setMaxRetries(Integer.parseInt(value));
            } else if (STICKYSESSION.equals(name)) {
                if ("No".equalsIgnoreCase(value)) {
                    balancer.setStickySession(false);
                }
            } else if (STICKYSESSIONCOOKIE.equals(name)) {
                balancer.setStickySessionCookie(value);
            } else if (STICKYSESSIONPATH.equals(name)) {
                balancer.setStickySessionPath(value);
            } else if (STICKYSESSIONREMOVE.equals(name)) {
                if ("Yes".equalsIgnoreCase(value)) {
                    balancer.setStickySessionRemove(true);
                }
            } else if (STICKYSESSIONFORCE.equals(name)) {
                if ("no".equalsIgnoreCase(value)) {
                    balancer.setStickySessionForce(false);
                }
            } else if (JVMROUTE.equals(name)) {
                node.setJvmRoute(value);
            } else if (DOMAIN.equals(name)) {
                node.setDomain(value);
            } else if (HOST.equals(name)) {
                node.setHostname(value);
            } else if (PORT.equals(name)) {
                node.setPort(Integer.parseInt(value));
            } else if (TYPE.equals(name)) {
                node.setType(value);
            } else if (REVERSED.equals(name)) {
                continue; // ignore
            } else if (FLUSH_PACKET.equals(name)) {
                if ("on".equalsIgnoreCase(value)) {
                    node.setFlushPackets(true);
                } else if ("auto".equalsIgnoreCase(value)) {
                    node.setFlushPackets(true);
                }
            } else if (FLUSH_WAIT.equals(name)) {
                node.setFlushwait(Integer.parseInt(value));
            } else if (MCMPConstants.PING.equals(name)) {
                node.setPing(Integer.parseInt(value));
            } else if (SMAX.equals(name)) {
                node.setSmax(Integer.parseInt(value));
            } else if (TTL.equals(name)) {
                node.setTtl(TimeUnit.SECONDS.toMillis(Long.parseLong(value)));
            } else if (TIMEOUT.equals(name)) {
                node.setTimeout(Integer.parseInt(value));
            } else if (CONTEXT.equals(name)) {
                final String[] context = value.split(",");
                contexts = Arrays.asList(context);
            } else if (ALIAS.equals(name)) {
                final String[] alias = value.split(",");
                hosts = Arrays.asList(alias);
            } else if(WAITWORKER.equals(name)) {
                node.setWaitWorker(Integer.parseInt(value));
            } else {
                processError(TYPESYNTAX, SBADFLD + name + SBADFLD1, exchange);
                return;
            }
        }

        final NodeConfig config;
        try {
            // Build the config
            config = node.build();
            if (container.addNode(config, balancer, exchange.getIoThread(), exchange.getConnection().getByteBufferPool())) {
                // Apparently this is hard to do in the C part, so maybe we should just remove this
                if (contexts != null && hosts != null) {
                    for (final String context : contexts) {
                        container.enableContext(context, config.getJvmRoute(), hosts);
                    }
                }
                processOK(exchange);
            } else {
                processError(MCMPErrorCode.NODE_STILL_EXISTS, exchange);
            }
        } catch (Exception e) {
            processError(MCMPErrorCode.CANT_UPDATE_NODE, exchange);
        }
    }
private void processConfig ( final HttpServerExchange exchange , final RequestData requestData ) { List < String > hosts = null ; List < String > contexts = null ; final Balancer . BalancerBuilder balancer = Balancer . builder ( ) ; final NodeConfig . NodeBuilder node = NodeConfig . builder ( modCluster ) ; final Iterator < HttpString > i = requestData . iterator ( ) ; while ( i . hasNext ( ) ) { final HttpString name = i . next ( ) ; final String value = requestData . getFirst ( name ) ; UndertowLogger . ROOT_LOGGER . mcmpKeyValue ( name , value ) ; if ( ! checkString ( value ) ) { processError ( TYPESYNTAX , SBADFLD + name + SBADFLD1 , exchange ) ; return ; } if ( BALANCER . equals ( name ) ) { node . setBalancer ( value ) ; balancer . setName ( value ) ; } else if ( MAXATTEMPTS . equals ( name ) ) { balancer . setMaxRetries ( Integer . parseInt ( value ) ) ; } else if ( STICKYSESSION . equals ( name ) ) { if ( "No" . equalsIgnoreCase ( value ) ) { balancer . setStickySession ( false ) ; } } else if ( STICKYSESSIONCOOKIE . equals ( name ) ) { balancer . setStickySessionCookie ( value ) ; } else if ( STICKYSESSIONPATH . equals ( name ) ) { balancer . setStickySessionPath ( value ) ; } else if ( STICKYSESSIONREMOVE . equals ( name ) ) { if ( "Yes" . equalsIgnoreCase ( value ) ) { balancer . setStickySessionRemove ( true ) ; } } else if ( STICKYSESSIONFORCE . equals ( name ) ) { if ( "no" . equalsIgnoreCase ( value ) ) { balancer . setStickySessionForce ( false ) ; } } else if ( JVMROUTE . equals ( name ) ) { node . setJvmRoute ( value ) ; } else if ( DOMAIN . equals ( name ) ) { node . setDomain ( value ) ; } else if ( HOST . equals ( name ) ) { node . setHostname ( value ) ; } else if ( PORT . equals ( name ) ) { node . setPort ( Integer . parseInt ( value ) ) ; } else if ( TYPE . equals ( name ) ) { node . setType ( value ) ; } else if ( REVERSED . equals ( name ) ) { continue ; } else if ( FLUSH_PACKET . equals ( name ) ) { if ( "on" . equalsIgnoreCase ( value ) ) { node . setFlushPackets ( true ) ; } else if ( "auto" . equalsIgnoreCase ( value ) ) { node . setFlushPackets ( true ) ; } } else if ( FLUSH_WAIT . equals ( name ) ) { node . setFlushwait ( Integer . parseInt ( value ) ) ; } else if ( MCMPConstants . PING . equals ( name ) ) { node . setPing ( Integer . parseInt ( value ) ) ; } else if ( SMAX . equals ( name ) ) { node . setSmax ( Integer . parseInt ( value ) ) ; } else if ( TTL . equals ( name ) ) { node . setTtl ( TimeUnit . SECONDS . toMillis ( Long . parseLong ( value ) ) ) ; } else if ( TIMEOUT . equals ( name ) ) { node . setTimeout ( Integer . parseInt ( value ) ) ; } else if ( CONTEXT . equals ( name ) ) { final String [ ] context = value . split ( "," ) ; contexts = Arrays . asList ( context ) ; } else if ( ALIAS . equals ( name ) ) { final String [ ] alias = value . split ( "," ) ; hosts = Arrays . asList ( alias ) ; } else if ( WAITWORKER . equals ( name ) ) { node . setWaitWorker ( Integer . parseInt ( value ) ) ; } else { processError ( TYPESYNTAX , SBADFLD + name + SBADFLD1 , exchange ) ; return ; } } final NodeConfig config ; try { config = node . build ( ) ; if ( container . addNode ( config , balancer , exchange . getIoThread ( ) , exchange . getConnection ( ) . getByteBufferPool ( ) ) ) { if ( contexts != null && hosts != null ) { for ( final String context : contexts ) { container . enableContext ( context , config . getJvmRoute ( ) , hosts ) ; } } processOK ( exchange ) ; } else { processError ( MCMPErrorCode . NODE_STILL_EXISTS , exchange ) ; } } catch ( Exception e ) { processError ( MCMPErrorCode . CANT_UPDATE_NODE , exchange ) ; } }
Process the node config.

@param exchange the http server exchange
@param requestData the request data