Interface CustomizedBulkUpdateRepository<D extends com.broadleafcommerce.data.tracking.core.Identifiable>
- All Superinterfaces:
com.broadleafcommerce.common.extension.DomainTypeAware
- All Known Subinterfaces:
BulkUpdateRepository<D>
,JpaBulkUpdateRepository<D>
- All Known Implementing Classes:
JpaCustomizedBulkUpdateRepository
public interface CustomizedBulkUpdateRepository<D extends com.broadleafcommerce.data.tracking.core.Identifiable>
extends com.broadleafcommerce.common.extension.DomainTypeAware
Additional functionality necessary for a
BulkUpdateRepository
.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptioninitializeCreateSandboxNotificationState
(String bulkUpdateId) Atomically initializes theNotificationState
forCreateSandboxRequestProducer.TYPE
on the given bulk update if it is found to have aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.initializeDeleteSandboxNotificationState
(String bulkUpdateId) Atomically initializes theNotificationState
forDeleteSandboxRequestProducer.TYPE
on the given bulk update if it is found to have aBulkUpdate.status
ofBulkUpdateStatus.ERROR
.setContainedErrors
(D bulkUpdate) Atomically finds and updates the given bulk update: finds the bulk update with the ID matching the givenbulkUpdate
, sets the bulk update'sBulkUpdate.errors
to the errors contained within the givenbulkUpdate
, setsBulkUpdate.status
toBulkUpdateStatus.ERROR
, and renewsBulkUpdate.lastUpdated
.setFinishedStatus
(String bulkUpdateId) Atomically sets theBulkUpdate.status
toBulkUpdateStatus.FINISHED
and renewsBulkUpdate.lastUpdated
if the bulk update is found and has aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.setNumberOfRecordsProcessed
(String bulkUpdateId, long numberOfRecordsProcessed) Atomically sets theBulkUpdate.numberOfRecordsProcessed
to the given value and renewsBulkUpdate.lastUpdated
if the bulk update is found and has aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.setProcessingStatus
(String bulkUpdateId) Atomically updateBulkUpdate.status
toBulkUpdateStatus.PROCESSING
and renewBulkUpdate.lastUpdated
if the currentBulkUpdate.status
isBulkUpdateStatus.REQUESTED
.Methods inherited from interface com.broadleafcommerce.common.extension.DomainTypeAware
getDomainType
-
Method Details
-
setProcessingStatus
Atomically updateBulkUpdate.status
toBulkUpdateStatus.PROCESSING
and renewBulkUpdate.lastUpdated
if the currentBulkUpdate.status
isBulkUpdateStatus.REQUESTED
.- Parameters:
bulkUpdateId
- the ID of the bulk update to modify- Returns:
- the updated
BulkUpdate
if found and updated,null
otherwise
-
setContainedErrors
Atomically finds and updates the given bulk update: finds the bulk update with the ID matching the givenbulkUpdate
, sets the bulk update'sBulkUpdate.errors
to the errors contained within the givenbulkUpdate
, setsBulkUpdate.status
toBulkUpdateStatus.ERROR
, and renewsBulkUpdate.lastUpdated
. No other values frombulkUpdate
are applied.The change is applied only if the bulk update is found to have a
BulkUpdate.status
ofBulkUpdateStatus.REQUESTED
orBulkUpdateStatus.PROCESSING
.- Parameters:
bulkUpdate
- a bulk update object containing the errors to set- Returns:
- the updated bulk update if found and updated,
null
otherwise
-
setNumberOfRecordsProcessed
Atomically sets theBulkUpdate.numberOfRecordsProcessed
to the given value and renewsBulkUpdate.lastUpdated
if the bulk update is found and has aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.- Parameters:
bulkUpdateId
- the ID of the bulk update to modifynumberOfRecordsProcessed
- the new value to set forBulkUpdate.numberOfRecordsProcessed
- Returns:
- the updated
BulkUpdate
if found and updated,null
otherwise
-
setFinishedStatus
Atomically sets theBulkUpdate.status
toBulkUpdateStatus.FINISHED
and renewsBulkUpdate.lastUpdated
if the bulk update is found and has aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.- Parameters:
bulkUpdateId
- the ID of the bulk update to modify- Returns:
- the updated
BulkUpdate
if found and updated,null
otherwise
-
initializeCreateSandboxNotificationState
Atomically initializes theNotificationState
forCreateSandboxRequestProducer.TYPE
on the given bulk update if it is found to have aBulkUpdate.status
ofBulkUpdateStatus.PROCESSING
.- Parameters:
bulkUpdateId
- the ID of the bulk update to modify- Returns:
- the updated
BulkUpdate
if found and updated,null
otherwise
-
initializeDeleteSandboxNotificationState
Atomically initializes theNotificationState
forDeleteSandboxRequestProducer.TYPE
on the given bulk update if it is found to have aBulkUpdate.status
ofBulkUpdateStatus.ERROR
.- Parameters:
bulkUpdateId
- the ID of the bulk update to modify- Returns:
- the updated
BulkUpdate
if found and updated,null
otherwise
-