summaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2018-09-11 14:38:13 -0400
committerAlexis de Talhouët <adetalhouet89@gmail.com>2018-09-11 15:59:30 -0400
commit78fc81bf6a35077b8ad80cf29b218477baa15a47 (patch)
tree833f9fecf7388aaa7d39c7e9e5ed8ba7850bd461 /blueprints-processor/adaptors
parentea45fbffab1f36271def9443fd32cdbd75839f7e (diff)
Migrate features to Oxygen
Change-Id: Ic9db80e71070093209b8eda1cdd12e053a18aded Issue-ID: CCSDK-505 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'blueprints-processor/adaptors')
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/pom.xml12
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigPropertyMapDaoImpl.java23
-rw-r--r--blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml28
-rw-r--r--blueprints-processor/adaptors/rest-adaptor-provider/pom.xml14
4 files changed, 28 insertions, 49 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/pom.xml b/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
index a965c7fcd..9454421d2 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
+++ b/blueprints-processor/adaptors/data-adaptor-provider/pom.xml
@@ -122,18 +122,6 @@
org.onap.ccsdk.config.data.adaptor.domain,
org.onap.ccsdk.config.data.adaptor.service
</Export-Package>
- <Import-Package>!*spring*,!joptsimple,!net.*,!bsh,
- !org.apache.commons.pool*,!org.apache.commons.fileupload*,!org.apache.http.*,!org.apache.logger*,
- !org.apache.lucene*,!org.apache.t*,!org.apache.derby*,!org.codehaus.groovy*,!org.custommonkey.xmlunit*,
- !org.hibernate*,!org.jruby*,!org.aspectj*,!org.mockito*,!org.openqa*,!org.skyscreamer*,!org.testng*,
- !com.caucho*,!com.gargoylesoftware*,!com.jamonapi*,!com.rometools*,!com.squareup*,!com.sun*,!groovy*,
- !javax.ejb*,!javax.enterprise*,!javax.faces*,!javax.in*,!javax.money*,!javax.portlet*,!javax.resource*,
- org.*,javax.*,com.google.gson*,com.google.common.*,*jackson*
- </Import-Package>
- <Embed-Dependency>
- *;groupId=!*eelf*|*opendaylight*|*ccsdk*|*osgi*|*jackson*|*json*|*powermock*|*junit*
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigPropertyMapDaoImpl.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigPropertyMapDaoImpl.java
index 423e01451..65e241e7d 100644
--- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigPropertyMapDaoImpl.java
+++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/config/data/adaptor/dao/ConfigPropertyMapDaoImpl.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.StringUtils;
import org.onap.ccsdk.config.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;
@@ -45,21 +46,23 @@ public class ConfigPropertyMapDaoImpl implements ConfigPropertyMapDao {
if (!(DataAdaptorConstants.PROPERTY_ENV_PROD.equalsIgnoreCase(envType)
|| DataAdaptorConstants.PROPERTY_ENV_SOLO.equalsIgnoreCase(envType))) {
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
- Runnable task = () -> {
- initializeMap();
- };
+ Runnable task = this::initializeMap;
executor.scheduleWithFixedDelay(task, 60, 15, TimeUnit.MINUTES);
}
}
private void initializeMap() {
- 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);
+ 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 (CannotGetJdbcConnectionException e) {
+ // WHAT TO DO?
+ }
}
@Override
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 4cf4d78cc..644fd77f4 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
@@ -24,20 +24,6 @@
<reference id="dataSource" interface="javax.sql.DataSource" />
- <!-- Expose the Common Component Bean -->
-
- <bean id="configResourceService"
- class="org.onap.ccsdk.config.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.config.data.adaptor.service.ConfigResourceService" />
-
<!-- Data SourceInitialisation -->
<bean id="config.dataSource"
@@ -81,4 +67,18 @@
<argument ref="jdbcTemplate" />
</bean>
+ <!-- Expose the Common Component Bean -->
+
+ <bean id="configResourceService"
+ class="org.onap.ccsdk.config.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.config.data.adaptor.service.ConfigResourceService" />
+
</blueprint>
diff --git a/blueprints-processor/adaptors/rest-adaptor-provider/pom.xml b/blueprints-processor/adaptors/rest-adaptor-provider/pom.xml
index d35f1c1a3..6f17a1cef 100644
--- a/blueprints-processor/adaptors/rest-adaptor-provider/pom.xml
+++ b/blueprints-processor/adaptors/rest-adaptor-provider/pom.xml
@@ -74,7 +74,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
- <version>1.12</version>
+ <version>1.17</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
@@ -176,18 +176,6 @@
org.onap.ccsdk.config.rest.adaptor.service,
org.onap.ccsdk.config.rest.adaptor.utils
</Export-Package>
- <Import-Package>!*spring*,!joptsimple,!net.*,!bsh,
- !org.apache.commons.pool*,!org.apache.commons.fileupload*,!org.apache.http.*,!org.apache.logger*,
- !org.apache.lucene*,!org.apache.t*,!org.apache.derby*,!org.codehaus.groovy*,!org.custommonkey.xmlunit*,
- !org.hibernate*,!org.jruby*,!org.aspectj*,!org.mockito*,!org.openqa*,!org.skyscreamer*,!org.testng*,
- !com.caucho*,!com.gargoylesoftware*,!com.jamonapi*,!com.rometools*,!com.squareup*,!com.sun*,!groovy*,
- !javax.ejb*,!javax.enterprise*,!javax.faces*,!javax.in*,!javax.money*,!javax.portlet*,!javax.resource*,
- org.*,javax.*,com.google.gson*,com.google.common.*,*jackson*
- </Import-Package>
- <Embed-Dependency>
- *;groupId=!*eelf*|*opendaylight*|*ccsdk*|*osgi*|*jackson*|*json*|*powermock*|*junit*
- </Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>