Class BulkBuilder
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.client.builder.RequestBuilder<BulkResponse>
-
- de.captaingoldfish.scim.sdk.client.builder.BulkBuilder
-
public class BulkBuilder extends RequestBuilder<BulkResponse>
author Pascal Knueppel
created at: 08.03.2020
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBulkBuilder.BulkRequestOperationCreatoran additional build step class that allows to set the values of a bulk operation
-
Constructor Summary
Constructors Constructor Description BulkBuilder(String baseUrl, ScimHttpClient scimHttpClient, boolean isFullUrl)if the resource should be retrieved by using the fully qualified url
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkBuilder.BulkRequestOperationCreatorbulkRequestOperation(String path)sets the path to the resource endpoint e.g.BulkBuilder.BulkRequestOperationCreatorbulkRequestOperation(String path, String id)sets the path to the resource endpoint e.g.BulkBuilderfailOnErrors(Integer failOnErrors)sets how many errors are allowed on the server side before the request should be rolled backprotected org.apache.http.client.methods.HttpUriRequestgetHttpUriRequest()builds the request for the serverprotected StringgetResource()overrides the default method from the superclass to have easier control of the resource that will be put into the request bodyprotected booleanisExpectedResponseCode(int httpStatus)tells this abstract class if the http status from the server is the expected success statusprotected Function<HttpResponse,Boolean>isResponseParseable()checks if the response contains a schema-uri that matches the value ofSchemaUris.BULK_RESPONSE_URI-
Methods inherited from class de.captaingoldfish.scim.sdk.client.builder.RequestBuilder
addHeaderToRequest, sendRequest, sendRequest, sendRequestWithMultiHeaders, setResource, setResource, toResponse
-
-
-
-
Constructor Detail
-
BulkBuilder
public BulkBuilder(String baseUrl, ScimHttpClient scimHttpClient, boolean isFullUrl)
if the resource should be retrieved by using the fully qualified url- Parameters:
baseUrl- the fully qualified url to the required resourcescimHttpClient- the http client instanceisFullUrl- if the given base url is the fully qualified url or not
-
-
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:
isExpectedResponseCodein classRequestBuilder<BulkResponse>- Parameters:
httpStatus- the http status from the server- Returns:
- true if the response status shows success
-
getHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getHttpUriRequest()
builds the request for the server- Specified by:
getHttpUriRequestin classRequestBuilder<BulkResponse>
-
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
-
isResponseParseable
protected Function<HttpResponse,Boolean> isResponseParseable()
checks if the response contains a schema-uri that matches the value ofSchemaUris.BULK_RESPONSE_URI- Overrides:
isResponseParseablein classRequestBuilder<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)
sets the path to the resource endpoint e.g. "/Users" or "/Groups"
-
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 pathid- the id of an existing resource in case of patch, update or delete
-
-