public void addConnector(String name, ConnectorConfiguration connectorConfig) throws Exception {
        ModelNode fullRequest;

        final Address connectorAddress = Address.root().add(SUBSYSTEM, SUBSYSTEM_WEB, CONNECTOR, name);
        final ModelNode connectorRequest = createRequest(ADD, connectorAddress);
        setPossibleExpression(connectorRequest, "executor", connectorConfig.getExecutor());
        setPossibleExpression(connectorRequest, "max-connections", connectorConfig.getMaxConnections());
        setPossibleExpression(connectorRequest, "max-post-size", connectorConfig.getMaxPostSize());
        setPossibleExpression(connectorRequest, "max-save-post-size", connectorConfig.getMaxSavePostSize());
        setPossibleExpression(connectorRequest, "protocol", connectorConfig.getProtocol());
        setPossibleExpression(connectorRequest, "proxy-name", connectorConfig.getProxyName());
        setPossibleExpression(connectorRequest, "proxy-port", connectorConfig.getProxyPort());
        setPossibleExpression(connectorRequest, "scheme", connectorConfig.getScheme());
        setPossibleExpression(connectorRequest, "socket-binding", connectorConfig.getSocketBinding());
        setPossibleExpression(connectorRequest, "redirect-port", connectorConfig.getRedirectPort());
        setPossibleExpression(connectorRequest, "enabled", String.valueOf(connectorConfig.isEnabled()));
        setPossibleExpression(connectorRequest, "enable-lookups", String.valueOf(connectorConfig.isEnableLookups()));
        setPossibleExpression(connectorRequest, "secure", String.valueOf(connectorConfig.isSecure()));

        SSLConfiguration sslConfig = connectorConfig.getSslConfiguration();
        if (sslConfig != null) {
            final Address sslAddress = connectorAddress.clone().add(SSL, "configuration"); // MUST be "configuration"
            final ModelNode sslRequest = createRequest(ADD, sslAddress);
            setPossibleExpression(sslRequest, "ca-certificate-file", sslConfig.getCaCertificateFile());
            setPossibleExpression(sslRequest, "ca-certificate-password", sslConfig.getCaCertificatePassword());
            setPossibleExpression(sslRequest, "ca-revocation-url", sslConfig.getCaRevocationUrl());
            setPossibleExpression(sslRequest, "certificate-file", sslConfig.getCertificateFile());
            setPossibleExpression(sslRequest, "certificate-key-file", sslConfig.getCertificateKeyFile());
            setPossibleExpression(sslRequest, "cipher-suite", sslConfig.getCipherSuite());
            setPossibleExpression(sslRequest, "key-alias", sslConfig.getKeyAlias());
            setPossibleExpression(sslRequest, "keystore-type", sslConfig.getKeystoreType());
            setPossibleExpression(sslRequest, "name", sslConfig.getName());
            setPossibleExpression(sslRequest, "password", sslConfig.getPassword());
            setPossibleExpression(sslRequest, "protocol", sslConfig.getProtocol());
            setPossibleExpression(sslRequest, "session-cache-size", sslConfig.getSessionCacheSize());
            setPossibleExpression(sslRequest, "session-timeout", sslConfig.getSessionTimeout());
            setPossibleExpression(sslRequest, "truststore-type", sslConfig.getTruststoreType());
            setPossibleExpression(sslRequest, "verify-client", sslConfig.getVerifyClient());
            setPossibleExpression(sslRequest, "verify-depth", sslConfig.getVerifyDepth());
            fullRequest = createBatchRequest(connectorRequest, sslRequest);
        } else {
            fullRequest = connectorRequest;
        }

        final ModelNode response = execute(fullRequest);
        if (!isSuccess(response)) {
            throw new FailureException(response, "Failed to add new connector [" + name + "]");
        }
        return;
    }
