f2a14a56f95eca5451f7c60ad9785311cca6bcdc
[usecase-ui/intent-analysis.git] /
1 package org.onap.usecaseui.intentanalysis.intentProcessService;
2
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.stereotype.Service;
5
6 @Service
7 public class IntentProcessService {
8     @Autowired
9     IntentDetectionService intentDetectionServiceImpl;
10     @Autowired
11     IntentInvestigationService intentInvestigationService;
12     @Autowired
13     IntentDefinitionService intentDefinitionService;
14     @Autowired
15     IntentDistributionService intentDistributionService;
16     @Autowired
17     IntentOperationService intentOperationService;
18
19     private Function intentOwner;
20     private Function intentHandler;
21
22
23     public void setIntentRole(Function intentOwner,Function intentHandler){
24         if (intentOwner!= null){
25             this.intentOwner = intentOwner;
26         }
27         if (intentHandler!= null){
28             this.intentHandler= intentHandler;
29         }
30     }
31     public void intentProcess() {
32         intentDetectionServiceImpl.setIntentRole(intentOwner,intentHandler);
33         intentDetectionServiceImpl.detectionProcess();
34
35         //investigation process
36         intentInvestigationService.setIntentRole(intentOwner,intentHandler);
37         intentInvestigationService.investigationProcess();//List<handler>?
38
39         //definition process
40         intentDefinitionService.setIntentRole(intentOwner,intentHandler);
41         intentDefinitionService.definitionPorcess();
42
43         //distribution process
44         intentDistributionService.setIntentRole(intentOwner,intentHandler);
45         intentDistributionService.distributionProcess();
46
47         //operation process
48         intentOperationService.setIntentRole(intentOwner,intentHandler);
49         intentOperationService.operationProcess();
50     }
51
52
53 }