Class JpaCustomizedDataFeedPublicationRepository<D extends JpaDataFeedPublication>
java.lang.Object
com.broadleafcommerce.datafeed.provider.jpa.repository.trackable.JpaCustomizedDataFeedPublicationRepository<D>
- Type Parameters:
D
- the persisted domain type
- All Implemented Interfaces:
CustomizedDataFeedPublicationRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedDataFeedPublicationRepository<D extends JpaDataFeedPublication>
extends Object
implements CustomizedDataFeedPublicationRepository<D>, org.springframework.beans.factory.InitializingBean
JPA implementation of
CustomizedDataFeedPublicationRepository
.-
Constructor Summary
ConstructorDescriptionJpaCustomizedDataFeedPublicationRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, JpaDataFeedQueryHelper queryHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected DataFeedPublicationRepository<D>
Lazy injection so we can access base repository methods.protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder
protected javax.persistence.EntityManager
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected com.broadleafcommerce.common.messaging.notification.NotificationStateService
Lazy injection since this is technically a service component.protected JpaDataFeedQueryHelper
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager
protected com.broadleafcommerce.common.messaging.notification.domain.NotificationState
initializeAndResetNotificationState
(D entity, String notificationStateName, Instant changeTimestamp) initializeNotificationState
(List<String> ids, String messageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically finds theDataFeedPublication
instances for the givenids
, and initializes theirNotificationState
formessageType
.void
setBaseRepository
(DataFeedPublicationRepository<D> baseRepository) Lazy injection so we can access base repository methods.void
setNotificationStateService
(com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService) Lazy injection since this is technically a service component.setStatusAndCompletionDetails
(String id, String newStatus, Instant endTime, boolean containsErrors, List<String> errorDetails, String whereCurrentStatus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedPublication.getStatus()
and completion details on the specified publication.setStatusAndStartTime
(String id, String newStatus, Instant startTime, String whereCurrentStatus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedPublication.getStatus()
andDataFeedPublication.getStartTime()
on the specified publication.
-
Constructor Details
-
JpaCustomizedDataFeedPublicationRepository
public JpaCustomizedDataFeedPublicationRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, JpaDataFeedQueryHelper queryHelper)
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
initializeNotificationState
@Policy(operationTypes=UPDATE) @Transactional("datafeedTransactionManager") public List<D> initializeNotificationState(List<String> ids, String messageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedDataFeedPublicationRepository
Atomically finds theDataFeedPublication
instances for the givenids
, and initializes theirNotificationState
formessageType
.- Specified by:
initializeNotificationState
in interfaceCustomizedDataFeedPublicationRepository<D extends JpaDataFeedPublication>
- Parameters:
ids
- theDataFeedPublication.getId()
ids for which to initialize the notification state. Cannot be empty.messageType
- the message type (ex:NotificationState.getName()
contextInfo
- context information around multitenant state- Returns:
- the
DataFeedPublication
instances that were successfully found and updated (omitting those which were not successfully updated)
-
initializeAndResetNotificationState
-
setStatusAndStartTime
@Nullable @Policy(operationTypes=UPDATE) @Transactional("datafeedTransactionManager") public D setStatusAndStartTime(String id, String newStatus, Instant startTime, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedDataFeedPublicationRepository
Atomically sets a newDataFeedPublication.getStatus()
andDataFeedPublication.getStartTime()
on the specified publication.- Specified by:
setStatusAndStartTime
in interfaceCustomizedDataFeedPublicationRepository<D extends JpaDataFeedPublication>
- Parameters:
id
- the ID of the publication to updatenewStatus
- the new value to set forDataFeedPublication.getStatus()
startTime
- the value to set forDataFeedPublication.getStartTime()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the publication currently has this value for itsDataFeedPublication.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated publication if successfully updated, else
null
-
setStatusAndCompletionDetails
@Nullable @Policy(operationTypes=UPDATE) @Transactional("datafeedTransactionManager") public D setStatusAndCompletionDetails(String id, String newStatus, Instant endTime, boolean containsErrors, @Nullable List<String> errorDetails, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedDataFeedPublicationRepository
Atomically sets a newDataFeedPublication.getStatus()
and completion details on the specified publication.- Specified by:
setStatusAndCompletionDetails
in interfaceCustomizedDataFeedPublicationRepository<D extends JpaDataFeedPublication>
- Parameters:
id
- the ID of the publication to updatenewStatus
- the new value to set forDataFeedPublication.getStatus()
endTime
- the value to set forDataFeedPublication.getEndTime()
containsErrors
- the value to set forDataFeedPublication.isContainsErrors()
errorDetails
- (optional) the value to set forDataFeedPublication.getErrorDetails()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the publication currently has this value for itsDataFeedPublication.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated publication if successfully updated, else
null
-
getBehaviorUtil
protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil getBehaviorUtil() -
getCriteriaBuilder
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder getCriteriaBuilder() -
getRepositoryEntityTypeManager
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager() -
getQueryHelper
-
getEntityManager
protected javax.persistence.EntityManager getEntityManager() -
getNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper() -
getBaseRepository
Lazy injection so we can access base repository methods. -
setBaseRepository
Lazy injection so we can access base repository methods. -
getNotificationStateService
protected com.broadleafcommerce.common.messaging.notification.NotificationStateService getNotificationStateService()Lazy injection since this is technically a service component. -
setNotificationStateService
@Autowired @Lazy public void setNotificationStateService(com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService) Lazy injection since this is technically a service component.
-