Class JpaCustomizedImportBatchRepository<D extends JpaBatch>
java.lang.Object
com.broadleafcommerce.dataimport.provider.jpa.repository.JpaCustomizedImportBatchRepository<D>
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.DomainTypeAware,com.broadleafcommerce.common.messaging.notification.NotificationStateRepository,com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment,CustomizedImportBatchRepository<D>
public class JpaCustomizedImportBatchRepository<D extends JpaBatch>
extends Object
implements CustomizedImportBatchRepository<D>, com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment
- Author:
- Phillip Verheyden (phillipuniverse)
-
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedImportBatchRepository(com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment notificationStateRepository) -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.persistence.criteria.PredicatebuildIdFilter(String batchId, jakarta.persistence.criteria.Root<D> batchEntity, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) protected jakarta.persistence.criteria.PredicatebuildStatusFilter(String status, jakarta.persistence.criteria.Root<D> batchEntity, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) deleteAllByImportIdsInBatch(List<String> importIds) Delete the batches that match the corresponding import ids using a single query.Stream<com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware>findNotificationReadyMembers(Object lastProcessedNativeId, int pageSize, String messageType, Duration faultThreshold, Class<?> entityType) markProcessingBatchAsCompleted(String batchId) Changes the status toBatchStatus.COMPLETEDand the completion date to the current time if the given batch is in aBatchStatus.PROCESSINGstate.replaceContainedItems(D batchContainingItems) Atomically updates the batch items for the given batch.booleansetFailedNotificationAttempt(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped) booleansetNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType)
-
Constructor Details
-
JpaCustomizedImportBatchRepository
public JpaCustomizedImportBatchRepository(com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment notificationStateRepository)
-
-
Method Details
-
save
-
saveAll
-
getDomainType
- Specified by:
getDomainTypein interfacecom.broadleafcommerce.common.extension.DomainTypeAware
-
replaceContainedItems
@Transactional("importTransactionManager") @Nullable public D replaceContainedItems(D batchContainingItems) Description copied from interface:CustomizedImportBatchRepositoryAtomically updates the batch items for the given batch. No other properties of the given batch are updated- Specified by:
replaceContainedItemsin interfaceCustomizedImportBatchRepository<D extends JpaBatch>- Parameters:
batchContainingItems- the batch containing the items that should be updated- Returns:
- the updated batch or null if there is no batch for the given id
-
deleteAllByImportIdsInBatch
@Transactional("importTransactionManager") public Integer deleteAllByImportIdsInBatch(List<String> importIds) Description copied from interface:CustomizedImportBatchRepositoryDelete the batches that match the corresponding import ids using a single query.- Specified by:
deleteAllByImportIdsInBatchin interfaceCustomizedImportBatchRepository<D extends JpaBatch>- Parameters:
importIds- the list of import ids to delete against- Returns:
- the number of batches deleted
-
buildIdFilter
-
markProcessingBatchAsCompleted
@Nullable @Transactional("importTransactionManager") public D markProcessingBatchAsCompleted(String batchId) Description copied from interface:CustomizedImportBatchRepositoryChanges the status toBatchStatus.COMPLETEDand the completion date to the current time if the given batch is in aBatchStatus.PROCESSINGstate.- Specified by:
markProcessingBatchAsCompletedin interfaceCustomizedImportBatchRepository<D extends JpaBatch>- Parameters:
batchId- the batch to update- Returns:
- the modified batch or null if there was no batch for the given
batchIdor the batch was not in aBatchStatus.PROCESSINGstate
-
buildStatusFilter
-
setNotificationAcknowledged
public boolean setNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType) - Specified by:
setNotificationAcknowledgedin interfacecom.broadleafcommerce.common.messaging.notification.NotificationStateRepository
-
setFailedNotificationAttempt
public boolean setFailedNotificationAttempt(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped) - Specified by:
setFailedNotificationAttemptin interfacecom.broadleafcommerce.common.messaging.notification.NotificationStateRepository
-
findNotificationReadyMembers
public Stream<com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware> findNotificationReadyMembers(Object lastProcessedNativeId, int pageSize, String messageType, Duration faultThreshold, Class<?> entityType) - Specified by:
findNotificationReadyMembersin interfacecom.broadleafcommerce.common.messaging.notification.NotificationStateRepository
-