Table of Contents |
---|
CPS Delta feature Exceptions
Where ever possible the Delta Feature will throw the same exceptions as defined in CPS core. If any new exception for the delta feature are required the following will be updated here.
Issues & Decisions
# | Issue | Notes | Decision |
---|---|---|---|
1 | Add or Delete leaves (optional leaves) handle as UPDATE or ADD/DELETE ? | The delta report proposed follows the Json Patch format of representing the differences between 2 json. Going by the general convention, referring RFC-6902:
| Add/Delete as per notes on the left |
2 | How to handle multiple changes at different levels? | Example:
There could be Many more complex scenarios.... Replied below | |
3 | More scenarios need to be explored and documented in detail. Such as handling arrays within a json, handling child/grandchild changes. |
CPS Delta feature Exceptions
Where ever possible the Delta Feature will throw the same exceptions as defined in CPS core. If any new exception for the delta feature are required the following will be updated here.
HTTP response codes for Delta between 2 Anchors API
The proposed API will be part of the CPS Data Interface. The following response codes will be returned by the API:
# | Sub Interface | Method | Scenario | HTTP Response codes to be implemented | Notes |
---|---|---|---|---|---|
1 | Data | Proposed API: GET- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/delta?anchor2={anchor-name}?xpath={xpath}&descendants={descendants} Proposed method name: getDeltaByDataspaceAndAnchors() | Generate a delta report between 2 anchors in a given dataspace. |
| AnchorNotFoundException should provide the name of missing anchor from the given two anchor names. |
...
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "action": "ADD", "xpath": "/bookstore/categories/[@code=3]", "payload": { "code": 3, "name": "kidz" } }, { "action": "DELETE", "xpath": "/bookstore/categories/[@code=1]", "payload": { "code": 1, "name": "Fiction" } }, { "action": "UPDATE", "xpath": "/bookstore/categories/[@code=2]", "payload": { "name": "Comic" } } ] |
Mechanism for Delta generation between Anchors
Gliffy Diagram | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...