Module spring.data.cassandra
Class SingleSessionFactoryLookup
java.lang.Object
org.springframework.data.cassandra.core.cql.session.lookup.SingleSessionFactoryLookup
- All Implemented Interfaces:
SessionFactoryLookup
An implementation of
SessionFactoryLookup
that simply wraps a single given SessionFactory
, returned
for any session factory name. Useful for testing or environments that provide only one SessionFactory
.- Since:
- 2.0
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionSingleSessionFactoryLookup
(SessionFactory sessionFactory) Create a new instance ofSingleSessionFactoryLookup
givenSessionFactory
. -
Method Summary
Modifier and TypeMethodDescriptiongetSessionFactory
(String sessionFactoryName) Implementations must implement this method to retrieve theSessionFactory
identified by the given name from their backing store.
-
Constructor Details
-
SingleSessionFactoryLookup
Create a new instance ofSingleSessionFactoryLookup
givenSessionFactory
.- Parameters:
sessionFactory
- the singleSessionFactory
to wrap, must not be null.
-
-
Method Details
-
getSessionFactory
public SessionFactory getSessionFactory(String sessionFactoryName) throws SessionFactoryLookupFailureException Description copied from interface:SessionFactoryLookup
Implementations must implement this method to retrieve theSessionFactory
identified by the given name from their backing store.- Specified by:
getSessionFactory
in interfaceSessionFactoryLookup
- Parameters:
sessionFactoryName
- the name of theSessionFactory
.- Returns:
- the
SessionFactory
(never null). - Throws:
SessionFactoryLookupFailureException
- if the lookup failed.
-