src/main/java/org/jboss/loom/migrators/server/ServerMigrator.java
private static String createVirtualServerScript(VirtualServerBean virtualServer) throws CliScriptException {
        String errMsg = "in virtual-server (engine in AS5) must be set";
        Utils.throwIfBlank(virtualServer.getVirtualServerName(), errMsg, "Server name");

        CliAddScriptBuilder builder = new CliAddScriptBuilder();
        StringBuilder resultScript = new StringBuilder("/subsystem=web/virtual-server=");
        resultScript.append(virtualServer.getVirtualServerName()).append(":add(");

        builder.addProperty("enable-welcome-root", virtualServer.getEnableWelcomeRoot());
        builder.addProperty("default-web-module", virtualServer.getDefaultWebModule());

        String aliases = "";
        if (virtualServer.getAliasName() != null) {
            StringBuilder aliasBuilder = new StringBuilder();
            for (String alias : virtualServer.getAliasName()) {
                aliasBuilder.append(", \"").append(alias).append("\"");
            }

            aliases = aliasBuilder.toString();
            aliases = aliases.replaceFirst(", ", "");

            if (!aliases.isEmpty()) {
                aliases = ", alias=[" + aliases + "]";
            }
        }

        resultScript.append(builder.formatAndClearProps()).append(aliases).append(")");

        return resultScript.toString();
    }
/**
     * Creates a CLI script for adding virtual-server to AS7
     *
     * @param virtualServer object representing migrated virtual-server
     * @return string containing created CLI script
     * 
     * @deprecated  Generate this from the ModelNode.
     */
Creates a CLI script for adding virtual-server to AS7
@param virtualServer object representing migrated virtual-server
@return string containing created CLI script

@deprecated  Generate this from the ModelNode.
Creates a CLI script for adding virtual - server to AS7 @param virtualServer object representing migrated virtual - server @return string containing created CLI script @deprecated Generate this from the ModelNode .
private static String createVirtualServerScript(VirtualServerBean virtualServer) throws CliScriptException {
        String errMsg = "in virtual-server (engine in AS5) must be set";
        Utils.throwIfBlank(virtualServer.getVirtualServerName(), errMsg, "Server name");
        CliAddScriptBuilder builder = new CliAddScriptBuilder();
        StringBuilder resultScript = new StringBuilder("/subsystem=web/virtual-server=");
        resultScript.append(virtualServer.getVirtualServerName()).append(":add(");
        builder.addProperty("enable-welcome-root", virtualServer.getEnableWelcomeRoot());
        builder.addProperty("default-web-module", virtualServer.getDefaultWebModule());
        String aliases = "";
        if (virtualServer.getAliasName() != null) {
            StringBuilder aliasBuilder = new StringBuilder();
            for (String alias : virtualServer.getAliasName()) {
                aliasBuilder.append(", \"").append(alias).append("\"");
            }
            aliases = aliasBuilder.toString();
            aliases = aliases.replaceFirst(", ", "");
            if (!aliases.isEmpty()) {
                aliases = ", alias=[" + aliases + "]";
            }
        }
        resultScript.append(builder.formatAndClearProps()).append(aliases).append(")");
        return resultScript.toString();
    }
private static String createVirtualServerScript ( VirtualServerBean virtualServer ) throws CliScriptException { String errMsg = "in virtual-server (engine in AS5) must be set" ; Utils . throwIfBlank ( virtualServer . getVirtualServerName ( ) , errMsg , "Server name" ) ; CliAddScriptBuilder builder = new CliAddScriptBuilder ( ) ; StringBuilder resultScript = new StringBuilder ( "/subsystem=web/virtual-server=" ) ; resultScript . append ( virtualServer . getVirtualServerName ( ) ) . append ( ":add(" ) ; builder . addProperty ( "enable-welcome-root" , virtualServer . getEnableWelcomeRoot ( ) ) ; builder . addProperty ( "default-web-module" , virtualServer . getDefaultWebModule ( ) ) ; String aliases = "" ; if ( virtualServer . getAliasName ( ) != null ) { StringBuilder aliasBuilder = new StringBuilder ( ) ; for ( String alias : virtualServer . getAliasName ( ) ) { aliasBuilder . append ( ", \"" ) . append ( alias ) . append ( "\"" ) ; } aliases = aliasBuilder . toString ( ) ; aliases = aliases . replaceFirst ( ", " , "" ) ; if ( ! aliases . isEmpty ( ) ) { aliases = ", alias=[" + aliases + "]" ; } } resultScript . append ( builder . formatAndClearProps ( ) ) . append ( aliases ) . append ( ")" ) ; return resultScript . toString ( ) ; }
Creates a CLI script for adding virtual-server to AS7
 @param virtualServer object representing migrated virtual-server
 @return string containing created CLI script
Creates a CLI script for adding virtual - server to AS7 @param virtualServer object representing migrated virtual - server @return string containing created CLI script