com.unboundid.scim.wink
Class BulkContentRequestHandler

java.lang.Object
  extended by com.unboundid.scim.sdk.BulkContentHandler
      extended by com.unboundid.scim.wink.BulkContentRequestHandler

public class BulkContentRequestHandler
extends BulkContentHandler

This class implements the bulk operation handler to process bulk operation requests in the SCIM server. The original purpose of the BulkContentHandler interface was to allow each operation to be processed as soon as it had been read so that we do not have to hold the entire content of a bulk request in memory. However, there are two issues making that approach infeasible:

  1. Since JSON objects are unordered, the failOnErrors value could conceivably come after the Operations array, which would be too late.
  2. It would not be possible to reject a request that exceeded the maxOperations setting without processing any operations.


Constructor Summary
BulkContentRequestHandler(SCIMApplication application, RequestContext requestContext, SCIMBackend backend, BulkStreamResponse bulkStreamResponse)
          Create a new instance of this bulk operation handler.
 
Method Summary
 ResourceDescriptor getResourceDescriptor(String endpoint)
          Retrieve the resource descriptor for a given endpoint.
 void handleFailOnErrors(int failOnErrors)
          Handles the value of failOnErrors.
 boolean handleOperation(int opIndex, BulkOperation bulkOperation)
          Handle an individual operation.
 String transformValue(int opIndex, String value)
          Transform a data value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkContentRequestHandler

public BulkContentRequestHandler(SCIMApplication application,
                                 RequestContext requestContext,
                                 SCIMBackend backend,
                                 BulkStreamResponse bulkStreamResponse)
Create a new instance of this bulk operation handler.

Parameters:
application - The SCIM application.
requestContext - The request context for the bulk request.
backend - The SCIM backend to process the operations.
bulkStreamResponse - The bulk stream response to write response operations to.
Method Detail

handleFailOnErrors

public void handleFailOnErrors(int failOnErrors)
Handles the value of failOnErrors.

Overrides:
handleFailOnErrors in class BulkContentHandler
Parameters:
failOnErrors - The number of errors that the Service Provider will accept before the operation is terminated and an error response is returned.

transformValue

public String transformValue(int opIndex,
                             String value)
Transform a data value. This method may be used to resolve bulkId references to resource IDs.

Overrides:
transformValue in class BulkContentHandler
Parameters:
opIndex - The index of the bulk operation containing the data value.
value - The value to be transformed.
Returns:
The transformed value.

getResourceDescriptor

public ResourceDescriptor getResourceDescriptor(String endpoint)
Retrieve the resource descriptor for a given endpoint.

Overrides:
getResourceDescriptor in class BulkContentHandler
Parameters:
endpoint - A SCIM resource endpoint.
Returns:
The resource descriptor for this endpoint, or null if the endpoint is unknown.

handleOperation

public boolean handleOperation(int opIndex,
                               BulkOperation bulkOperation)
                        throws SCIMException
Handle an individual operation.

Overrides:
handleOperation in class BulkContentHandler
Parameters:
opIndex - The index of the operation.
bulkOperation - The individual operation within the bulk operation.
Returns:
true if operations should continue to be provided, or false if the remaining operations are of no interest.
Throws:
SCIMException - If an error occurs that prevents processing of the entire bulk content.


Copyright © 2011-2012 UnboundID. All Rights Reserved.