Add intent base operation process code . 12/130712/1
authorhekeguang <hekeguang@chinamobile.com>
Mon, 5 Sep 2022 01:33:18 +0000 (09:33 +0800)
committerhekeguang <hekeguang@chinamobile.com>
Mon, 5 Sep 2022 01:34:27 +0000 (09:34 +0800)
Issue-ID: USECASEUI-696
Change-Id: I73bfc202ab44041f33c5e1102fa3d7b8d38381f3
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
14 files changed:
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/CLLBusinessIntentManagementFunction.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessActuationModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessKnowledgeModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/CLLDeliveryManagementFunction.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentController.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/FormatIntentInputManagementFunction.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputActuationModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputKnowledgeModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/IntentManagementFunction.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentModule/KnowledgeModule.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDetectionService.java
intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessService.java

index 9061036..80ff29e 100644 (file)
@@ -26,12 +26,23 @@ import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.Decision
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
+
 @Data
 @Component("CLLBusinessIntentManagementFunction")
 public class CLLBusinessIntentManagementFunction extends IntentManagementFunction {
-    private ActuationModule actuationModule  = new CLLBusinessActuationModule();
-    private DecisionModule decisoinModule = new CLLBusinessDecisionModule();
-    private KnowledgeModule knowledgeModule = new CLLBusinessKnowledgeModule();
 
+    @Resource(name= "CLLBusinessActuationModule")
+    public void setActuationModule(ActuationModule actuationModule) {
+        this.actuationModule=actuationModule;
+    }
+    @Resource(name= "CLLBusinessKnowledgeModule")
+    public void setKnowledgeModule(KnowledgeModule knowledgeModule) {
+        this.knowledgeModule=knowledgeModule;
+    }
+    @Resource(name= "CLLBusinessDecisionModule")
+    public void setDecisionModule(DecisionModule decisionModule) {
+        this.decisionModule=decisionModule;
+    }
 
 }
index d2a5c53..ecd5b50 100644 (file)
@@ -16,8 +16,6 @@
 package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule;
 
 
-import org.apache.commons.lang.StringUtils;
-import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType;
 import org.onap.usecaseui.intentanalysis.bean.models.Intent;
 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
@@ -26,14 +24,14 @@ import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentinterfaceservice.IntentInterfaceService;
 import org.onap.usecaseui.intentanalysis.service.IntentService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
