class App {

  public synchronized Boolean connect() {
    logger.info("connecting to cassandra");

    DriverConfigLoader loader = DriverConfigLoader.programmaticBuilder()
      .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(5))
      .startProfile("slow")
      .withDuration(DefaultDriverOption.REQUEST_TIMEOUT, Duration.ofSeconds(30))
      .endProfile()
      .build();

    session = CqlSession.builder().withConfigLoader(loader)
      .addContactPoint(new InetSocketAddress("localhost", 9041))
      .withLocalDatacenter("datacenter1")
      .build();
    logger.info("connected");
    return true;
  }

}