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.DomainTypeAwareAdditional functionality necessary for aExportRepository.- Author:
- Samarth Dhruva (samarthd)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DsetError(String exportId, String errorMessage)Atomically finds and updates the given export: finds the export with the ID matching the givenexport, sets the export'sExport.errorMessageto the given value, setsExport.statustoExportStatus.ERROR, and renewsExport.lastUpdated.DsetFileLocationAndFinishedStatus(String exportId, String fileLocation)Atomically sets theExport.statustoExportStatus.FINISHED, sets theExport.fileLocationtofileLocation, and renewsExport.lastUpdatedif the export is found and has aExport.statusofExportStatus.PROCESSING.DsetNumberOfRecordsProcessed(String exportId, long numberOfRecordsProcessed)Atomically sets theExport.numberOfRecordsProcessedto the given value and renewsExport.lastUpdatedif the export is found and has aExport.statusofExportStatus.PROCESSING.DsetProcessingStatus(String exportId)Atomically updateExport.statustoExportStatus.PROCESSINGand renewExport.lastUpdatedif the currentExport.statusisExportStatus.REQUESTED.
-
-
-
Method Detail
-
setProcessingStatus
@Nullable D setProcessingStatus(String exportId)
Atomically updateExport.statustoExportStatus.PROCESSINGand renewExport.lastUpdatedif the currentExport.statusisExportStatus.REQUESTED.- Parameters:
exportId- the ID of the export to modify- Returns:
- the updated
Exportif found and updated,nullotherwise
-
setError
@Nullable D setError(String exportId, String errorMessage)
Atomically finds and updates the given export: finds the export with the ID matching the givenexport, sets the export'sExport.errorMessageto the given value, setsExport.statustoExportStatus.ERROR, and renewsExport.lastUpdated.The update is applied only if the export is found to have a
Export.statusofExportStatus.REQUESTEDorExportStatus.PROCESSING.- Parameters:
exportId- the ID of the export to find and updateerrorMessage- the error message to set on the export- Returns:
- the updated export if found and updated,
nullotherwise
-
setNumberOfRecordsProcessed
@Nullable D setNumberOfRecordsProcessed(String exportId, long numberOfRecordsProcessed)
Atomically sets theExport.numberOfRecordsProcessedto the given value and renewsExport.lastUpdatedif the export is found and has aExport.statusofExportStatus.PROCESSING.- Parameters:
exportId- the ID of the export to modifynumberOfRecordsProcessed- the new value to set forExport.numberOfRecordsProcessed- Returns:
- the updated
Exportif found and updated,nullotherwise
-
setFileLocationAndFinishedStatus
@Nullable D setFileLocationAndFinishedStatus(String exportId, String fileLocation)
Atomically sets theExport.statustoExportStatus.FINISHED, sets theExport.fileLocationtofileLocation, and renewsExport.lastUpdatedif the export is found and has aExport.statusofExportStatus.PROCESSING.- Parameters:
exportId- the ID of the export to modifyfileLocation- the file location to set on the export- Returns:
- the updated
Exportif found and updated,nullotherwise
-
-