Class DefaultDataFeedPublicationService<P extends DataFeedPublication>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.datafeed.service.DefaultDataFeedPublicationService<P>
- Type Parameters:
- P- business/projection type of- DataFeedPublication
- All Implemented Interfaces:
- com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,- com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>,- DataFeedPublicationService<P>
public class DefaultDataFeedPublicationService<P extends DataFeedPublication>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements DataFeedPublicationService<P>
Default implementation of 
DataFeedPublicationService- 
Constructor SummaryConstructorsConstructorDescriptionDefaultDataFeedPublicationService(DataFeedPublicationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected com.broadleafcommerce.common.messaging.notification.NotificationManagerprotected DataFeedPublicationRepository<com.broadleafcommerce.data.tracking.core.Trackable>initializeNotificationStateAndEmitMessage(List<String> ids, String messageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically finds theDataFeedPublicationinstances for the givenids, and initializes theirNotificationStateformessageType.readByContextIdAndDataFeedProcessExecutionId(String id, String dataFeedProcessExecutionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads theDataFeedPublicationby id and the data feed process execution id.readByProcessExecutionId(String dataFeedProcessExecutionId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads allDataFeedPublicationinstances belonging to the givenDataFeedProcessExecution.org.springframework.data.domain.Page<P>readByProcessExecutionId(String dataFeedProcessExecutionId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads theDataFeedPublicationinstances for the specified data feed process execution id.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.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityServicegetRsqlHelper, readAll, readAll, readAll, readAllMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityServiceconvertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityServicecreate, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityServicereadAll, readAll, readAll, readAll
- 
Constructor Details- 
DefaultDataFeedPublicationServicepublic DefaultDataFeedPublicationService(DataFeedPublicationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, @Nullable com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager) 
 
- 
- 
Method Details- 
readByProcessExecutionIdpublic List<P> readByProcessExecutionId(String dataFeedProcessExecutionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedPublicationServiceReads allDataFeedPublicationinstances belonging to the givenDataFeedProcessExecution.- Specified by:
- readByProcessExecutionIdin interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- dataFeedProcessExecutionId- the value of- DataFeedPublication.getDataFeedProcessExecutionId()to match
- contextInfo- context information around multitenant state
- Returns:
- a list of all found publication instances
 
- 
readByProcessExecutionIdpublic org.springframework.data.domain.Page<P> readByProcessExecutionId(String dataFeedProcessExecutionId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedPublicationServiceReads theDataFeedPublicationinstances for the specified data feed process execution id.- Specified by:
- readByProcessExecutionIdin interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- dataFeedProcessExecutionId- the data feed process execution id
- filters- the RSQL- Nodeused to restrict result
- page- the requested page of results from the database
- contextInfo- context information around multitenant state
- Returns:
- the DataFeedPublicationinstances for the specified data feed process execution id
 
- 
readByContextIdAndDataFeedProcessExecutionIdpublic Optional<P> readByContextIdAndDataFeedProcessExecutionId(String id, String dataFeedProcessExecutionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedPublicationServiceReads theDataFeedPublicationby id and the data feed process execution id.- Specified by:
- readByContextIdAndDataFeedProcessExecutionIdin interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- id- the data feed publication id
- dataFeedProcessExecutionId- the data feed process execution id
- contextInfo- context information around multitenant state
- Returns:
- an Optionalcontaining the narrowed entity instance in the form of a business instance, elseOptional.empty()
 
- 
initializeNotificationStateAndEmitMessagepublic List<P> initializeNotificationStateAndEmitMessage(List<String> ids, String messageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedPublicationServiceAtomically finds theDataFeedPublicationinstances for the givenids, and initializes theirNotificationStateformessageType.For those where the update is successful, calls NotificationManager.handle(NotificationStateRepository, NotificationStateAware, String)for themessageType, which will emit the message.- Specified by:
- initializeNotificationStateAndEmitMessagein interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- ids- the- DataFeedPublication.getId()ids for which to initialize and emit the message. Cannot be empty.
- messageType- the message type (ex:- NotificationState.getName()
- contextInfo- context information around multitenant state
- Returns:
- the DataFeedPublicationinstances that were successfully found and updated (omitting those which were not successfully updated)
 
- 
setStatusAndStartTime@Nullable public P setStatusAndStartTime(String id, String newStatus, Instant startTime, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedPublicationServiceAtomically sets a newDataFeedPublication.getStatus()andDataFeedPublication.getStartTime()on the specified publication.- Specified by:
- setStatusAndStartTimein interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- id- the ID of the publication to update
- newStatus- the new value to set for- DataFeedPublication.getStatus()
- startTime- the value to set for- DataFeedPublication.getStartTime()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the publication currently has this value for its- DataFeedPublication.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated publication if successfully updated, else null
 
- 
setStatusAndCompletionDetails@Nullable public P 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:DataFeedPublicationServiceAtomically sets a newDataFeedPublication.getStatus()and completion details on the specified publication.- Specified by:
- setStatusAndCompletionDetailsin interface- DataFeedPublicationService<P extends DataFeedPublication>
- Parameters:
- id- the ID of the publication to update
- newStatus- the new value to set for- DataFeedPublication.getStatus()
- endTime- the value to set for- DataFeedPublication.getEndTime()
- containsErrors- the value to set for- DataFeedPublication.isContainsErrors()
- errorDetails- (optional) the value to set for- DataFeedPublication.getErrorDetails()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the publication currently has this value for its- DataFeedPublication.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated publication if successfully updated, else null
 
- 
getPublicationRepositoryprotected DataFeedPublicationRepository<com.broadleafcommerce.data.tracking.core.Trackable> getPublicationRepository()
- 
getNotificationManager@Nullable protected com.broadleafcommerce.common.messaging.notification.NotificationManager getNotificationManager()
 
-