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 ofSingleSessionFactoryLookupgivenSessionFactory. -
Method Summary
Modifier and TypeMethodDescriptiongetSessionFactory(String sessionFactoryName) Implementations must implement this method to retrieve theSessionFactoryidentified by the given name from their backing store.
-
Constructor Details
-
SingleSessionFactoryLookup
Create a new instance ofSingleSessionFactoryLookupgivenSessionFactory.- Parameters:
sessionFactory- the singleSessionFactoryto wrap, must not be null.
-
-
Method Details
-
getSessionFactory
public SessionFactory getSessionFactory(String sessionFactoryName) throws SessionFactoryLookupFailureException Description copied from interface:SessionFactoryLookupImplementations must implement this method to retrieve theSessionFactoryidentified by the given name from their backing store.- Specified by:
getSessionFactoryin interfaceSessionFactoryLookup- Parameters:
sessionFactoryName- the name of theSessionFactory.- Returns:
- the
SessionFactory(never null). - Throws:
SessionFactoryLookupFailureException- if the lookup failed.
-