-@Service
+@Component
 public class CLLBusinessActuationModule extends ActuationModule {
     @Autowired
     IntentProcessService processService;
index 564429b..6428742 100644 (file)
@@ -30,13 +30,16 @@ import org.onap.usecaseui.intentanalysis.service.ImfRegInfoService;
 import org.onap.usecaseui.intentanalysis.util.CommonUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.Component;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @Log4j2
-@Service
+@Component
 public class CLLBusinessDecisionModule extends DecisionModule {
     @Autowired
     private ImfRegInfoService imfRegInfoService;
index d93f3f5..d2c984d 100644 (file)
  */
 package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule;
 
-import org.apache.commons.collections.CollectionUtils;
 import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType;
-import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
-import org.onap.usecaseui.intentanalysis.bean.models.Expectation;
-import org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget;
 import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentDetectionService;
 import org.onap.usecaseui.intentanalysis.service.IntentService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
-@Service
+@Component
 public class CLLBusinessKnowledgeModule extends KnowledgeModule {
     private static Logger LOGGER = LoggerFactory.getLogger(CLLBusinessKnowledgeModule.class);
 
index 40baf41..76b0cf5 100644 (file)
  */
 package org.onap.usecaseui.intentanalysis.clldeliveryIntentmgt;
 
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessActuationModule;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessDecisionModule;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessKnowledgeModule;
 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
-import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
-import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
-import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
 
 public class CLLDeliveryManagementFunction extends IntentManagementFunction {
-    private ActuationModule actuationModule  = new CLLBusinessActuationModule();
-    private DecisionModule decisoinModule = new CLLBusinessDecisionModule();
-    private KnowledgeModule knowledgeModule = new CLLBusinessKnowledgeModule();
 }
index 4983298..41d2d2a 100644 (file)
@@ -40,6 +40,8 @@ public class IntentController {
 
     @Autowired
     private IntentProcessService processService;
+    @Autowired
+    FormatIntentInputManagementFunction formatIntentInputManagementFunction;
 
     @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity<List<Intent>> getIntentList() {
@@ -71,8 +73,7 @@ public class IntentController {
 
     @PostMapping(value="/handleIntent",produces = MediaType.APPLICATION_JSON_VALUE)
     public void handleIntent(@RequestBody Intent intent) {
-        processService.setIntentRole(new FormatIntentInputManagementFunction(), null);
+        processService.setIntentRole(formatIntentInputManagementFunction, null);
         processService.intentProcess(intent);
-
     }
 }
index 235d638..ebbe9b8 100644 (file)
  */
 package org.onap.usecaseui.intentanalysis.formatintentinputMgt;
 
+import lombok.Data;
+import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessActuationModule;
+import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessDecisionModule;
+import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule.CLLBusinessKnowledgeModule;
 import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputActuationModule;
 import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputDecisionModule;
 import org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinputModule.FormatIntentInputKnowledgeModule;
@@ -22,9 +26,25 @@ import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunct
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
+
+@Data
+@Component("formatIntentInputManagementFunction")
 public class FormatIntentInputManagementFunction extends IntentManagementFunction {
-    private ActuationModule actuationModule  = new FormatIntentInputActuationModule();
-    private DecisionModule decisoinModule = new FormatIntentInputDecisionModule();
-    private KnowledgeModule knowledgeModule = new FormatIntentInputKnowledgeModule();
+
+    @Resource(name= "formatIntentInputKnowledgeModule")
+    public void setKnowledgeModule(KnowledgeModule knowledgeModule) {
+        this.knowledgeModule=knowledgeModule;
+    }
+    @Resource(name= "formatIntentInputActuationModule")
+    public void setKnowledgeModule(ActuationModule actuationModule) {
+        this.actuationModule=actuationModule;
+    }
+    @Resource(name= "formatIntentInputDecisionModule")
+    public void setKnowledgeModule(DecisionModule decisionModule) {
+        this.decisionModule=decisionModule;
+    }
 }
index 936bf0e..df8e714 100644 (file)
@@ -18,10 +18,11 @@ package org.onap.usecaseui.intentanalysis.formatintentinputMgt.formatintentinput
 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
+import org.springframework.stereotype.Component;
 
 import java.util.List;
 import java.util.Map;
-
+@Component
 public class FormatIntentInputActuationModule extends ActuationModule {
     @Override
     public void sendToIntentHandler(IntentManagementFunction IntentHandler) {
index ac116fd..f49326a 100644 (file)
@@ -23,11 +23,12 @@ import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunct
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Component;
 
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
-
+@Component
 public class FormatIntentInputDecisionModule extends DecisionModule {
     @Autowired
     ApplicationContext applicationContext;
index 4fa9ee2..22edc86 100644 (file)
@@ -20,13 +20,18 @@ import org.onap.usecaseui.intentanalysis.bean.models.Intent;
 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentDetectionService;
+import org.onap.usecaseui.intentanalysis.service.IntentService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
 import java.util.List;
 
+@Component
 public class FormatIntentInputKnowledgeModule extends KnowledgeModule {
     @Autowired
     IntentDetectionService intentDetectionService;
+    @Autowired
+    IntentService intentService;
 
     @Override
     public IntentGoalBean intentCognition(Intent intent) {
index 550051e..387d728 100644 (file)
@@ -21,11 +21,13 @@ 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.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
 
 @Data
 @Configuration
+@Component
 public class IntentManagementFunction {
-    private ActuationModule actuationModule;
-    private DecisionModule decisionModule;
-    private KnowledgeModule knowledgeModule;
+    protected ActuationModule actuationModule;
+    protected DecisionModule decisionModule;
+    protected KnowledgeModule knowledgeModule;
 }
index 133ce37..02d467a 100644 (file)
@@ -19,7 +19,10 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.onap.usecaseui.intentanalysis.bean.models.*;
 import org.onap.usecaseui.intentanalysis.service.IntentService;
+import org.onap.usecaseui.intentanalysis.service.impl.IntentServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -27,10 +30,9 @@ import java.util.stream.Collectors;
 
 public abstract class KnowledgeModule {
     @Autowired
-    IntentService intentService;
+    private IntentService intentService;
     //Parse, decompose, orchestrate the original intent
    public  abstract IntentGoalBean intentCognition(Intent intent);
-
     // in distribution, ask permission from imf
     public abstract boolean recieveCreateIntent();
     public abstract boolean recieveUpdateIntent();
index 389f7ce..60c4f74 100644 (file)
  */
 package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
 
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.StringUtils;
-import org.onap.usecaseui.intentanalysis.bean.enums.OperatorType;
-import org.onap.usecaseui.intentanalysis.bean.models.*;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
 import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
-import org.onap.usecaseui.intentanalysis.service.IntentService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
 @Service
 public class IntentDetectionService {
 
     private IntentManagementFunction intentHandler;
     private IntentManagementFunction intentOwner;
-    @Autowired
-    IntentService intentService;
 
     public void setIntentRole(IntentManagementFunction intentOwner, IntentManagementFunction intentHandler) {
         if (intentOwner != null) {
index 5d4a5dc..537f582 100644 (file)
@@ -18,6 +18,7 @@ package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService
 import org.onap.usecaseui.intentanalysis.bean.models.Intent;
 import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean;
 import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
+import org.onap.usecaseui.intentanalysis.service.IntentService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -36,7 +37,8 @@ public class IntentProcessService {
     IntentDistributionService intentDistributionService;
     @Autowired
     IntentOperationService intentOperationService;
-
+@Autowired
+    IntentService intentService;
     private IntentManagementFunction intentOwner;
     private IntentManagementFunction intentHandler;