aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src
diff options
context:
space:
mode:
authorcmrizhangzhen <781953240@qq.com>2022-07-14 19:11:40 +0800
committerzhen zhang <781953240@qq.com>2022-07-15 02:54:01 +0000
commitec022d2b08c4a5bd74d62e35cc03c32fe845da7a (patch)
tree2f2fd6551dedd2e06bb1f3247a654582aa9687d6 /intentanalysis/src
parent61921b6736371405813269eb657ec2ea4841e43b (diff)
add base code for intentanalysis
Issue-ID: USECASEUI-696 Signed-off-by: cmrizhangzhen <781953240@qq.com> Change-Id: Id74af93a493bcf61ac868dac920b387c3708abbb
Diffstat (limited to 'intentanalysis/src')
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/IntentAnalysisManagementFunction.java20
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/ActuationModuleImpl.java33
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/DecisoinModuleImpl.java39
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/KnownledgeModuleImpl.java21
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/ActuationModule.java13
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/DecisionModule.java23
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/KnowledgeModule.java9
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/Function.java14
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDefinitionService.java29
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDetectionService.java29
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDistributionService.java29
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentInvestigationService.java30
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentOperationService.java33
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentProcessService.java53
14 files changed, 375 insertions, 0 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/IntentAnalysisManagementFunction.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/IntentAnalysisManagementFunction.java
new file mode 100644
index 0000000..c1b1174
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/IntentAnalysisManagementFunction.java
@@ -0,0 +1,20 @@
+package org.onap.usecaseui.intentanalysis.intentAnalysisService;
+
+
+import lombok.Data;
+import org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl.ActuationModuleImpl;
+import org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl.DecisoinModuleImpl;
+import org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl.KnownledgeModuleImpl;
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.onap.usecaseui.intentanalysis.intentModule.KnowledgeModule;
+import org.onap.usecaseui.intentanalysis.intentProcessService.Function;
+
+@Data
+public class IntentAnalysisManagementFunction extends Function {
+ private ActuationModule actuationModule = new ActuationModuleImpl();
+ private DecisionModule decisoinModule = new DecisoinModuleImpl();
+ private KnowledgeModule knowledgeModule = new KnownledgeModuleImpl();
+
+
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/ActuationModuleImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/ActuationModuleImpl.java
new file mode 100644
index 0000000..e6e99e8
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/ActuationModuleImpl.java
@@ -0,0 +1,33 @@
+package org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl;
+
+
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentProcessService.Function;
+import org.onap.usecaseui.intentanalysis.intentProcessService.IntentProcessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ActuationModuleImpl implements ActuationModule {
+ @Autowired
+ IntentProcessService processService;
+
+ @Override
+ public void sendToIntentHandler(Function intentHandler) {
+ processService.setIntentRole(intentHandler, null);
+ processService.intentProcess();
+ }
+
+ @Override
+ public void sendToNonIntentHandler() {
+ }
+
+ @Override
+ public void interactWithIntentHandle() {
+
+ }
+
+ @Override
+ public void saveIntentToDb() {
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/DecisoinModuleImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/DecisoinModuleImpl.java
new file mode 100644
index 0000000..2a54549
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/DecisoinModuleImpl.java
@@ -0,0 +1,39 @@
+package org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl;
+
+
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.onap.usecaseui.intentanalysis.intentProcessService.Function;
+import org.springframework.stereotype.Service;
+
+@Service
+public class DecisoinModuleImpl implements DecisionModule {
+ @Override
+ public void determineUltimateGoal() {}
+
+ @Override
+ public Function exploreIntentHandlers() {
+
+ return null;
+
+ }
+
+ @Override
+ public void intentDefinition() {}
+
+ @Override
+ public void decideSuitableAction() {}
+
+ @Override
+ public boolean needDecompostion() {
+ return false;
+ }
+
+ @Override
+ public void intentDecomposition() {}
+
+ @Override
+ public void intentOrchestration() {}
+
+ @Override
+ public void interactWithTemplateDb() {}
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/KnownledgeModuleImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/KnownledgeModuleImpl.java
new file mode 100644
index 0000000..2940c1e
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentAnalysisService/intentModuleImpl/KnownledgeModuleImpl.java
@@ -0,0 +1,21 @@
+package org.onap.usecaseui.intentanalysis.intentAnalysisService.intentModuleImpl;
+
+import org.onap.usecaseui.intentanalysis.intentModule.KnowledgeModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class KnownledgeModuleImpl implements KnowledgeModule {
+ @Override
+ public void intentResolution() {}
+
+ @Override
+ public void intentReportResolution() {}
+
+ @Override
+ public void getSystemStatus() {}
+
+ @Override
+ public void interactWithIntentOwner() {
+
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/ActuationModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/ActuationModule.java
new file mode 100644
index 0000000..1db3d0e
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/ActuationModule.java
@@ -0,0 +1,13 @@
+package org.onap.usecaseui.intentanalysis.intentModule;
+
+import org.onap.usecaseui.intentanalysis.intentProcessService.Function;
+
+public interface ActuationModule {
+ //actuationModel & knownledgeModel interact
+ void sendToIntentHandler(Function IntentHandler);
+ void sendToNonIntentHandler();//直接操作
+ void interactWithIntentHandle();
+ //Save intent information to the intent instance database
+ void saveIntentToDb();
+
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/DecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/DecisionModule.java
new file mode 100644
index 0000000..5379176
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/DecisionModule.java
@@ -0,0 +1,23 @@
+package org.onap.usecaseui.intentanalysis.intentModule;
+
+
+import org.onap.usecaseui.intentanalysis.intentProcessService.Function;
+
+public interface DecisionModule {
+ void determineUltimateGoal();//
+ Function exploreIntentHandlers();
+ void intentDefinition();
+ void decideSuitableAction();
+
+ //confirm whether the intent needs to be decomposed and orchestrated
+ public boolean needDecompostion();
+
+ //call decomposition module
+ public void intentDecomposition();
+
+ //call orchestration module
+ public void intentOrchestration();
+
+
+ public void interactWithTemplateDb();
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/KnowledgeModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/KnowledgeModule.java
new file mode 100644
index 0000000..d22697d
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentModule/KnowledgeModule.java
@@ -0,0 +1,9 @@
+package org.onap.usecaseui.intentanalysis.intentModule;
+
+public interface KnowledgeModule {
+ void intentResolution();
+ void intentReportResolution();
+ void getSystemStatus();
+ void interactWithIntentOwner();
+ //actuationModel & knownledgeModel interact
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/Function.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/Function.java
new file mode 100644
index 0000000..a7b7be6
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/Function.java
@@ -0,0 +1,14 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+
+import lombok.Data;
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.onap.usecaseui.intentanalysis.intentModule.KnowledgeModule;
+
+@Data
+public class Function {
+ private ActuationModule actuationModule;
+ private DecisionModule decisionModule;
+ private KnowledgeModule knowledgeModule;
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDefinitionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDefinitionService.java
new file mode 100644
index 0000000..cc9b8a5
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDefinitionService.java
@@ -0,0 +1,29 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentDefinitionService {
+
+ private Function intentHandler;
+ private Function intentOwner;
+
+ public void setIntentRole(Function intentOwner, Function intentHandler) {
+ if (intentOwner != null) {
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler != null) {
+ this.intentHandler = intentHandler;
+ }
+ }
+
+ public void definitionPorcess() {
+ DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
+ ActuationModule intentActuationModule = intentOwner.getActuationModule();
+ intentDecisionModule.intentDefinition();
+ intentActuationModule.saveIntentToDb();
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDetectionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDetectionService.java
new file mode 100644
index 0000000..7b71bd7
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDetectionService.java
@@ -0,0 +1,29 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+import org.onap.usecaseui.intentanalysis.intentModule.KnowledgeModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentDetectionService {
+
+ private Function intentHandler;
+ private Function intentOwner;
+
+ public void setIntentRole(Function intentOwner,Function intentHandler){
+ if (intentOwner!= null){
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler!= null){
+ this.intentHandler= intentHandler;
+ }
+ }
+
+ public void detectionProcess() {
+ KnowledgeModule ownerKnowledgeModule = intentOwner.getKnowledgeModule();
+ ownerKnowledgeModule.intentResolution();
+ ownerKnowledgeModule.intentReportResolution();
+ ownerKnowledgeModule.getSystemStatus();
+ ownerKnowledgeModule.interactWithIntentOwner();
+
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDistributionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDistributionService.java
new file mode 100644
index 0000000..5b45487
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentDistributionService.java
@@ -0,0 +1,29 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentDistributionService {
+ @Autowired
+ private Function intentHandler;
+ private Function intentOwner;
+
+ public void setIntentRole(Function intentOwner,Function intentHandler){
+ if (intentOwner!= null){
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler!= null){
+ this.intentHandler= intentHandler;
+ }
+ }
+
+ public void distributionProcess() {
+ ActuationModule intentActuationModule = intentHandler.getActuationModule();
+
+ intentActuationModule.sendToIntentHandler(intentHandler);
+ }
+
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentInvestigationService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentInvestigationService.java
new file mode 100644
index 0000000..21d2b6d
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentInvestigationService.java
@@ -0,0 +1,30 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentInvestigationService {
+ private Function intentHandler;
+ private Function intentOwner;
+
+ public void setIntentRole(Function intentOwner,Function intentHandler){
+ if (intentOwner!= null){
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler!= null){
+ this.intentHandler= intentHandler;
+ }
+ }
+
+ public void investigationProcess() {
+ DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
+ intentDecisionModule.needDecompostion();
+ intentDecisionModule.intentDecomposition();
+ intentDecisionModule.intentOrchestration();
+ intentDecisionModule.decideSuitableAction();
+ intentDecisionModule.exploreIntentHandlers();//返回handler
+ }
+
+
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentOperationService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentOperationService.java
new file mode 100644
index 0000000..6618793
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentOperationService.java
@@ -0,0 +1,33 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+
+import org.onap.usecaseui.intentanalysis.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.intentModule.DecisionModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentOperationService {
+
+ private Function intentHandler;
+ private Function intentOwner;
+
+ public void setIntentRole(Function intentOwner,Function intentHandler){
+ if (intentOwner!= null){
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler!= null){
+ this.intentHandler= intentHandler;
+ }
+ }
+
+ public void operationProcess() {
+ DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
+ ActuationModule intentActuationModule = intentOwner.getActuationModule();
+
+ intentDecisionModule.interactWithTemplateDb();
+ intentActuationModule.interactWithIntentHandle();
+ intentActuationModule.sendToIntentHandler(intentHandler);
+
+ intentActuationModule.sendToNonIntentHandler();
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentProcessService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentProcessService.java
new file mode 100644
index 0000000..f2a14a5
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentProcessService/IntentProcessService.java
@@ -0,0 +1,53 @@
+package org.onap.usecaseui.intentanalysis.intentProcessService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class IntentProcessService {
+ @Autowired
+ IntentDetectionService intentDetectionServiceImpl;
+ @Autowired
+ IntentInvestigationService intentInvestigationService;
+ @Autowired
+ IntentDefinitionService intentDefinitionService;
+ @Autowired
+ IntentDistributionService intentDistributionService;
+ @Autowired
+ IntentOperationService intentOperationService;
+
+ private Function intentOwner;
+ private Function intentHandler;
+
+
+ public void setIntentRole(Function intentOwner,Function intentHandler){
+ if (intentOwner!= null){
+ this.intentOwner = intentOwner;
+ }
+ if (intentHandler!= null){
+ this.intentHandler= intentHandler;
+ }
+ }
+ public void intentProcess() {
+ intentDetectionServiceImpl.setIntentRole(intentOwner,intentHandler);
+ intentDetectionServiceImpl.detectionProcess();
+
+ //investigation process
+ intentInvestigationService.setIntentRole(intentOwner,intentHandler);
+ intentInvestigationService.investigationProcess();//List<handler>?
+
+ //definition process
+ intentDefinitionService.setIntentRole(intentOwner,intentHandler);
+ intentDefinitionService.definitionPorcess();
+
+ //distribution process
+ intentDistributionService.setIntentRole(intentOwner,intentHandler);
+ intentDistributionService.distributionProcess();
+
+ //operation process
+ intentOperationService.setIntentRole(intentOwner,intentHandler);
+ intentOperationService.operationProcess();
+ }
+
+
+}