Interface SessionFactory

All Known Implementing Classes:
AbstractRoutingSessionFactory, DefaultSessionFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SessionFactory
A factory for Apache Cassandra sessions. A SessionFactory object is the preferred means of getting a connection. The SessionFactory interface is implemented by a CqlSession provider. A SessionFactory object can have properties that can be modified when necessary. For example, if the CqlSession is moved to a different server, the property for the server can be changed. The benefit is that because the data source's properties can be changed, any code accessing that SessionFactory does not need to be changed.
Since:
2.0
Author:
Mark Paluch
See Also:
  • CqlSession
  • Session
  • Method Summary

    Modifier and Type
    Method
    Description
    com.datastax.oss.driver.api.core.CqlSession
    Attempts to establish a CqlSession with the connection infrastructure that this SessionFactory object represents.
  • Method Details

    • getSession

      com.datastax.oss.driver.api.core.CqlSession getSession()
      Attempts to establish a CqlSession with the connection infrastructure that this SessionFactory object represents.
      Returns:
      a CqlSession to Apache Cassandra.
      See Also:
      • CqlSession