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 Details

    • setProcessingStatus

      @Nullable D setProcessingStatus(String bulkUpdateId)
      Atomically update BulkUpdate.status to BulkUpdateStatus.PROCESSING and renew BulkUpdate.lastUpdated if the current BulkUpdate.status is BulkUpdateStatus.REQUESTED.
      Parameters:
      bulkUpdateId - the ID of the bulk update to modify
      Returns:
      the updated BulkUpdate if found and updated, null otherwise
    • setContainedErrors

      @Nullable D setContainedErrors(D bulkUpdate)
      Atomically finds and updates the given bulk update: finds the bulk update with the ID matching the given bulkUpdate, sets the bulk update's BulkUpdate.errors to the errors contained within the given bulkUpdate, sets BulkUpdate.status to BulkUpdateStatus.ERROR, and renews BulkUpdate.lastUpdated. No other values from bulkUpdate are applied.

      The change is applied only if the bulk update is found to have a BulkUpdate.status of BulkUpdateStatus.REQUESTED or BulkUpdateStatus.PROCESSING.

      Parameters:
      bulkUpdate - a bulk update object containing the errors to set
      Returns:
      the updated bulk update if found and updated, null otherwise
    • setNumberOfRecordsProcessed

      @Nullable D setNumberOfRecordsProcessed(String bulkUpdateId, long numberOfRecordsProcessed)
      Atomically sets the BulkUpdate.numberOfRecordsProcessed to the given value and renews BulkUpdate.lastUpdated if the bulk update is found and has a BulkUpdate.status of BulkUpdateStatus.PROCESSING.
      Parameters:
      bulkUpdateId - the ID of the bulk update to modify
      numberOfRecordsProcessed - the new value to set for BulkUpdate.numberOfRecordsProcessed
      Returns:
      the updated BulkUpdate if found and updated, null otherwise
    • setFinishedStatus

      @Nullable D setFinishedStatus(String bulkUpdateId)
      Atomically sets the BulkUpdate.status to BulkUpdateStatus.FINISHED and renews BulkUpdate.lastUpdated if the bulk update is found and has a BulkUpdate.status of BulkUpdateStatus.PROCESSING.
      Parameters:
      bulkUpdateId - the ID of the bulk update to modify
      Returns:
      the updated BulkUpdate if found and updated, null otherwise
    • initializeCreateSandboxNotificationState

      @Nullable D initializeCreateSandboxNotificationState(String bulkUpdateId)
      Atomically initializes the NotificationState for CreateSandboxRequestProducer.TYPE on the given bulk update if it is found to have a BulkUpdate.status of BulkUpdateStatus.PROCESSING.
      Parameters:
      bulkUpdateId - the ID of the bulk update to modify
      Returns:
      the updated BulkUpdate if found and updated, null otherwise
    • initializeDeleteSandboxNotificationState

      @Nullable D initializeDeleteSandboxNotificationState(String bulkUpdateId)
      Atomically initializes the NotificationState for DeleteSandboxRequestProducer.TYPE on the given bulk update if it is found to have a BulkUpdate.status of BulkUpdateStatus.ERROR.
      Parameters:
      bulkUpdateId - the ID of the bulk update to modify
      Returns:
      the updated BulkUpdate if found and updated, null otherwise