Package com.datastax.astra.boot
Class AstraSpringAutoConfiguration
java.lang.Object
com.datastax.astra.boot.AstraSpringAutoConfiguration
@Configuration
@ConditionalOnClass(AstraClient.class)
@EnableConfigurationProperties(AstraClientProperties.class)
public class AstraSpringAutoConfiguration
extends Object
Initializing AstraClient (if class present in classpath)
- #1 Configuration with application.properties
- #2 Configuration with environment variables
- #3 Configuration with AstraRC on file system in user.home
You can also define your
AstraClient
explicitely.- Author:
- Cedrick LUNVEN (@clunven)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAcessing astra client.com.datastax.oss.driver.api.core.CqlSession
cqlSession
(AstraClient astraClient) We want the CqlSession generated byAstraClient
.
-
Constructor Details
-
AstraSpringAutoConfiguration
public AstraSpringAutoConfiguration()
-
-
Method Details
-
astraClient
Acessing astra client.- Returns:
- astra client
-
cqlSession
@Bean @ConditionalOnProperty(prefix="astra.cql", name="enabled", havingValue="true") public com.datastax.oss.driver.api.core.CqlSession cqlSession(AstraClient astraClient) We want the CqlSession generated byAstraClient
.- Parameters:
astraClient
- astraClient- Returns:
- the ccassandra session
-