aboutsummaryrefslogtreecommitdiffstats
path: root/blueprints-processor/adaptors/data-adaptor-provider/src
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-09-11 20:57:17 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-11 20:57:17 +0000
commit4490a4c1f86702cc55203c634d0914003eca6ea5 (patch)
treee51a4919a070db8c9a579c1274b7967c512b18ee /blueprints-processor/adaptors/data-adaptor-provider/src
parent5dfa696b46c79c64c429c66d2af911bd54a653d7 (diff)
parent78fc81bf6a35077b8ad80cf29b218477baa15a47 (diff)
Merge "Migrate features to Oxygen"
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src')
-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
2 files changed, 27 insertions, 24 deletions
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>