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 aExportRepository
.- Author:
- Samarth Dhruva (samarthd)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.errorMessage
to the given value, setsExport.status
toExportStatus.ERROR
, and renewsExport.lastUpdated
.D
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
.D
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
.D
setProcessingStatus(String exportId)
Atomically updateExport.status
toExportStatus.PROCESSING
and renewExport.lastUpdated
if the currentExport.status
isExportStatus.REQUESTED
.
-
-
-
Method Detail
-
setProcessingStatus
@Nullable D setProcessingStatus(String exportId)
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
@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.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
@Nullable D 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
.- 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
@Nullable D 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
.- 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
-
-