@@ -96,7 +96,6 @@ public abstract class SessionBuilder<SelfT extends SessionBuilder, SessionT> {
9696 protected DriverConfigLoader configLoader ;
9797 protected Set <EndPoint > programmaticContactPoints = new HashSet <>();
9898 protected CqlIdentifier keyspace ;
99- protected Callable <InputStream > cloudConfigInputStream ;
10099 protected Callable <InputStream > scyllaCloudConfigInputStream ;
101100
102101 protected ProgrammaticArguments .Builder programmaticArgumentsBuilder =
@@ -632,31 +631,6 @@ public SelfT withClassLoader(@Nullable ClassLoader classLoader) {
632631 return self ;
633632 }
634633
635- /**
636- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
637- * the provided {@link Path}.
638- *
639- * <p>To connect to a Cloud database, you must first download the secure database bundle from the
640- * DataStax Astra console that contains the connection information, then instruct the driver to
641- * read its contents using either this method or one if its variants.
642- *
643- * <p>For more information, please refer to the DataStax Astra documentation.
644- *
645- * @param cloudConfigPath Path to the secure connect bundle zip file.
646- * @see #withCloudSecureConnectBundle(URL)
647- * @see #withCloudSecureConnectBundle(InputStream)
648- */
649- @ NonNull
650- public SelfT withCloudSecureConnectBundle (@ NonNull Path cloudConfigPath ) {
651- try {
652- URL cloudConfigUrl = cloudConfigPath .toAbsolutePath ().normalize ().toUri ().toURL ();
653- this .cloudConfigInputStream = cloudConfigUrl ::openStream ;
654- } catch (MalformedURLException e ) {
655- throw new IllegalArgumentException ("Incorrect format of cloudConfigPath" , e );
656- }
657- return self ;
658- }
659-
660634 @ NonNull
661635 public SelfT withScyllaCloudSecureConnectBundle (@ NonNull Path cloudConfigPath ) {
662636 try {
@@ -680,84 +654,18 @@ public SelfT withCodecRegistry(@Nullable MutableCodecRegistry codecRegistry) {
680654 return self ;
681655 }
682656
683- /**
684- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
685- * the provided {@link URL}.
686- *
687- * <p>To connect to a Cloud database, you must first download the secure database bundle from the
688- * DataStax Astra console that contains the connection information, then instruct the driver to
689- * read its contents using either this method or one if its variants.
690- *
691- * <p>For more information, please refer to the DataStax Astra documentation.
692- *
693- * @param cloudConfigUrl URL to the secure connect bundle zip file.
694- * @see #withCloudSecureConnectBundle(Path)
695- * @see #withCloudSecureConnectBundle(InputStream)
696- */
697- @ NonNull
698- public SelfT withCloudSecureConnectBundle (@ NonNull URL cloudConfigUrl ) {
699- this .cloudConfigInputStream = cloudConfigUrl ::openStream ;
700- return self ;
701- }
702-
703657 @ NonNull
704658 public SelfT withScyllaCloudSecureConnectBundle (@ NonNull URL cloudConfigUrl ) {
705659 this .scyllaCloudConfigInputStream = cloudConfigUrl ::openStream ;
706660 return self ;
707661 }
708662
709- /**
710- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
711- * the provided {@link InputStream}.
712- *
713- * <p>To connect to a Cloud database, you must first download the secure database bundle from the
714- * DataStax Astra console that contains the connection information, then instruct the driver to
715- * read its contents using either this method or one if its variants.
716- *
717- * <p>For more information, please refer to the DataStax Astra documentation.
718- *
719- * <p>Note that the provided stream will be consumed <em>and closed</em> when either {@link
720- * #build()} or {@link #buildAsync()} are called; attempting to reuse it afterwards will result in
721- * an error being thrown.
722- *
723- * @param cloudConfigInputStream A stream containing the secure connect bundle zip file.
724- * @see #withCloudSecureConnectBundle(Path)
725- * @see #withCloudSecureConnectBundle(URL)
726- */
727- @ NonNull
728- public SelfT withCloudSecureConnectBundle (@ NonNull InputStream cloudConfigInputStream ) {
729- this .cloudConfigInputStream = () -> cloudConfigInputStream ;
730- return self ;
731- }
732-
733663 @ NonNull
734664 public SelfT withScyllaCloudSecureConnectBundle (@ NonNull InputStream cloudConfigInputStream ) {
735665 this .scyllaCloudConfigInputStream = () -> cloudConfigInputStream ;
736666 return self ;
737667 }
738668
739- /**
740- * Configures this SessionBuilder to use the provided Cloud proxy endpoint.
741- *
742- * <p>Normally, this method should not be called directly; the normal and easiest way to configure
743- * the driver for Cloud deployments is through a {@linkplain #withCloudSecureConnectBundle(URL)
744- * secure connect bundle}.
745- *
746- * <p>Setting this option to any non-null address will make the driver use a special topology
747- * monitor tailored for Cloud deployments. This topology monitor assumes that the target cluster
748- * should be contacted through the proxy specified here, using SNI routing.
749- *
750- * <p>For more information, please refer to the DataStax Astra documentation.
751- *
752- * @param cloudProxyAddress The address of the Cloud proxy to use.
753- * @see <a href="https://en.wikipedia.org/wiki/Server_Name_Indication">Server Name Indication</a>
754- */
755- @ NonNull
756- public SelfT withCloudProxyAddress (@ Nullable InetSocketAddress cloudProxyAddress ) {
757- this .programmaticArgumentsBuilder .withCloudProxyAddress (cloudProxyAddress );
758- return self ;
759- }
760-
761669 @ NonNull
762670 public SelfT withScyllaCloudProxyAddress (
763671 @ Nullable InetSocketAddress cloudProxyAddress , String nodeDomain ) {
0 commit comments