2a33124eac1e94272f7e9af7bb5e26577ff59bef
[so.git] /
1 package org.onap.so.adapters.appc.orchestrator.service;
2
3 import javax.annotation.PostConstruct;
4 import org.onap.so.utils.ExternalTaskServiceUtils;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.context.annotation.Profile;
7 import org.springframework.core.env.Environment;
8 import org.springframework.stereotype.Component;
9
10 @Component
11 @Profile("!test")
12 public class ApplicationControllerTaskService {
13
14     @Autowired
15     public Environment env;
16
17     @Autowired
18     private ApplicationControllerTask appcOrchestrator;
19
20     @Autowired
21     private ExternalTaskServiceUtils externalTaskServiceUtils;
22
23     @PostConstruct
24     public void appcOrchestrator() throws Exception {
25         for (int i = 0; i < externalTaskServiceUtils.getMaxClients(); i++) {
26             externalTaskServiceUtils.createExternalTaskClient().subscribe("AppcService").lockDuration(604800000)
27                     .handler(appcOrchestrator::executeExternalTask).open();
28         }
29     }
30
31 }