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.errorMessage
to the given value, setsExport.status
toExportStatus.ERROR
, and renewsExport.lastUpdated
.setFileLocationAndFinishedStatus
(String exportId, String fileLocation) Atomically sets theExport.status
toExportStatus.FINISHED
, sets theExport.fileLocation
tofileLocation
, and renewsExport.lastUpdated
if the export is found and has aExport.status
ofExportStatus.PROCESSING
.setNumberOfRecordsProcessed
(String exportId, long numberOfRecordsProcessed) Atomically sets theExport.numberOfRecordsProcessed
to the given value and renewsExport.lastUpdated
if the export is found and has aExport.status
ofExportStatus.PROCESSING
.setProcessingStatus
(String exportId) Atomically updateExport.status
toExportStatus.PROCESSING
and renewExport.lastUpdated
if the currentExport.status
isExportStatus.REQUESTED
.Methods inherited from interface com.broadleafcommerce.common.extension.DomainTypeAware
getDomainType
-
Method Details
-
setProcessingStatus
Atomically updateExport.status
toExportStatus.PROCESSING
and renewExport.lastUpdated
if the currentExport.status
isExportStatus.REQUESTED
.- Parameters:
exportId
- the ID of the export to modify- Returns:
- the updated
Export
if found and updated,null
otherwise
-
setError
Atomically finds and updates the given export: finds the export with the ID matching the givenexport
, sets the export'sExport.errorMessage
to the given value, setsExport.status
toExportStatus.ERROR
, and renewsExport.lastUpdated
.The update is applied only if the export is found to have a
Export.status
ofExportStatus.REQUESTED
orExportStatus.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,
null
otherwise
-
setNumberOfRecordsProcessed
Atomically sets theExport.numberOfRecordsProcessed
to the given value and renewsExport.lastUpdated
if the export is found and has aExport.status
ofExportStatus.PROCESSING
.- Parameters:
exportId
- the ID of the export to modifynumberOfRecordsProcessed
- the new value to set forExport.numberOfRecordsProcessed
- Returns:
- the updated
Export
if found and updated,null
otherwise
-
setFileLocationAndFinishedStatus
Atomically sets theExport.status
toExportStatus.FINISHED
, sets theExport.fileLocation
tofileLocation
, and renewsExport.lastUpdated
if the export is found and has aExport.status
ofExportStatus.PROCESSING
.- Parameters:
exportId
- the ID of the export to modifyfileLocation
- the file location to set on the export- Returns:
- the updated
Export
if found and updated,null
otherwise
-