Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Need further analysis for Delete and Update (link spike)

Implementation Proposal

We will be augmenting the existing CPS-Core endpoint /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes?xpath=/

REST Layer

  • DataRestController.java
    • Add a check in addListElements to see if the parent xpath is a root path ("/").  If root node, create passed list element as top node. Else add passed list element to parent xpath node.
  • DataRestControllerSpec.groovy
    • Add test for scenario above

Service Layer

  • CpsDataService.java
    • Overload saveListElements method with implementation for no parentNodeXpath
  • CpsDataServiceImpl.java
    • Overload saveListElements method with implementation for no parentNodeXpath
    • buildDataNodes and call new method storeListElements in Persistence Layer

Persistence Layer

  • CpsDataPersistenceService.java
    • new method storeListElements
  • CpsDataPersistenceServiceImpl.java
    • new method storeListElements, converts datanodes to fragment repository and saves it.


EndpointIssueSolutionSpike/User Story
Get NodeGet Node only gets the first node of the list element at the top level.Create a new endpoint Get Nodes which can return multiple parallel nodes.
Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-766


Post List Element

Post List Element does not allow for create List Element, only appends onto existing node as childrenAdd functionality to Post List Element to allow for the independent creation of a list element

Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-765

Delete NodeDelete Datanode is unable to delete an element from the list elements if they are the top level list node. 

Investigate implementation which will allow for deletion of element(s) from top level list elements
NB ensure no possibility of empty list element at top level

Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-767

Update List ElementUpdate List Element relies on the parent node of the list element to update the List Elements but a top level List Element will not have a parent nodeInvestigate implementation which will allow for update of element(s) from top level list elements
NB ensure no possibility of empty list element at top level
Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-767