com.unboundid.scim.sdk
Class SCIMService

java.lang.Object
  extended by com.unboundid.scim.sdk.SCIMService

public class SCIMService
extends Object

The SCIMService class represents a client connection to a SCIM service provider. It handles setting up and configuring the connection which will be used by the SCIMEndpoints that are obtained form this SCIMService.


Constructor Summary
SCIMService(URI baseUrl)
          Constructs a new SCIMService that uses java.net.HttpURLConnection for the HTTP layer.
SCIMService(URI baseUrl, org.apache.wink.client.ClientConfig clientConfig)
          Constructs a new SCIMService that is configured from the provided org.apache.wink.client.ClientConfig instance.
SCIMService(URI baseUrl, String username, String password)
          Constructs a new SCIMService with basic authentication support using the provided credentials.
 
Method Summary
 javax.ws.rs.core.MediaType getAcceptType()
          Retrieves the accept media type that should be used when reading data from the SCIM service provider.
 URI getBaseURL()
          Retrieves the SCIM Service Provider URL.
 javax.ws.rs.core.MediaType getContentType()
          Retrieves the content media type that should be used when writing data to the SCIM service provider.
<R extends BaseResource>
SCIMEndpoint<R>
getEndpoint(ResourceDescriptor resourceDescriptor, ResourceFactory<R> resourceFactory)
          Returns a SCIMEndpoint with the current settings that can be used to invoke CRUD operations.
 SCIMEndpoint<GroupResource> getGroupEndpoint()
          Returns a SCIMEndpoint for the Groups endpoint defined in the core schema.
 ResourceDescriptor getResourceDescriptor(String resourceName, String schema)
          Retrieves the ResourceDescriptor for the specified resource from the SCIM service provider.
 SCIMEndpoint<ResourceDescriptor> getResourceSchemaEndpoint()
          Returns a SCIMEndpoint for the Schemas endpoint.
 ServiceProviderConfig getServiceProviderConfig()
          Retrieves the Service Provider Config from the SCIM service provider.
 String getUserAgent()
          Retrieves the user-agent string that will be used in the HTTP request headers.
 SCIMEndpoint<UserResource> getUserEndpoint()
          Returns a SCIMEndpoint for the Users endpoint defined in the core schema.
 boolean isOverrideDelete()
          Whether to override DELETE operations with POST.
 boolean isOverridePatch()
          Whether to override PATCH operations with POST.
 boolean isOverridePut()
          Whether to override PUT operations with POST.
 BulkResponse processBulkRequest(List<BulkOperation> operations)
          Invoke a bulk request.
 BulkResponse processBulkRequest(List<BulkOperation> operations, int failOnErrors)
          Invoke a bulk request.
 void setAcceptType(javax.ws.rs.core.MediaType acceptType)
          Sets the accept media type that should be used when reading data from the SCIM service provider.
 void setContentType(javax.ws.rs.core.MediaType contentType)
          Sets the content media type that should be used when writing data to the SCIM service provider.
 void setOverrideDelete(boolean overrideDelete)
          Sets whether to override DELETE operations with POST.
 void setOverridePatch(boolean overridePatch)
          Sets whether to override PATCH operations with POST.
 void setOverridePut(boolean overridePut)
          Sets whether to override PUT operations with POST.
 void setUserAgent(String userAgent)
          Sets the user-agent string to use in the request headers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCIMService

public SCIMService(URI baseUrl,
                   org.apache.wink.client.ClientConfig clientConfig)
Constructs a new SCIMService that is configured from the provided org.apache.wink.client.ClientConfig instance.

Parameters:
baseUrl - The SCIM Service Provider URL.
clientConfig - The configuration to use.

SCIMService

public SCIMService(URI baseUrl)
Constructs a new SCIMService that uses java.net.HttpURLConnection for the HTTP layer.

Parameters:
baseUrl - The SCIM Service Provider URL.

SCIMService

public SCIMService(URI baseUrl,
                   String username,
                   String password)
Constructs a new SCIMService with basic authentication support using the provided credentials. This SCIMService will use java.net.HttpURLConnection for the HTTP layer.

Parameters:
baseUrl - The SCIM Service Provider URL.
username - The username.
password - The password.
Method Detail

getEndpoint

public <R extends BaseResource> SCIMEndpoint<R> getEndpoint(ResourceDescriptor resourceDescriptor,
                                                            ResourceFactory<R> resourceFactory)
Returns a SCIMEndpoint with the current settings that can be used to invoke CRUD operations. Any changes to the SCIMService configuration will not be reflected in the returned SCIMEndpoint.

Type Parameters:
R - The type of SCIM resource instances.
Parameters:
resourceDescriptor - The ResourceDescriptor of the endpoint.
resourceFactory - The ResourceFactory that should be used to create SCIM resource instances.
Returns:
The SCIMEndpoint that can be used to invoke CRUD operations.

getUserEndpoint

