2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 highstreet technologies GmbH
4 * Copyright (C) 2021 Nordix Foundation
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * 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.nfproxy.api;
23 import java.util.Collection;
24 import org.checkerframework.checker.nullness.qual.NonNull;
25 import org.onap.cps.spi.FetchDescendantsOption;
26 import org.onap.cps.spi.model.DataNode;
29 * Datastore interface for handling CPS data.
31 public interface NfProxyDataService {
34 * Retrieves datanode by XPath for a given cm handle.
36 * @param cmHandle The identifier for a network function, network element, subnetwork or any other cm
37 * object by managed NF-Proxy
39 * @param fetchDescendantsOption defines the scope of data to fetch: either single node or all the descendant nodes
40 * (recursively) as well
41 * @return data node object
43 DataNode getDataNode(@NonNull String cmHandle, @NonNull String xpath,
44 @NonNull FetchDescendantsOption fetchDescendantsOption);
47 * Get datanodes for the given cm handle by cps path.
49 * @param cmHandle The identifier for a network function, network element, subnetwork or any other cm object by
51 * @param cpsPath cps path
52 * @return a collection of datanodes
54 Collection<DataNode> queryDataNodes(@NonNull String cmHandle, @NonNull String cpsPath);
57 * Updates data node for given cm handle using xpath to parent node.
59 * @param cmHandle The identifier for a network function, network element, subnetwork or any other cm object
61 * @param parentNodeXpath xpath to parent node
62 * @param jsonData json data
64 void updateNodeLeaves(@NonNull String cmHandle, @NonNull String parentNodeXpath, @NonNull String jsonData);
67 * Replaces existing data node content including descendants.
69 * @param cmHandle The identifier for a network function, network element, subnetwork or any other cm object
71 * @param parentNodeXpath xpath to parent node
72 * @param jsonData json data
74 void replaceNodeTree(@NonNull String cmHandle, @NonNull String parentNodeXpath, @NonNull String jsonData);