public void createConnection ( ICredentials credentials , ConnectorClusterConfig config ) throws ConnectionException { logger . info ( "Creating new connection..." ) ; Connection connection = createNativeConnection ( credentials , config ) ; String connectionName = config . getName ( ) . getName ( ) ; synchronized ( connections ) { if ( ! connections . containsKey ( connectionName ) ) { connections . put ( connectionName , connection ) ; logger . info ( "Connected to [" + connectionName + "]" ) ; } else { String msg = "The connection [" + connectionName + "] already exists" ; logger . error ( msg ) ; throw new ConnectionException ( msg ) ; } } }
This method create a connection .