summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java
diff options
context:
space:
mode:
authorRuslan Kashapov <ruslan.kashapov@pantheon.tech>2021-02-08 11:02:39 +0200
committerRuslan Kashapov <ruslan.kashapov@pantheon.tech>2021-02-16 14:06:40 +0200
commitd1ea2af79952a41264552247441410fc24cd48f5 (patch)
tree5b11d435ff104c013d0ab5e5430d27fae630508d /cps-service/src/main/java
parent10edcd916622acd3cb7069a069231153e715b467 (diff)
Data fragment update by xpath #2 - persistence layer
Issue-ID: CPS-58 Change-Id: Ifc4580936d06c6907d6b5ab20657063b6707ccbe Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/CpsDataPersistenceService.java22
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/FetchChildrenOption.java25
2 files changed, 22 insertions, 25 deletions
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 97aecaafd1..9a0c180a8f 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
@@ -21,6 +21,7 @@
package org.onap.cps.spi;
+import java.util.Map;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.onap.cps.spi.model.DataNode;
@@ -64,4 +65,25 @@ public interface CpsDataPersistenceService {
*/
DataNode getDataNode(@NonNull String dataspaceName, @NonNull String anchorName, @NonNull String xpath,
@NonNull FetchDescendantsOption fetchDescendantsOption);
+
+
+ /**
+ * Updates leaves for existing data node.
+ *
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @param xpath xpath
+ * @param leaves the leaves as a map where key is a leaf name and a value is a leaf value
+ */
+ void updateDataLeaves(@NonNull String dataspaceName, @NonNull String anchorName, @NonNull String xpath,
+ @NonNull Map<String, Object> leaves);
+
+ /**
+ * Replaces existing data node content including descendants.
+ *
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @param dataNode data node
+ */
+ void replaceDataNodeTree(@NonNull String dataspaceName, @NonNull String anchorName, @NonNull DataNode dataNode);
}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/FetchChildrenOption.java b/cps-service/src/main/java/org/onap/cps/spi/FetchChildrenOption.java
deleted file mode 100644
index 97712c128c..0000000000
--- a/cps-service/src/main/java/org/onap/cps/spi/FetchChildrenOption.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Pantheon.tech
- * ================================================================================
- * 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;
-
-public enum FetchChildrenOption {
- OMIT_CHILDREN,
- INCLUDE_ALL_CHILDREN
-}