Class ScimRequestBuilder
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.client.ScimRequestBuilder
-
- All Implemented Interfaces:
AutoCloseable
public class ScimRequestBuilder extends Object implements AutoCloseable
author Pascal Knueppel
created at: 07.12.2019 - 23:08
this class can be used to build any type of request for SCIM
-
-
Constructor Summary
Constructors Constructor Description ScimRequestBuilder(String baseUrl, ScimClientConfig scimClientConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkBuilderbulk()builds an bulk request builderBulkBuilderbulk(String fullyQualifiedUrl)builds an bulk request buildervoidclose()closes the underlying apache http client.<T extends ResourceNode>
CreateBuilder<T>create(Class<T> type, String endpoint)builds a create builder class based on the given type<T extends ResourceNode>
CreateBuilder<T>create(String fullyQualifiedUrl, Class<T> type)builds a create builder class based on the given type<T extends ResourceNode>
DeleteBuilder<T>delete(Class<T> type, String endpoint)builds a delete builder class based on the given type used to delete a singleton entry at the provider<T extends ResourceNode>
DeleteBuilder<T>delete(Class<T> type, String endpoint, String resourceId)builds a delete builder class based on the given type<T extends ResourceNode>
DeleteBuilder<T>delete(String fullyQualifiedUrl, Class<T> type)builds a delete builder class based on the given type<T extends ResourceNode>
GetBuilder<T>get(Class<T> type, String endpoint)builds a get builder that is used to access a singleton resource from the provider<T extends ResourceNode>
GetBuilder<T>get(Class<T> type, String endpoint, String resourceId)builds a get builder class based on the given type<T extends ResourceNode>
GetBuilder<T>get(String fullyQualifiedUrl, Class<T> type)builds a get builder class based on the given typeScimClientConfiggetScimClientConfig()the configuration for the client that should be usedprotected ScimHttpClientgetScimHttpClient()a convenience implementation that wraps the apache http clientServiceProvidergetServiceProvider()the service provider configuration from the SCIM provider application<T extends ResourceNode>
ListBuilder<T>list(Class<T> type, String endpoint)builds an update builder class based on the given type<T extends ResourceNode>
ListBuilder<T>list(String fullyQualifiedUrl, Class<T> type)builds an update builder class based on the given typeServiceProviderloadServiceProviderConfiguration()tries to load the service provider configuration from the SCIM provider, but it will not cause any aborts if loading of the configuration does fail<T extends ResourceNode>
PatchBuilder<T>patch(Class<T> type, String endpoint)builds a patch request builder used to patch a singleton entry at the provider<T extends ResourceNode>
PatchBuilder<T>patch(Class<T> type, String endpoint, String resourceId)builds a patch request builder<T extends ResourceNode>
PatchBuilder<T>patch(String fullyQualifiedUrl, Class<T> type)builds a patch request buildervoidsetServiceProvider(ServiceProvider serviceProvider)the service provider configuration from the SCIM provider application<T extends ResourceNode>
UpdateBuilder<T>update(Class<T> type, String endpoint)builds an update builder class used to update a singleton entry at the provider<T extends ResourceNode>
UpdateBuilder<T>update(Class<T> type, String endpoint, String resourceId)builds an update builder class based on the given type<T extends ResourceNode>
UpdateBuilder<T>update(String fullyQualifiedUrl, Class<T> type)builds an update builder class based on the given type
-
-
-
Constructor Detail
-
ScimRequestBuilder
public ScimRequestBuilder(String baseUrl, ScimClientConfig scimClientConfig)
-
-
Method Detail
-
loadServiceProviderConfiguration
public ServiceProvider loadServiceProviderConfiguration()
tries to load the service provider configuration from the SCIM provider, but it will not cause any aborts if loading of the configuration does fail
-
create
public <T extends ResourceNode> CreateBuilder<T> create(Class<T> type, String endpoint)
builds a create builder class based on the given type- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a create-request builder for the given resource type
-
create
public <T extends ResourceNode> CreateBuilder<T> create(String fullyQualifiedUrl, Class<T> type)
builds a create builder class based on the given type- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a create-request builder for the given resource type
-
get
public <T extends ResourceNode> GetBuilder<T> get(Class<T> type, String endpoint, String resourceId)
builds a get builder class based on the given type- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"resourceId- the id of the resource that should be returned (may be null if the endpoint path already contains the id)- Returns:
- a get-request builder for the given resource type
-
get
public <T extends ResourceNode> GetBuilder<T> get(Class<T> type, String endpoint)
builds a get builder that is used to access a singleton resource from the provider- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a get-request builder for the given resource type
-
get
public <T extends ResourceNode> GetBuilder<T> get(String fullyQualifiedUrl, Class<T> type)
builds a get builder class based on the given type- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a get-request builder for the given resource type
-
delete
public <T extends ResourceNode> DeleteBuilder<T> delete(Class<T> type, String endpoint, String resourceId)
builds a delete builder class based on the given type- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"resourceId- the id of the resource that should be returned (may be null if the endpoint path already contains the id)- Returns:
- a delete-request builder for the given resource type
-
delete
public <T extends ResourceNode> DeleteBuilder<T> delete(Class<T> type, String endpoint)
builds a delete builder class based on the given type used to delete a singleton entry at the provider- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a delete-request builder for the given resource type
-
delete
public <T extends ResourceNode> DeleteBuilder<T> delete(String fullyQualifiedUrl, Class<T> type)
builds a delete builder class based on the given type- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a delete-request builder for the given resource type
-
update
public <T extends ResourceNode> UpdateBuilder<T> update(Class<T> type, String endpoint, String resourceId)
builds an update builder class based on the given type- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"resourceId- the id of the resource that should be returned (may be null if the endpoint path already contains the id)- Returns:
- a update-request builder for the given resource type
-
update
public <T extends ResourceNode> UpdateBuilder<T> update(Class<T> type, String endpoint)
builds an update builder class used to update a singleton entry at the provider- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a update-request builder for the given resource type
-
update
public <T extends ResourceNode> UpdateBuilder<T> update(String fullyQualifiedUrl, Class<T> type)
builds an update builder class based on the given type- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a update-request builder for the given resource type
-
list
public <T extends ResourceNode> ListBuilder<T> list(Class<T> type, String endpoint)
builds an update builder class based on the given type- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a update-request builder for the given resource type
-
list
public <T extends ResourceNode> ListBuilder<T> list(String fullyQualifiedUrl, Class<T> type)
builds an update builder class based on the given type- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a update-request builder for the given resource type
-
bulk
public BulkBuilder bulk()
builds an bulk request builder- Returns:
- a bulk-request builder
-
bulk
public BulkBuilder bulk(String fullyQualifiedUrl)
builds an bulk request builder- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified url- Returns:
- a bulk-request builder
-
patch
public <T extends ResourceNode> PatchBuilder<T> patch(Class<T> type, String endpoint, String resourceId)
builds a patch request builder- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"resourceId- the id of the resource that should be returned (may be null if the endpoint path already contains the id)- Returns:
- a patch-request builder
-
patch
public <T extends ResourceNode> PatchBuilder<T> patch(Class<T> type, String endpoint)
builds a patch request builder used to patch a singleton entry at the provider- Parameters:
type- the type that should be createdendpoint- the endpoint path to the resource e.g. "/Users" or "/Groups"- Returns:
- a patch-request builder
-
patch
public <T extends ResourceNode> PatchBuilder<T> patch(String fullyQualifiedUrl, Class<T> type)
builds a patch request builder- Parameters:
fullyQualifiedUrl- if the builder should not build the url on the baseUrl but use another fully qualified urltype- the type that should be created- Returns:
- a patch-request builder
-
close
public void close()
closes the underlying apache http client. If the http client is closed this request builder is still usable. The next request will simply be executed with a new http client instance- Specified by:
closein interfaceAutoCloseable
-
getScimClientConfig
public ScimClientConfig getScimClientConfig()
the configuration for the client that should be used
-
getScimHttpClient
protected ScimHttpClient getScimHttpClient()
a convenience implementation that wraps the apache http client
-
getServiceProvider
public ServiceProvider getServiceProvider()
the service provider configuration from the SCIM provider application
-
setServiceProvider
public void setServiceProvider(ServiceProvider serviceProvider)
the service provider configuration from the SCIM provider application
-
-