Interface CustomizedExportRepository<D extends com.broadleafcommerce.data.tracking.core.Identifiable>

All Superinterfaces:
com.broadleafcommerce.common.extension.DomainTypeAware
All Known Subinterfaces:
ExportRepository<D>, JpaExportRepository<D>
All Known Implementing Classes:
JpaCustomizedExportRepository

public interface CustomizedExportRepository<D extends com.broadleafcommerce.data.tracking.core.Identifiable> extends com.broadleafcommerce.common.extension.DomainTypeAware
Additional functionality necessary for a ExportRepository.
Author:
Samarth Dhruva (samarthd)
  • Method Details

    • setProcessingStatus

      @Nullable D setProcessingStatus(String exportId)
      Atomically update Export.status to ExportStatus.PROCESSING and renew Export.lastUpdated if the current Export.status is ExportStatus.REQUESTED.
      Parameters:
      exportId - the ID of the export to modify
      Returns:
      the updated Export if found and updated, null otherwise
    • setError

      @Nullable D setError(String exportId, String errorMessage)
      Atomically finds and updates the given export: finds the export with the ID matching the given export, sets the export's Export.errorMessage to the given value, sets Export.status to ExportStatus.ERROR, and renews Export.lastUpdated.

      The update is applied only if the export is found to have a Export.status of ExportStatus.REQUESTED or ExportStatus.PROCESSING.

      Parameters:
      exportId - the ID of the export to find and update
      errorMessage - the error message to set on the export
      Returns:
      the updated export if found and updated, null otherwise
    • setNumberOfRecordsProcessed

      @Nullable D setNumberOfRecordsProcessed(String exportId, long numberOfRecordsProcessed)
      Atomically sets the Export.numberOfRecordsProcessed to the given value and renews Export.lastUpdated if the export is found and has a Export.status of ExportStatus.PROCESSING.
      Parameters:
      exportId - the ID of the export to modify
      numberOfRecordsProcessed - the new value to set for Export.numberOfRecordsProcessed
      Returns:
      the updated Export if found and updated, null otherwise
    • setFileLocationAndFinishedStatus

      @Nullable D setFileLocationAndFinishedStatus(String exportId, String fileLocation)
      Atomically sets the Export.status to ExportStatus.FINISHED, sets the Export.fileLocation to fileLocation, and renews Export.lastUpdated if the export is found and has a Export.status of ExportStatus.PROCESSING.
      Parameters:
      exportId - the ID of the export to modify
      fileLocation - the file location to set on the export
      Returns:
      the updated Export if found and updated, null otherwise