aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src')
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ConditionParentType.java32
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/OperatorType.java45
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Condition.java35
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Context.java7
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTarget.java2
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java7
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IMFRegInfoController.java (renamed from intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java)14
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IMFRegInfoService.java (renamed from intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IntentFunctionManageService.java)2
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/impl/IMFRegInfoServiceImpl.java (renamed from intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/impl/IntentFunctionManageServiceImpl.java)8
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/ConditionMapper.java36
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/IMFRegInfoMapper.java26
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/ConditionService.java41
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ConditionServiceImpl.java71
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ContextServiceImpl.java23
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationServiceImpl.java7
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationTargetServiceImpl.java8
16 files changed, 334 insertions, 30 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ConditionParentType.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ConditionParentType.java
new file mode 100644
index 0000000..6acd292
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ConditionParentType.java
@@ -0,0 +1,32 @@
+/*
+ * 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 ConditionParentType {
+ CONDITION(0, "condition"),
+ CONTEXT(1,"context"),
+ EXPECTATION_TARGET(2, "expectation_target");
+
+ private int index;
+
+ private String desc;
+
+ ConditionParentType(int index, String desc) {
+ this.index = index;
+ this.desc = desc;
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/OperatorType.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/OperatorType.java
new file mode 100644
index 0000000..9478c69
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/OperatorType.java
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+import lombok.Getter;
+
+@Getter
+public enum OperatorType {
+ OR(0,"or"),
+ GATHERTHAN(1,"gather than"),
+ EQUALTO(2,"equal to"),
+ LESSTHAN(3,"less than"),
+ NOTEQUALTO(4,"not euqal to"),
+ ONEOF(5,"one of"),
+ SOMEOF(6,"some of"),
+ MAXIMUMVALUE(7,"maximum value"),
+ MINIMUMVALUE(8,"minimum value"),
+ MEDIAN(9,"median"),
+ CREDIBILITY(10,"credibility"),
+ AND(11,"and");
+
+
+ private int index;
+
+ private String desc;
+
+ OperatorType(int index, String desc) {
+ this.index = index;
+ this.desc = desc;
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Condition.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Condition.java
new file mode 100644
index 0000000..33d295c
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Condition.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.OperatorType;
+
+import java.util.List;
+
+@Data
+public class Condition {
+ private String conditionId;
+
+ private String conditionName;
+
+ private OperatorType operator;
+
+ private String conditionValue;
+
+ private List<Condition> conditionList;
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Context.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Context.java
index 02aa2c2..bf36762 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Context.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Context.java
@@ -17,7 +17,8 @@
package org.onap.usecaseui.intentanalysis.bean.models;
import lombok.Data;
-import org.onap.usecaseui.intentanalysis.bean.enums.ContextType;
+
+import java.util.List;
@Data
@@ -27,8 +28,6 @@ public class Context {
private String contextName;
- private ContextType contextType;
-
- private String contextCondition;
+ private List<Condition> contextConditions;
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTarget.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTarget.java
index 412813d..70cc36b 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTarget.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTarget.java
@@ -29,7 +29,7 @@ public class ExpectationTarget {
private String targetName;
- private String targetCondition;
+ private List<Condition> targetConditions;
private List<Context> targetContexts;
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java
index 5ea8ef9..b137942 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java
@@ -26,10 +26,9 @@ import java.util.List;
public class IntentManagementFunctionRegInfo {
private String id;
private String description;
- private List<SupportArea> supportArea; //ͨ¹ýintentname cll ͨ¹ýintentName
- private String supportModel; // expectation expectationtarget targetCondition value
- private List<SupportInterface> supportInterfaces; //
+ private List<SupportArea> supportArea;
+ private String supportModel;
+ private List<SupportInterface> supportInterfaces;
private String handleName;
private IntentFunctionType intentFunctionType;//out or in
-
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IMFRegInfoController.java
index f36df23..c00103a 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentFunctionManageController.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IMFRegInfoController.java
@@ -19,7 +19,7 @@
package org.onap.usecaseui.intentanalysis.controller;
import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
-import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService;
+import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IMFRegInfoService;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -29,29 +29,29 @@ import java.util.List;
@RestController
@RequestMapping(value = "/intentFunctionManage")
-public class IntentFunctionManageController {
+public class IMFRegInfoController {
@Resource(name = "intentFunctionManageService")
- IntentFunctionManageService intentFunctionManageService;
+ IMFRegInfoService IMFRegInfoService;
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity createIntentManage(@RequestBody IntentManagementFunctionRegInfo intentManage) {
- return ResponseEntity.ok(intentFunctionManageService.createFunctionManage(intentManage));
+ return ResponseEntity.ok(IMFRegInfoService.createFunctionManage(intentManage));
}
@DeleteMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity deleteIntentManage(@PathVariable(value = "id") String id) {
- return ResponseEntity.ok(intentFunctionManageService.deleteFunctionManage(id));
+ return ResponseEntity.ok(IMFRegInfoService.deleteFunctionManage(id));
}
@PutMapping(value = "/{intentId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity updateIntentManageById(
@PathVariable(value = "id") String id, @RequestBody IntentManagementFunctionRegInfo intentManage) {
- return ResponseEntity.ok(intentFunctionManageService.updateIntentManageById(id, intentManage));
+ return ResponseEntity.ok(IMFRegInfoService.updateIntentManageById(id, intentManage));
}
@GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<IntentManagementFunctionRegInfo>> getIntentManageByID() {
- return ResponseEntity.ok(intentFunctionManageService.getIntentManage());
+ return ResponseEntity.ok(IMFRegInfoService.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/IMFRegInfoService.java
index 8a1f918..ead7a0c 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IntentFunctionManageService.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentFunctionManageService/IMFRegInfoService.java
@@ -19,7 +19,7 @@ import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionReg
import java.util.List;
-public interface IntentFunctionManageService {
+public interface IMFRegInfoService {
int createFunctionManage(IntentManagementFunctionRegInfo intentManage) ;
int deleteFunctionManage(String id);
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/IMFRegInfoServiceImpl.java
index 71a6914..cb21982 100644
--- 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/IMFRegInfoServiceImpl.java
@@ -17,8 +17,9 @@ package org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManage
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.intentFunctionManageService.IMFRegInfoService;
import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.ActuationModule;
+import org.onap.usecaseui.intentanalysis.mapper.IMFRegInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
@@ -27,9 +28,12 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List;
@Service("intentFunctionManageService")
-public class IntentFunctionManageServiceImpl implements IntentFunctionManageService {
+public class IMFRegInfoServiceImpl implements IMFRegInfoService {
@Autowired
private ApplicationContext applicationContext;
+
+ @Autowired
+ private IMFRegInfoMapper imfRegInfoMapper;
@Override
public int createFunctionManage(IntentManagementFunctionRegInfo intentManage) {
return 0;
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/ConditionMapper.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/ConditionMapper.java
new file mode 100644
index 0000000..6f3c642
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/ConditionMapper.java
@@ -0,0 +1,36 @@
+/*
+ * 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.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.onap.usecaseui.intentanalysis.bean.enums.ConditionParentType;
+import org.onap.usecaseui.intentanalysis.bean.models.Condition;
+
+import java.util.List;
+
+@Mapper
+public interface ConditionMapper {
+
+ void insertConditionList(@Param(value = "conditionList") List<Condition> conditionList);
+
+ void insertConditionParentList(@Param(value = "conditionList") List<Condition> conditionList,
+ @Param(value = "parentType") ConditionParentType conditionParentType,
+ @Param(value = "parentId") String parentId);
+
+ List<Condition> selectConditionByParentId(String parentId);
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/IMFRegInfoMapper.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/IMFRegInfoMapper.java
new file mode 100644
index 0000000..ca4318d
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/IMFRegInfoMapper.java
@@ -0,0 +1,26 @@
+/*
+ * 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.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo;
+
+@Mapper
+public interface IMFRegInfoMapper {
+ void insertIMFRegInfoRegInfo(@Param(value = "fulfilmentInfo") IntentManagementFunctionRegInfo imfregInfo);
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/ConditionService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/ConditionService.java
new file mode 100644
index 0000000..474fce2
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/ConditionService.java
@@ -0,0 +1,41 @@
+/*
+ * 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.service;
+
+import org.onap.usecaseui.intentanalysis.bean.enums.ConditionParentType;
+import org.onap.usecaseui.intentanalysis.bean.models.Condition;
+import org.springframework.stereotype.Service;
+
+
+import java.util.List;
+
+
+public interface ConditionService {
+
+ void createConditionList(List<Condition> cnditionList, ConditionParentType conditionParentType, String parentId);
+
+ void insertCondition(Condition condition, String parentId);
+
+ void deleteConditionListByParentId(String parentId);
+
+ void deleteConditionById(String conditionId);
+
+ void updateConditionListByParentId(List<Condition> conditionList, String parentId);
+
+ List<Condition> getConditionListByParentId(String parentId);
+
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ConditionServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ConditionServiceImpl.java
new file mode 100644
index 0000000..a553b90
--- /dev/null
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ConditionServiceImpl.java
@@ -0,0 +1,71 @@
+/*
+ * 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.service.impl;
+
+import org.onap.usecaseui.intentanalysis.bean.enums.ConditionParentType;
+import org.onap.usecaseui.intentanalysis.bean.models.Condition;
+import org.onap.usecaseui.intentanalysis.mapper.ConditionMapper;
+import org.onap.usecaseui.intentanalysis.service.ConditionService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class ConditionServiceImpl implements ConditionService {
+
+ private static Logger LOGGER = LoggerFactory.getLogger(ContextServiceImpl.class);
+
+ @Autowired
+ private ConditionMapper conditionMapper;
+
+ @Autowired
+ private ConditionService conditionService;
+
+ @Override
+ public void createConditionList(List<Condition> conditionList, ConditionParentType conditionParentType, String parentId) {
+ conditionMapper.insertConditionList(conditionList);
+ conditionMapper.insertConditionParentList(conditionList,conditionParentType,parentId);
+ }
+
+ @Override
+ public void insertCondition(Condition condition, String parentId) {
+
+ }
+
+ @Override
+ public void deleteConditionListByParentId(String parentId) {
+
+ }
+
+ @Override
+ public void deleteConditionById(String conditionId) {
+
+ }
+
+ @Override
+ public void updateConditionListByParentId(List<Condition> conditionList, String parentId) {
+
+ }
+
+ @Override
+ public List<Condition> getConditionListByParentId(String parentId) {
+ return conditionMapper.selectConditionByParentId(parentId);
+ }
+}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ContextServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ContextServiceImpl.java
index ff2b7da..c0f472d 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ContextServiceImpl.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ContextServiceImpl.java
@@ -17,32 +17,43 @@
package org.onap.usecaseui.intentanalysis.service.impl;
-import java.util.ArrayList;
-import java.util.List;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
+import org.onap.usecaseui.intentanalysis.bean.enums.ConditionParentType;
import org.onap.usecaseui.intentanalysis.bean.enums.ContextParentType;
import org.onap.usecaseui.intentanalysis.bean.models.Context;
import org.onap.usecaseui.intentanalysis.mapper.ContextMapper;
+import org.onap.usecaseui.intentanalysis.service.ConditionService;
import org.onap.usecaseui.intentanalysis.service.ContextService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
@Service
public class ContextServiceImpl implements ContextService {
- private static Logger LOGGER = LoggerFactory.getLogger(ContextServiceImpl.class);
+ static Logger LOGGER = LoggerFactory.getLogger(ContextServiceImpl.class);
+ private ConditionParentType conditionParentType;
@Autowired
private ContextMapper contextMapper;
@Autowired
private ContextService contextService;
+ @Autowired
+ private ConditionService conditionService;
+
@Override
public void createContextList(List<Context> contextList, ContextParentType contextParentType, String parentId) {
contextMapper.insertContextList(contextList);
+
+ for (Context context: contextList) {
+ conditionService.createConditionList(context.getContextConditions(),conditionParentType.CONTEXT,context.getContextId());
+ }
+
contextMapper.insertContextParentList(contextList, contextParentType, parentId);
}
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationServiceImpl.java
index 5fb7128..d5db0ca 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationServiceImpl.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationServiceImpl.java
@@ -20,6 +20,7 @@ package org.onap.usecaseui.intentanalysis.service.impl;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
+import org.onap.usecaseui.intentanalysis.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.onap.usecaseui.intentanalysis.bean.enums.ContextParentType;
@@ -28,11 +29,6 @@ import org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget;
import org.onap.usecaseui.intentanalysis.common.ResponseConsts;
import org.onap.usecaseui.intentanalysis.exception.DataBaseException;
import org.onap.usecaseui.intentanalysis.mapper.ExpectationMapper;
-import org.onap.usecaseui.intentanalysis.service.ContextService;
-import org.onap.usecaseui.intentanalysis.service.ExpectationService;
-import org.onap.usecaseui.intentanalysis.service.ExpectationObjectService;
-import org.onap.usecaseui.intentanalysis.service.ExpectationTargetService;
-import org.onap.usecaseui.intentanalysis.service.FulfilmentInfoService;
@Service
@@ -54,6 +50,7 @@ public class ExpectationServiceImpl implements ExpectationService {
@Autowired
private ContextService contextService;
+
@Autowired
private FulfilmentInfoService fulfilmentInfoService;
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationTargetServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationTargetServiceImpl.java
index f45ef30..87e8435 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationTargetServiceImpl.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ExpectationTargetServiceImpl.java
@@ -19,6 +19,9 @@ package org.onap.usecaseui.intentanalysis.service.impl;
import java.util.ArrayList;
import java.util.List;
+
+import org.onap.usecaseui.intentanalysis.bean.enums.ConditionParentType;
+import org.onap.usecaseui.intentanalysis.service.ConditionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,18 +41,22 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService {
private ContextParentType contextParentType;
+ private ConditionParentType conditionParentType;
@Autowired
private ExpectationTargetMapper expectationTargetMapper;
@Autowired
private ExpectationTargetService expectationTargetService;
+
@Autowired
private FulfilmentInfoService fulfilmentInfoService;
@Autowired
private ContextService contextService;
+ @Autowired
+ private ConditionService conditionService;
@Override
public void createTarget(ExpectationTarget expectationTarget, String expectationId) {
expectationTargetMapper.insertExpectationTarget(expectationTarget, expectationId);
@@ -58,6 +65,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService {
expectationTarget.getTargetId());
fulfilmentInfoService.createFulfilmentInfo(expectationTarget.getTargetFulfilmentInfo(),
expectationTarget.getTargetId());
+ conditionService.createConditionList(expectationTarget.getTargetConditions(),conditionParentType.EXPECTATION_TARGET,expectationId);
}
@Override