Interface BulkUpdateProcessor<P>
- 
- Type Parameters:
 P- the business-domain type of the records this processor can filter by. While the basic filtration can only be applied to a single domain, the logic inmodifyAndPersist(List, BulkUpdate)can query/update additional domains that need to be adjusted as part of the update.
public interface BulkUpdateProcessor<P>WhileBulkUpdateManageris responsible for most of the coordination during a bulk update, it will delegate to aBulkUpdateProcessorfor operations that are specific to theBulkUpdate.targetandBulkUpdate.type.Generally speaking, there should be one
BulkUpdateProcessorregistered for eachBulkUpdate.targetthat needs to be supported, and inside of it there should be implementations for each desiredBulkUpdate.typeon thatBulkUpdate.target.The
BulkUpdateManagerwill use only the firstBulkUpdateProcessorfor whichcanHandle(BulkUpdate)returns true.- Author:
 - Samarth Dhruva (samarthd)
 - See Also:
 BulkUpdateManager
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanHandle(BulkUpdate bulkUpdate)Returns whether this processor can support performing the given bulk update operation.BatchProcessResponsemodifyAndPersist(List<P> batchToProcess, BulkUpdate bulkUpdate)Accepts a list of objects - this will be a batch subset of the full results returned inreadRecordsToProcess(BulkUpdate).ReadRecordsResponse<P>readRecordsToProcess(BulkUpdate bulkUpdate)Returns the full stream of records from the data store that should be processed. 
 - 
 
- 
- 
Method Detail
- 
canHandle
boolean canHandle(BulkUpdate bulkUpdate)
Returns whether this processor can support performing the given bulk update operation. Generally this should be entirely based onBulkUpdate.targetandBulkUpdate.type.- Parameters:
 bulkUpdate- the update that needs to be processed- Returns:
 - true if the processor can support performing the bulk update operation, false otherwise
 
 
- 
readRecordsToProcess
ReadRecordsResponse<P> readRecordsToProcess(BulkUpdate bulkUpdate)
Returns the full stream of records from the data store that should be processed.Implementations should utilize
BulkUpdate.filterString,BulkUpdate.inclusions, andBulkUpdate.exclusionsto filter/include results. A reasonable implementation could have the following rules:- If 
filterStringis blank andinclusionsis not empty, only the entities specified ininclusionswill be returned (minus anyexclusions). - If 
filterStringis blank andinclusionsis empty, all entities in the data store will be returned (minus anyexclusions). - If 
filterStringis not blank, then all entities matching the filters and any entities specified ininclusionswill be returned (minus anyexclusions). 
- Parameters:
 bulkUpdate- the update that is being processed- Returns:
 - a 
ReadRecordsResponsecontaining the full stream of records from the data store that should be processed, withfilterString,inclusions, andexclusionsalready accounted for - See Also:
 BulkUpdate.filterString,BulkUpdate.inclusions,BulkUpdate.exclusions
 - If 
 
- 
modifyAndPersist
BatchProcessResponse modifyAndPersist(List<P> batchToProcess, BulkUpdate bulkUpdate)
Accepts a list of objects - this will be a batch subset of the full results returned inreadRecordsToProcess(BulkUpdate). Then,BulkUpdate.serializedPayloadand context information (such asBulkUpdate.updatingSandboxId,BulkUpdate.updatingApplicationId,BulkUpdate.updatingCatalogId) should be used to apply the necessary modifications and persist the results.This method is called multiple times - once for each batch until all records are processed.
- Parameters:
 batchToProcess- a list of records to update and persist. The maximum size of this list is defined byBulkUpdateProcessingConfigurationProperties.batchSize.bulkUpdate- the update that is being processed- Returns:
 - a response describing whether the processing of the batch succeeded/failed
 
 
 - 
 
 -