diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-06-27 12:35:47 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-07-07 08:22:31 +0000 |
commit | bf2ffad5b686eb0ffddbeeeca5824b8caea0c8ff (patch) | |
tree | 53e09d40e18b4aecff6f501633d374b87c4688be /catalog-dao/src/main/java/org | |
parent | 868746d27adc90efeba5909d3eb60a6e0cd24c27 (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 'catalog-dao/src/main/java/org')
6 files changed, 26 insertions, 13 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java index 8449e676ca..30da6bce6e 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ArtifactCassandraDao.java @@ -28,6 +28,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.resources.data.ESArtifactData; 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.Component; import javax.annotation.PostConstruct; @@ -38,8 +39,10 @@ public class ArtifactCassandraDao extends CassandraDao { private static Logger logger = Logger.getLogger(ArtifactCassandraDao.class.getName()); private ArtifactAccessor artifactAccessor; - public ArtifactCassandraDao() { - super(); + + @Autowired + public ArtifactCassandraDao(CassandraClient cassandraClient) { + super(cassandraClient); } diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDao.java index d5c8a19f06..7c27fc912a 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDao.java @@ -30,6 +30,7 @@ import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.cassandra.schema.Table; import org.openecomp.sdc.be.resources.data.auditing.*; import org.openecomp.sdc.common.log.wrappers.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -43,8 +44,9 @@ public class AuditCassandraDao extends CassandraDao { private static Logger logger = Logger.getLogger(AuditCassandraDao.class.getName()); - public AuditCassandraDao() { - super(); + @Autowired + public AuditCassandraDao(CassandraClient cassandraClient) { + super(cassandraClient); } @PostConstruct diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java index 284b91ac74..3eba7ae54a 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/CassandraDao.java @@ -27,7 +27,6 @@ import com.datastax.driver.core.querybuilder.QueryBuilder; import com.datastax.driver.mapping.MappingManager; import fj.data.Either; import org.openecomp.sdc.common.log.wrappers.Logger; -import org.springframework.beans.factory.annotation.Autowired; public abstract class CassandraDao { @@ -36,9 +35,12 @@ public abstract class CassandraDao { protected Session session; protected MappingManager manager; - @Autowired protected CassandraClient client; + public CassandraDao(CassandraClient cassandraClient) { + this.client = cassandraClient; + } + /** * the method checks if the given table is empty under the keyspace the * session was opened to. diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDao.java index 11643d16e8..7b23a9db41 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDao.java @@ -30,6 +30,7 @@ import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.resources.data.ComponentCacheData; 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.Component; import javax.annotation.PostConstruct; @@ -45,9 +46,10 @@ public class ComponentCassandraDao extends CassandraDao { private ComponentCacheAccessor componentCacheAccessor; - public ComponentCassandraDao() { - super(); + @Autowired + public ComponentCassandraDao(CassandraClient cassandraClient) { + super(cassandraClient); } @PostConstruct diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/OperationalEnvironmentDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/OperationalEnvironmentDao.java index 783eb9533b..9e1bfd8c35 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/OperationalEnvironmentDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/OperationalEnvironmentDao.java @@ -10,6 +10,7 @@ import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry; import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; import org.openecomp.sdc.common.log.enums.EcompLoggerErrorCode; import org.openecomp.sdc.common.log.wrappers.Logger; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -22,8 +23,9 @@ public class OperationalEnvironmentDao extends CassandraDao { private static Logger logger = Logger.getLogger(OperationalEnvironmentDao.class.getName()); private OperationalEnvironmentsAccessor operationalEnvironmentsAccessor; - public OperationalEnvironmentDao() { - super(); + @Autowired + public OperationalEnvironmentDao(CassandraClient cassandraClient) { + super(cassandraClient); } @PostConstruct diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDao.java index a9ca4e845b..76aaad95a5 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDao.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDao.java @@ -28,6 +28,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair; import org.openecomp.sdc.be.resources.data.SdcSchemaFilesData; 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.Component; import javax.annotation.PostConstruct; @@ -38,9 +39,10 @@ public class SdcSchemaFilesCassandraDao extends CassandraDao { private static Logger logger = Logger.getLogger(SdcSchemaFilesCassandraDao.class.getName()); private SdcSchemaFilesAccessor sdcSchemaFilesAccessor; - - public SdcSchemaFilesCassandraDao() { - super(); + + @Autowired + public SdcSchemaFilesCassandraDao(CassandraClient cassandraClient) { + super(cassandraClient); } @PostConstruct |