src/main/java/org/jboss/loom/migrators/server/ServerMigrator.java
private ConnectorAS7Bean migrateConnector(ConnectorAS5Bean connector, ServerMigratorResource resource, MigrationContext ctx)
            throws NodeGenerationException {
        ConnectorAS7Bean connAS7 = new ConnectorAS7Bean();

        connAS7.setEnabled("true");
        connAS7.setEnableLookups(connector.getEnableLookups());
        connAS7.setMaxPostSize(connector.getMaxPostSize());
        connAS7.setMaxSavePostSize(connector.getMaxSavePostSize());
        connAS7.setProtocol(connector.getProtocol());
        connAS7.setProxyName(connector.getProxyName());
        connAS7.setProxyPort(connector.getProxyPort());
        connAS7.setRedirectPort(connector.getRedirectPort());

        // Ajp connector need scheme too. So http is set.
        connAS7.setScheme("http");

        
        // Socket-binding
        String protocol = null;
        if( connector.getProtocol().equals("HTTP/1.1") ) {
                protocol = "true".equalsIgnoreCase( connector.getSslEnabled() ) ? "https" : "http";
        } else {
            // TODO: This can't be just assumed!
            protocol = "ajp";
        }
        connAS7.setSocketBinding(createSocketBinding(connector.getPort(), protocol, resource));

        // Name
        connAS7.setConnectorName(protocol);

        
        // SSL enabled?
        if( "true".equalsIgnoreCase( connector.getSslEnabled() ) ) {
            connAS7.setScheme("https");
            connAS7.setSecure(connector.getSecure());

            connAS7.setSslName("ssl");
            connAS7.setVerifyClient(connector.getClientAuth());

            if( connector.getKeystoreFile() != null ) {
                String fName =  new File(connector.getKeystoreFile()).getName();
                connAS7.setCertifKeyFile(AS7_CONFIG_DIR_PLACEHOLDER +  "/keys/" + fName);
                CopyFileAction action = createCopyActionForKeyFile(resource, fName);
                if ( action != null ) ctx.getActions().add(action);
            }

            if ((connector.getSslProtocol().equals("TLS")) || (connector.getSslProtocol() == null)) {
                connAS7.setSslProtocol("TLSv1");
            } else{
                connAS7.setSslProtocol(connector.getSslProtocol());
            }

            connAS7.setCiphers(connector.getCiphers());
            connAS7.setKeyAlias(connAS7.getKeyAlias());

            // TODO: AS 7 has just one password, while AS 5 has keystorePass and truststorePass.
            connAS7.setPassword(connector.getKeystorePass());
        }

        return connAS7;
    }
/**
     * Migrates a connector from AS5 to AS7
     *
     * @param connector object representing connector in AS5
     * @return migrated AS7's connector
     * @throws NodeGenerationException if socket-binding cannot be created or set
     */
Migrates a connector from AS5 to AS7
@param connector object representing connector in AS5
@return migrated AS7's connector
@throws NodeGenerationException if socket-binding cannot be created or set
Migrates a connector from AS5 to AS7 @param connector object representing connector in AS5 @return migrated AS7 ' s connector @throws NodeGenerationException if socket - binding cannot be created or set
private ConnectorAS7Bean migrateConnector(ConnectorAS5Bean connector, ServerMigratorResource resource, MigrationContext ctx)
            throws NodeGenerationException {
        ConnectorAS7Bean connAS7 = new ConnectorAS7Bean();
        connAS7.setEnabled("true");
        connAS7.setEnableLookups(connector.getEnableLookups());
        connAS7.setMaxPostSize(connector.getMaxPostSize());
        connAS7.setMaxSavePostSize(connector.getMaxSavePostSize());
        connAS7.setProtocol(connector.getProtocol());
        connAS7.setProxyName(connector.getProxyName());
        connAS7.setProxyPort(connector.getProxyPort());
        connAS7.setRedirectPort(connector.getRedirectPort());
        connAS7.setScheme("http");
        String protocol = null;
        if( connector.getProtocol().equals("HTTP/1.1") ) {
                protocol = "true".equalsIgnoreCase( connector.getSslEnabled() ) ? "https" : "http";
        } else {
            protocol = "ajp";
        }
        connAS7.setSocketBinding(createSocketBinding(connector.getPort(), protocol, resource));
        connAS7.setConnectorName(protocol);
        if( "true".equalsIgnoreCase( connector.getSslEnabled() ) ) {
            connAS7.setScheme("https");
            connAS7.setSecure(connector.getSecure());
            connAS7.setSslName("ssl");
            connAS7.setVerifyClient(connector.getClientAuth());
            if( connector.getKeystoreFile() != null ) {
                String fName =  new File(connector.getKeystoreFile()).getName();
                connAS7.setCertifKeyFile(AS7_CONFIG_DIR_PLACEHOLDER +  "/keys/" + fName);
                CopyFileAction action = createCopyActionForKeyFile(resource, fName);
                if ( action != null ) ctx.getActions().add(action);
            }
            if ((connector.getSslProtocol().equals("TLS")) || (connector.getSslProtocol() == null)) {
                connAS7.setSslProtocol("TLSv1");
            } else{
                connAS7.setSslProtocol(connector.getSslProtocol());
            }
            connAS7.setCiphers(connector.getCiphers());
            connAS7.setKeyAlias(connAS7.getKeyAlias());
            connAS7.setPassword(connector.getKeystorePass());
        }
        return connAS7;
    }
