From 78fc81bf6a35077b8ad80cf29b218477baa15a47 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Tue, 11 Sep 2018 14:38:13 -0400 Subject: Migrate features to Oxygen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic9db80e71070093209b8eda1cdd12e053a18aded Issue-ID: CCSDK-505 Signed-off-by: Alexis de Talhouët --- .../data/adaptor/dao/ConfigPropertyMapDaoImpl.java | 23 ++++++++++-------- .../org/opendaylight/blueprint/impl-blueprint.xml | 28 +++++++++++----------- 2 files changed, 27 insertions(+), 24 deletions(-) (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src/main') 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 @@ - - - - - - - - - - - - + + + + + + + + + + + + -- cgit 1.2.3-korg