com.unboundid.scim.sdk
Class SCIMEndpoint<R extends BaseResource>

java.lang.Object
  extended by com.unboundid.scim.sdk.SCIMEndpoint<R>
Type Parameters:
R - The type of resource instances handled by this SCIMEndpoint.

public class SCIMEndpoint<R extends BaseResource>
extends Object

This class represents a SCIM endpoint (ie. Users, Groups, etc.) and handles all protocol-level interactions with the service provider. It acts as a helper class for invoking CRUD operations of resources and processing their results.


Method Summary
 R create(R resource)
          Create the specified resource instance at the service provider.
 R create(R resource, String... requestedAttributes)
          Create the specified resource instance at the service provider and return only the specified attributes from the newly inserted resource.
 void delete(String id)
          Delete the resource instance specified by the provided ID.
 void delete(String id, String etag)
          Delete the resource instance specified by the provided ID.
 R get(String id)
          Retrieves a resource instance given the ID.
 R get(String id, String etag, String... requestedAttributes)
          Retrieves a resource instance given the ID, only if the current version has been modified.
 R newResource()
          Constructs a new instance of a resource object which is empty.
 Resources<R> query(String filter)
          Retrieves all resource instances that match the provided filter.
 Resources<R> query(String filter, SortParameters sortParameters, PageParameters pageParameters, String... requestedAttributes)
          Retrieves all resource instances that match the provided filter.
 R update(R resource)
          Update the existing resource with the one provided.
 R update(R resource, String etag, String... requestedAttributes)
          Update the existing resource with the one provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newResource

public R newResource()
Constructs a new instance of a resource object which is empty. This method does not interact with the SCIM service. It creates a local object that may be provided to the create(R) method after the attributes have been specified.

Returns:
A new instance of a resource object.

get

public R get(String id)
                           throws SCIMException
Retrieves a resource instance given the ID.

Parameters:
id - The ID of the resource to retrieve.
Returns:
The retrieved resource.
Throws:
SCIMException - If an error occurs.

get

public R get(String id,
             String etag,
             String... requestedAttributes)
                           throws SCIMException
Retrieves a resource instance given the ID, only if the current version has been modified.

Parameters:
id - The ID of the resource to retrieve.
etag - The entity tag that indicates the entry should be returned only if the entity tag of the current resource is different from the provided value. A value of null indicates unconditional return.
requestedAttributes - The attributes of the resource to retrieve.
Returns:
The retrieved resource or null if the requested resource has not been modified.
Throws:
SCIMException - If an error occurs.

query

public Resources<R> query(String filter)
                                        throws SCIMException
Retrieves all resource instances that match the provided filter.

Parameters:
filter - The filter that should be used.
Returns:
The resource instances that match the provided filter.
Throws:
SCIMException - If an error occurs.

query

public Resources<R> query(String filter,
                          SortParameters sortParameters,
                          PageParameters pageParameters,
                          String... requestedAttributes)
                                        throws SCIMException
Retrieves all resource instances that match the provided filter. Matching resources are returned sorted according to the provided SortParameters. PageParameters maybe used to specify the range of resource instances that are returned.

Parameters:
filter - The filter that should be used.
sortParameters - The sort parameters that should be used.
pageParameters - The page parameters that should be used.
requestedAttributes - The attributes of the resource to retrieve.
Returns:
The resource instances that match the provided filter.
Throws:
SCIMException - If an error occurs.

create

public R create(R resource)
                              throws SCIMException
Create the specified resource instance at the service provider.

Parameters:
resource - The resource to create.
Returns:
The newly inserted resource returned by the service provider.
Throws:
SCIMException - If an error occurs.

create

public R create(R resource,
                String... requestedAttributes)
                              throws SCIMException
Create the specified resource instance at the service provider and return only the specified attributes from the newly inserted resource.

Parameters:
resource - The resource to create.
requestedAttributes - The attributes of the newly inserted resource to retrieve.
Returns:
The newly inserted resource returned by the service provider.
Throws:
SCIMException - If an error occurs.

update

public R update(R resource)
                              throws SCIMException
Update the existing resource with the one provided.

Parameters:
resource - The modified resource to be updated.
Returns:
The updated resource returned by the service provider.
Throws:
SCIMException - If an error occurs.

update

public R update(R resource,
                String etag,
                String... requestedAttributes)
                              throws SCIMException
Update the existing resource with the one provided. This update is conditional upon the provided entity tag matching the tag from the current resource. If (and only if) they match, the update will be performed.

Parameters:
resource - The modified resource to be updated.
etag - The entity tag value that is the expected value for the target resource. A value of null will not set an etag precondition and a value of "*" will perform an unconditional update.
requestedAttributes - The attributes of updated resource to return.
Returns:
The updated resource returned by the service provider.
Throws:
SCIMException - If an error occurs.

delete

public void delete(String id)
            throws SCIMException
Delete the resource instance specified by the provided ID.

Parameters:
id - The ID of the resource to delete.
Throws:
SCIMException - If an error occurs.

delete

public void delete(String id,
                   String etag)
            throws SCIMException
Delete the resource instance specified by the provided ID. This delete is conditional upon the provided entity tag matching the tag from the current resource. If (and only if) they match, the delete will be performed.

Parameters:
id - The ID of the resource to delete.
etag - The entity tag value that is the expected value for the target resource. A value of null will not set an etag precondition and a value of "*" will perform an unconditional delete.
Throws:
SCIMException - If an error occurs.


Copyright © 2011-2012 UnboundID. All Rights Reserved.