diff options
Diffstat (limited to 'catalog-dao/src/main/java/org/openecomp/sdc/be/dao/config/DAOSpringConfig.java')
-rw-r--r-- | catalog-dao/src/main/java/org/openecomp/sdc/be/dao/config/DAOSpringConfig.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/config/DAOSpringConfig.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/config/DAOSpringConfig.java new file mode 100644 index 0000000000..d9c6829079 --- /dev/null +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/config/DAOSpringConfig.java @@ -0,0 +1,34 @@ +package org.openecomp.sdc.be.dao.config; + +import org.openecomp.sdc.be.dao.DAOTitanStrategy; +import org.openecomp.sdc.be.dao.TitanClientStrategy; +import org.openecomp.sdc.be.dao.titan.TitanGenericDao; +import org.openecomp.sdc.be.dao.titan.TitanGraphClient; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +@Configuration +public class DAOSpringConfig { + + @Bean(name = "titan-generic-dao") + @Primary + public TitanGenericDao titanGenericDao(@Qualifier("titan-client") TitanGraphClient titanGraphClient) { + return new TitanGenericDao(titanGraphClient); + } + + @Bean(name = "titan-client", initMethod = "createGraph") + @Primary + public TitanGraphClient titanGraphClient(@Qualifier("dao-client-strategy") TitanClientStrategy titanClientStrategy) { + return new TitanGraphClient(titanClientStrategy); + } + + @Bean(name = "dao-client-strategy") + public TitanClientStrategy titanClientStrategy() { + return new DAOTitanStrategy(); + } + + + +} |