-
Bug
-
Resolution: Done
-
Medium
-
New Delhi Release, Oslo Release
-
None
Data Update Events for CpsDataService::deleteDataNodes(dataspace, anchors) are not sent (if the anchor names are different from the schema set names).
CpsDataService has a method for deleting all data across multiple anchors:
void deleteDataNodes(String dataspaceName, Collection<String> anchorNames, OffsetDateTime observedTimestamp);
The implementation uses CpsAnchorService::getAnchors to get the anchors before sending update events:
for (final Anchor anchor : cpsAnchorService.getAnchors(dataspaceName, anchorNames)) { sendDataUpdatedEvent(anchor, ROOT_NODE_XPATH, Operation.DELETE, observedTimestamp); }
However, the getAnchors method expects schema set names, not anchor names:
Collection<Anchor> getAnchors(String dataspaceName, Collection<String> schemaSetNames);
The proposed solution is to have two separate methods:
Collection<Anchor> getAnchors(String dataspaceName, Collection<String> anchorNames); Collection<Anchor> getAnchorsBySchemaSetNames(String dataspaceName, Collection<String> schemaSetNames);
A/C:
- Unit tests updated in CpsDataServiceImplSpec to show data event being sent