Captain-P-Goldfish / SCIM-SDK

a scim implementation as described in RFC7643 and RFC7644
https://github.com/Captain-P-Goldfish/SCIM/wiki
BSD 3-Clause "New" or "Revised" License
121 stars 38 forks source link

Bulk need do somethings after all #721

Closed PC-Chiu closed 3 weeks ago

PC-Chiu commented 3 weeks ago

If I need do somethings after all bulk operations? How to implement or config the SCIM server?

Captain-P-Goldfish commented 3 weeks ago

I am not sure what you are asking. Do you want to use the Bulk-Endpoint? Simply add a BulkConfig to the ServiceProvider implementation and set bulkSupported=true

PC-Chiu commented 3 weeks ago

Bulk-Endpoint invoke Resources-endpoint with loop(iterator) mode, I want to do somethings after all bulk operations finished, eg., submit transaction, publish event...

Captain-P-Goldfish commented 3 weeks ago

you could try this:

ScimResponse scimResponse = resourceEndpoint.handleRequest(request.getRequestURL().toString() + query,
                                                               HttpMethod.valueOf(request.getMethod()),
                                                               requestBody,
                                                               httpHeaders,
                                                               (scimResponseNode, aBoolean) -> {
                                                                 if (scimResponseNode instanceof BulkResponse)
                                                                 {
                                                                   // do your stuff
                                                                 }
                                                               },
                                                               new Context(scimAuthentication));
PC-Chiu commented 3 weeks ago

OK, thx.