6d4099612f087ee77f0989ffe8d465687634f1cc
[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.intentBaseService.intentFunctionManageService.impl;
17
18 import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
19 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
20 import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IMFRegInfoService;
21 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
22 import org.onap.usecaseui.intentanalysis.mapper.IMFRegInfoMapper;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.context.ApplicationContext;
25 import org.springframework.stereotype.Service;
26
27 import java.lang.reflect.InvocationTargetException;
28 import java.util.List;
29
30 @Service("intentFunctionManageService")
31 public class IMFRegInfoServiceImpl implements IMFRegInfoService {
32     @Autowired
33     private ApplicationContext applicationContext;
34
35     @Autowired
36     private IMFRegInfoMapper imfRegInfoMapper;
37     @Override
38     public int createFunctionManage(IntentManagementFunctionRegInfo intentManage)  {
39         return 0;
40     }
41
42     @Override
43     public int deleteFunctionManage(String id) {
44         return 0;
45     }
46
47     @Override
48     public int updateIntentManageById(String id, IntentManagementFunctionRegInfo intentManage) {
49         return 0;
50     }
51
52     @Override
53     public List<IntentManagementFunctionRegInfo> getIntentManage() {
54         return null;
55     }
56
57     public List<IntentManagementFunction> filterHandleFunction(IntentManagementFunctionRegInfo managementRegInfo) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
58         String managetFunctionRegName =managementRegInfo.getHandleName();
59
60         IntentManagementFunction function =
61                 (IntentManagementFunction)applicationContext.getBean(managetFunctionRegName);
62
63         ActuationModule actuationModule = function.getActuationModule();
64         actuationModule.directOperation();
65         IntentManagementFunction intentManagementFunction =
66                 (IntentManagementFunction) Class.forName(managetFunctionRegName)
67                         .getDeclaredConstructor().newInstance();
68         ActuationModule actuationModule1 = intentManagementFunction.getActuationModule();
69         return null;
70     }
71
72 }