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 Summary
Modifier and TypeMethodDescriptionAtomically 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.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.setNumberOfRecordsProcessed(String exportId, long numberOfRecordsProcessed) Atomically sets theExport.numberOfRecordsProcessedto the given value and renewsExport.lastUpdatedif the export is found and has aExport.statusofExportStatus.PROCESSING.setProcessingStatus(String exportId) Atomically updateExport.statustoExportStatus.PROCESSINGand renewExport.lastUpdatedif the currentExport.statusisExportStatus.REQUESTED.Methods inherited from interface com.broadleafcommerce.common.extension.DomainTypeAware
getDomainType
-
Method Details
-
setProcessingStatus
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
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
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
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
-