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