2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022-2023 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.cps.ncmp.api.impl.ncmppersistence;
23 import java.time.OffsetDateTime;
24 import java.util.Collection;
25 import org.onap.cps.spi.FetchDescendantsOption;
26 import org.onap.cps.spi.model.DataNode;
29 * DmiRegistryConstants class to be strictly used for DMI Related constants only.
31 public interface NcmpPersistence {
33 String NCMP_DATASPACE_NAME = "NCMP-Admin";
34 String NCMP_DMI_REGISTRY_ANCHOR = "ncmp-dmi-registry";
35 String NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME = "NFP-Operational";
36 String NCMP_DMI_REGISTRY_PARENT = "/dmi-registry";
37 OffsetDateTime NO_TIMESTAMP = null;
40 * Method to delete a list or a list element.
42 * @param listElementXpath list element xPath
44 void deleteListOrListElement(String listElementXpath);
47 * Method to delete a schema set.
49 * @param schemaSetName schema set name
51 void deleteSchemaSetWithCascade(String schemaSetName);
54 * Method to delete multiple schema sets.
56 * @param schemaSetNames schema set names
58 void deleteSchemaSetsWithCascade(Collection<String> schemaSetNames);
61 * Get data node via xpath.
66 Collection<DataNode> getDataNode(String xpath);
69 * Get data node via xpath.
72 * @param fetchDescendantsOption fetch descendants option
75 Collection<DataNode> getDataNode(String xpath, FetchDescendantsOption fetchDescendantsOption);
78 * Get collection of data nodes via xpaths.
80 * @param xpaths collection of xpaths
81 * @return collection of data nodes
83 Collection<DataNode> getDataNodes(Collection<String> xpaths);
86 * Get collection of data nodes via xpaths.
88 * @param xpaths collection of xpaths
89 * @param fetchDescendantsOption fetch descendants option
90 * @return collection of data nodes
92 Collection<DataNode> getDataNodes(Collection<String> xpaths,
93 FetchDescendantsOption fetchDescendantsOption);
96 * Replaces list content by removing all existing elements and inserting the given new elements as data nodes.
98 * @param parentNodeXpath parent node xpath
99 * @param dataNodes datanodes representing the updated data
101 void replaceListContent(String parentNodeXpath, Collection<DataNode> dataNodes);
106 * @param dataNodeXpath data node xpath
108 void deleteDataNode(String dataNodeXpath);
111 * Deletes multiple data nodes.
113 * @param dataNodeXpaths data node xpaths
115 void deleteDataNodes(Collection<String> dataNodeXpaths);