Interface DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
- All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
- All Known Implementing Classes:
DefaultDataFeedProcessExecutionService
public interface DataFeedProcessExecutionService<P extends DataFeedProcessExecution>
extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service component providing API for CRUD operations on
DataFeedProcessExecution
.
Supported by DataFeedProcessExecutionRepository
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioninitializeNotificationStateAndEmitMessage
(String id, String messageType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically finds theDataFeedProcessExecution
for the givenid
, and initializes itsNotificationState
formessageType
.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 theDataFeedProcessExecution
instances for the specified data feed process id.readByContextIdAndDataFeedProcessId
(String id, String dataFeedProcessId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads theDataFeedProcessExecution
by 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 anOptional
instead of throwingEntityMissingException
when 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 interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Method Details
-
readByContextIdOpt
Optional<P> readByContextIdOpt(@NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Similar toCrudEntityService.readByContextId(String, ContextInfo)
, but returns anOptional
instead of throwingEntityMissingException
when not found.- 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
Optional
containing the narrowed entity instance in the form of a business instance, elseOptional.empty()
-
readByContextIdAndDataFeedProcessId
Optional<P> readByContextIdAndDataFeedProcessId(String id, String dataFeedProcessId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads theDataFeedProcessExecution
by id and the data feed process id.- Parameters:
id
- The context id for the entitydataFeedProcessId
- the data feed process idcontext
- context information around multitenant state- Returns:
- an
Optional
containing the narrowed entity instance in the form of a business instance, elseOptional.empty()
-
readAllByDataFeedProcessId
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) Reads theDataFeedProcessExecution
instances for the specified data feed process id.- Parameters:
dataFeedProcessId
- the data feed process idfilters
- the RSQLNode
used to restrict resultpage
- the requested page of results from the databasecontext
- context information around multitenant state- Returns:
- the
DataFeedProcessExecution
instances for the specified data feed process id
-
initializeNotificationStateAndEmitMessage
@Nullable P initializeNotificationStateAndEmitMessage(String id, String messageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically finds theDataFeedProcessExecution
for the givenid
, and initializes itsNotificationState
formessageType
.If the update is successful, calls
NotificationManager.handle(NotificationStateRepository, NotificationStateAware, String)
for themessageType
, which will emit the message.- Parameters:
id
- theDataFeedProcessExecution.getId()
for which to initialize and emit the messagemessageType
- the message type (ex:NotificationState.getName()
contextInfo
- context information around multitenant state- Returns:
- the updated
DataFeedProcessExecution
if successfully found and updated,null
otherwise
-
setStatus
@Nullable P setStatus(String id, String newStatus, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedProcessExecution.getStatus()
on the specified execution.- Parameters:
id
- the ID of the execution to updatenewStatus
- the new value to set forDataFeedProcessExecution.getStatus()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the execution currently has this value for itsDataFeedProcessExecution.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated execution if successfully updated, else
null
-
setStatusAndStartTime
@Nullable P setStatusAndStartTime(String id, String newStatus, Instant startTime, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically sets a newDataFeedProcessExecution.getStatus()
andDataFeedProcessExecution.getStartTime()
on the specified execution.- Parameters:
id
- the ID of the execution to updatenewStatus
- the new value to set forDataFeedProcessExecution.getStatus()
startTime
- the value to set forDataFeedProcessExecution.getStartTime()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the execution currently has this value for itsDataFeedProcessExecution.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated execution if successfully updated, else
null
-
setStatusAndCompletionDetails
@Nullable 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) Atomically sets a newDataFeedProcessExecution.getStatus()
and completion details on the specified execution.- Parameters:
id
- the ID of the execution to updatenewStatus
- the new value to set forDataFeedProcessExecution.getStatus()
endTime
- the value to set forDataFeedProcessExecution.getEndTime()
containsErrors
- the value to set forDataFeedProcessExecution.isContainsErrors()
errorDetails
- (optional) the value to set forDataFeedProcessExecution.getErrorDetails()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the execution currently has this value for itsDataFeedProcessExecution.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated execution if successfully updated, else
null
-
setQueriedDataFileLocation
@Nullable P setQueriedDataFileLocation(String id, String queriedDataFileLocation, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Atomically setsDataFeedProcessExecution.getQueriedDataFileLocation()
on the specified execution.- Parameters:
id
- the ID of the execution to updatequeriedDataFileLocation
- the value to set forDataFeedProcessExecution.getQueriedDataFileLocation()
whereCurrentStatus
- (optional) if provided, the update will only be applied if the execution currently has this value for itsDataFeedProcessExecution.getStatus()
contextInfo
- context information around multitenant state- Returns:
- the updated execution if successfully updated, else
null
-