com.ibm.pim.common
Interface Batchable

All Known Subinterfaces:
Catalog

public interface Batchable

The Batchable interface specifies the set of methods that a class needs to implement to allow persistence to the data store in a batched manner as opposed to singleton object saves.

Since:
6.0.0

Field Summary
static java.lang.String copyright
           
 
Method Summary
 java.util.List<ExtendedValidationErrors> flushBatch()
          This is the method where the implementing class sends the queued up objects to the data store.
 BatchStatistics getBatchProcessingStatistics()
          This method returns the current set of statistics related to a given batching session (all actions from the call to startBatchProcessing to current point in time).
 void startBatchProcessing()
          This is the setup method for batch processing.
 java.util.List<ExtendedValidationErrors> stopBatchProcessing()
          This is the tear-down method for batch processing.
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

startBatchProcessing

void startBatchProcessing()
This is the setup method for batch processing. It provides a placeholder for the implementing class to put up any housekeeping setup information.

Throws:
java.lang.UnsupportedOperationException - If the object under batching is already under another batch, for ex, an import in progress on the catalog.
PIMInternalException - If an internal error occurs

flushBatch

java.util.List<ExtendedValidationErrors> flushBatch()
This is the method where the implementing class sends the queued up objects to the data store. This is the method where all the validation logic is invoked.

Returns:
List Returns a list of extended validation errors object each of which corresponds to the validation errors on items that failed validation when the batch was being flushed to the data store.
Throws:
PIMInternalException - If an internal error occurs
java.lang.UnsupportedOperationException - If the object that supports batching is not under the batch operation

stopBatchProcessing

java.util.List<ExtendedValidationErrors> stopBatchProcessing()
This is the tear-down method for batch processing. This method is supposed to flush any remaining objects that have been queued up to be sent to the datastore and is expected to implement any cleanup housekeeping activity for the batching setup.

Returns:
List This method flushes any remaining batched objects, it returns a list of extended validation errors object each of which corresponds to the validation errors on items that failed validation when the batch was being flushed to the data store.
Throws:
PIMInternalException - If an internal error occurs
java.lang.UnsupportedOperationException - If the object that supports batching is not under the batch operation

getBatchProcessingStatistics

BatchStatistics getBatchProcessingStatistics()
This method returns the current set of statistics related to a given batching session (all actions from the call to startBatchProcessing to current point in time).

Returns:
BatchStatistics If stopBatchProcessing has been called, then the results of the last set of batch operations (from start to stop) are returned. The statistics are basically, the number of new items added, the number of items modified, the number of items deleted, etc. If batching was not initiated for this catalog, an empty map will be returned.
Throws:
PIMInternalException - If an internal error occurs