Class PatchBuilder<T extends ResourceNode>


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
  • Constructor Details

    • 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 resource
      responseEntityType - the type of the resource that should be returned
      scimHttpClient - the http client instance
    • PatchBuilder

      public PatchBuilder(String baseUrl, String endpoint, String resourceId, Class<T> responseEntityType, ScimHttpClient scimHttpClient)
  • Method Details

    • setExpectedResponseHeaders

      public PatchBuilder<T> setExpectedResponseHeaders(Map<String,String> requiredResponseHeaders)
      Set this if the SCIM provider is not behaving SCIM compliant by manipulating the expected headers that will be returned from the server
      • null: The headers are checked as normally for the content-type "application/scim+json"
      • empty map: The check of response headers is disabled
      • filled map: The check of the response headers will be done with the entries of this map
      Overrides:
      setExpectedResponseHeaders in class RequestBuilder<T extends ResourceNode>
    • 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<T extends ResourceNode>
      Parameters:
      httpStatus - the http status from the server
      Returns:
      true if the response status shows success
    • setPatchResource

      public PatchBuilder<T> setPatchResource(PatchOpRequest resource)
      sets the patch request directly if already build into the request context
      Parameters:
      resource - the patch request representation
    • setPatchResource

      public PatchBuilder<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:
      getHttpUriRequest in class RequestBuilder<T extends ResourceNode>
    • getResource

      public final String getResource()
      Description copied from class: RequestBuilder
      the resource that should be sent to the service provider
      Overrides:
      getResource in class RequestBuilder<T extends ResourceNode>
      Returns:
      the resource that will be sent to the server