Interface DataFeedPublicationService<P extends DataFeedPublication>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultDataFeedPublicationService

public interface DataFeedPublicationService<P extends DataFeedPublication> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service component providing API for CRUD operations on DataFeedPublication. Supported by DataFeedPublicationRepository.
See Also:
  • Method Details

    • readByProcessExecutionId

      List<P> readByProcessExecutionId(String dataFeedProcessExecutionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads all DataFeedPublication instances belonging to the given DataFeedProcessExecution.
      Parameters:
      dataFeedProcessExecutionId - the value of DataFeedPublication.getDataFeedProcessExecutionId() to match
      contextInfo - context information around multitenant state
      Returns:
      a list of all found publication instances
    • readByProcessExecutionId

      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)
      Reads the DataFeedPublication instances for the specified data feed process execution id.
      Parameters:
      dataFeedProcessExecutionId - the data feed process execution id
      filters - the RSQL Node used to restrict result
      page - the requested page of results from the database
      contextInfo - context information around multitenant state
      Returns:
      the DataFeedPublication instances for the specified data feed process execution id
    • readByContextIdAndDataFeedProcessExecutionId

      Optional<P> readByContextIdAndDataFeedProcessExecutionId(String id, String dataFeedProcessExecutionId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Reads the DataFeedPublication by id and the data feed process execution id.
      Parameters:
      id - the data feed publication id
      dataFeedProcessExecutionId - the data feed process execution id
      contextInfo - context information around multitenant state
      Returns:
      an Optional containing the narrowed entity instance in the form of a business instance, else Optional.empty()
    • initializeNotificationStateAndEmitMessage

      List<P> initializeNotificationStateAndEmitMessage(List<String> ids, String messageType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Atomically finds the DataFeedPublication instances for the given ids, and initializes their NotificationState for messageType.

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

      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 DataFeedPublication instances that were successfully found and updated (omitting those which were not successfully updated)
    • 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 DataFeedPublication.getStatus() and DataFeedPublication.getStartTime() on the specified publication.
      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 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 DataFeedPublication.getStatus() and completion details on the specified publication.
      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