Repository: incubator-unomi Updated Branches: refs/heads/feature-DMF-1343 9203d36f4 -> 993652a3f
DMF-1343 : Handle transforming an import config oneshot <--> recurrent Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/993652a3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/993652a3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/993652a3 Branch: refs/heads/feature-DMF-1343 Commit: 993652a3f47c9cd4d6755f72226c66576d25e5d3 Parents: 9203d36 Author: Abdelkader Midani <amid...@apache.org> Authored: Mon May 29 12:14:20 2017 +0200 Committer: Abdelkader Midani <amid...@apache.org> Committed: Mon May 29 12:14:20 2017 +0200 ---------------------------------------------------------------------- .../core/context/ProfileImportCamelContext.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/993652a3/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/context/ProfileImportCamelContext.java ---------------------------------------------------------------------- diff --git a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/context/ProfileImportCamelContext.java b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/context/ProfileImportCamelContext.java index 2f3eaad..df734d3 100644 --- a/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/context/ProfileImportCamelContext.java +++ b/extensions/router/router-core/src/main/java/org/apache/unomi/router/core/context/ProfileImportCamelContext.java @@ -54,6 +54,8 @@ public class ProfileImportCamelContext implements SynchronousBundleListener { private String uploadDir; private Map<String, String> kafkaProps; + private final String IMPORT_CONFIG_TYPE_RECURRENT = "recurrent"; + private BundleContext bundleContext; public void setBundleContext(BundleContext bundleContext) { @@ -109,11 +111,14 @@ public class ProfileImportCamelContext implements SynchronousBundleListener { if(route!=null && stopRoute(importConfiguration.getItemId())) { camelContext.removeRoute(importConfiguration.getItemId()); } - ProfileImportSourceToKafkaRouteBuilder builder = new ProfileImportSourceToKafkaRouteBuilder(kafkaProps); - builder.setImportConfigurationList(Arrays.asList(importConfiguration)); - builder.setJacksonDataFormat(jacksonDataFormat); - builder.setContext(camelContext); - camelContext.addRoutes(builder); + //Handle transforming an import config oneshot <--> recurrent + if(IMPORT_CONFIG_TYPE_RECURRENT.equals(importConfiguration.getConfigType())){ + ProfileImportSourceToKafkaRouteBuilder builder = new ProfileImportSourceToKafkaRouteBuilder(kafkaProps); + builder.setImportConfigurationList(Arrays.asList(importConfiguration)); + builder.setJacksonDataFormat(jacksonDataFormat); + builder.setContext(camelContext); + camelContext.addRoutes(builder); + } } public CamelContext getCamelContext() {