aboutsummaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors/data-adaptor-provider
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2018-09-14 16:03:35 -0400
committerSingal, Kapil (ks220y) <ks220y@att.com>2018-09-14 17:47:16 -0400
commitb1248f701a8428d9e0df45af18e306a7e4545669 (patch)
tree8ff27543470d43892fa19317b0d4f91ccd9867fd /blueprints-processor/adaptors/data-adaptor-provider
parent43b4f3fc292fa69361065ca3343e5e37eb41c209 (diff)
SDN Controller Blueprint Processor
Removing Config Property Map Table and Dao Implementation Reformatting Codebase as per Onap Code Style Change-Id: I0841d5173aa40268e3451fd793826835c74fec77 Issue-ID: CCSDK-572 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider')
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/pom.xml226
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java33
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java74
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java1
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java1
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java49
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java10
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java12
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml34
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql10
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java53
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java6
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java6
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql88
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml29
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml5
16 files changed, 172 insertions, 465 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/pom.xml b/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
index 0de0bab0a..99a1f923e 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
@@ -1,125 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2017-2018 AT&T Intellectual Property.
- Modifications Copyright © 2018 IBM.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
+<!-- Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright
+ © 2018 IBM. Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License. You may
+ obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>binding-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
+ <parent>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath />
+ </parent>
- <groupId>org.onap.ccsdk.features</groupId>
- <version>0.3.0-SNAPSHOT</version>
- <artifactId>blueprints-data-adaptor-provider</artifactId>
- <packaging>bundle</packaging>
- <name>Blueprints Data Adaptor - Provider</name>
- <url>http://maven.apache.org</url>
+ <groupId>org.onap.ccsdk.features</groupId>
+ <version>0.3.0-SNAPSHOT</version>
+ <artifactId>blueprints-data-adaptor-provider</artifactId>
+ <packaging>bundle</packaging>
+ <name>Blueprints Data Adaptor - Provider</name>
+ <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons.lang3.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-provider</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>org.mariadb.jdbc</groupId>
- <artifactId>mariadb-java-client</artifactId>
- <version>${mariadb.connector.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>com.att.eelf</groupId>
- <artifactId>eelf-core</artifactId>
- <version>${eelf.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${h2database.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>${commons.lang3.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>${mariadb.connector.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>${h2database.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <additionalparam>-Xdoclint:none</additionalparam>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${maven.bundle.version}</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Name>${project.artifactId}</Bundle-Name>
- <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
- <Export-Package>org.onap.ccsdk.features.data.adaptor,
- org.onap.ccsdk.features.data.adaptor.dao,
- org.onap.ccsdk.features.data.adaptor.db,
- org.onap.ccsdk.features.data.adaptor.domain,
- org.onap.ccsdk.features.data.adaptor.service
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam>-Xdoclint:none</additionalparam>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${maven.bundle.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Name>${project.artifactId}</Bundle-Name>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>org.onap.ccsdk.features.data.adaptor,
+ org.onap.ccsdk.features.data.adaptor.dao,
+ org.onap.ccsdk.features.data.adaptor.db,
+ org.onap.ccsdk.features.data.adaptor.domain,
+ org.onap.ccsdk.features.data.adaptor.service
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java
deleted file mode 100644
index 4a77f7f05..000000000
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-
-public interface ConfigPropertyMapDao {
-
- /**
- * Query ConcurrentHashMap having CONFIG_PROPERTY_MAP table data for given key.
- *
- * @param key key mapped to a value
- * @return the result string, containing mapped string value
- * @throws org.onap.ccsdk.sli.core.sli.SvcLogicException if fails
- */
- public String getConfigPropertyByKey(String key) throws SvcLogicException;
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java
deleted file mode 100644
index 90f92ca27..000000000
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang3.StringUtils;
-import org.onap.ccsdk.features.data.adaptor.DataAdaptorConstants;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.springframework.jdbc.CannotGetJdbcConnectionException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.google.common.base.Preconditions;
-
-public class ConfigPropertyMapDaoImpl implements ConfigPropertyMapDao {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigPropertyMapDaoImpl.class);
-
- private JdbcTemplate jdbcTemplate;
- private Map<String, String> configPropertyMap = new ConcurrentHashMap<>();
-
- public ConfigPropertyMapDaoImpl(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- initializeMap();
-
- String envType = configPropertyMap.get(DataAdaptorConstants.PROPERTY_ENV_TYPE);
- if (!(DataAdaptorConstants.PROPERTY_ENV_PROD.equalsIgnoreCase(envType)
- || DataAdaptorConstants.PROPERTY_ENV_SOLO.equalsIgnoreCase(envType))) {
- ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
- Runnable task = this::initializeMap;
- executor.scheduleWithFixedDelay(task, 60, 15, TimeUnit.MINUTES);
- }
- }
-
- private void initializeMap() {
- try {
- String getPropQuery = "SELECT * FROM CONFIG_PROPERTY_MAP";
- jdbcTemplate.queryForList(getPropQuery).forEach(rows -> {
- String key = StringUtils.trimToEmpty((String) rows.get("reference_key"));
- String value = StringUtils.trimToEmpty((String) rows.get("reference_value"));
- configPropertyMap.put(key, value);
- });
- logger.trace("loaded configPropertyMap : ({})", configPropertyMap);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- @Override
- public String getConfigPropertyByKey(String key) throws SvcLogicException {
- Preconditions.checkArgument(StringUtils.isNotBlank(key), "missing property key");
- return configPropertyMap.get(key);
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java
index 5e50d6f5f..bc33d51a3 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java
@@ -18,7 +18,6 @@
package org.onap.ccsdk.features.data.adaptor.dao;
import java.util.List;
-
import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java
index c9c5f8a73..c0381a989 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java
@@ -18,7 +18,6 @@
package org.onap.ccsdk.features.data.adaptor.dao;
import java.util.List;
-
import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java
deleted file mode 100644
index d9503b3be..000000000
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.features.data.adaptor.domain;
-
-import java.io.Serializable;
-
-public class ConfigPropertyMapData implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private String referenceKey;
- private String referenceValue;
-
- public String getReferenceKey() {
- return referenceKey;
- }
-
- public void setReferenceKey(String referenceKey) {
- this.referenceKey = referenceKey;
- }
-
- public String getReferenceValue() {
- return referenceValue;
- }
-
- public void setReferenceValue(String referenceValue) {
- this.referenceValue = referenceValue;
- }
-
- @Override
- public String toString() {
- return "ConfigPropertyMapData [referenceKey=" + referenceKey + ", referenceValue=" + referenceValue + "]";
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java
index 2f01749a3..cbd9e9279 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java
@@ -19,7 +19,6 @@ package org.onap.ccsdk.features.data.adaptor.service;
import java.util.List;
import java.util.Map;
-
import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -128,15 +127,6 @@ public interface ConfigResourceService {
public ConfigResource saveConfigResource(ConfigResource configResource) throws SvcLogicException;
/**
- * Query ConcurrentHashMap having CONFIG_PROPERTY_MAP table data for given key.
- *
- * @param key key mapped to a value
- * @return the result string, containing mapped string value
- * @throws org.onap.ccsdk.sli.core.sli.SvcLogicException if fails
- */
- public String getConfigPropertyByKey(String key) throws SvcLogicException;
-
- /**
* Query CONFIG_TRANSACTION_LOG table for given request_id, mapping each row to a Java object via a
* TransactionLog RowMapper.
*
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java
index bf1990377..ab24f16c7 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java
@@ -19,8 +19,6 @@ package org.onap.ccsdk.features.data.adaptor.service;
import java.util.List;
import java.util.Map;
-
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
@@ -40,19 +38,16 @@ public class ConfigResourceServiceImpl implements ConfigResourceService {
private ConfigResourceDao configResourceDao;
private QueryExecutorDao queryExecutorDao;
private NamedQueryExecutorDao namedQueryExecutorDao;
- private ConfigPropertyMapDao configPropertyMapDao;
@SuppressWarnings("squid:S00107")
public ConfigResourceServiceImpl(TransactionLogDao transactionLogDao, ConfigResourceDao configResourceDao,
- QueryExecutorDao queryExecutorDao, NamedQueryExecutorDao namedQueryExecutorDao,
- ConfigPropertyMapDao configPropertyMapDao) {
+ QueryExecutorDao queryExecutorDao, NamedQueryExecutorDao namedQueryExecutorDao) {
logger.info("{} Constuctor Initated...", CLASS_NAME);
this.transactionLogDao = transactionLogDao;
this.configResourceDao = configResourceDao;
this.queryExecutorDao = queryExecutorDao;
this.namedQueryExecutorDao = namedQueryExecutorDao;
- this.configPropertyMapDao = configPropertyMapDao;
}
@Override
@@ -106,9 +101,4 @@ public class ConfigResourceServiceImpl implements ConfigResourceService {
return configResourceDao.save(configResource);
}
- @Override
- public String getConfigPropertyByKey(String key) throws SvcLogicException {
- return configPropertyMapDao.getConfigPropertyByKey(key);
- }
-
}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
index e38bcd3ce..76459d51d 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml
@@ -1,20 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2017-2018 AT&T Intellectual Property.
- Modifications Copyright © 2018 IBM.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
+<!-- Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright
+ © 2018 IBM. Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License. You may
+ obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the License. -->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
@@ -62,23 +54,17 @@
<argument ref="namedParameterJdbcTemplate" />
</bean>
- <bean id="configPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <argument ref="jdbcTemplate" />
- </bean>
-
<!-- Expose the Common Component Bean -->
<bean id="configResourceService"
- class="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceServiceImpl">
+ class="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceServiceImpl">
<argument ref="transactionLogDao" />
<argument ref="configResourceDao" />
<argument ref="queryExecutorDao" />
<argument ref="namedQueryExecutorDao" />
- <argument ref="configPropertyMapDao" />
</bean>
<service ref="configResourceService"
- interface="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService" />
+ interface="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService" />
</blueprint>
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql
index 593f347de..efcd415e3 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql
@@ -6,7 +6,6 @@ DROP TABLE sdnctl.CONFIG_RESOURCE_ASSIGNMENT_DATA;
DROP TABLE sdnctl.CONFIG_RESOURCE;
DROP TABLE sdnctl.CONFIG_RESOURCE_RELATION;
DROP TABLE sdnctl.CONFIG_TRANSACTION_LOG
-DROP TABLE sdnctl.CONFIG_PROPERTY_MAP
-- -----------------------------------------------------
@@ -95,12 +94,3 @@ CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_RESOURCE_ASSIGNMENT_DATA (
ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
--- -----------------------------------------------------
--- table sdnctl.CONFIG_PROPERTY_MAP
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_PROPERTY_MAP (
- reference_key VARCHAR(100) NOT NULL,
- reference_value VARCHAR(250) NOT NULL,
- CONSTRAINT PK_CONFIG_PROPERTY_MAP PRIMARY KEY (reference_key)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java
deleted file mode 100644
index 1915017a6..000000000
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import org.junit.Assert;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.MethodSorters;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
-import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {"classpath:test-context-h2db.xml"})
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class ConfigPropertyMapDaoTest {
-
- @Autowired
- private ConfigPropertyMapDao configPropertyMapDao;
-
- @Autowired
- private QueryExecutorDao queryExecutorDao;
-
- @Test
- public void testConfigResourcesData() throws Exception {
- String sql = "INSERT INTO CONFIG_PROPERTY_MAP (reference_key, reference_value) VALUES ( ?, ?)";
- Object[] data = new Object[] {"dummy123", "username123"};
- int result = queryExecutorDao.update(sql, data);
- Assert.assertNotNull("Failed to get Query Result", result);
-
- String propKeyValye = configPropertyMapDao.getConfigPropertyByKey("org.onap.ccsdk.features.rest.adaptors.test");
- Assert.assertNull("propKeyValue is null", propKeyValye);
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
index 53724c5c9..61a2e3196 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceNodeTest.java
@@ -24,7 +24,6 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.ccsdk.features.data.adaptor.DataAdaptorConstants;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
@@ -58,13 +57,10 @@ public class ConfigResourceNodeTest {
@Autowired
NamedQueryExecutorDao namedQueryExecutorDao;
- @Autowired
- ConfigPropertyMapDao configPropertyMapDao;
-
@Before
public void before() {
configResourceService = new ConfigResourceServiceImpl(transactionLogDao, configResourceDao, queryExecutorDao,
- namedQueryExecutorDao, configPropertyMapDao);
+ namedQueryExecutorDao);
configResourceNode = new ConfigResourceNode(configResourceService);
}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
index 2d599e2f1..cecede810 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceTest.java
@@ -29,7 +29,6 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDaoTest;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
@@ -62,13 +61,10 @@ public class ConfigResourceServiceTest {
@Autowired
NamedQueryExecutorDao namedQueryExecutorDao;
- @Autowired
- ConfigPropertyMapDao configPropertyMapDao;
-
@Before
public void before() {
configResourceService = new ConfigResourceServiceImpl(transactionLogDao, configResourceDao, queryExecutorDao,
- namedQueryExecutorDao, configPropertyMapDao);
+ namedQueryExecutorDao);
}
@Test
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
index 15d22e242..af7f02c51 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/sql/schema.sql
@@ -1,46 +1,42 @@
-
-CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE (
- config_resource_id VARCHAR(50) PRIMARY KEY,
- resource_id VARCHAR(50) NOT NULL,
- resource_type VARCHAR(50) NOT NULL,
- service_template_name VARCHAR(50) NULL DEFAULT NULL,
- service_template_version VARCHAR(50) NULL DEFAULT NULL,
- template_name VARCHAR(50) NOT NULL,
- recipe_name VARCHAR(50) NOT NULL,
- request_id VARCHAR(50) NOT NULL,
- resource_data LONGTEXT NULL DEFAULT NULL,
- mask_data LONGTEXT NULL DEFAULT NULL,
- created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- status VARCHAR(20) NOT NULL,
- updated_by VARCHAR(50) NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE_ASSIGNMENT_DATA (
- config_resource_assignment_data_id VARCHAR(50) PRIMARY KEY,
- config_resource_id VARCHAR(50) NOT NULL,
- version INT(11) NOT NULL,
- updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- updated_by VARCHAR(50) NOT NULL,
- template_key_name VARCHAR(50) NOT NULL,
- resource_name VARCHAR(50) NOT NULL,
- data_type VARCHAR(100) NOT NULL,
- entry_schema VARCHAR(100) NULL DEFAULT NULL,
- resource_value LONGTEXT NOT NULL,
- source VARCHAR(50) NOT NULL,
- status VARCHAR(50) NOT NULL,
- message LONGTEXT NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_TRANSACTION_LOG (
- config_transaction_log_id VARCHAR(50) PRIMARY KEY,
- request_id VARCHAR(50) NULL DEFAULT NULL,
- message_type VARCHAR(100) NULL DEFAULT NULL,
- creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- message LONGTEXT NULL DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS CONFIG_PROPERTY_MAP (
- reference_key VARCHAR(100) NOT NULL,
- reference_value VARCHAR(250) NOT NULL
-);
-
+
+CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE (
+ config_resource_id VARCHAR(50) PRIMARY KEY,
+ resource_id VARCHAR(50) NOT NULL,
+ resource_type VARCHAR(50) NOT NULL,
+ service_template_name VARCHAR(50) NULL DEFAULT NULL,
+ service_template_version VARCHAR(50) NULL DEFAULT NULL,
+ template_name VARCHAR(50) NOT NULL,
+ recipe_name VARCHAR(50) NOT NULL,
+ request_id VARCHAR(50) NOT NULL,
+ resource_data LONGTEXT NULL DEFAULT NULL,
+ mask_data LONGTEXT NULL DEFAULT NULL,
+ created_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ status VARCHAR(20) NOT NULL,
+ updated_by VARCHAR(50) NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS CONFIG_RESOURCE_ASSIGNMENT_DATA (
+ config_resource_assignment_data_id VARCHAR(50) PRIMARY KEY,
+ config_resource_id VARCHAR(50) NOT NULL,
+ version INT(11) NOT NULL,
+ updated_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updated_by VARCHAR(50) NOT NULL,
+ template_key_name VARCHAR(50) NOT NULL,
+ resource_name VARCHAR(50) NOT NULL,
+ data_type VARCHAR(100) NOT NULL,
+ entry_schema VARCHAR(100) NULL DEFAULT NULL,
+ resource_value LONGTEXT NOT NULL,
+ source VARCHAR(50) NOT NULL,
+ status VARCHAR(50) NOT NULL,
+ message LONGTEXT NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS CONFIG_TRANSACTION_LOG (
+ config_transaction_log_id VARCHAR(50) PRIMARY KEY,
+ request_id VARCHAR(50) NULL DEFAULT NULL,
+ message_type VARCHAR(100) NULL DEFAULT NULL,
+ creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ message LONGTEXT NULL DEFAULT NULL
+);
+
+
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
index baffb54e6..9e413b099 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context-h2db.xml
@@ -1,20 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright © 2017-2018 AT&T Intellectual Property.
- Modifications Copyright © 2018 IBM.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
+<!-- Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright
+ © 2018 IBM. Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License. You may
+ obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software distributed
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ the specific language governing permissions and limitations under the License. -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -57,11 +49,6 @@
<constructor-arg ref="jdbcTemplate" />
</bean>
- <bean id="configPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <constructor-arg ref="jdbcTemplate" />
- </bean>
-
<bean id="queryExecutorDao"
class="org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDaoImpl">
<constructor-arg ref="jdbcTemplate" />
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
index ee3d33120..59af664b1 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/test/resources/test-context.xml
@@ -75,11 +75,6 @@
<constructor-arg ref="jdbcTemplate" />
</bean>
- <bean id="ConfigPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <constructor-arg ref="jdbcTemplate" />
- </bean>
-
<bean id="queryExecutorDao"
class="org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDaoImpl">
<constructor-arg ref="jdbcTemplate" />