Class BulkBuilder

    • Constructor Detail

      • BulkBuilder

        public BulkBuilder​(String baseUrl,
                           ScimHttpClient scimHttpClient,
                           boolean isFullUrl,
                           Supplier<ServiceProvider> serviceProviderSupplier)
        if the resource should be retrieved by using the fully qualified url
        Parameters:
        baseUrl - the fully qualified url to the required resource
        scimHttpClient - the http client instance
        isFullUrl - if the given base url is the fully qualified url or not
        serviceProviderSupplier - contains the configuration of the service provider that is used to determine the max-operations of a bulk request and to help to split the operations into several requests if necessary.
        This object might be null
    • Method Detail

      • isExpectedResponseCode

        protected boolean isExpectedResponseCode​(int httpStatus)
        tells this abstract class if the http status from the server is the expected success status
        Specified by:
        isExpectedResponseCode in class RequestBuilder<BulkResponse>
        Parameters:
        httpStatus - the http status from the server
        Returns:
        true if the response status shows success
      • getResource

        protected String getResource()
        overrides the default method from the superclass to have easier control of the resource that will be put into the request body
        Overrides:
        getResource in class RequestBuilder<BulkResponse>
      • failOnErrors

        public BulkBuilder failOnErrors​(Integer failOnErrors)
        sets how many errors are allowed on the server side before the request should be rolled back
        Parameters:
        failOnErrors - the number of errors that are accepted on the server side
      • bulkRequestOperation

        public BulkBuilder.BulkRequestOperationCreator bulkRequestOperation​(String path,
                                                                            String id)
        sets the path to the resource endpoint e.g. "/Users" or "/Groups"
        Parameters:
        path - "/Users", "/Groups" or any other registered resource path
        id - the id of an existing resource in case of patch, update or delete
      • sendRequestWithMultiHeaders

        public ServerResponse<BulkResponse> sendRequestWithMultiHeaders​(Map<String,​String[]> httpHeaders)
        sends the defined request to the service provider
        Overrides:
        sendRequestWithMultiHeaders in class RequestBuilder<BulkResponse>
        Parameters:
        httpHeaders - allows the user to add additional http headers to the request
        Returns:
        the response from the given request. A response must not be returned in any case from the service provider so the returned type is still optional
      • getIdFromLocationAttribute

        protected String getIdFromLocationAttribute​(BulkResponseOperation bulkResponseOperation)
        extracted into its own method for unit tests.
      • getBulkRequestOperationList

        public List<BulkRequestOperation> getBulkRequestOperationList()
        the bulk request operations that should be executed
      • setServiceProviderSupplier

        public void setServiceProviderSupplier​(Supplier<ServiceProvider> serviceProviderSupplier)
        contains the configuration of the service provider that is used to determine the max-operations of a bulk request and to help to split the operations into several requests if necessary.
        This object might be null