diff options
Diffstat (limited to 'blueprints-processor/adaptors')
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>
|