Class DataFeedPublicationManager
java.lang.Object
com.broadleafcommerce.datafeed.service.manager.DataFeedPublicationManager
Responsible for managing the lifecycle of a
DataFeedPublication
operation.
While DataFeedPublicationService
is in charge of CRUD-related operations on
DataFeedPublication
, this service is a higher-level abstraction that performs the
surrounding logic of processing publication operations. It internally delegates to
DataFeedPublicationService
for CRUD operations.
-
Constructor Summary
ConstructorDescriptionDataFeedPublicationManager
(DataFeedPublicationConfigurationService feedPublicationConfigurationService, DataFeedPublicationService<DataFeedPublication> publicationService, DataFeedProcessExecutionService<DataFeedProcessExecution> executionService, List<DataFeedPublisher> publishers, com.broadleafcommerce.common.extension.TypeFactory typeFactory, StorageService storageService) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(String tenantId, com.broadleafcommerce.data.tracking.core.type.OperationType operationType) protected DataFeedPublishResponseDetails
buildPublishResponse
(boolean containsErrors, List<String> errorDetails) protected void
completePublication
(String dataFeedPublicationId, DataFeedPublishResponseDetails publishResponse, String tenantId) protected Path
copyQueriedDataToTemporaryFile
(String uniqueFilenameInContext, String tenantId) protected DataFeedPublisher
protected DataFeedProcessExecutionManager
Lazy injection of this component since both are at a similar level of abstraction and we want to avoid circular dependency issues.protected DataFeedPublicationConfigurationService
protected DataFeedPublicationService<DataFeedPublication>
protected List<DataFeedPublisher>
protected StorageService
protected com.broadleafcommerce.common.extension.TypeFactory
preparePublishRequest
(DataFeedPublishRequestDetails toInitialize, DataFeedPublication publication, String tenantId) Prepares and initializes the givenDataFeedPublishRequestDetails
instance for the publication.void
runPublication
(String dataFeedPublicationId, String requestingTenantId) Actually runs the provided existing data feed publication.void
setExecutionManager
(DataFeedProcessExecutionManager executionManager) Lazy injection of this component since both are at a similar level of abstraction and we want to avoid circular dependency issues.
-
Constructor Details
-
DataFeedPublicationManager
public DataFeedPublicationManager(DataFeedPublicationConfigurationService feedPublicationConfigurationService, DataFeedPublicationService<DataFeedPublication> publicationService, DataFeedProcessExecutionService<DataFeedProcessExecution> executionService, List<DataFeedPublisher> publishers, com.broadleafcommerce.common.extension.TypeFactory typeFactory, StorageService storageService)
-
-
Method Details
-
runPublication
Actually runs the provided existing data feed publication.- Parameters:
dataFeedPublicationId
- theDataFeedPublication.getId()
which needs to be run. This must exist in the datastore with statusDefaultDataFeedPublicationStatuses.REQUESTED
.requestingTenantId
- the tenant ID of where this run-publication request is coming from. This is important to prevent different tenants from running publications in each other
-
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(String tenantId, com.broadleafcommerce.data.tracking.core.type.OperationType operationType) -
preparePublishRequest
protected List<String> preparePublishRequest(DataFeedPublishRequestDetails toInitialize, DataFeedPublication publication, String tenantId) Prepares and initializes the givenDataFeedPublishRequestDetails
instance for the publication.- Parameters:
toInitialize
- a newly instantiatedDataFeedPublishRequestDetails
instance that should have its fields initializedpublication
- the publication for which this request is being builttenantId
- the current context tenant ID- Returns:
- a list containing any error messages that may have occurred during preparation, else an empty list
-
copyQueriedDataToTemporaryFile
-
findEligibleFeedPublisher
@Nullable protected DataFeedPublisher findEligibleFeedPublisher(DataFeedPublishRequestDetails request) -
buildPublishResponse
protected DataFeedPublishResponseDetails buildPublishResponse(boolean containsErrors, List<String> errorDetails) -
completePublication
protected void completePublication(String dataFeedPublicationId, DataFeedPublishResponseDetails publishResponse, String tenantId) -
getFeedPublicationConfigurationService
-
getPublicationService
-
getExecutionService
-
getPublishers
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getStorageService
-
getExecutionManager
Lazy injection of this component since both are at a similar level of abstraction and we want to avoid circular dependency issues. -
setExecutionManager
Lazy injection of this component since both are at a similar level of abstraction and we want to avoid circular dependency issues.
-