3e60bf5a52bc388a4203cc15bd92d252c2d316cd
[usecase-ui/intent-analysis.git] /
1 /*
2  * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.usecaseui.intentanalysis.cllassuranceIntentmgt.cllassurancemodule;
17
18 import java.util.List;
19 import org.onap.usecaseui.intentanalysis.bean.models.Expectation;
20 import org.onap.usecaseui.intentanalysis.bean.models.Intent;
21 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
22 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
23 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
24 import org.springframework.stereotype.Component;
25
26 import java.util.LinkedHashMap;
27 @Component
28 public class CLLAssuranceDecisionModule extends DecisionModule {
29     @Override
30     public void determineUltimateGoal() {
31
32     }
33
34     @Override
35     public void updateIntentInfo(Intent originIntent, IntentGoalBean intentGoalBean){
36
37     }
38
39     @Override
40     public IntentManagementFunction exploreIntentHandlers(IntentGoalBean intentGoalBean) {
41         return null;
42     }
43
44
45     @Override
46     public void decideSuitableAction() {
47
48     }
49
50     @Override
51     public void interactWithTemplateDb() {
52
53     }
54
55     @Override
56     public LinkedHashMap<IntentGoalBean, IntentManagementFunction> findHandler(IntentGoalBean intentGoalBean) {
57         return null;
58     }
59
60     @Override
61     public void updateIntentWithOriginIntent(Intent originIntent, Intent intent){
62         List<Expectation> originIntentExpectationList =  originIntent.getIntentExpectations();
63
64         String instanceId = "";
65         for (Expectation expectation : originIntentExpectationList) {
66             if (expectation.getExpectationName().contains("assurance")){
67                 instanceId = expectation.getExpectationObject().getObjectInstance();
68                 break;
69             }
70         }
71
72         for (Expectation expectation : intent.getIntentExpectations()) {
73             expectation.getExpectationObject().setObjectInstance(instanceId);
74         }
75     }
76 }