SIF 3 MultiObject CRUD SIF 3 Consumer MultiObject
SIF 3: Multi-Object CRUD SIF 3 Consumer: Multi-Object CRUD Exercise Presented by: Joerg Huber
2 What is Multi-Object CRUD? A Consumer can request CRUD operations for multiple SIF Objects (of the same type) with ONE REST call! ¡ ¡ I. e. Update, Create, Delete 10 Student. Personals in one call. Response will return a list of HTTP status and/or Error Messages. l l #Elements in the list equals #Elements in request. Valid Status to be returned depends on the requested operation (200 ok for update, 204 ok for create etc). Refer to SIF Specification for details. Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
3 Multi-Object Create (and single object create) This REST API call requires a HTTP Header parameter called “must. Use. Advisory” which is set to either True or False: ¡ True: The consumer has set the Ref. ID in the SIF Objects and requests the provider to accept it. l ¡ Provider may still reject it if it is invalid, duplicated etc. False: Consumer may provide a Ref. ID but expects the provider to allocate a new and final one and then return the new Ref. ID in the response. SIF 3 Framework: Set it in the property adapter. must. Use. Advisory. IDs Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
4 Multi-Object Delete When deleting SIF Objects only a list of Ref. IDs to must be provided (payload). ¡ ¡ SIF Object does no longer exists in Consumer Application, so not more than Ref. ID is known. Internally the Delete API uses a HTTP PUT with a HTTP Header called “method. Override” and a value of “DELETE” l l l HTTP DELETE does not allow for payloads where as HTTP PUT does. Fully managed within SIF 3 Framework (i. e. transparent to the API). Developer doesn’t need to deal with this special case. Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
5 DELAYED Request Ability Multi-Object CRUD operations allow for DELAYED Requests! This is an Asynchronous Messaging pattern. The response to a DELAYED request is a Two-Stepped process: ¡ Step 1 – Immediate Response: l l ¡ ACK to initial request (HTTP Status of 202 – Accepted). No payload except if an error is returned (i. e. not authorised) Step 2 – Delayed Response: Actual Data of request is put on a response queue to be picked up by consumer at some time. l l Payloads are collections of objects. Payloads are the same type as if request was called with IMMEDIATE. Note: Delayed request/response not yet supported with either Framework. Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
6 Payload Considerations Collections of Objects can result in large payloads! This should be avoided because: ¡ ¡ Inefficient use of resources on provider (one thread vs multiple threads). Connection timeouts due to long processing times: l l On the wire (HTTP request is cut-off by proxies) On DB (connection is cut-off) Payload size is driven by the consumer! ¡ ¡ Retrieve Request: Use Paging Update/Create/Delete Request: Use multiple calls with smaller payloads. Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
7 Exercise – Multi-Object Delete, Create etc. Return to Demo. Consumer from Exercise 2 Try to add more methods to either: ¡ ¡ ¡ Delete Update Create Multiple Student. Personal objects in one API call. See Exercise 5 for details Training Course SIF 3: Multi-Object CRUD September 21 © Systemic Pty Ltd
- Slides: 7