Class ScimService

    • Constructor Detail

      • ScimService

        public ScimService​(@NotNull
                           jakarta.ws.rs.client.WebTarget baseTarget)
        Create a new client instance to the SCIM 2 service provider at the provided WebTarget. The path of the WebTarget should be the base URI SCIM 2 service (i.e., https://host/scim/v2).
        Parameters:
        baseTarget - The web target for the base URI of the SCIM 2 service provider.
    • Method Detail

      • create

        @NotNull
        public <T extends ScimResource> T create​(@NotNull
                                                 String endpoint,
                                                 @NotNull
                                                 T resource)
                                          throws ScimException
        Create the provided new SCIM resource at the service provider.
        Specified by:
        create in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        resource - The new resource to create.
        Returns:
        The successfully create SCIM resource.
        Throws:
        ScimException - if an error occurs.
      • retrieve

        @NotNull
        public <T extends ScimResource> T retrieve​(@NotNull
                                                   String endpoint,
                                                   @NotNull
                                                   String id,
                                                   @NotNull
                                                   Class<T> cls)
                                            throws ScimException
        Retrieve a known SCIM resource from the service provider.
        Specified by:
        retrieve in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        cls - The Java class object used to determine the type to return.
        Returns:
        The successfully retrieved SCIM resource.
        Throws:
        ScimException - if an error occurs.
      • retrieve

        @NotNull
        public <T extends ScimResource> T retrieve​(@NotNull
                                                   URI url,
                                                   @NotNull
                                                   Class<T> cls)
                                            throws ScimException
        Retrieve a known SCIM resource from the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        url - The URL of the resource to retrieve.
        cls - The Java class object used to determine the type to return.
        Returns:
        The successfully retrieved SCIM resource.
        Throws:
        ScimException - if an error occurs.
      • retrieve

        @NotNull
        public <T extends ScimResource> T retrieve​(@NotNull
                                                   T resource)
                                            throws ScimException
        Retrieve a known SCIM resource from the service provider. If the service provider supports resource versioning and the resource has not been modified, the provided resource will be returned.
        Specified by:
        retrieve in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The resource to retrieve.
        Returns:
        The successfully retrieved SCIM resource.
        Throws:
        ScimException - if an error occurs.
      • replace

        @NotNull
        public <T extends ScimResource> T replace​(@NotNull
                                                  T resource)
                                           throws ScimException
        Modify a SCIM resource by replacing the resource's attributes at the service provider. If the service provider supports resource versioning, the resource will only be modified if it has not been modified since it was retrieved.
        Specified by:
        replace in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The previously retrieved and revised resource.
        Returns:
        The successfully replaced SCIM resource.
        Throws:
        ScimException - if an error occurs.
      • delete

        public void delete​(@NotNull
                           String endpoint,
                           @NotNull
                           String id)
                    throws ScimException
        Delete a SCIM resource at the service provider.
        Specified by:
        delete in interface ScimInterface
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        Throws:
        ScimException - if an error occurs.
      • delete

        public void delete​(@NotNull
                           URI url)
                    throws ScimException
        Delete a SCIM resource at the service provider.
        Parameters:
        url - The URL of the resource to delete.
        Throws:
        ScimException - if an error occurs.
      • createRequest

        @NotNull
        public <T extends ScimResourceCreateRequestBuilder<T> createRequest​(@NotNull
                                                                              String endpoint,
                                                                              @NotNull
                                                                              T resource)
        Build a request to create the provided new SCIM resource at the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        resource - The new resource to create.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • retrieveRequest

        @NotNull
        public RetrieveRequestBuilder.Typed retrieveRequest​(@NotNull
                                                            String endpoint,
                                                            @NotNull
                                                            String id)
        Build a request to retrieve a known SCIM resource from the service provider.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • retrieveRequest

        @NotNull
        public RetrieveRequestBuilder.Typed retrieveRequest​(@NotNull
                                                            URI url)
        Build a request to retrieve a known SCIM resource from the service provider.
        Parameters:
        url - The URL of the resource to retrieve.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • retrieveRequest

        @NotNull
        public <T extends ScimResourceRetrieveRequestBuilder.Generic<T> retrieveRequest​(@NotNull
                                                                                          T resource)
        Build a request to retrieve a known SCIM resource from the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The resource to retrieve.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • searchRequest

        @NotNull
        public SearchRequestBuilder searchRequest​(@NotNull
                                                  String endpoint)
        Build a request to query and retrieve resources of a single resource type from the service provider.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • replaceRequest

        @NotNull
        public <T extends ScimResourceReplaceRequestBuilder<T> replaceRequest​(@NotNull
                                                                                URI uri,
                                                                                @NotNull
                                                                                T resource)
        Build a request to modify a SCIM resource by replacing the resource's attributes at the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        uri - The URL of the resource to modify.
        resource - The resource to replace.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • replaceRequest

        @NotNull
        public <T extends ScimResourceReplaceRequestBuilder<T> replaceRequest​(@NotNull
                                                                                T resource)
        Build a request to modify a SCIM resource by replacing the resource's attributes at the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The previously retrieved and revised resource.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • modify

        @NotNull
        public <T extends ScimResource> T modify​(@NotNull
                                                 String endpoint,
                                                 @NotNull
                                                 String id,
                                                 @NotNull
                                                 PatchRequest patchRequest,
                                                 @NotNull
                                                 Class<T> clazz)
                                          throws ScimException
        Modify a SCIM resource by updating one or more attributes using a sequence of operations to "add", "remove", or "replace" values. The service provider configuration may be used to discover service provider support for PATCH.
        Specified by:
        modify in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        patchRequest - The patch request to use for the update.
        clazz - The class of the SCIM resource.
        Returns:
        The modified resource.
        Throws:
        ScimException - if an error occurs.
      • modifyRequest

        @NotNull
        public ModifyRequestBuilder.Typed modifyRequest​(@NotNull
                                                        String endpoint,
                                                        @NotNull
                                                        String id)
        Modify a SCIM resource by updating one or more attributes using a sequence of operations to "add", "remove", or "replace" values. The service provider configuration may be used to discover service provider support for PATCH.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • modifyRequest

        @NotNull
        public ModifyRequestBuilder.Typed modifyRequest​(@NotNull
                                                        URI url)
        Modify a SCIM resource by updating one or more attributes using a sequence of operations to "add", "remove", or "replace" values. The service provider configuration may be used to discover service provider support for PATCH.
        Parameters:
        url - The URL of the resource to modify.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • modify

        @NotNull
        public <T extends ScimResource> T modify​(@NotNull
                                                 T resource,
                                                 @NotNull
                                                 PatchRequest patchRequest)
                                          throws ScimException
        Modify a SCIM resource by updating one or more attributes using a sequence of operations to "add", "remove", or "replace" values. The service provider configuration may be used to discover service provider support for PATCH.
        Specified by:
        modify in interface ScimInterface
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The resource to modify.
        patchRequest - the patch request to use for the update.
        Returns:
        The modified resource.
        Throws:
        ScimException - if an error occurs.
      • modifyRequest

        @NotNull
        public <T extends ScimResourceModifyRequestBuilder.Generic<T> modifyRequest​(@NotNull
                                                                                      T resource)
        Modify a SCIM resource by updating one or more attributes using a sequence of operations to "add", "remove", or "replace" values. The service provider configuration may be used to discover service provider support for PATCH.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The resource to modify.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
      • deleteRequest

        @NotNull
        public DeleteRequestBuilder deleteRequest​(@NotNull
                                                  String endpoint,
                                                  @NotNull
                                                  String id)
                                           throws ScimException
        Build a request to delete a SCIM resource at the service provider.
        Parameters:
        endpoint - The resource endpoint such as: "Users" or "Groups" as defined by the associated resource type.
        id - The resource identifier (for example the value of the "id" attribute).
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
        Throws:
        ScimException - if an error occurs.
      • deleteRequest

        @NotNull
        public <T extends ScimResourceDeleteRequestBuilder deleteRequest​(@NotNull
                                                                           T resource)
                                                                    throws ScimException
        Build a request to delete a SCIM resource at the service provider.
        Type Parameters:
        T - The Java type of the resource.
        Parameters:
        resource - The resource to delete.
        Returns:
        The request builder that may be used to specify additional request parameters and to invoke the request.
        Throws:
        ScimException - if an error occurs.