diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2022-09-13 09:07:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-09-13 09:07:54 +0000 |
commit | 5b977b6607d696d347de08ecba638ffbf4d57d16 (patch) | |
tree | 10e2ddab3c2f8c2046bf044b7767cbd0c5108613 /cps-service/src/main/java | |
parent | 96d54ef097e3d7ccbc89b615bf3c042ec0141e97 (diff) | |
parent | 7b6ab50231f5ab39d1476531031437f81328115e (diff) |
Merge "Handle partial failure"
Diffstat (limited to 'cps-service/src/main/java')
3 files changed, 39 insertions, 5 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java index 6bf493556e..b6aa04be76 100755 --- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java +++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java @@ -97,7 +97,7 @@ public class CpsDataServiceImpl implements CpsDataService { CpsValidator.validateNameCharacters(dataspaceName, anchorName); final Collection<Collection<DataNode>> listElementDataNodeCollections = buildDataNodes(dataspaceName, anchorName, parentNodeXpath, jsonDataList); - cpsDataPersistenceService.addListElementsBatch(dataspaceName, anchorName, parentNodeXpath, + cpsDataPersistenceService.addMultipleLists(dataspaceName, anchorName, parentNodeXpath, listElementDataNodeCollections); processDataUpdatedEventAsync(dataspaceName, anchorName, parentNodeXpath, UPDATE, observedTimestamp); } diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java index 8b45ae78d9..cd0cefcbf3 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java +++ b/cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java @@ -66,15 +66,15 @@ public interface CpsDataPersistenceService { Collection<DataNode> listElementsCollection); /** - * Adds list child elements to a Fragment. + * Add multiple lists of data nodes to a parent node at the same time. * * @param dataspaceName dataspace name * @param anchorName anchor name * @param parentNodeXpath parent node xpath - * @param listElementsCollections collections of data nodes representing list elements + * @param newLists collections of lists of data nodes representing list elements */ - void addListElementsBatch(String dataspaceName, String anchorName, String parentNodeXpath, - Collection<Collection<DataNode>> listElementsCollections); + void addMultipleLists(String dataspaceName, String anchorName, String parentNodeXpath, + Collection<Collection<DataNode>> newLists); /** * Retrieves datanode by XPath for given dataspace and anchor. diff --git a/cps-service/src/main/java/org/onap/cps/spi/exceptions/AlreadyDefinedExceptionBatch.java b/cps-service/src/main/java/org/onap/cps/spi/exceptions/AlreadyDefinedExceptionBatch.java new file mode 100644 index 0000000000..a5ce6fde21 --- /dev/null +++ b/cps-service/src/main/java/org/onap/cps/spi/exceptions/AlreadyDefinedExceptionBatch.java @@ -0,0 +1,34 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2022 Nordix Foundation + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.cps.spi.exceptions; + +import java.util.Collection; +import lombok.Getter; + +public class AlreadyDefinedExceptionBatch extends RuntimeException { + + @Getter + private final Collection<String> alreadyDefinedCmHandleIds; + + public AlreadyDefinedExceptionBatch(final Collection<String> alreadyDefinedCmHandleIds) { + this.alreadyDefinedCmHandleIds = alreadyDefinedCmHandleIds; + } +} |