Class AbstractFileFeedPublisher
java.lang.Object
com.broadleafcommerce.datafeed.service.publisher.file.AbstractFileFeedPublisher
- All Implemented Interfaces:
- DataFeedPublisher,- org.springframework.core.Ordered
- Direct Known Subclasses:
- CommerceManagerFeedAPIPublisher,- MerchantCenterSFTPPublisher
A commonly useful starting point for 
DataFeedPublisher implementations that produce and
 upload files to publish feed data.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA special payload to track details about a publish process as it moves through the different steps inprocess(DataFeedPublishRequestDetails).
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractFileFeedPublisher(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<DataFeedFileTransformer> fileTransformers, List<DataFeedFileSubmitter> fileSubmitters) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract PathcreateLocalOutputFile(DataFeedPublishRequestDetails publishRequest) Create the temporary local output file.protected DataFeedFileSubmitResponseDetailsengageFileSubmission(AbstractFileFeedPublisher.FilePublishContext publishContext) Engage the submission/upload step to takeAbstractFileFeedPublisher.FilePublishContext.getLocalOutputFile()and send it to the appropriate destination.protected DataFeedFileTransformResponseDetailsengageFileTransformation(AbstractFileFeedPublisher.FilePublishContext publishContext) Engage the transformation step to read fromDataFeedPublishRequestDetails.getQueriedDataFileLocalCopy()and transform + serialize those elements toAbstractFileFeedPublisher.FilePublishContext.getLocalOutputFile().protected Optional<DataFeedFileSubmitter>findFileSubmitter(DataFeedPublishRequestDetails publishRequestDetails) protected Optional<DataFeedFileTransformer>findFileTransformer(DataFeedPublishRequestDetails publishRequestDetails) protected List<DataFeedFileSubmitter>protected List<DataFeedFileTransformer>protected com.fasterxml.jackson.databind.ObjectMapperprotected com.broadleafcommerce.common.extension.TypeFactorypreparePublishContext(DataFeedPublishRequestDetails publishRequest) process(DataFeedPublishRequestDetails publishRequest) Engages the actual data transformation + submission flow to publish data to the specified destination.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.datafeed.service.publisher.DataFeedPublishercanHandle, getOrder
- 
Constructor Details- 
AbstractFileFeedPublisherpublic AbstractFileFeedPublisher(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<DataFeedFileTransformer> fileTransformers, List<DataFeedFileSubmitter> fileSubmitters) 
 
- 
- 
Method Details- 
processDescription copied from interface:DataFeedPublisherEngages the actual data transformation + submission flow to publish data to the specified destination.This method contract is intentionally simple to allow maximum flexibility in implementation. - Specified by:
- processin interface- DataFeedPublisher
- Parameters:
- publishRequest- a payload containing various relevant input details for processing
- Returns:
- a payload containing details around success/failure
 
- 
preparePublishContextprotected AbstractFileFeedPublisher.FilePublishContext preparePublishContext(DataFeedPublishRequestDetails publishRequest) throws Exception - Throws:
- Exception
 
- 
createLocalOutputFileprotected abstract Path createLocalOutputFile(DataFeedPublishRequestDetails publishRequest) throws Exception Create the temporary local output file. Note that this method is intentionally simple and is not intended to be a place where file contents are initialized.Since this is the file that will ultimately be uploaded to the destination, ensure it has the appropriate file name/extensions required by the provider. Typically, implementations will delegate to DataFeedFileTransformer.createLocalOutputFile(DataFeedPublishRequestDetails).- Parameters:
- publishRequest- the publish request details
- Returns:
- a reference to the created file
- Throws:
- Exception- if something went wrong
- See Also:
 
- 
engageFileTransformationprotected DataFeedFileTransformResponseDetails engageFileTransformation(AbstractFileFeedPublisher.FilePublishContext publishContext) Engage the transformation step to read fromDataFeedPublishRequestDetails.getQueriedDataFileLocalCopy()and transform + serialize those elements toAbstractFileFeedPublisher.FilePublishContext.getLocalOutputFile().- Parameters:
- publishContext- the publish context
- Returns:
- the success/failure details about this operation
 
- 
findFileTransformerprotected Optional<DataFeedFileTransformer> findFileTransformer(DataFeedPublishRequestDetails publishRequestDetails) 
- 
engageFileSubmissionprotected DataFeedFileSubmitResponseDetails engageFileSubmission(AbstractFileFeedPublisher.FilePublishContext publishContext) Engage the submission/upload step to takeAbstractFileFeedPublisher.FilePublishContext.getLocalOutputFile()and send it to the appropriate destination.- Parameters:
- publishContext- the publish context
- Returns:
- the success/failure details about this operation
 
- 
findFileSubmitterprotected Optional<DataFeedFileSubmitter> findFileSubmitter(DataFeedPublishRequestDetails publishRequestDetails) 
- 
getTypeFactoryprotected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
- 
getObjectMapperprotected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
- 
getFileTransformers
- 
getFileSubmitters
 
-