[CPS] RI: Code Refactoring
[cps.git] / cps-service / src / main / java / org / onap / cps / spi / CpsDataPersistenceService.java
index 90e6ec7..d28a333 100644 (file)
@@ -36,18 +36,6 @@ import org.onap.cps.spi.model.DataNode;
  */
 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
@@ -137,15 +125,6 @@ public interface CpsDataPersistenceService {
      */
     void updateDataLeaves(String dataspaceName, String anchorName, String xpath, Map<String, Serializable> leaves);
 
-    /**
-     * Replaces an existing data node's content including descendants.
-     *
-     * @param dataspaceName dataspace name
-     * @param anchorName    anchor name
-     * @param dataNode      data node
-     */
-    void updateDataNodeAndDescendants(String dataspaceName, String anchorName, DataNode dataNode);
-
     /**
      * Replaces multiple existing data nodes' content including descendants in a batch operation.
      *
@@ -153,7 +132,7 @@ public interface CpsDataPersistenceService {
      * @param anchorName    anchor name
      * @param dataNodes     data nodes
      */
-    void updateDataNodesAndDescendants(String dataspaceName, String anchorName, final List<DataNode> dataNodes);
+    void updateDataNodesAndDescendants(String dataspaceName, String anchorName, final Collection<DataNode> dataNodes);
 
     /**
      * Replaces list content by removing all existing elements and inserting the given new elements
@@ -223,6 +202,19 @@ public interface CpsDataPersistenceService {
     List<DataNode> queryDataNodes(String dataspaceName, String anchorName,
                                   String cpsPath, FetchDescendantsOption fetchDescendantsOption);
 
+    /**
+     * Get a datanode by dataspace name and cps path across all anchors.
+     *
+     * @param dataspaceName          dataspace name
+     * @param cpsPath                cps path
+     * @param fetchDescendantsOption defines whether the descendants of the node(s) found by the query should be
+     *                               included in the output
+     * @return the data nodes found i.e. 0 or more data nodes
+     */
+    List<DataNode> queryDataNodesAcrossAnchors(String dataspaceName,
+                                  String cpsPath, FetchDescendantsOption fetchDescendantsOption);
+
+
     /**
      * Starts a session which allows use of locks and batch interaction with the persistence service.
      *