diff options
author | cmrizhangzhen <781953240@qq.com> | 2022-07-22 11:05:36 +0800 |
---|---|---|
committer | cmrizhangzhen <781953240@qq.com> | 2022-07-22 11:05:57 +0800 |
commit | 411dfd0c420ad82d698e2b383edbe6248e13ad5c (patch) | |
tree | dcd449404d5267e99bc28bed368fb435c67acc39 /intentanalysis | |
parent | 2a905d6fd39322fc5714dfc0f2dc3f44094daf23 (diff) |
add intentFunction manage
Issue-ID: USECASEUI-696
Signed-off-by: cmrizhangzhen <781953240@qq.com>
Change-Id: I7983c487a2920487f1caecc44ca376956d0e5239
Diffstat (limited to 'intentanalysis')
10 files changed, 340 insertions, 1 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/IntentFunctionType.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/IntentFunctionType.java new file mode 100644 index 0000000..c9d00a2 --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/IntentFunctionType.java @@ -0,0 +1,47 @@ +/* + * + * * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package org.onap.usecaseui.intentanalysis.bean.enums; + +public enum IntentFunctionType { + INTERNALFUNCTION(0,"internalFunction"), + EXTERNALFUNCTION(1,"externalFunction"); + private int type; + private String desc; + + IntentFunctionType(int type, String desc) { + this.type = type; + this.desc = desc; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportArea.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportArea.java new file mode 100644 index 0000000..5f1a003 --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportArea.java @@ -0,0 +1,47 @@ +/* + * + * * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ +package org.onap.usecaseui.intentanalysis.bean.enums; + +public enum SupportArea { + SLICING(0, "slicing"), + FEMALE(1, "5g"), + MALE(2, "4g"); + private int type; + private String desc; + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + SupportArea(int type, String desc) { + this.type = type; + this.desc = desc; + } +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportInterface.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportInterface.java new file mode 100644 index 0000000..a375e68 --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/SupportInterface.java @@ -0,0 +1,48 @@ +/* + * + * * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ +package org.onap.usecaseui.intentanalysis.bean.enums; + +public enum SupportInterface { + //CREATE,DELETE,UPDATE,SEARCH; + CREATE(0,"CREATE"), + DELETE(1,"DELETE"), + UPDATE(2,"UPDATE"), + SEARCH(3,"SEARCH"); + private int type; + private String name; + SupportInterface(int type, String name) { + this.type = type; + this.name = name; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagerRegInfo.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagerRegInfo.java new file mode 100644 index 0000000..24ef19e --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagerRegInfo.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.intentanalysis.bean.models; + +import lombok.Data; +import org.onap.usecaseui.intentanalysis.bean.enums.IntentFunctionType; +import org.onap.usecaseui.intentanalysis.bean.enums.SupportArea; +import org.onap.usecaseui.intentanalysis.bean.enums.SupportInterface; + +import java.util.List; + +@Data +public class IntentManagerRegInfo { + private String id; + private String description; + private List<SupportArea> supportArea; + private String supportModel; + private List<SupportInterface> supportInterfaces; + private String handleName; + private IntentFunctionType intentFunctionType; + +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/CLLBusinessIntentManagementFunction.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/CLLBusinessIntentManagementFunction.java index fc4696f..53e13e0 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/CLLBusinessIntentManagementFunction.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/CLLBusinessIntentManagementFunction.java @@ -24,8 +24,10 @@ import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.Actuatio import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule; import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule; import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction; +import org.springframework.stereotype.Component; @Data +@Component("CLLBusinessIntentManagementFunction") public class CLLBusinessIntentManagementFunction extends IntentManagementFunction { private ActuationModule actuationModule = new ActuationModuleImpl(); private DecisionModule decisoinModule = new DecisoinModuleImpl(); diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/intentModuleImpl/ActuationModuleImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/intentModuleImpl/ActuationModuleImpl.java index bb7fbb5..4d9eac7 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/intentModuleImpl/ActuationModuleImpl.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/intentModuleImpl/ActuationModuleImpl.java @@ -35,6 +35,7 @@ public class ActuationModuleImpl implements ActuationModule { @Override public void sendToNonIntentHandler() { + System.out.println("hahha"); } @Override diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java new file mode 100644 index 0000000..cd5ca8c --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java @@ -0,0 +1,57 @@ +/* + * + * * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package org.onap.usecaseui.intentanalysis.controller; + +import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo; +import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping(value = "/intentFunctionManage") +public class IntentFunctionManageController { + @Resource(name = "intentFunctionManageService") + IntentFunctionManageService intentFunctionManageService; + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity createIntentManage(@RequestBody IntentManagerRegInfo intentManage) { + return ResponseEntity.ok(intentFunctionManageService.createFunctionManage(intentManage)); + } + + @DeleteMapping(produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity deleteIntentManage(@PathVariable(value = "id") String id) { + return ResponseEntity.ok(intentFunctionManageService.deleteFunctionManage(id)); + } + + @PutMapping(value = "/{intentId}", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity updateIntentById( + @PathVariable(value = "id") String id, @RequestBody IntentManagerRegInfo intentManage) { + return ResponseEntity.ok(intentFunctionManageService.updateIntentById(id, intentManage)); + } + + @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity<List<IntentManagerRegInfo>> getIntentManageByID() { + return ResponseEntity.ok(intentFunctionManageService.getIntentManage()); + } + +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IntentFunctionManageService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IntentFunctionManageService.java new file mode 100644 index 0000000..b3a05b2 --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IntentFunctionManageService.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService; + +import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo; + +import java.util.List; + +public interface IntentFunctionManageService { + int createFunctionManage(IntentManagerRegInfo intentManage) ; + + int deleteFunctionManage(String id); + + int updateIntentById(String id, IntentManagerRegInfo intentManage); + + List<IntentManagerRegInfo> getIntentManage(); + +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/impl/IntentFunctionManageServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/impl/IntentFunctionManageServiceImpl.java new file mode 100644 index 0000000..edf4e7f --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/impl/IntentFunctionManageServiceImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.impl; + +import org.onap.usecaseui.intentanalysis.bean.models.Intent; +import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo; +import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction; +import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService; +import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; + +@Service("intentFunctionManageService") +public class IntentFunctionManageServiceImpl implements IntentFunctionManageService { + @Autowired + private ApplicationContext applicationContext; + + @Override + public int createFunctionManage(IntentManagerRegInfo intentManage) { + IntentManagementFunction intentManagementFunction = (IntentManagementFunction)applicationContext.getBean("CLLBusinessIntentManagementFunction"); + return 0; + } + + @Override + public int deleteFunctionManage(String id) { + return 0; + } + + @Override + public int updateIntentById(String id, IntentManagerRegInfo intentManage) { + return 0; + } + + @Override + public List<IntentManagerRegInfo> getIntentManage() { + return null; + } + + public List<IntentManagementFunction> filterHanleFunction(Intent intent) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { + String functionName ="CLLBusinessIntentManagementFunction"; + + IntentManagementFunction function = + (IntentManagementFunction)applicationContext.getBean(functionName); + + ActuationModule actuationModule = function.getActuationModule(); + actuationModule.sendToNonIntentHandler(); +// + IntentManagementFunction intentManagementFunction = + (IntentManagementFunction) Class.forName(functionName) + .getDeclaredConstructor().newInstance(); + ActuationModule actuationModule1 = intentManagementFunction.getActuationModule(); + return null; + } + +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionService.java index eb58546..4622aa1 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionService.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Service; @Service public class IntentDistributionService { - @Autowired private IntentManagementFunction intentHandler; private IntentManagementFunction intentOwner; |