public SCIMEndpoint<UserResource> getUserEndpoint()
Returns a SCIMEndpoint for the Users endpoint defined in the core schema.

Returns:
The SCIMEndpoint for the Users endpoint defined in the core schema.

getGroupEndpoint

public SCIMEndpoint<GroupResource> getGroupEndpoint()
Returns a SCIMEndpoint for the Groups endpoint defined in the core schema.

Returns:
The SCIMEndpoint for the Groups endpoint defined in the core schema.

getResourceSchemaEndpoint

public SCIMEndpoint<ResourceDescriptor> getResourceSchemaEndpoint()
Returns a SCIMEndpoint for the Schemas endpoint. This endpoint allows for the retrieval of schema for all service provider supported resources.

Returns:
The SCIMEndpoint for the Schemas endpoint.

getResourceDescriptor

public ResourceDescriptor getResourceDescriptor(String resourceName,
                                                String schema)
                                         throws SCIMException
Retrieves the ResourceDescriptor for the specified resource from the SCIM service provider.

Parameters:
resourceName - The name of the resource.
schema - The schema URN of the resource or null to match only based on the name of the resource.
Returns:
The ResourceDescriptor for the specified resource or null if none are found.
Throws:
SCIMException - If the ResourceDescriptor could not be read.

getServiceProviderConfig

public ServiceProviderConfig getServiceProviderConfig()
                                               throws SCIMException
Retrieves the Service Provider Config from the SCIM service provider.

Returns:
The Service Provider Config.
Throws:
SCIMException - If the Service Provider Config could not be read.

processBulkRequest

public BulkResponse processBulkRequest(List<BulkOperation> operations)
                                throws SCIMException
Invoke a bulk request. The service provider will perform as many operations as possible without regard to the number of failures.

Parameters:
operations - The operations to be performed.
Returns:
The bulk response.
Throws:
SCIMException - If the request fails.

processBulkRequest

public BulkResponse processBulkRequest(List<BulkOperation> operations,
                                       int failOnErrors)
                                throws SCIMException
Invoke a bulk request.

Parameters:
operations - The operations to be performed.
failOnErrors - The number of errors that the service provider will accept before the operation is terminated and an error response is returned. A value of -1 indicates the the service provider will continue to perform as many operations as possible without regard to failures.
Returns:
The bulk response.
Throws:
SCIMException - If the request fails.

getBaseURL

public URI getBaseURL()
Retrieves the SCIM Service Provider URL.

Returns:
The SCIM Service Provider URL.

getContentType

public javax.ws.rs.core.MediaType getContentType()
Retrieves the content media type that should be used when writing data to the SCIM service provider.

Returns:
The content media type that should be used when writing data to the SCIM service provider.

setContentType

public void setContentType(javax.ws.rs.core.MediaType contentType)
Sets the content media type that should be used when writing data to the SCIM service provider.

Parameters:
contentType - he content media type that should be used when writing data to the SCIM service provider.

getAcceptType

public javax.ws.rs.core.MediaType getAcceptType()
Retrieves the accept media type that should be used when reading data from the SCIM service provider.

Returns:
The accept media type that should be used when reading data from the SCIM service provider.

setAcceptType

public void setAcceptType(javax.ws.rs.core.MediaType acceptType)
Sets the accept media type that should be used when reading data from the SCIM service provider.

Parameters:
acceptType - The accept media type that should be used when reading data from the SCIM service provider.

getUserAgent

public String getUserAgent()
Retrieves the user-agent string that will be used in the HTTP request headers.

Returns:
The user-agent string. This may be null, in which case a default user-agent will be used.

setUserAgent

public void setUserAgent(String userAgent)
Sets the user-agent string to use in the request headers.

Parameters:
userAgent - The user-agent string that should be used.

isOverrideDelete

public boolean isOverrideDelete()
Whether to override DELETE operations with POST.

Returns:
true to override DELETE operations with POST or false to use the DELETE method.

setOverrideDelete

public void setOverrideDelete(boolean overrideDelete)
Sets whether to override DELETE operations with POST.

Parameters:
overrideDelete - true to override DELETE operations with POST or false to use the DELETE method.

isOverridePatch

public boolean isOverridePatch()
Whether to override PATCH operations with POST.

Returns:
true to override PATCH operations with POST or false to use the PATCH method.

setOverridePatch

public void setOverridePatch(boolean overridePatch)
Sets whether to override PATCH operations with POST.

Parameters:
overridePatch - true to override PATCH operations with POST or false to use the PATCH method.

isOverridePut

public boolean isOverridePut()
Whether to override PUT operations with POST.

Returns:
true to override PUT operations with POST or false to use the PUT method.

setOverridePut

public void setOverridePut(boolean overridePut)
Sets whether to override PUT operations with POST.

Parameters:
overridePut - true to override PUT operations with POST or false to use the PUT method.


Copyright © 2011-2012 UnboundID. All Rights Reserved.