public void addConnector ( String name , ConnectorConfiguration connectorConfig ) throws Exception { ModelNode fullRequest ; final Address connectorAddress = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_WEB , CONNECTOR , name ) ; final ModelNode connectorRequest = createRequest ( ADD , connectorAddress ) ; setPossibleExpression ( connectorRequest , "executor" , connectorConfig . getExecutor ( ) ) ; setPossibleExpression ( connectorRequest , "max-connections" , connectorConfig . getMaxConnections ( ) ) ; setPossibleExpression ( connectorRequest , "max-post-size" , connectorConfig . getMaxPostSize ( ) ) ; setPossibleExpression ( connectorRequest , "max-save-post-size" , connectorConfig . getMaxSavePostSize ( ) ) ; setPossibleExpression ( connectorRequest , "protocol" , connectorConfig . getProtocol ( ) ) ; setPossibleExpression ( connectorRequest , "proxy-name" , connectorConfig . getProxyName ( ) ) ; setPossibleExpression ( connectorRequest , "proxy-port" , connectorConfig . getProxyPort ( ) ) ; setPossibleExpression ( connectorRequest , "scheme" , connectorConfig . getScheme ( ) ) ; setPossibleExpression ( connectorRequest , "socket-binding" , connectorConfig . getSocketBinding ( ) ) ; setPossibleExpression ( connectorRequest , "redirect-port" , connectorConfig . getRedirectPort ( ) ) ; setPossibleExpression ( connectorRequest , "enabled" , String . valueOf ( connectorConfig . isEnabled ( ) ) ) ; setPossibleExpression ( connectorRequest , "enable-lookups" , String . valueOf ( connectorConfig . isEnableLookups ( ) ) ) ; setPossibleExpression ( connectorRequest , "secure" , String . valueOf ( connectorConfig . isSecure ( ) ) ) ; SSLConfiguration sslConfig = connectorConfig . getSslConfiguration ( ) ; if ( sslConfig != null ) { final Address sslAddress = connectorAddress . clone ( ) . add ( SSL , "configuration" ) ; final ModelNode sslRequest = createRequest ( ADD , sslAddress ) ; setPossibleExpression ( sslRequest , "ca-certificate-file" , sslConfig . getCaCertificateFile ( ) ) ; setPossibleExpression ( sslRequest , "ca-certificate-password" , sslConfig . getCaCertificatePassword ( ) ) ; setPossibleExpression ( sslRequest , "ca-revocation-url" , sslConfig . getCaRevocationUrl ( ) ) ; setPossibleExpression ( sslRequest , "certificate-file" , sslConfig . getCertificateFile ( ) ) ; setPossibleExpression ( sslRequest , "certificate-key-file" , sslConfig . getCertificateKeyFile ( ) ) ; setPossibleExpression ( sslRequest , "cipher-suite" , sslConfig . getCipherSuite ( ) ) ; setPossibleExpression ( sslRequest , "key-alias" , sslConfig . getKeyAlias ( ) ) ; setPossibleExpression ( sslRequest , "keystore-type" , sslConfig . getKeystoreType ( ) ) ; setPossibleExpression ( sslRequest , "name" , sslConfig . getName ( ) ) ; setPossibleExpression ( sslRequest , "password" , sslConfig . getPassword ( ) ) ; setPossibleExpression ( sslRequest , "protocol" , sslConfig . getProtocol ( ) ) ; setPossibleExpression ( sslRequest , "session-cache-size" , sslConfig . getSessionCacheSize ( ) ) ; setPossibleExpression ( sslRequest , "session-timeout" , sslConfig . getSessionTimeout ( ) ) ; setPossibleExpression ( sslRequest , "truststore-type" , sslConfig . getTruststoreType ( ) ) ; setPossibleExpression ( sslRequest , "verify-client" , sslConfig . getVerifyClient ( ) ) ; setPossibleExpression ( sslRequest , "verify-depth" , sslConfig . getVerifyDepth ( ) ) ; fullRequest = createBatchRequest ( connectorRequest , sslRequest ) ; } else { fullRequest = connectorRequest ; } final ModelNode response = execute ( fullRequest ) ; if ( ! isSuccess ( response ) ) { throw new FailureException ( response , "Failed to add new connector [" + name + "]" ) ; } return ; }
Add a new web connector, which may be a secure SSL connector (HTTPS) or not (HTTP).

@param name name of new connector to add
@param connectorConfig the connector's configuration
@throws Exception any error