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 Details

    • readByContextIdOpt

      Optional<P> readByContextIdOpt(@NonNull String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Similar to CrudEntityService.readByContextId(String, ContextInfo), but returns an Optional instead of throwing EntityMissingException 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, else Optional.empty()
    • readByContextIdAndDataFeedProcessId

      Optional<P> readByContextIdAndDataFeedProcessId(String id, String dataFeedProcessId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Reads the DataFeedProcessExecution by id and the data feed process id.
      Parameters:
      id - The context id for the entity
      dataFeedProcessId - the data feed process id
      context - context information around multitenant state
      Returns:
      an Optional containing the narrowed entity instance in the form of a business instance, else Optional.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 the DataFeedProcessExecution instances for the specified data feed process id.
      Parameters:
      dataFeedProcessId - the data feed process id
      filters - the RSQL Node used to restrict result
      page - the requested page of results from the database
      context - 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 the DataFeedProcessExecution for the given id, and initializes its NotificationState for messageType.

      If the update is successful, calls NotificationManager.handle(NotificationStateRepository, NotificationStateAware, String) for the messageType, which will emit the message.

      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 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 new DataFeedProcessExecution.getStatus() on the specified execution.
      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 P setStatusAndStartTime(String id, String newStatus, Instant startTime, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Atomically sets a new DataFeedProcessExecution.getStatus() and DataFeedProcessExecution.getStartTime() on the specified execution.
      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 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 new DataFeedProcessExecution.getStatus() and completion details on the specified execution.
      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 P setQueriedDataFileLocation(String id, String queriedDataFileLocation, @Nullable String whereCurrentStatus, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Atomically sets DataFeedProcessExecution.getQueriedDataFileLocation() on the specified execution.
      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