...
(see CCSDK-2871 DP: Long-term Java API(s)
- CpsException
- CpsAdminException
- DataspaceNotFoundException
- SchemaSetNotFoundException
- SchemaSetAlreadyDefinedException
- SchemaSetValidationException
- SchemaSetAlreadyDefinedException
- SpecificException1
- SpecificException2
- DataValidationException
- SpecificException3
- SpecificException4
- PathValidationException
- SpecificException5
- CpsAdminException
...
# | Slogan | Remarks | Decision | Who &When |
---|---|---|---|---|
1 | treatment of incorrect dataspace, schemaset (names) | These are core concept of CPS and should be correct/exists (except in create use cases of course) |
| CPS Team Meeting 3 Dec |
2 | Using different HTTP Response code (400 v 404) depending on type of operation, adding data/requesting data | It might make sense to use 404 Not Found in a get scenario (ie like #3 scenario in the table below) But this would be wrong in a create/add data scenario. The API throws the same Exception so the REST Impl would need additional code to handle this distinction | Use 400 Bad requests in both scenarios for the following reasons
| CPS Team Meeting 3 Dec |
...
# | Use case | Scenario | DB (Spring) Response | SPI Response | Java API | REST API Response Code | Response Body | Error Object Message |
---|---|---|---|---|---|---|---|---|
1 | Add schema set to dataspace | schema set with same name already exists | DataIntegrityViolationException | SchemaSetAlreadyDefinedException | SchemaSetAlreadyDefinedException | 400 (bad request) | json error object | schema set xyz already defined for dataspace abc |
2 | Add schema set to dataspace | dataspacename does not exist | No records (Optional, not present) | DataspaceNotFoundException | DataspaceNotFoundException | 400 (bad request) | json error object | TBD |
3 | List anchors for dataspace name | dataspacename does not exist | No records (Optional, not present) | DataspaceNotFoundException | DataspaceNotFoundException | 400 (bad request) | json error object | dataspace xyz not found |
4 | List anchors for dataspace name | no anchor records in DB | 0 records | empty collection | empty collection | 200 (ok) | empty list | N/A |
5 | Add schema set to dataspace | the schema set throws a validation exception when parsed with ODL Yang Parser e.g.
| N/A | N/A | SchemaSetValidationException (e casue) details should contain cause message | 400 (bad request) | json error object | message and details |
6 | ||||||||
7 |