private ConnectorAS7Bean migrateConnector ( ConnectorAS5Bean connector , ServerMigratorResource resource , MigrationContext ctx ) throws NodeGenerationException { ConnectorAS7Bean connAS7 = new ConnectorAS7Bean ( ) ; connAS7 . setEnabled ( "true" ) ; connAS7 . setEnableLookups ( connector . getEnableLookups ( ) ) ; connAS7 . setMaxPostSize ( connector . getMaxPostSize ( ) ) ; connAS7 . setMaxSavePostSize ( connector . getMaxSavePostSize ( ) ) ; connAS7 . setProtocol ( connector . getProtocol ( ) ) ; connAS7 . setProxyName ( connector . getProxyName ( ) ) ; connAS7 . setProxyPort ( connector . getProxyPort ( ) ) ; connAS7 . setRedirectPort ( connector . getRedirectPort ( ) ) ; connAS7 . setScheme ( "http" ) ; String protocol = null ; if ( connector . getProtocol ( ) . equals ( "HTTP/1.1" ) ) { protocol = "true" . equalsIgnoreCase ( connector . getSslEnabled ( ) ) ? "https" : "http" ; } else { protocol = "ajp" ; } connAS7 . setSocketBinding ( createSocketBinding ( connector . getPort ( ) , protocol , resource ) ) ; connAS7 . setConnectorName ( protocol ) ; if ( "true" . equalsIgnoreCase ( connector . getSslEnabled ( ) ) ) { connAS7 . setScheme ( "https" ) ; connAS7 . setSecure ( connector . getSecure ( ) ) ; connAS7 . setSslName ( "ssl" ) ; connAS7 . setVerifyClient ( connector . getClientAuth ( ) ) ; if ( connector . getKeystoreFile ( ) != null ) { String fName = new File ( connector . getKeystoreFile ( ) ) . getName ( ) ; connAS7 . setCertifKeyFile ( AS7_CONFIG_DIR_PLACEHOLDER + "/keys/" + fName ) ; CopyFileAction action = createCopyActionForKeyFile ( resource , fName ) ; if ( action != null ) ctx . getActions ( ) . add ( action ) ; } if ( ( connector . getSslProtocol ( ) . equals ( "TLS" ) ) || ( connector . getSslProtocol ( ) == null ) ) { connAS7 . setSslProtocol ( "TLSv1" ) ; } else { connAS7 . setSslProtocol ( connector . getSslProtocol ( ) ) ; } connAS7 . setCiphers ( connector . getCiphers ( ) ) ; connAS7 . setKeyAlias ( connAS7 . getKeyAlias ( ) ) ; connAS7 . setPassword ( connector . getKeystorePass ( ) ) ; } return connAS7 ; }
Migrates a connector from AS5 to AS7
 @param connector object representing connector in AS5
 @return migrated AS7's connector
 @throws NodeGenerationException if socket-binding cannot be created or set
Migrates a connector from AS5 to AS7 @param connector object representing connector in AS5 @return migrated AS7 ' s connector @throws NodeGenerationException if socket - binding cannot be created or set
// Ajp connector need scheme too. So http is set. // Socket-binding // TODO: This can't be just assumed! // Name // SSL enabled? // TODO: AS 7 has just one password, while AS 5 has keystorePass and truststorePass.