private Cluster getCluster()

in service/src/main/java/org/apache/fineract/cn/provisioner/internal/repository/TenantCassandraRepository.java [134:149]


  private Cluster getCluster(final @Nonnull TenantEntity tenantEntity) {
    final Cluster.Builder clusterBuilder = Cluster
            .builder()
            .withClusterName(tenantEntity.getClusterName());

    if (this.environment.containsProperty(CassandraConnectorConstants.CLUSTER_USER_PROP)) {
      final String user = this.environment.getProperty(CassandraConnectorConstants.CLUSTER_USER_PROP);
      final String pwd = this.environment.getProperty(CassandraConnectorConstants.CLUSTER_PASSWORD_PROP);

      final AuthProvider authProvider = new PlainTextAuthProvider(user, pwd);
      clusterBuilder.withAuthProvider(authProvider);
    }
    ContactPointUtils.process(clusterBuilder, tenantEntity.getContactPoints());

    return clusterBuilder.build();
  }