@ Given ( "^I( securely)? connect to '(Cassandra|Mongo|Elasticsearch)' cluster at '(.+)'$" ) public void connect ( String secured , String clusterType , String url ) throws DBException , UnknownHostException { switch ( clusterType ) { case "Cassandra" : commonspec . getCassandraClient ( ) . setHost ( url ) ; commonspec . getCassandraClient ( ) . connect ( secured ) ; break ; case "Mongo" : commonspec . getMongoDBClient ( ) . connect ( ) ; break ; case "Elasticsearch" : LinkedHashMap < String , Object > settings_map = new LinkedHashMap < String , Object > ( ) ; settings_map . put ( "cluster.name" , System . getProperty ( "ES_CLUSTER" , ES_DEFAULT_CLUSTER_NAME ) ) ; commonspec . getElasticSearchClient ( ) . setSettings ( settings_map ) ; commonspec . getElasticSearchClient ( ) . connect ( ) ; break ; default : throw new DBException ( "Unknown cluster type" ) ; } }
Connect to cluster .