+ public void lockAnchor(final String sessionID, final String dataspaceName,
+ final String anchorName, final Long timeoutInMilliseconds) {
+ cpsDataPersistenceService.lockAnchor(sessionID, dataspaceName, anchorName, timeoutInMilliseconds);
+ }
+
+ @Override
+ @Timed(value = "cps.data.service.datanode.descendants.update",
+ description = "Time taken to update a data node and descendants")
+ public void updateDataNodeAndDescendants(final String dataspaceName, final String anchorName,
+ final String parentNodeXpath, final String jsonData,
+ final OffsetDateTime observedTimestamp) {
+ cpsValidator.validateNameCharacters(dataspaceName, anchorName);
+ final Anchor anchor = cpsAdminService.getAnchor(dataspaceName, anchorName);
+ final Collection<DataNode> dataNodes = buildDataNodes(anchor, parentNodeXpath, jsonData, ContentType.JSON);
+ cpsDataPersistenceService.updateDataNodesAndDescendants(dataspaceName, anchorName, dataNodes);
+ processDataUpdatedEventAsync(anchor, parentNodeXpath, UPDATE, observedTimestamp);
+ }
+
+ @Override
+ @Timed(value = "cps.data.service.datanode.descendants.batch.update",
+ description = "Time taken to update a batch of data nodes and descendants")
+ public void updateDataNodesAndDescendants(final String dataspaceName, final String anchorName,
+ final Map<String, String> nodesJsonData,
+ final OffsetDateTime observedTimestamp) {
+ cpsValidator.validateNameCharacters(dataspaceName, anchorName);
+ final Anchor anchor = cpsAdminService.getAnchor(dataspaceName, anchorName);
+ final Collection<DataNode> dataNodes = buildDataNodes(anchor, nodesJsonData);
+ cpsDataPersistenceService.updateDataNodesAndDescendants(dataspaceName, anchorName, dataNodes);
+ nodesJsonData.keySet().forEach(nodeXpath ->
+ processDataUpdatedEventAsync(anchor, nodeXpath, UPDATE, observedTimestamp));
+ }
+
+ @Override
+ @Timed(value = "cps.data.service.list.update",
+ description = "Time taken to update a list")