Class PatchBuilder<T extends ResourceNode>
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.client.builder.RequestBuilder<T>
-
- de.captaingoldfish.scim.sdk.client.builder.ETagRequestBuilder<T>
-
- de.captaingoldfish.scim.sdk.client.builder.PatchBuilder<T>
-
public class PatchBuilder<T extends ResourceNode> extends ETagRequestBuilder<T>
allows to build a patch request that can be sent to the server
created at: 01.05.2020- Author:
- Pascal Knüppel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPatchBuilder.PatchOperationBuilder<T extends ResourceNode>used to build a simple patch operation
-
Constructor Summary
Constructors Constructor Description PatchBuilder(String fullUrl, Class<T> responseEntityType, ScimHttpClient scimHttpClient)if the resource should be retrieved by using the fully qualified urlPatchBuilder(String baseUrl, String endpoint, String resourceId, Class<T> responseEntityType, ScimHttpClient scimHttpClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchBuilder.PatchOperationBuilder<T>addOperation()protected org.apache.http.client.methods.HttpUriRequestgetHttpUriRequest()builds the request for the serverStringgetResource()protected booleanisExpectedResponseCode(int httpStatus)tells this abstract class if the http status from the server is the expected success statusRequestBuilder<T>setPatchResource(PatchOpRequest resource)sets the patch request directly if already build into the request contextRequestBuilder<T>setPatchResource(String resource)sets the patch request directly if already build into the request context-
Methods inherited from class de.captaingoldfish.scim.sdk.client.builder.ETagRequestBuilder
setETagForIfMatch, setETagForIfMatch, setETagForIfNoneMatch, setETagForIfNoneMatch
-
Methods inherited from class de.captaingoldfish.scim.sdk.client.builder.RequestBuilder
addHeaderToRequest, isResponseParseable, sendRequest, sendRequest, sendRequestWithMultiHeaders, setResource, setResource, toResponse
-
-
-
-
Constructor Detail
-
PatchBuilder
public PatchBuilder(String fullUrl, Class<T> responseEntityType, ScimHttpClient scimHttpClient)
if the resource should be retrieved by using the fully qualified url- Parameters:
fullUrl- the fully qualified url to the required resourceresponseEntityType- the type of the resource that should be returnedscimHttpClient- the http client instance
-
-
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<T extends ResourceNode>- Parameters:
httpStatus- the http status from the server- Returns:
- true if the response status shows success
-
setPatchResource
public RequestBuilder<T> setPatchResource(PatchOpRequest resource)
sets the patch request directly if already build into the request context- Parameters:
resource- the patch request representation
-
setPatchResource
public RequestBuilder<T> setPatchResource(String resource)
sets the patch request directly if already build into the request context- Parameters:
resource- the patch request representation
-
addOperation
public PatchBuilder.PatchOperationBuilder<T> addOperation()
- Returns:
- an operation builder to add a new operation
-
getHttpUriRequest
protected org.apache.http.client.methods.HttpUriRequest getHttpUriRequest()
builds the request for the server- Specified by:
getHttpUriRequestin classRequestBuilder<T extends ResourceNode>
-
getResource
public final String getResource()
- Returns:
- the resource that will be sent to the server
-
-