2 * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
18 import org.onap.usecaseui.intentanalysis.bean.models.Intent;
19 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
20 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
21 import org.onap.usecaseui.intentanalysis.service.IntentService;
22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.stereotype.Service;
25 import java.util.List;
29 public class IntentProcessService {
31 IntentDetectionService intentDetectionService;
33 IntentInvestigationService intentInvestigationService;
35 IntentDefinitionService intentDefinitionService;
37 IntentDistributionService intentDistributionService;
39 IntentOperationService intentOperationService;
41 IntentService intentService;
42 private IntentManagementFunction intentOwner;
43 private IntentManagementFunction intentHandler;
46 public void setIntentRole(IntentManagementFunction intentOwner, IntentManagementFunction intentHandler){
47 if (intentOwner!= null){
48 this.intentOwner = intentOwner;
50 if (intentHandler!= null){
51 this.intentHandler= intentHandler;
54 public void intentProcess(Intent intent) {
55 intentDetectionService.setIntentRole(intentOwner,intentHandler);
56 IntentGoalBean intentGoalBean = intentDetectionService.detectionProcess(intent);
58 //investigation process
59 intentInvestigationService.setIntentRole(intentOwner,intentHandler);
60 List<Map<IntentGoalBean,IntentManagementFunction>> intentListMap =
61 intentInvestigationService.investigationProcess(intentGoalBean);
64 for (Map<IntentGoalBean,IntentManagementFunction> map : intentListMap) {
65 //definition process save subintent
66 intentDefinitionService.setIntentRole(intentOwner,intentHandler);
67 intentDefinitionService.definitionPorcess(intentListMap);
69 //distribution process
70 intentDistributionService.setIntentRole(intentOwner,intentHandler);
71 intentDistributionService.distributionProcess(map);
74 intentOperationService.setIntentRole(intentOwner,intentHandler);
75 intentOperationService.operationProcess();