com.unboundid.scim.marshal.json
Class JsonStreamMarshaller

java.lang.Object
  extended by com.unboundid.scim.marshal.json.JsonStreamMarshaller
All Implemented Interfaces:
StreamMarshaller

public class JsonStreamMarshaller
extends Object
implements StreamMarshaller

This class provides a SCIM object marshaller implementation to write a stream of SCIM objects to their JSON representation.


Constructor Summary
JsonStreamMarshaller(OutputStream outputStream)
          Create a JSON marshaller that writes to the given output stream.
 
Method Summary
 void bulkMarshal(int failOnErrors, List<BulkOperation> operations)
          Write the content of a SCIM bulk operation request or response.
 void close()
          Close the marshaller.
 void marshal(BaseResource resource)
          Write a SCIM object.
 void marshal(Resources<? extends BaseResource> response)
          Write a SCIM query response.
 void marshal(SCIMException response)
          Write a SCIM error response.
 void writeBulkFinish()
          Write the end of a bulk request or response.
 void writeBulkOperation(BulkOperation o)
          Write a bulk operation to a bulk request or response.
 void writeBulkStart(int failOnErrors, Set<String> schemaURIs)
          Write the start of a bulk request or response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonStreamMarshaller

public JsonStreamMarshaller(OutputStream outputStream)
                     throws SCIMException
Create a JSON marshaller that writes to the given output stream. The resulting marshaller must be closed after use.

Parameters:
outputStream - The ouput stream to write to.
Throws:
SCIMException - If the marshaller could not be created.
Method Detail

close

public void close()
           throws SCIMException
Close the marshaller.

Specified by:
close in interface StreamMarshaller
Throws:
SCIMException - If the data could not be written.

marshal

public void marshal(BaseResource resource)
             throws SCIMException
Write a SCIM object.

Specified by:
marshal in interface StreamMarshaller
Parameters:
resource - The SCIM resource to be written.
Throws:
SCIMException - If the data could not be written.

marshal

public void marshal(Resources<? extends BaseResource> response)
             throws SCIMException
Write a SCIM query response.

Specified by:
marshal in interface StreamMarshaller
Parameters:
response - The SCIM response to be written.
Throws:
SCIMException - If the data could not be written.

marshal

public void marshal(SCIMException response)
             throws SCIMException
Write a SCIM error response.

Specified by:
marshal in interface StreamMarshaller
Parameters:
response - The SCIM response to be written.
Throws:
SCIMException - If the data could not be written.

writeBulkStart

public void writeBulkStart(int failOnErrors,
                           Set<String> schemaURIs)
                    throws SCIMException
Write the start of a bulk request or response.

Specified by:
writeBulkStart in interface StreamMarshaller
Parameters:
failOnErrors - The value of failOnErrors, or -1 to not provide a value.
schemaURIs - The set of schema URIs used by the bulk request or response.
Throws:
SCIMException - If the data could not be written.

writeBulkOperation

public void writeBulkOperation(BulkOperation o)
                        throws SCIMException
Write a bulk operation to a bulk request or response.

Specified by:
writeBulkOperation in interface StreamMarshaller
Parameters:
o - The bulk operation to write.
Throws:
SCIMException - If the data could not be written.

writeBulkFinish

public void writeBulkFinish()
                     throws SCIMException
Write the end of a bulk request or response.

Specified by:
writeBulkFinish in interface StreamMarshaller
Throws:
SCIMException - If the data could not be written.

bulkMarshal

public void bulkMarshal(int failOnErrors,
                        List<BulkOperation> operations)
                 throws SCIMException
Write the content of a SCIM bulk operation request or response.

Specified by:
bulkMarshal in interface StreamMarshaller
Parameters:
failOnErrors - The value of failOnErrors, or -1 to not provide a value.
operations - The bulk operations to include in the content.
Throws:
SCIMException - If the data could not be written.


Copyright © 2011-2012 UnboundID. All Rights Reserved.