|
60 | 60 | import com.google.common.util.concurrent.SettableFuture;
|
61 | 61 | import com.google.common.util.concurrent.Uninterruptibles;
|
62 | 62 | import java.io.Closeable;
|
63 |
| -import java.io.File; |
64 |
| -import java.io.IOException; |
65 |
| -import java.io.InputStream; |
66 | 63 | import java.net.InetAddress;
|
67 | 64 | import java.net.InetSocketAddress;
|
68 |
| -import java.net.URL; |
69 | 65 | import java.net.UnknownHostException;
|
70 |
| -import java.security.GeneralSecurityException; |
71 | 66 | import java.util.ArrayList;
|
72 | 67 | import java.util.Collection;
|
73 | 68 | import java.util.Collections;
|
@@ -1384,92 +1379,6 @@ public Builder withNoCompact() {
|
1384 | 1379 | return this;
|
1385 | 1380 | }
|
1386 | 1381 |
|
1387 |
| - /** |
1388 |
| - * Configure for Scylla Cloud Serverless cluster using configuration bundle. |
1389 |
| - * |
1390 |
| - * @param configurationFile configuration bundle file. |
1391 |
| - * @return this builder. |
1392 |
| - * @throws IOException |
1393 |
| - * @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig) |
1394 |
| - */ |
1395 |
| - public Builder withScyllaCloudConnectionConfig(File configurationFile) throws IOException { |
1396 |
| - return withScyllaCloudConnectionConfig(configurationFile.toURI().toURL()); |
1397 |
| - } |
1398 |
| - |
1399 |
| - /** |
1400 |
| - * Configure for Scylla Cloud Serverless cluster using URL to configuration bundle. |
1401 |
| - * |
1402 |
| - * @param configurationUrl URL from which configuration bundle can be read. |
1403 |
| - * @return this builder. |
1404 |
| - * @throws IOException |
1405 |
| - * @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig) |
1406 |
| - */ |
1407 |
| - public Builder withScyllaCloudConnectionConfig(URL configurationUrl) throws IOException { |
1408 |
| - return withScyllaCloudConnectionConfig(configurationUrl.openStream()); |
1409 |
| - } |
1410 |
| - |
1411 |
| - /** |
1412 |
| - * Configure for Scylla Cloud Serverless cluster using InputStream of configuration bundle. |
1413 |
| - * |
1414 |
| - * @param inputStream input stream containing configuration bundle format data. |
1415 |
| - * @return this builder. |
1416 |
| - * @throws IOException |
1417 |
| - * @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig) |
1418 |
| - */ |
1419 |
| - public Builder withScyllaCloudConnectionConfig(InputStream inputStream) throws IOException { |
1420 |
| - return withScyllaCloudConnectionConfig( |
1421 |
| - ScyllaCloudConnectionConfig.fromInputStream(inputStream)); |
1422 |
| - } |
1423 |
| - |
1424 |
| - /** |
1425 |
| - * Sets a collection of options for connecting to Scylla Cloud Serverless cluster. |
1426 |
| - * |
1427 |
| - * <p>Sets several options according to provided {@link ScyllaCloudConnectionConfig}. This |
1428 |
| - * includes calling {@link Builder#withEndPointFactory(EndPointFactory)}, {@link |
1429 |
| - * Builder#withSSL(SSLOptions)}, {@link Builder#withAuthProvider(AuthProvider)}, {@link |
1430 |
| - * Builder#withoutAdvancedShardAwareness()} with parameters derived from the config. |
1431 |
| - * |
1432 |
| - * <p>Cannot be combined with {@link Builder#addContactPoint}. All contact points should already |
1433 |
| - * be provided in {@link ScyllaCloudConnectionConfig}. |
1434 |
| - * |
1435 |
| - * @param config instantiated ScyllaCloudConnectionConfig. |
1436 |
| - * @return this builder. |
1437 |
| - */ |
1438 |
| - protected Builder withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig config) { |
1439 |
| - try { |
1440 |
| - ScyllaCloudDatacenter currentDatacenter = config.getCurrentDatacenter(); |
1441 |
| - InetSocketAddress proxyAddress = currentDatacenter.getServer(); |
1442 |
| - |
1443 |
| - Builder builder = |
1444 |
| - withEndPointFactory( |
1445 |
| - new ScyllaCloudSniEndPointFactory( |
1446 |
| - proxyAddress, currentDatacenter.getNodeDomain())) |
1447 |
| - .withSSL( |
1448 |
| - (config.getCurrentDatacenter().isInsecureSkipTlsVerify() |
1449 |
| - ? config.createBundle().getInsecureSSLOptions() |
1450 |
| - : config.createBundle().getSSLOptions())) |
1451 |
| - .withAuthProvider( |
1452 |
| - new PlainTextAuthProvider( |
1453 |
| - config.getCurrentAuthInfo().getUsername(), |
1454 |
| - config.getCurrentAuthInfo().getPassword())) |
1455 |
| - .withoutAdvancedShardAwareness(); |
1456 |
| - |
1457 |
| - if (builder.rawHostContactPoints.size() > 0 |
1458 |
| - || builder.rawHostAndPortContactPoints.size() > 0 |
1459 |
| - || builder.contactPoints.size() > 0) { |
1460 |
| - throw new IllegalStateException( |
1461 |
| - "Can't use withCloudSecureConnectBundle if you've already called addContactPoint(s)"); |
1462 |
| - } |
1463 |
| - builder.addContactPoint(new SniEndPoint(proxyAddress, currentDatacenter.getNodeDomain())); |
1464 |
| - |
1465 |
| - return builder; |
1466 |
| - } catch (IOException e) { |
1467 |
| - throw new IllegalStateException("Cannot construct cloud config", e); |
1468 |
| - } catch (GeneralSecurityException e) { |
1469 |
| - throw new IllegalStateException("Cannot construct cloud config", e); |
1470 |
| - } |
1471 |
| - } |
1472 |
| - |
1473 | 1382 | /**
|
1474 | 1383 | * Disables advanced shard awareness. By default, this driver chooses local port while making a
|
1475 | 1384 | * connection to node, to signal which shard it wants to connect to. This allows driver to
|
|
0 commit comments