aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-07-10 14:20:54 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-07-10 14:20:54 +0300
commitc72d565bb58226b20625b2bce5f0019046bee649 (patch)
tree8658e49595705b02e47ddc14afa20d6bb7123547 /vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java
parentef8a6b47847012fd59ea20da21d8d3d7c4a301ed (diff)
Merge 1806 code of vid-common
Change-Id: I75d52abed4a24dfe3827d79edc4a2938726aa87a Issue-ID: VID-208 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java b/vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java
new file mode 100644
index 000000000..7b999b404
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/config/JobAdapterConfig.java
@@ -0,0 +1,33 @@
+package org.onap.vid.config;
+
+
+import org.hibernate.SessionFactory;
+import org.onap.vid.job.JobAdapter;
+import org.onap.vid.job.JobsBrokerService;
+import org.onap.vid.job.impl.JobAdapterImpl;
+import org.onap.vid.job.impl.JobsBrokerServiceInDatabaseImpl;
+import org.onap.vid.properties.VidProperties;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@EnableTransactionManagement
+public class JobAdapterConfig {
+
+ @Bean
+ public JobAdapter jobAdapter() {
+ return new JobAdapterImpl();
+ }
+
+ @Bean
+ public JobsBrokerService jobsBrokerService(DataAccessService dataAccessService, SessionFactory sessionFactory) {
+ int maxOpenedInstantiationRequestsToMso = Integer.parseInt(SystemProperties.getProperty(VidProperties.MSO_MAX_OPENED_INSTANTIATION_REQUESTS));
+ int pollingIntervalSeconds = Integer.parseInt(SystemProperties.getProperty(VidProperties.MSO_ASYNC_POLLING_INTERVAL_SECONDS));
+
+ return new JobsBrokerServiceInDatabaseImpl(dataAccessService, sessionFactory, maxOpenedInstantiationRequestsToMso, pollingIntervalSeconds);
+ }
+
+}