Class RequestBuilder<T extends ScimObjectNode>

    • Method Detail

      • setResource

        protected RequestBuilder<T> setResource​(String resource)
        Parameters:
        resource - sets the resource that should be sent to the service provider
      • setResource

        protected RequestBuilder<T> setResource​(com.fasterxml.jackson.databind.JsonNode resource)
        Parameters:
        resource - sets the resource that should be sent to the service provider
      • isExpectedResponseCode

        protected abstract boolean isExpectedResponseCode​(int httpStatus)
        tells this abstract class if the http status from the server is the expected success status
        Parameters:
        httpStatus - the http status from the server
        Returns:
        true if the response status shows success
      • isResponseParseable

        protected Function<HttpResponse,​Boolean> isResponseParseable()
        an optional method that might be used by a builder to verify if the response can be parsed into the expected resource type
      • sendRequest

        public ServerResponse<T> sendRequest()
        sends the defined request to the service provider
        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
      • sendRequestWithMultiHeaders

        public ServerResponse<T> sendRequestWithMultiHeaders​(Map<String,​String[]> httpHeaders)
        sends the defined request to the service provider
        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
      • addHeaderToRequest

        protected void addHeaderToRequest​(Map<String,​String[]> defaultHeaders,
                                          Map<String,​String[]> preferredHeaders,
                                          org.apache.http.client.methods.HttpUriRequest request)
        adds the http headers to the current request
        Parameters:
        defaultHeaders - the default http headers from the ScimClientConfig. these headers will be overridden by the map from sendRequest(Map) if duplicate keys are present
        preferredHeaders - the http headers that have been added to the sendRequest(Map) method. This map takes precedence for the default headers set in the ScimClientConfig
        request - the request object to which these http headers will be added
      • sendRequest

        public ServerResponse<T> sendRequest​(Map<String,​String> headers)
        sends the defined request to the service provider
        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
      • toResponse

        protected ServerResponse<T> toResponse​(HttpResponse response)
        moved into its own method to override the returned class in the list-builder that has a sub-generic type
      • getHttpUriRequest

        protected abstract org.apache.http.client.methods.HttpUriRequest getHttpUriRequest()
        builds the request for the server
      • getBaseUrl

        protected String getBaseUrl()
        the base url to the scim service
      • getEndpoint

        protected String getEndpoint()
        the resource endpoint path e.g. /Users or /Groups
      • getResource

        protected String getResource()
        the resource that should be sent to the service provider
      • getResponseEntityType

        protected Class<T> getResponseEntityType()
        the expected resource type
      • getScimHttpClient

        protected ScimHttpClient getScimHttpClient()
        an apache http client wrapper that offers some convenience methods