* Copyright (C) 2020-2022 Nordix Foundation.
* Modifications Copyright (C) 2021 Pantheon.tech
* Modifications Copyright (C) 2022 Bell Canada
+ * Modifications Copyright (C) 2022 TechMahindra Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
public interface CpsDataPersistenceService {
+
/**
* Store a datanode.
*
* @param dataspaceName dataspace name
* @param anchorName anchor name
* @param dataNode data node
+ * @deprecated Please use {@link #storeDataNodes(String, String, Collection)} as it supports multiple data nodes.
*/
+ @Deprecated
void storeDataNode(String dataspaceName, String anchorName, DataNode dataNode);
+ /**
+ * Store multiple datanodes at once.
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @param dataNodes data nodes
+ */
+ void storeDataNodes(String dataspaceName, String anchorName, Collection<DataNode> dataNodes);
+
/**
* Add a child to a Fragment.
*
*/
void addChildDataNode(String dataspaceName, String anchorName, String parentXpath, DataNode dataNode);
+ /**
+ * Add multiple children to a Fragment.
+ *
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @param parentXpath parent xpath
+ * @param dataNodes collection of dataNodes
+ */
+ void addChildDataNodes(String dataspaceName, String anchorName, String parentXpath, Collection<DataNode> dataNodes);
+
/**
* Adds list child elements to a Fragment.
*
* @param parentNodeXpath parent node xpath
* @param listElementsCollection collection of data nodes representing list elements
*/
-
void addListElements(String dataspaceName, String anchorName, String parentNodeXpath,
Collection<DataNode> listElementsCollection);