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 Details

    • JpaCustomizedImportBatchRepository

      public JpaCustomizedImportBatchRepository(com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment notificationStateRepository)
  • Method Details

    • save

      @Transactional("importTransactionManager") public Object save(Object entity)
    • saveAll

      @Transactional("importTransactionManager") public List<Object> saveAll(Iterable<?> entities)
    • getDomainType

      public Class<D> getDomainType()
      Specified by:
      getDomainType in interface com.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 interface CustomizedImportBatchRepository<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

      protected javax.persistence.criteria.Predicate buildIdFilter(String batchId, javax.persistence.criteria.Root<D> batchEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • markProcessingBatchAsCompleted

      @Nullable @Transactional("importTransactionManager") public D markProcessingBatchAsCompleted(String batchId)
      Description copied from interface: CustomizedImportBatchRepository
      Changes the status to BatchStatus.COMPLETED and the completion date to the current time if the given batch is in a BatchStatus.PROCESSING state.
      Specified by:
      markProcessingBatchAsCompleted in interface CustomizedImportBatchRepository<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 a BatchStatus.PROCESSING state
    • buildStatusFilter

      protected javax.persistence.criteria.Predicate buildStatusFilter(String status, javax.persistence.criteria.Root<D> batchEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • setNotificationAcknowledged

      public boolean setNotificationAcknowledged(Object nativeId, String messageType, int attemptCount, Class<?> entityType)
      Specified by:
      setNotificationAcknowledged in interface com.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 interface com.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 interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository