Interface BatchItemCompletionService<P extends BatchItemCompletion>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
- All Known Implementing Classes:
DefaultBatchItemCompletionService
public interface BatchItemCompletionService<P extends BatchItemCompletion>
extends com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService<P>
Service API for
BatchItemCompletion
. Supported by
ImportBatchItemCompletionRepository
.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptioncreateAllFromBatchItems
(String importId, List<BatchItem> completedBatchItems) Accepts a list of completedBatchItems
and creates aBatchItemCompletion
for each of them.Delete the batch item completions that match the corresponding idsfindByImportIdAndStatusAndCorrelationIdIn
(String importId, String status, Set<String> referencedCorrelationIds) Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given importId,BatchItemCompletion.status
the given status andBatchItemCompletion.correlationId
the set of correlation ids.org.springframework.data.domain.Page<P>
readAllByImportId
(String importId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given value.readAllByImportIdAndStatus
(String importId, String status) Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given importId andBatchItemCompletion.status
given status.readBatchItemCompletionIdsByImportIdForPurge
(String importId, int batchSize) Read a list of batch item completions for the provided import id.readByCorrelationIdInOrTopLevelParentIdInOrderedByLineNumber
(String importId, Collection<String> correlationIdIn, Collection<String> topLevelParentCorrelationIdIn) For the givenimportId
, returns all batch item completion records which either have aBatchItemCompletion.correlationId
that matches one of the givencorrelationIdIn
values or aBatchItemCompletion.topLevelParentCorrelationId
that matches one of the giventopLevelParentCorrelationIdIn
values.Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlMappableCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
createAllFromBatchItems
Accepts a list of completedBatchItems
and creates aBatchItemCompletion
for each of them.- Parameters:
importId
- the ID of the import which the batch items belong tocompletedBatchItems
- a list of completed batch items- Returns:
- all of the created batch item completions
-
readAllByImportId
org.springframework.data.domain.Page<P> readAllByImportId(String importId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given value.- Parameters:
importId
- the ID of the import whose batch item completions should be returnedfilters
- additional filters used to restrict results. Cannot be null - useEmptyNode
if no additional filters should be applied.pageable
- information about which page of results should be returned from the database- Returns:
- all of the item completions for the given import
-
readAllByImportIdAndStatus
Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given importId andBatchItemCompletion.status
given status.- Parameters:
importId
- the ID of the import whose batch item completions should be returnedstatus
- the status of the record to retrieve- Returns:
- all of the item completions for the given import and status
-
readByCorrelationIdInOrTopLevelParentIdInOrderedByLineNumber
Stream<P> readByCorrelationIdInOrTopLevelParentIdInOrderedByLineNumber(String importId, @Nullable Collection<String> correlationIdIn, @Nullable Collection<String> topLevelParentCorrelationIdIn) For the givenimportId
, returns all batch item completion records which either have aBatchItemCompletion.correlationId
that matches one of the givencorrelationIdIn
values or aBatchItemCompletion.topLevelParentCorrelationId
that matches one of the giventopLevelParentCorrelationIdIn
values.Results must be sorted by
BatchItemCompletion.lineNumber
in ascending order.- Parameters:
importId
- the ID of the import which results should be filtered bycorrelationIdIn
- a list of correlation IDs that are valid to return in the result (optional). If not supplied, results will not be filtered by this field.topLevelParentCorrelationIdIn
- a list of top level parent correlation IDs that are valid to return in the result (optional). If not supplied, results will not be filtered by this field.- Returns:
- all records which either have a
BatchItemCompletion.correlationId
that matches one of the givencorrelationIdIn
values or aBatchItemCompletion.topLevelParentCorrelationId
that matches one of the giventopLevelParentCorrelationIdIn
values, sorted byBatchItemCompletion.lineNumber
in ascending order
-
findByImportIdAndStatusAndCorrelationIdIn
List<P> findByImportIdAndStatusAndCorrelationIdIn(String importId, String status, Set<String> referencedCorrelationIds) Finds and returns all of the item completions whoseBatchItemCompletion.importId
matches the given importId,BatchItemCompletion.status
the given status andBatchItemCompletion.correlationId
the set of correlation ids.- Parameters:
importId
- the ID of the import whose batch item completions should be returnedstatus
- the status of the record to retrievereferencedCorrelationIds
- the set of correlation ids- Returns:
- all of the item completions for the given import and status
-
readBatchItemCompletionIdsByImportIdForPurge
Read a list of batch item completions for the provided import id. The default implementation of this method starts at page 0 with the intention that these batches are getting purged after each call, which would result in a new set ofBatchItemCompletion
entities.- Parameters:
importId
- the import id to match batch item completions againstbatchSize
- the batch size for results returned- Returns:
- a list of batch item completions for the provided import id
-
deleteBatchItemCompletionsById
Delete the batch item completions that match the corresponding ids- Parameters:
ids
- the list of ids to delete- Returns:
- the number of batch item completions deleted
-