import java.util.List;
@Data
-public class IntentManagerRegInfo {
+public class IntentManagementFunctionRegInfo {
private String id;
private String description;
private List<SupportArea> supportArea;
import lombok.Data;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.intentModuleImpl.ActuationModuleImpl;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.intentModuleImpl.DecisoinModuleImpl;
-import org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.intentModuleImpl.KnownledgeModuleImpl;
+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;
-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();
- private KnowledgeModule knowledgeModule = new KnownledgeModuleImpl();
+ private ActuationModule actuationModule = new CLLBusinessActuationModule();
+ private DecisionModule decisoinModule = new CLLBusinessDecisionModule();
+ private KnowledgeModule knowledgeModule = new CLLBusinessKnowledgeModule();
}
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.intentModuleImpl;
+package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+import org.onap.usecaseui.intentanalysis.intentBaseService.IntentHandleService;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentProcessService;
import org.springframework.stereotype.Service;
@Service
-public class ActuationModuleImpl implements ActuationModule {
+public class CLLBusinessActuationModule implements ActuationModule {
@Autowired
IntentProcessService processService;
+ @Autowired
+ IntentHandleService intentHandleService;
+
@Override
- public void sendToIntentHandler(IntentManagementFunction intentHandler) {
- processService.setIntentRole(intentHandler, null);
- processService.intentProcess();
+ public void sendToIntentHandler(IntentManagementFunction IntentHandler) {
+
}
@Override
public void sendToNonIntentHandler() {
+
}
@Override
@Override
public void saveIntentToDb() {
+
}
}
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.intentModuleImpl;
+package org.onap.usecaseui.intentanalysis.cllBusinessIntentMgt.cllBusinessModule;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
import org.springframework.stereotype.Service;
@Service
-public class DecisoinModuleImpl implements DecisionModule {
+public class CLLBusinessDecisionModule implements DecisionModule {
@Override
public void determineUltimateGoal() {}
--- /dev/null
+/*
+ * 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.cllBusinessIntentMgt.cllBusinessModule;
+
+import org.onap.usecaseui.intentanalysis.bean.models.Expectation;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CLLBusinessKnowledgeModule implements KnowledgeModule {
+
+ @Override
+ public Intent intentCognition(Intent intent) {
+ intentResolution(intent);
+ //intentReportResolution();
+ getSystemStatus();
+ //interactWithIntentOwner();
+ determineDetectionGoal();
+ return null;
+ }
+
+ //find similar intents in DB
+ void intentResolution(Intent intent) {
+
+ }
+
+ void intentReportResolution() {
+ }
+
+
+ //query the implementation of intent requirements in the system
+ void getSystemStatus() {
+ }
+
+
+ void interactWithIntentOwner() {
+ }
+
+
+ //Determine add, delete, modify according to theobject,target and context of the expectation
+ void determineDetectionGoal() {
+ }
+
+}
+++ /dev/null
-/*
- * 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.cllBusinessIntentMgt.intentModuleImpl;
-
-import org.onap.usecaseui.intentanalysis.intentBaseService.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() {
-
- }
-}
import java.util.List;
+
+import org.onap.usecaseui.intentanalysis.intentBaseService.IntentHandleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@Autowired
private IntentService intentService;
+ @Autowired
+ private IntentHandleService intentHandleService;
+
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Intent>> getIntentList() {
return ResponseEntity.ok(intentService.getIntentList());
intentService.deleteIntentById(intentId);
}
+ @PostMapping(value="/handleIntent",produces = MediaType.APPLICATION_JSON_VALUE)
+ public void handleIntent(@RequestBody Intent intent) {
+ intentHandleService.handleOriginalIntent(intent);
+
+ }
}
package org.onap.usecaseui.intentanalysis.controller;
-import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
IntentFunctionManageService intentFunctionManageService;
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity createIntentManage(@RequestBody IntentManagerRegInfo intentManage) {
+ public ResponseEntity createIntentManage(@RequestBody IntentManagementFunctionRegInfo intentManage) {
return ResponseEntity.ok(intentFunctionManageService.createFunctionManage(intentManage));
}
@PutMapping(value = "/{intentId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity updateIntentManageById(
- @PathVariable(value = "id") String id, @RequestBody IntentManagerRegInfo intentManage) {
+ @PathVariable(value = "id") String id, @RequestBody IntentManagementFunctionRegInfo intentManage) {
return ResponseEntity.ok(intentFunctionManageService.updateIntentManageById(id, intentManage));
}
@GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<IntentManagerRegInfo>> getIntentManageByID() {
+ public ResponseEntity<List<IntentManagementFunctionRegInfo>> getIntentManageByID() {
return ResponseEntity.ok(intentFunctionManageService.getIntentManage());
}
--- /dev/null
+/*
+ * 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;
+
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
+import org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService.IntentProcessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+@Service
+public class IntentHandleService {
+ @Autowired
+ private IntentProcessService processService;
+
+ /**
+ * Process the original intent and find the corresponding IntentManagementFunction
+ * @param intent
+ */
+ public void handleOriginalIntent(Intent intent){
+ IntentManagementFunction intentOwner = selectIntentManagementFunction(intent);
+ handleIntent(intent,intentOwner);
+ }
+
+ public void handleIntent(Intent intent, IntentManagementFunction intentOwner) {
+ processService.setIntentRole(intentOwner, null);
+ processService.intentProcess(intent);
+ }
+
+ public IntentManagementFunction selectIntentManagementFunction(Intent intent) {
+ //select the IntentManagementFunctionRegInfo Based on the IMFRegistry information.
+ //Only internalFunction support.
+ //and based on the IntentManagementFunctionRegInfo, get the right IntentManagementFunction bean.
+ //if no IntentManagementFunction selected, that means this intent is not supported by this system.
+ return null;
+ }
+
+ public IntentManagementFunctionRegInfo selectIntentManagementFunctionRegInfo(Intent intent) {
+ //select the IntentManagementFunctionRegInfo Based on the IMFRegistry information.
+ //Both internalFunction and externalFunction support.
+ //This is used to get he IntentManagementFunction for a subIntent decomposition.
+ return null;
+ }
+}
*/
package org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService;
-import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
import java.util.List;
public interface IntentFunctionManageService {
- int createFunctionManage(IntentManagerRegInfo intentManage) ;
+ int createFunctionManage(IntentManagementFunctionRegInfo intentManage) ;
int deleteFunctionManage(String id);
- int updateIntentManageById(String id, IntentManagerRegInfo intentManage);
+ int updateIntentManageById(String id, IntentManagementFunctionRegInfo intentManage);
- List<IntentManagerRegInfo> getIntentManage();
+ List<IntentManagementFunctionRegInfo> getIntentManage();
}
*/
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.bean.models.IntentManagementFunctionRegInfo;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
@Autowired
private ApplicationContext applicationContext;
@Override
- public int createFunctionManage(IntentManagerRegInfo intentManage) {
+ public int createFunctionManage(IntentManagementFunctionRegInfo intentManage) {
return 0;
}
}
@Override
- public int updateIntentManageById(String id, IntentManagerRegInfo intentManage) {
+ public int updateIntentManageById(String id, IntentManagementFunctionRegInfo intentManage) {
return 0;
}
@Override
- public List<IntentManagerRegInfo> getIntentManage() {
+ public List<IntentManagementFunctionRegInfo> getIntentManage() {
return null;
}
- public List<IntentManagementFunction> filterHandleFunction(IntentManagerRegInfo managementRegInfo) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
+ public List<IntentManagementFunction> filterHandleFunction(IntentManagementFunctionRegInfo managementRegInfo) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
String managetFunctionRegName =managementRegInfo.getHandleName();
IntentManagementFunction function =
*/
package org.onap.usecaseui.intentanalysis.intentBaseService.intentModule;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
+
public interface KnowledgeModule {
- void intentResolution();
- void intentReportResolution();
- void getSystemStatus();
- void interactWithIntentOwner();
- //actuationModel & knownledgeModel interact
+ //Parse, decompose, orchestrate the original intent
+ Intent intentCognition(Intent intent);
}
*/
package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule;
import org.springframework.stereotype.Service;
}
}
- public void detectionProcess() {
+ public Intent detectionProcess(Intent intent) {
KnowledgeModule ownerKnowledgeModule = intentOwner.getKnowledgeModule();
- ownerKnowledgeModule.intentResolution();
- ownerKnowledgeModule.intentReportResolution();
- ownerKnowledgeModule.getSystemStatus();
- ownerKnowledgeModule.interactWithIntentOwner();
+ return ownerKnowledgeModule.intentCognition(intent);
}
}
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.DecisionModule;
import org.springframework.stereotype.Service;
+import java.util.List;
+
@Service
public class IntentInvestigationService {
private IntentManagementFunction intentHandler;
}
}
- public void investigationProcess() {
+ public List<IntentManagementFunction> investigationProcess() {
DecisionModule intentDecisionModule = intentOwner.getDecisionModule();
intentDecisionModule.needDecompostion();
intentDecisionModule.intentDecomposition();
intentDecisionModule.intentOrchestration();
intentDecisionModule.decideSuitableAction();
intentDecisionModule.exploreIntentHandlers();//返回handler
+ return null;
}
*/
package org.onap.usecaseui.intentanalysis.intentBaseService.intentProcessService;
+import org.onap.usecaseui.intentanalysis.bean.models.Intent;
import org.onap.usecaseui.intentanalysis.intentBaseService.IntentManagementFunction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.List;
+
@Service
public class IntentProcessService {
@Autowired
- IntentDetectionService intentDetectionServiceImpl;
+ IntentDetectionService intentDetectionService;
@Autowired
IntentInvestigationService intentInvestigationService;
@Autowired
this.intentHandler= intentHandler;
}
}
- public void intentProcess() {
- intentDetectionServiceImpl.setIntentRole(intentOwner,intentHandler);
- intentDetectionServiceImpl.detectionProcess();
+ public void intentProcess(Intent intent) {
+ intentDetectionService.setIntentRole(intentOwner,intentHandler);
+ Intent detectIntent = intentDetectionService.detectionProcess(intent);
//investigation process
intentInvestigationService.setIntentRole(intentOwner,intentHandler);
- intentInvestigationService.investigationProcess();//List<handler>?
+ List<IntentManagementFunction> intentManagementFunctions =
+ intentInvestigationService.investigationProcess();//List<handler>?
- //definition process
- intentDefinitionService.setIntentRole(intentOwner,intentHandler);
- intentDefinitionService.definitionPorcess();
+ for (IntentManagementFunction intentHandler : intentManagementFunctions) {
+ //definition process
+ intentDefinitionService.setIntentRole(intentOwner,intentHandler);
+ intentDefinitionService.definitionPorcess();
- //distribution process
- intentDistributionService.setIntentRole(intentOwner,intentHandler);
- intentDistributionService.distributionProcess();
+ //distribution process
+ intentDistributionService.setIntentRole(intentOwner,intentHandler);
+ intentDistributionService.distributionProcess();
- //operation process
- intentOperationService.setIntentRole(intentOwner,intentHandler);
- intentOperationService.operationProcess();
+ //operation process
+ intentOperationService.setIntentRole(intentOwner,intentHandler);
+ intentOperationService.operationProcess();
+ }
}