Class DefaultDataFeedProcessExecutionService<P extends DataFeedProcessExecution>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.datafeed.service.DefaultDataFeedProcessExecutionService<P>
- Type Parameters:
- P- business/projection type of- DataFeedProcessExecution
- All Implemented Interfaces:
- com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>,- com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>,- DataFeedProcessExecutionService<P>
public class DefaultDataFeedProcessExecutionService<P extends DataFeedProcessExecution>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements DataFeedProcessExecutionService<P>
Default implementation of 
DataFeedProcessExecutionService- 
Constructor SummaryConstructorsConstructorDescriptionDefaultDataFeedProcessExecutionService(DataFeedProcessExecutionRepository<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 DataFeedProcessExecutionRepository<com.broadleafcommerce.data.tracking.core.Trackable>initializeNotificationStateAndEmitMessage(String id, String messageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically finds theDataFeedProcessExecutionfor the givenid, and initializes itsNotificationStateformessageType.org.springframework.data.domain.Page<P>readAllByDataFeedProcessId(String dataFeedProcessId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads theDataFeedProcessExecutioninstances for the specified data feed process id.readByContextIdAndDataFeedProcessId(String id, String dataFeedProcessId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads theDataFeedProcessExecutionby id and the data feed process id.readByContextIdOpt(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Similar toCrudEntityService.readByContextId(String, ContextInfo), but returns anOptionalinstead of throwingEntityMissingExceptionwhen not found.setQueriedDataFileLocation(String id, String queriedDataFileLocation, String whereCurrentStatus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically setsDataFeedProcessExecution.getQueriedDataFileLocation()on the specified execution.setStatus(String id, String newStatus, String whereCurrentStatus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedProcessExecution.getStatus()on the specified execution.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 newDataFeedProcessExecution.getStatus()and completion details on the specified execution.setStatusAndStartTime(String id, String newStatus, Instant startTime, String whereCurrentStatus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedProcessExecution.getStatus()andDataFeedProcessExecution.getStartTime()on the specified execution.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- 
DefaultDataFeedProcessExecutionServicepublic DefaultDataFeedProcessExecutionService(DataFeedProcessExecutionRepository<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- 
readByContextIdOptpublic Optional<P> readByContextIdOpt(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:DataFeedProcessExecutionServiceSimilar toCrudEntityService.readByContextId(String, ContextInfo), but returns anOptionalinstead of throwingEntityMissingExceptionwhen not found.- Specified by:
- readByContextIdOptin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- The context id for the entity. This is the id by which the business recognizes the item.
- context- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
- Returns:
- an Optionalcontaining the narrowed entity instance in the form of a business instance, elseOptional.empty()
 
- 
readByContextIdAndDataFeedProcessIdpublic Optional<P> readByContextIdAndDataFeedProcessId(String id, String dataFeedProcessId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:DataFeedProcessExecutionServiceReads theDataFeedProcessExecutionby id and the data feed process id.- Specified by:
- readByContextIdAndDataFeedProcessIdin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- The context id for the entity
- dataFeedProcessId- the data feed process id
- context- context information around multitenant state
- Returns:
- an Optionalcontaining the narrowed entity instance in the form of a business instance, elseOptional.empty()
 
- 
readAllByDataFeedProcessIdpublic org.springframework.data.domain.Page<P> readAllByDataFeedProcessId(String dataFeedProcessId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:DataFeedProcessExecutionServiceReads theDataFeedProcessExecutioninstances for the specified data feed process id.- Specified by:
- readAllByDataFeedProcessIdin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- dataFeedProcessId- the data feed process id
- filters- the RSQL- Nodeused to restrict result
- page- the requested page of results from the database
- context- context information around multitenant state
- Returns:
- the DataFeedProcessExecutioninstances for the specified data feed process id
 
- 
initializeNotificationStateAndEmitMessage@Nullable public P initializeNotificationStateAndEmitMessage(String id, String messageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedProcessExecutionServiceAtomically finds theDataFeedProcessExecutionfor the givenid, and initializes itsNotificationStateformessageType.If the update is successful, calls NotificationManager.handle(NotificationStateRepository, NotificationStateAware, String)for themessageType, which will emit the message.- Specified by:
- initializeNotificationStateAndEmitMessagein interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- the- DataFeedProcessExecution.getId()for which to initialize and emit the message
- messageType- the message type (ex:- NotificationState.getName()
- contextInfo- context information around multitenant state
- Returns:
- the updated DataFeedProcessExecutionif successfully found and updated,nullotherwise
 
- 
setStatus@Nullable public P setStatus(String id, String newStatus, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedProcessExecutionServiceAtomically sets a newDataFeedProcessExecution.getStatus()on the specified execution.- Specified by:
- setStatusin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- the ID of the execution to update
- newStatus- the new value to set for- DataFeedProcessExecution.getStatus()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the execution currently has this value for its- DataFeedProcessExecution.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated execution if successfully updated, else null
 
- 
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:DataFeedProcessExecutionServiceAtomically sets a newDataFeedProcessExecution.getStatus()andDataFeedProcessExecution.getStartTime()on the specified execution.- Specified by:
- setStatusAndStartTimein interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- the ID of the execution to update
- newStatus- the new value to set for- DataFeedProcessExecution.getStatus()
- startTime- the value to set for- DataFeedProcessExecution.getStartTime()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the execution currently has this value for its- DataFeedProcessExecution.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated execution 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:DataFeedProcessExecutionServiceAtomically sets a newDataFeedProcessExecution.getStatus()and completion details on the specified execution.- Specified by:
- setStatusAndCompletionDetailsin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- the ID of the execution to update
- newStatus- the new value to set for- DataFeedProcessExecution.getStatus()
- endTime- the value to set for- DataFeedProcessExecution.getEndTime()
- containsErrors- the value to set for- DataFeedProcessExecution.isContainsErrors()
- errorDetails- (optional) the value to set for- DataFeedProcessExecution.getErrorDetails()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the execution currently has this value for its- DataFeedProcessExecution.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated execution if successfully updated, else null
 
- 
setQueriedDataFileLocation@Nullable public P setQueriedDataFileLocation(String id, String queriedDataFileLocation, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:DataFeedProcessExecutionServiceAtomically setsDataFeedProcessExecution.getQueriedDataFileLocation()on the specified execution.- Specified by:
- setQueriedDataFileLocationin interface- DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- Parameters:
- id- the ID of the execution to update
- queriedDataFileLocation- the value to set for- DataFeedProcessExecution.getQueriedDataFileLocation()
- whereCurrentStatus- (optional) if provided, the update will only be applied if the execution currently has this value for its- DataFeedProcessExecution.getStatus()
- contextInfo- context information around multitenant state
- Returns:
- the updated execution if successfully updated, else null
 
- 
getProcessExecutionRepositoryprotected DataFeedProcessExecutionRepository<com.broadleafcommerce.data.tracking.core.Trackable> getProcessExecutionRepository()
- 
getNotificationManager@Nullable protected com.broadleafcommerce.common.messaging.notification.NotificationManager getNotificationManager()
 
-