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
ConstructorDescriptionJpaCustomizedImportBatchRepository
(com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment notificationStateRepository) -
Method Summary
Modifier and TypeMethodDescriptionprotected javax.persistence.criteria.Predicate
buildIdFilter
(String batchId, javax.persistence.criteria.Root<D> batchEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) protected javax.persistence.criteria.Predicate
buildStatusFilter
(String status, javax.persistence.criteria.Root<D> batchEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) 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.COMPLETED
and the completion date to the current time if the given batch is in aBatchStatus.PROCESSING
state.replaceContainedItems
(D batchContainingItems) Atomically updates the batch items for the given batch.boolean
setFailedNotificationAttempt
(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped) boolean
setNotificationAcknowledged
(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:
getDomainType
in interfacecom.broadleafcommerce.common.extension.DomainTypeAware
-
replaceContainedItems
@Transactional("importTransactionManager") @Nullable public D replaceContainedItems(D batchContainingItems) Description copied from interface:CustomizedImportBatchRepository
Atomically updates the batch items for the given batch. No other properties of the given batch are updated- Specified by:
replaceContainedItems
in 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
-
buildIdFilter
-
markProcessingBatchAsCompleted
@Nullable @Transactional("importTransactionManager") public D markProcessingBatchAsCompleted(String batchId) Description copied from interface:CustomizedImportBatchRepository
Changes the status toBatchStatus.COMPLETED
and the completion date to the current time if the given batch is in aBatchStatus.PROCESSING
state.- Specified by:
markProcessingBatchAsCompleted
in interfaceCustomizedImportBatchRepository<D extends JpaBatch>
- Parameters:
batchId
- the batch to update- Returns:
- the modified batch or null if there was no batch for the given
batchId
or the batch was not in aBatchStatus.PROCESSING
state
-
buildStatusFilter
-
setNotificationAcknowledged
public boolean setNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType) - Specified by:
setNotificationAcknowledged
in interfacecom.broadleafcommerce.common.messaging.notification.NotificationStateRepository
-
setFailedNotificationAttempt
public boolean setFailedNotificationAttempt(Object nativeId, String messageType, int attemptCount, Instant nextAttempt, Class<?> entityType, boolean stopped) - Specified by:
setFailedNotificationAttempt
in 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:
findNotificationReadyMembers
in interfacecom.broadleafcommerce.common.messaging.notification.NotificationStateRepository
-