diff options
Diffstat (limited to 'intentanalysis/src/main')
20 files changed, 186 insertions, 186 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/FulfilmentStatus.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/FulfillmentStatus.java index 7038022..82914c8 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/FulfilmentStatus.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/FulfillmentStatus.java @@ -20,7 +20,7 @@ import lombok.Getter; import lombok.Setter; @Getter -public enum FulfilmentStatus { +public enum FulfillmentStatus { FULFILLED(0, "fulfilled"), NOT_FULFILLED(1, "not_fulfilled"); @@ -28,7 +28,7 @@ public enum FulfilmentStatus { private String desc; - FulfilmentStatus(int index, String desc) { + FulfillmentStatus(int index, String desc) { this.index = index; this.desc = desc; } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/NotFulfilledState.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/NotFulfilledState.java index efa3581..b99806b 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/NotFulfilledState.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/NotFulfilledState.java @@ -26,7 +26,7 @@ public enum NotFulfilledState { DEGRADED(2, "degraded"), SUSPENDED(3, "suspended"), TERMINATED(4, "terminated"), - FULFILMENTFAILED(5, "fulfilmentfailed"); + FULFILMENTFAILED(5, "fulfillmentfailed"); private int index; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Expectation.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Expectation.java index 7ebeec2..84c5a78 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Expectation.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Expectation.java @@ -40,5 +40,5 @@ public class Expectation { private List<Context> expectationContexts; - private FulfilmentInfo expectationFulfilmentInfo; + private FulfillmentInfo expectationFulfillmentInfo; } 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 70cc36b..1c6e145 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 @@ -33,5 +33,5 @@ public class ExpectationTarget { private List<Context> targetContexts; - private FulfilmentInfo targetFulfilmentInfo; + private FulfillmentInfo targetFulfillmentInfo; } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfo.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/FulfillmentInfo.java index 52e391c..dbd908e 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfo.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/FulfillmentInfo.java @@ -17,15 +17,15 @@ package org.onap.usecaseui.intentanalysis.bean.models; import lombok.Data; -import org.onap.usecaseui.intentanalysis.bean.enums.FulfilmentStatus; +import org.onap.usecaseui.intentanalysis.bean.enums.FulfillmentStatus; import org.onap.usecaseui.intentanalysis.bean.enums.NotFulfilledState; @Data -public class FulfilmentInfo { +public class FulfillmentInfo { private String fulfillmentId; - private FulfilmentStatus fulfillmentStatus; + private FulfillmentStatus fulfillmentStatus; private NotFulfilledState notFulfilledState; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Intent.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Intent.java index 46c4acb..9b6c9d7 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Intent.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/Intent.java @@ -33,7 +33,7 @@ public class Intent { private List<Context> intentContexts; - private FulfilmentInfo intentFulfilmentInfo; + private FulfillmentInfo intentFulfillmentInfo; private IntentGenerateType intentGenerateType; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentReport.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentReport.java index 016fb66..5dfc7a8 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentReport.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentReport.java @@ -24,7 +24,7 @@ import java.util.List; public class IntentReport { private String intentReportId; private String intentReference; - private List<FulfilmentInfo> fulfillmentInfos; + private List<FulfillmentInfo> fulfillmentInfos; private List<String> objectInstance; private Date reportTime; } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java index 4ec76e7..9975ef3 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt/cllBusinessModule/CLLBusinessDecisionModule.java @@ -108,7 +108,7 @@ public class CLLBusinessDecisionModule extends DecisionModule { subIntent.setIntentName(objEntry.getValue().get(0).getExpectationName().replace("Expectation", "Intent")); subIntent.setIntentExpectations(objEntry.getValue()); subIntent.setIntentGenerateType(IntentGenerateType.SYSTEMGENARATE); - //TODO intentFulfilmentInfo intentContexts + //TODO intentFulfillmentInfo intentContexts subIntentGoalBean.setIntentGoalType(intentGoalType); subIntentGoalBean.setIntent(subIntent); subIntentGoalList.add(subIntentGoalBean); diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentReportController.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentReportController.java index 4d7369f..a4dbb45 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentReportController.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller/IntentReportController.java @@ -16,7 +16,7 @@ package org.onap.usecaseui.intentanalysis.controller; import lombok.extern.log4j.Log4j2; -import org.onap.usecaseui.intentanalysis.bean.enums.FulfilmentStatus; +import org.onap.usecaseui.intentanalysis.bean.enums.FulfillmentStatus; import org.onap.usecaseui.intentanalysis.bean.enums.NotFulfilledState; import org.onap.usecaseui.intentanalysis.bean.models.*; import org.springframework.http.MediaType; @@ -51,15 +51,15 @@ public class IntentReportController { //report.setFulfillmentInfos(); LocalDateTime now = LocalDateTime.now(); report.setReportTime(Date.from( now.atZone( ZoneId.systemDefault()).toInstant())); - FulfilmentInfo fu1= new FulfilmentInfo(); - fu1.setFulfillmentId("fulfilmentInfo1"); - fu1.setFulfillmentStatus(FulfilmentStatus.FULFILLED); - FulfilmentInfo fu2= new FulfilmentInfo(); - fu2.setFulfillmentId("fulfilmentInfo2"); - fu2.setFulfillmentStatus(FulfilmentStatus.NOT_FULFILLED); + FulfillmentInfo fu1= new FulfillmentInfo(); + fu1.setFulfillmentId("fulfillmentInfo1"); + fu1.setFulfillmentStatus(FulfillmentStatus.FULFILLED); + FulfillmentInfo fu2= new FulfillmentInfo(); + fu2.setFulfillmentId("fulfillmentInfo2"); + fu2.setFulfillmentStatus(FulfillmentStatus.NOT_FULFILLED); fu2.setNotFulfilledState(NotFulfilledState.DEGRADED); fu2.setNotFulfilledReason("not fulfilled Reason"); - List<FulfilmentInfo> list = new ArrayList<>(); + List<FulfillmentInfo> list = new ArrayList<>(); list.add(fu1); list.add(fu2); report.setFulfillmentInfos(list); diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/FulfilmentInfoMapper.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/FulfillmentInfoMapper.java index 278e3ab..bd09776 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/FulfilmentInfoMapper.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper/FulfillmentInfoMapper.java @@ -19,19 +19,19 @@ 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.FulfilmentInfo; +import org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo; @Mapper -public interface FulfilmentInfoMapper { +public interface FulfillmentInfoMapper { - int insertFulfilmentInfo(@Param(value = "fulfilmentInfo") FulfilmentInfo fulfilmentInfo, + int insertFulfillmentInfo(@Param(value = "fulfillmentInfo") FulfillmentInfo fulfillmentInfo, @Param(value = "parentId") String parentId); - FulfilmentInfo selectFulfilmentInfo(@Param(value = "parentId") String parentId); + FulfillmentInfo selectFulfillmentInfo(@Param(value = "parentId") String parentId); - int updateFulfilmentInfo(@Param(value = "fulfilmentInfo") FulfilmentInfo fulfilmentInfo, + int updateFulfillmentInfo(@Param(value = "fulfillmentInfo") FulfillmentInfo fulfillmentInfo, @Param(value = "parentId") String parentId); - int deleteFulfilmentInfo(@Param(value = "parentId") String parentId); + int deleteFulfillmentInfo(@Param(value = "parentId") String parentId); } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/FulfilmentInfoService.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/FulfillmentInfoService.java index 0692462..5532c6c 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/FulfilmentInfoService.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/FulfillmentInfoService.java @@ -16,15 +16,15 @@ package org.onap.usecaseui.intentanalysis.service; -import org.onap.usecaseui.intentanalysis.bean.models.FulfilmentInfo; +import org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo; -public interface FulfilmentInfoService { +public interface FulfillmentInfoService { - void createFulfilmentInfo(FulfilmentInfo fulfilmentInfo, String parentId); + void createFulfillmentInfo(FulfillmentInfo fulfillmentInfo, String parentId); - void deleteFulfilmentInfo(String parentId); + void deleteFulfillmentInfo(String parentId); - void updateFulfilmentInfo(FulfilmentInfo fulfilmentInfo, String parentId); + void updateFulfillmentInfo(FulfillmentInfo fulfillmentInfo, String parentId); - FulfilmentInfo getFulfilmentInfo(String parentId); + FulfillmentInfo getFulfillmentInfo(String 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 7052ed3..31329b3 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 @@ -32,7 +32,7 @@ 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; +import org.onap.usecaseui.intentanalysis.service.FulfillmentInfoService; import org.springframework.util.CollectionUtils; @@ -56,7 +56,7 @@ public class ExpectationServiceImpl implements ExpectationService { private ContextService contextService; @Autowired - private FulfilmentInfoService fulfilmentInfoService; + private FulfillmentInfoService fulfillmentInfoService; private ContextParentType contextParentType; @@ -70,7 +70,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectationTargetService.createExpectationTargetList(expectation.getExpectationTargets(), expectationId); contextService.createContextList(expectation.getExpectationContexts(), expectationId); - fulfilmentInfoService.createFulfilmentInfo(expectation.getExpectationFulfilmentInfo(), + fulfillmentInfoService.createFulfillmentInfo(expectation.getExpectationFulfillmentInfo(), expectationId); } } @@ -90,7 +90,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectation.getExpectationId()); contextService.createContextList(expectation.getExpectationContexts(), expectation.getExpectationId()); - fulfilmentInfoService.createFulfilmentInfo(expectation.getExpectationFulfilmentInfo(), + fulfillmentInfoService.createFulfillmentInfo(expectation.getExpectationFulfillmentInfo(), expectation.getExpectationId()); if (expectationMapper.insertIntentExpectation(expectation, intentId) < 1) { @@ -110,7 +110,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectation.setExpectationObject(expectationObjectService.getExpectationObject(expectationId)); expectation.setExpectationTargets(expectationTargetService.getExpectationTargetList(expectationId)); expectation.setExpectationContexts(contextService.getContextList(expectationId)); - expectation.setExpectationFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(expectationId)); + expectation.setExpectationFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(expectationId)); } } else { log.info(String.format("Expectation list is null, intentId = %s", intentId)); @@ -125,7 +125,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectation.setExpectationObject(expectationObjectService.getExpectationObject(expectationId)); expectation.setExpectationTargets(expectationTargetService.getExpectationTargetList(expectationId)); expectation.setExpectationContexts(contextService.getContextList(expectationId)); - expectation.setExpectationFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(expectationId)); + expectation.setExpectationFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(expectationId)); } else { log.info(String.format("Expectation is null, expectationId = %s", expectationId)); } @@ -150,7 +150,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectationObjectService.updateExpectationObject(expectation.getExpectationObject(), expectation.getExpectationId()); expectationTargetService.updateExpectationTargetList(expectation.getExpectationTargets(), expectation.getExpectationId()); contextService.updateContextList(expectation.getExpectationContexts(), expectation.getExpectationId()); - fulfilmentInfoService.updateFulfilmentInfo(expectation.getExpectationFulfilmentInfo(), expectation.getExpectationId()); + fulfillmentInfoService.updateFulfillmentInfo(expectation.getExpectationFulfillmentInfo(), expectation.getExpectationId()); if (expectationMapper.updateIntentExpectation(expectation) < 1) { String msg = "Failed to update expectation to database."; log.error(msg); @@ -176,7 +176,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectationObjectService.deleteExpectationObject(expectationId); expectationTargetService.deleteExpectationTargetList(expectationId); contextService.deleteContextList(expectationId); - fulfilmentInfoService.deleteFulfilmentInfo(expectationId); + fulfillmentInfoService.deleteFulfillmentInfo(expectationId); if (expectationMapper.deleteIntentExpectation(expectationId) < 1) { String msg = "Failed to delete expectation to database."; log.error(msg); @@ -196,7 +196,7 @@ public class ExpectationServiceImpl implements ExpectationService { expectationObjectService.deleteExpectationObject(expectationId); expectationTargetService.deleteExpectationTargetList(expectationId); contextService.deleteContextList(expectationId); - fulfilmentInfoService.deleteFulfilmentInfo(expectationId); + fulfillmentInfoService.deleteFulfillmentInfo(expectationId); } if (expectationMapper.deleteIntentExpectationList(intentId) < 1) { String msg = "Failed to delete expectation list to database."; 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 1dff5a7..7dcce03 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 @@ -32,7 +32,7 @@ import org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget; import org.onap.usecaseui.intentanalysis.mapper.ExpectationTargetMapper; import org.onap.usecaseui.intentanalysis.service.ContextService; import org.onap.usecaseui.intentanalysis.service.ExpectationTargetService; -import org.onap.usecaseui.intentanalysis.service.FulfilmentInfoService; +import org.onap.usecaseui.intentanalysis.service.FulfillmentInfoService; import org.springframework.util.CollectionUtils; @@ -51,7 +51,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { private ExpectationTargetService expectationTargetService; @Autowired - private FulfilmentInfoService fulfilmentInfoService; + private FulfillmentInfoService fulfillmentInfoService; @Autowired private ContextService contextService; @@ -63,7 +63,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { public void createExpectationTarget(ExpectationTarget expectationTarget, String expectationId) { String expectationTargetId = expectationTarget.getTargetId(); contextService.createContextList(expectationTarget.getTargetContexts(), expectationTargetId); - fulfilmentInfoService.createFulfilmentInfo(expectationTarget.getTargetFulfilmentInfo(), + fulfillmentInfoService.createFulfillmentInfo(expectationTarget.getTargetFulfillmentInfo(), expectationTargetId); conditionService.createConditionList(expectationTarget.getTargetConditions(), expectationTargetId); if (expectationTargetMapper.insertExpectationTarget(expectationTarget, expectationId) < 1) { @@ -81,7 +81,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { for (ExpectationTarget expectationTarget : expectationTargetList) { String expectationTargetId = expectationTarget.getTargetId(); contextService.createContextList(expectationTarget.getTargetContexts(), expectationTargetId); - fulfilmentInfoService.createFulfilmentInfo(expectationTarget.getTargetFulfilmentInfo(), + fulfillmentInfoService.createFulfillmentInfo(expectationTarget.getTargetFulfillmentInfo(), expectationTargetId); conditionService.createConditionList(expectationTarget.getTargetConditions(), expectationTargetId); } @@ -103,7 +103,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { String expectationTargetId = expectationTarget.getTargetId(); expectationTarget.setTargetConditions(conditionService.getConditionList(expectationTargetId)); expectationTarget.setTargetContexts(contextService.getContextList(expectationTargetId)); - expectationTarget.setTargetFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(expectationTargetId)); + expectationTarget.setTargetFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(expectationTargetId)); } } else { log.info(String.format("Expectation target list is null, expectationId = %s", expectationId)); @@ -118,7 +118,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { if (expectationTarget != null) { expectationTarget.setTargetConditions(conditionService.getConditionList(expectationTargetId)); expectationTarget.setTargetContexts(contextService.getContextList(expectationTargetId)); - expectationTarget.setTargetFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(expectationTargetId)); + expectationTarget.setTargetFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(expectationTargetId)); } else { log.info(String.format("Expectation target is null, expectationTargetId = %s", expectationTargetId)); } @@ -142,7 +142,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { String expectationTargetId = expectationTarget.getTargetId(); if (expectationTargetIdListFromDB.contains(expectationTargetId)) { contextService.updateContextList(expectationTarget.getTargetContexts(), expectationTargetId); - fulfilmentInfoService.updateFulfilmentInfo(expectationTarget.getTargetFulfilmentInfo(), expectationTargetId); + fulfillmentInfoService.updateFulfillmentInfo(expectationTarget.getTargetFulfillmentInfo(), expectationTargetId); conditionService.updateConditionList(expectationTarget.getTargetConditions(), expectationTargetId); if (expectationTargetMapper.updateExpectationTarget(expectationTarget, expectationTargetId) < 1) { String msg = "Failed to update expectation target list to database."; @@ -167,7 +167,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { ExpectationTarget expectationTarget = expectationTargetService.getExpectationTarget(expectationTargetId); if (expectationTarget != null) { contextService.deleteContextList(expectationTargetId); - fulfilmentInfoService.deleteFulfilmentInfo(expectationTargetId); + fulfillmentInfoService.deleteFulfillmentInfo(expectationTargetId); conditionService.deleteConditionList(expectationTargetId); if (expectationTargetMapper.deleteExpectationTarget(expectationTargetId) < 1) { String msg = "Failed to delete expectation target to database."; @@ -185,7 +185,7 @@ public class ExpectationTargetServiceImpl implements ExpectationTargetService { for (ExpectationTarget expectationTarget : expectationTargetList) { String expectationTargetId = expectationTarget.getTargetId(); contextService.deleteContextList(expectationTargetId); - fulfilmentInfoService.deleteFulfilmentInfo(expectationTargetId); + fulfillmentInfoService.deleteFulfillmentInfo(expectationTargetId); conditionService.deleteConditionList(expectationTargetId); } if (expectationTargetMapper.deleteExpectationTargetList(expectationId) < 1) { diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfillmentInfoServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfillmentInfoServiceImpl.java new file mode 100644 index 0000000..6a72aea --- /dev/null +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfillmentInfoServiceImpl.java @@ -0,0 +1,92 @@ +/* + * Copyright 2022 Huawei Technologies Co., Ltd. + * + * 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.common.ResponseConsts; +import org.onap.usecaseui.intentanalysis.exception.DataBaseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo; +import org.onap.usecaseui.intentanalysis.mapper.FulfillmentInfoMapper; +import org.onap.usecaseui.intentanalysis.service.FulfillmentInfoService; +import lombok.extern.slf4j.Slf4j; + + +@Service +@Slf4j +public class FulfillmentInfoServiceImpl implements FulfillmentInfoService { + + @Autowired + private FulfillmentInfoMapper fulfillmentInfoMapper; + + @Autowired + private FulfillmentInfoService fulfillmentInfoService; + + @Override + public void createFulfillmentInfo(FulfillmentInfo fulfillmentInfo, String parentId) { + if (fulfillmentInfo != null) { + if (fulfillmentInfoMapper.insertFulfillmentInfo(fulfillmentInfo, parentId) < 1) { + String msg = "Failed to create fulfillment info to database."; + log.error(msg); + throw new DataBaseException(msg, ResponseConsts.RET_INSERT_DATA_FAIL); + } + log.info("Successfully created fulfillment info to database."); + } + } + + @Override + public void deleteFulfillmentInfo(String parentId) { + if (fulfillmentInfoService.getFulfillmentInfo(parentId) != null) { + if (fulfillmentInfoMapper.deleteFulfillmentInfo(parentId) < 1) { + String msg = "Failed to delete fulfillment info to database."; + log.error(msg); + throw new DataBaseException(msg, ResponseConsts.RET_DELETE_DATA_FAIL); + } + log.info("Successfully deleted fulfillment info to database."); + } + } + + @Override + public void updateFulfillmentInfo(FulfillmentInfo fulfillmentInfo, String parentId) { + + FulfillmentInfo fulfillmentInfoDB = fulfillmentInfoService.getFulfillmentInfo(parentId); + if (fulfillmentInfoDB == null && fulfillmentInfo != null) { + fulfillmentInfoService.createFulfillmentInfo(fulfillmentInfo, parentId); + } else if (fulfillmentInfoDB != null && fulfillmentInfo == null) { + fulfillmentInfoService.deleteFulfillmentInfo(parentId); + } else if (fulfillmentInfoDB != null) { + if (fulfillmentInfoMapper.updateFulfillmentInfo(fulfillmentInfo, parentId) < 1) { + String msg = "Failed to update fulfillment info to database."; + log.error(msg); + throw new DataBaseException(msg, ResponseConsts.RET_UPDATE_DATA_FAIL); + } + log.info("Successfully updated fulfillment info to database."); + } + } + + @Override + public FulfillmentInfo getFulfillmentInfo(String parentId) { + FulfillmentInfo fulfillmentInfo = fulfillmentInfoMapper.selectFulfillmentInfo(parentId); + if (fulfillmentInfo == null) { + log.info(String.format("FulfillmentInfo is null, parentId = %s", parentId)); + } + return fulfillmentInfo; + } +} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfilmentInfoServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfilmentInfoServiceImpl.java deleted file mode 100644 index 0b2c20d..0000000 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/FulfilmentInfoServiceImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2022 Huawei Technologies Co., Ltd. - * - * 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.common.ResponseConsts; -import org.onap.usecaseui.intentanalysis.exception.DataBaseException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.onap.usecaseui.intentanalysis.bean.models.FulfilmentInfo; -import org.onap.usecaseui.intentanalysis.mapper.FulfilmentInfoMapper; -import org.onap.usecaseui.intentanalysis.service.FulfilmentInfoService; -import lombok.extern.slf4j.Slf4j; - - -@Service -@Slf4j -public class FulfilmentInfoServiceImpl implements FulfilmentInfoService { - - @Autowired - private FulfilmentInfoMapper fulfilmentInfoMapper; - - @Autowired - private FulfilmentInfoService fulfilmentInfoService; - - @Override - public void createFulfilmentInfo(FulfilmentInfo fulfilmentInfo, String parentId) { - if (fulfilmentInfo != null) { - if (fulfilmentInfoMapper.insertFulfilmentInfo(fulfilmentInfo, parentId) < 1) { - String msg = "Failed to create fulfilment info to database."; - log.error(msg); - throw new DataBaseException(msg, ResponseConsts.RET_INSERT_DATA_FAIL); - } - log.info("Successfully created fulfilment info to database."); - } - } - - @Override - public void deleteFulfilmentInfo(String parentId) { - if (fulfilmentInfoService.getFulfilmentInfo(parentId) != null) { - if (fulfilmentInfoMapper.deleteFulfilmentInfo(parentId) < 1) { - String msg = "Failed to delete fulfilment info to database."; - log.error(msg); - throw new DataBaseException(msg, ResponseConsts.RET_DELETE_DATA_FAIL); - } - log.info("Successfully deleted fulfilment info to database."); - } - } - - @Override - public void updateFulfilmentInfo(FulfilmentInfo fulfilmentInfo, String parentId) { - - FulfilmentInfo fulfillmentInfoDB = fulfilmentInfoService.getFulfilmentInfo(parentId); - if (fulfillmentInfoDB == null && fulfilmentInfo != null) { - fulfilmentInfoService.createFulfilmentInfo(fulfilmentInfo, parentId); - } else if (fulfillmentInfoDB != null && fulfilmentInfo == null) { - fulfilmentInfoService.deleteFulfilmentInfo(parentId); - } else if (fulfillmentInfoDB != null) { - if (fulfilmentInfoMapper.updateFulfilmentInfo(fulfilmentInfo, parentId) < 1) { - String msg = "Failed to update fulfilment info to database."; - log.error(msg); - throw new DataBaseException(msg, ResponseConsts.RET_UPDATE_DATA_FAIL); - } - log.info("Successfully updated fulfilment info to database."); - } - } - - @Override - public FulfilmentInfo getFulfilmentInfo(String parentId) { - FulfilmentInfo fulfilmentInfo = fulfilmentInfoMapper.selectFulfilmentInfo(parentId); - if (fulfilmentInfo == null) { - log.info(String.format("FulfilmentInfo is null, parentId = %s", parentId)); - } - return fulfilmentInfo; - } -} diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java index eaa1f58..e9fcbe4 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java @@ -84,7 +84,7 @@ public class ImfRegInfoServiceImpl implements ImfRegInfoService { log.error(msg,intentName); throw new IntentInputException(msg, ResponseConsts.RET_FIND_CORRESPONDING_FAIL); } - //TODO call probe interface if fail intentFulfilmentInfo throw exception + //TODO call probe interface if fail intentFulfillmentInfo throw exception return imfList.get(0); } }
\ No newline at end of file diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/IntentServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/IntentServiceImpl.java index 8656587..10fd059 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/IntentServiceImpl.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/IntentServiceImpl.java @@ -36,7 +36,7 @@ import org.onap.usecaseui.intentanalysis.exception.DataBaseException; import org.onap.usecaseui.intentanalysis.mapper.IntentMapper; import org.onap.usecaseui.intentanalysis.service.ContextService; import org.onap.usecaseui.intentanalysis.service.ExpectationService; -import org.onap.usecaseui.intentanalysis.service.FulfilmentInfoService; +import org.onap.usecaseui.intentanalysis.service.FulfillmentInfoService; import org.onap.usecaseui.intentanalysis.service.IntentService; @@ -56,7 +56,7 @@ public class IntentServiceImpl implements IntentService { private ContextParentType contextParentType; @Autowired - private FulfilmentInfoService fulfilmentInfoService; + private FulfillmentInfoService fulfillmentInfoService; @Autowired private IntentService intentService; @@ -71,7 +71,7 @@ public class IntentServiceImpl implements IntentService { } expectationService.createIntentExpectationList(intent.getIntentExpectations(), intent.getIntentId()); contextService.createContextList(intent.getIntentContexts(), intent.getIntentId()); - fulfilmentInfoService.createFulfilmentInfo(intent.getIntentFulfilmentInfo(), intent.getIntentId()); + fulfillmentInfoService.createFulfillmentInfo(intent.getIntentFulfillmentInfo(), intent.getIntentId()); log.info("Successfully created intent to database."); return intent; } @@ -94,7 +94,7 @@ public class IntentServiceImpl implements IntentService { if (intent != null) { intent.setIntentExpectations(expectationService.getIntentExpectationList(intentId)); intent.setIntentContexts(contextService.getContextList(intentId)); - intent.setIntentFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(intentId)); + intent.setIntentFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(intentId)); } else { log.info(String.format("Intent is null, intentId = %s", intentId)); } @@ -112,7 +112,7 @@ public class IntentServiceImpl implements IntentService { } expectationService.updateIntentExpectationList(intent.getIntentExpectations(), intentId); contextService.updateContextList(intent.getIntentContexts(), intentId); - fulfilmentInfoService.updateFulfilmentInfo(intent.getIntentFulfilmentInfo(), intentId); + fulfillmentInfoService.updateFulfillmentInfo(intent.getIntentFulfillmentInfo(), intentId); if (intentMapper.updateIntent(intent) < 1) { String msg = "Failed to update intent to database."; log.error(msg); @@ -130,7 +130,7 @@ public class IntentServiceImpl implements IntentService { log.error(msg); throw new DataBaseException(msg, ResponseConsts.RET_QUERY_DATA_EMPTY); } - fulfilmentInfoService.deleteFulfilmentInfo(intentId); + fulfillmentInfoService.deleteFulfillmentInfo(intentId); contextService.deleteContextList(intentId); expectationService.deleteIntentExpectationList(intentId); if (intentMapper.deleteIntent(intentId) < 1) { @@ -148,7 +148,7 @@ public class IntentServiceImpl implements IntentService { for (Intent intent : intentList) { intent.setIntentExpectations(expectationService.getIntentExpectationList(intent.getIntentId())); intent.setIntentContexts(contextService.getContextList(intent.getIntentId())); - intent.setIntentFulfilmentInfo(fulfilmentInfoService.getFulfilmentInfo(intent.getIntentId())); + intent.setIntentFulfillmentInfo(fulfillmentInfoService.getFulfillmentInfo(intent.getIntentId())); } } else { diff --git a/intentanalysis/src/main/resources/intent-analysis-init.sql b/intentanalysis/src/main/resources/intent-analysis-init.sql index 4c985e4..4a349e7 100644 --- a/intentanalysis/src/main/resources/intent-analysis-init.sql +++ b/intentanalysis/src/main/resources/intent-analysis-init.sql @@ -39,9 +39,9 @@ create table if not exists context_mapping( parent_id varchar(255) ); -create table if not exists fulfilment_info( - fulfilment_info_id varchar(255) primary key, - fulfilment_info_status varchar(255), +create table if not exists fulfillment_info( + fulfillment_info_id varchar(255) primary key, + fulfillment_info_status varchar(255), not_fulfilled_state varchar(255), not_fulfilled_reason varchar(255) ); diff --git a/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml new file mode 100644 index 0000000..5aa65c5 --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.FulfillmentInfoMapper"> + + + <insert id="insertFulfillmentInfo"> + insert into fulfillment_info(fulfillment_info_id, fulfillment_info_status, not_fulfilled_state, not_fulfilled_reason) + values (#{parentId}, #{fulfillmentInfo.fulfillmentStatus}, #{fulfillmentInfo.notFulfilledState}, #{fulfillmentInfo.notFulfilledReason}) + </insert> + + <select id="selectFulfillmentInfo" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo"> + select fulfillment_info_status fulfillmentStatus, not_fulfilled_state notFulfilledState, + not_fulfilled_reason notFulfilledReason + from fulfillment_info + where fulfillment_info_id = #{parentId} + </select> + + <update id="updateFulfillmentInfo"> + update fulfillment_info + <trim prefix="set" suffixOverrides=","> + <if test="fulfillmentInfo.fulfillmentStatus != null">fulfillment_info_status = #{fulfillmentInfo.fulfillmentStatus},</if> + <if test="fulfillmentInfo.notFulfilledState != null">not_fulfilled_state = #{fulfillmentInfo.notFulfilledState},</if> + <if test="fulfillmentInfo.notFulfilledReason != null">not_fulfilled_reason = #{fulfillmentInfo.notFulfilledReason},</if> + </trim> + where fulfillment_info_id = #{parentId} + </update> + + <delete id="deleteFulfillmentInfo" parameterType="string"> + delete from fulfillment_info + where fulfillment_info_id = #{parentId} + </delete> +</mapper> diff --git a/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml deleted file mode 100644 index d9b9f7f..0000000 --- a/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE mapper - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.FulfilmentInfoMapper"> - - - <insert id="insertFulfilmentInfo"> - insert into fulfilment_info(fulfilment_info_id, fulfilment_info_status, not_fulfilled_state, not_fulfilled_reason) - values (#{parentId}, #{fulfilmentInfo.fulfilmentStatus}, #{fulfilmentInfo.notFulfilledState}, #{fulfilmentInfo.notFulfilledReason}) - </insert> - - <select id="selectFulfilmentInfo" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfilmentInfo"> - select fulfilment_info_status fulfilmentStatus, not_fulfilled_state notFulfilledState, - not_fulfilled_reason notFulfilledReason - from fulfilment_info - where fulfilment_info_id = #{parentId} - </select> - - <update id="updateFulfilmentInfo"> - update fulfilment_info - <trim prefix="set" suffixOverrides=","> - <if test="fulfilmentInfo.fulfilmentStatus != null">fulfilment_info_status = #{fulfilmentInfo.fulfilmentStatus},</if> - <if test="fulfilmentInfo.notFulfilledState != null">not_fulfilled_state = #{fulfilmentInfo.notFulfilledState},</if> - <if test="fulfilmentInfo.notFulfilledReason != null">not_fulfilled_reason = #{fulfilmentInfo.notFulfilledReason},</if> - </trim> - where fulfilment_info_id = #{parentId} - </update> - - <delete id="deleteFulfilmentInfo" parameterType="string"> - delete from fulfilment_info - where fulfilment_info_id = #{parentId} - </delete> -</mapper> |