private GridClientConfiguration clientConfiguration(){
  GridClientConfiguration cfg=new GridClientConfiguration();
  cfg.setTopologyRefreshFrequency(topologyRefreshFrequency());
  cfg.setMaxConnectionIdleTime(maxConnectionIdleTime());
  cfg.setProtocol(protocol());
  cfg.setServers(Arrays.asList(serverAddress()));
  cfg.setBalancer(new GridClientRoundRobinBalancer());
  if (useSsl())   cfg.setSslContextFactory(sslContextFactory());
  GridClientDataConfiguration loc=new GridClientDataConfiguration();
  GridClientDataConfiguration partitioned=new GridClientDataConfiguration();
  partitioned.setName(PARTITIONED_CACHE_NAME);
  partitioned.setAffinity(new GridClientPartitionAffinity());
  GridClientDataConfiguration partitionedAsyncBackup=new GridClientDataConfiguration();
  partitionedAsyncBackup.setName(PARTITIONED_ASYNC_BACKUP_CACHE_NAME);
  partitionedAsyncBackup.setAffinity(new GridClientPartitionAffinity());
  GridClientDataConfiguration replicated=new GridClientDataConfiguration();
  replicated.setName(REPLICATED_CACHE_NAME);
  GridClientDataConfiguration replicatedAsync=new GridClientDataConfiguration();
  replicatedAsync.setName(REPLICATED_ASYNC_CACHE_NAME);
  cfg.setDataConfigurations(Arrays.asList(loc,partitioned,replicated,replicatedAsync,partitionedAsyncBackup));
  return cfg;
}

private GridClientConfiguration clientConfiguration ( ) { GridClientConfiguration cfg = new GridClientConfiguration ( ) ; cfg . setTopologyRefreshFrequency ( topologyRefreshFrequency ( ) ) ; cfg . setMaxConnectionIdleTime ( maxConnectionIdleTime ( ) ) ; cfg . setProtocol ( protocol ( ) ) ; cfg . setServers ( Arrays . asList ( serverAddress ( ) ) ) ; cfg . setBalancer ( new GridClientRoundRobinBalancer ( ) ) ; if ( useSsl ( ) ) cfg . setSslContextFactory ( sslContextFactory ( ) ) ; GridClientDataConfiguration loc = new GridClientDataConfiguration ( ) ; GridClientDataConfiguration partitioned = new GridClientDataConfiguration ( ) ; partitioned . setName ( PARTITIONED_CACHE_NAME ) ; partitioned . setAffinity ( new GridClientPartitionAffinity ( ) ) ; GridClientDataConfiguration partitionedAsyncBackup = new GridClientDataConfiguration ( ) ; partitionedAsyncBackup . setName ( PARTITIONED_ASYNC_BACKUP_CACHE_NAME ) ; partitionedAsyncBackup . setAffinity ( new GridClientPartitionAffinity ( ) ) ; GridClientDataConfiguration replicated = new GridClientDataConfiguration ( ) ; replicated . setName ( REPLICATED_CACHE_NAME ) ; GridClientDataConfiguration replicatedAsync = new GridClientDataConfiguration ( ) ; replicatedAsync . setName ( REPLICATED_ASYNC_CACHE_NAME ) ; cfg . setDataConfigurations ( Arrays . asList ( loc , partitioned , replicated , replicatedAsync , partitionedAsyncBackup ) ) ; return cfg ; }
creates client that will try to connect to only first node in grid .
