Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-2254

Data Update Events for deleteDataNodes(dataspace, anchors) are not sent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Oslo Release
    • New Delhi Release, Oslo Release
    • CPS-Core
    • 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

            danielhanrahan Daniel Hanrahan
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 4 hours Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - 4 hours Remaining Estimate - 1 day
                4h