aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/main/java/org
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2019-06-27 12:35:47 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-07-07 08:22:31 +0000
commitbf2ffad5b686eb0ffddbeeeca5824b8caea0c8ff (patch)
tree53e09d40e18b4aecff6f501633d374b87c4688be /asdctool/src/main/java/org
parent868746d27adc90efeba5909d3eb60a6e0cd24c27 (diff)
Remove field injection in catalog-dao
Change-Id: I24c3a898fa34491e80074944614722fbb3085515 Issue-ID: SDC-2398 Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'asdctool/src/main/java/org')
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfig.java12
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java4
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java5
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java9
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfig.java4
5 files changed, 22 insertions, 12 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfig.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfig.java
index 3242c27384..7056acfab7 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfig.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfig.java
@@ -35,13 +35,13 @@ public class EsToCassandraDataMigrationConfig {
}
@Bean(name = "artifact-cassandra-dao")
- public ArtifactCassandraDao artifactCassandraDao() {
- return new ArtifactCassandraDao();
+ public ArtifactCassandraDao artifactCassandraDao(CassandraClient cassandraClient) {
+ return new ArtifactCassandraDao(cassandraClient);
}
@Bean(name = "audit-cassandra-dao")
- public AuditCassandraDao auditCassandraDao() {
- return new AuditCassandraDao();
+ public AuditCassandraDao auditCassandraDao(CassandraClient cassandraClient) {
+ return new AuditCassandraDao(cassandraClient);
}
@Bean(name = "cassandra-client")
@@ -50,7 +50,7 @@ public class EsToCassandraDataMigrationConfig {
}
@Bean(name = "sdc-schema-files-cassandra-dao")
- public SdcSchemaFilesCassandraDao sdcSchemaFilesCassandraDao() {
- return new SdcSchemaFilesCassandraDao();
+ public SdcSchemaFilesCassandraDao sdcSchemaFilesCassandraDao(CassandraClient cassandraClient) {
+ return new SdcSchemaFilesCassandraDao(cassandraClient);
}
}
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
index 02b37b7d21..a1dec76354 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
@@ -64,8 +64,8 @@ public class ValidationToolConfiguration {
public ReportManager reportManager() { return new ReportManager();}
@Bean(name = "artifact-cassandra-dao")
- public ArtifactCassandraDao artifactCassandraDao() {
- return new ArtifactCassandraDao();
+ public ArtifactCassandraDao artifactCassandraDao(CassandraClient cassandraClient) {
+ return new ArtifactCassandraDao(cassandraClient);
}
@Bean
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java
index a18d644f08..a4906ed031 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfig.java
@@ -10,6 +10,7 @@ import org.openecomp.sdc.asdctool.migration.service.SdcRepoService;
import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder;
import org.openecomp.sdc.be.components.scheduledtasks.ComponentsCleanBusinessLogic;
import org.openecomp.sdc.be.config.CatalogModelSpringConfig;
+import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
import org.openecomp.sdc.be.dao.config.DAOSpringConfig;
import org.openecomp.sdc.config.CatalogBESpringConfig;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,8 +53,8 @@ public class MigrationSpringConfig {
}
@Bean(name = "sdc-migration-tasks-cassandra-dao")
- public MigrationTasksDao migrationTasksDao() {
- return new MigrationTasksDao();
+ public MigrationTasksDao migrationTasksDao(CassandraClient cassandraClient) {
+ return new MigrationTasksDao(cassandraClient);
}
@Bean(name = "serviceDistributionArtifactsBuilder")
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java
index e1144c14b5..c9473541d6 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDao.java
@@ -7,21 +7,30 @@ import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
import fj.data.Either;
import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
import org.openecomp.sdc.be.dao.cassandra.CassandraDao;
import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
import org.openecomp.sdc.be.resources.data.MigrationTaskEntry;
import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
import org.openecomp.sdc.common.log.wrappers.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.math.BigInteger;
+@Service
public class MigrationTasksDao extends CassandraDao {
private static Logger logger = Logger.getLogger(MigrationTasksDao.class.getName());
private MigrationTasksAccessor migrationTasksAccessor;
private Mapper<MigrationTaskEntry> migrationTaskMapper;
+ @Autowired
+ public MigrationTasksDao(CassandraClient cassandraClient){
+ super(cassandraClient);
+ }
+
@PostConstruct
public void init() {
String keyspace = AuditingTypesConstants.REPO_KEYSPACE;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfig.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfig.java
index 5ce4314361..8256a33ae3 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfig.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfig.java
@@ -13,7 +13,7 @@ public class ImportTableConfig {
}
@Bean(name = "operational-environment-dao")
- public OperationalEnvironmentDao operationalEnvironmentDao() {
- return new OperationalEnvironmentDao();
+ public OperationalEnvironmentDao operationalEnvironmentDao(CassandraClient cassandraClient) {
+ return new OperationalEnvironmentDao(cassandraClient);
}
}