Class ExternalCatalogProvider<I extends CatalogItem>
java.lang.Object
com.broadleafcommerce.bulkoperations.service.provider.external.ExternalCatalogProvider<I>
- All Implemented Interfaces:
CatalogProvider<I>
public class ExternalCatalogProvider<I extends CatalogItem>
extends Object
implements CatalogProvider<I>
-
Constructor Summary
ConstructorsConstructorDescriptionExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ProviderUtils providerUtils, ExternalCatalogProperties properties) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.bulk.v2.domain.BulkOperationResponsecreateBulkOperation(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a bulk operation with the suppliedBulkOperationRequest.protected StringgetCreateBulkOperationUrl(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StringgetInitializeBulkOperationItemsUrl(String bulkOperationId, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected ExternalCatalogPropertiesprotected ProviderUtilsprotected StringList<com.broadleafcommerce.bulk.v2.domain.SupportedBulkOperation>getSupportedBulkOperations(String operationType, String entityType) Retrieves the list of supported bulk operations for the given operation type in catalog services.protected StringgetSupportedBulkOpsUrl(String operationType, String entityType) protected com.broadleafcommerce.common.extension.TypeFactoryprotected StringgetUpdateBulkOperationTotalRecordCountUrl(com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse) protected org.springframework.web.reactive.function.client.WebClientcom.broadleafcommerce.bulk.v2.domain.InitializeItemResponseinitializeItems(SearchResponse<I> searchResponse, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Initializes the bulk operation items from the entities returned in theSearchResponse.com.broadleafcommerce.bulk.v2.domain.BulkOperationResponseupdateBulkOperationTotalRecordCount(long totalRecordCount, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the bulk operation to set the total record count after item initialization.
-
Constructor Details
-
ExternalCatalogProvider
public ExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ProviderUtils providerUtils, ExternalCatalogProperties properties)
-
-
Method Details
-
createBulkOperation
public com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse createBulkOperation(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProviderCreates a bulk operation with the suppliedBulkOperationRequest.- Specified by:
createBulkOperationin interfaceCatalogProvider<I extends CatalogItem>- Parameters:
bulkOperationRequest- theBulkOperationRequestto createcontextInfo- context information surrounding sandboxing/multitenant state- Returns:
- the created bulk operation
-
getSupportedBulkOperations
public List<com.broadleafcommerce.bulk.v2.domain.SupportedBulkOperation> getSupportedBulkOperations(String operationType, @Nullable String entityType) Description copied from interface:CatalogProviderRetrieves the list of supported bulk operations for the given operation type in catalog services.- Specified by:
getSupportedBulkOperationsin interfaceCatalogProvider<I extends CatalogItem>- Parameters:
operationType- the operation type to checkentityType- the entity type to check- Returns:
- the list of supported bulk operations
-
initializeItems
public com.broadleafcommerce.bulk.v2.domain.InitializeItemResponse initializeItems(SearchResponse<I> searchResponse, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProviderInitializes the bulk operation items from the entities returned in theSearchResponse.- Specified by:
initializeItemsin interfaceCatalogProvider<I extends CatalogItem>- Parameters:
searchResponse- the list of catalog items from the search servicebulkOperationRequest- theBulkOperationRequestfor this bulk operationbulkOperationResponse- the bulk operation createdpageable- the current page informationcontextInfo- context information surrounding sandboxing/multitenant state- Returns:
- the
InitializeItemResponsecontaining the items created for the bulk operation
-
updateBulkOperationTotalRecordCount
public com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse updateBulkOperationTotalRecordCount(long totalRecordCount, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProviderUpdates the bulk operation to set the total record count after item initialization.- Specified by:
updateBulkOperationTotalRecordCountin interfaceCatalogProvider<I extends CatalogItem>- Parameters:
totalRecordCount- the total number of bulk operation item recordsbulkOperationResponse- the bulk operationcontextInfo- context information surrounding sandboxing/multitenant state- Returns:
- the updated
bulk operation
-
getCreateBulkOperationUrl
protected String getCreateBulkOperationUrl(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getSupportedBulkOpsUrl
-
getInitializeBulkOperationItemsUrl
-
getUpdateBulkOperationTotalRecordCountUrl
protected String getUpdateBulkOperationTotalRecordCountUrl(com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse) -
getServiceClient
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getProviderUtils
-
getProperties
-