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>
-
Field Summary
Fields -
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.BulkOperationResponse
createBulkOperation
(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a bulk operation with the suppliedBulkOperationRequest
.protected String
getAutoIncludedCategoriesUrl
(org.springframework.data.domain.Pageable page) protected String
getCategoryUrl
(String categoryContextId) protected String
getCreateBulkOperationUrl
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected String
getInitializeBulkOperationItemsUrl
(String bulkOperationId, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected ExternalCatalogProperties
protected ProviderUtils
protected String
List<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 String
getSupportedBulkOpsUrl
(String operationType, String entityType) protected com.broadleafcommerce.common.extension.TypeFactory
protected String
getUpdateBulkOperationTotalRecordCountUrl
(com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse) protected String
protected org.springframework.web.reactive.function.client.WebClient
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) Initializes the bulk operation items from the entities returned in theSearchResponse
.org.springframework.data.domain.Page<Category>
retrieveAutoIncludedCategories
(org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a page of categories that are marked as `AUTO_INCLUDE`.retrieveCategoryDetails
(String categoryContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves the category details for the given category context id.com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse
updateBulkOperationTotalRecordCount
(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.updateCategoryProducts
(CategoryProductRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the category products for the givenCategoryProductRequest
.
-
Field Details
-
ORIGINAL_AUTHOR_HEADER
- See Also:
-
-
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:CatalogProvider
Creates a bulk operation with the suppliedBulkOperationRequest
.- Specified by:
createBulkOperation
in interfaceCatalogProvider<I extends CatalogItem>
- Parameters:
bulkOperationRequest
- theBulkOperationRequest
to 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:CatalogProvider
Retrieves the list of supported bulk operations for the given operation type in catalog services.- Specified by:
getSupportedBulkOperations
in 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:CatalogProvider
Initializes the bulk operation items from the entities returned in theSearchResponse
.- Specified by:
initializeItems
in interfaceCatalogProvider<I extends CatalogItem>
- Parameters:
searchResponse
- the list of catalog items from the search servicebulkOperationRequest
- theBulkOperationRequest
for this bulk operationbulkOperationResponse
- the bulk operation createdpageable
- the current page informationcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the
InitializeItemResponse
containing 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:CatalogProvider
Updates the bulk operation to set the total record count after item initialization.- Specified by:
updateBulkOperationTotalRecordCount
in 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
-
retrieveAutoIncludedCategories
public org.springframework.data.domain.Page<Category> retrieveAutoIncludedCategories(org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProvider
Retrieves a page of categories that are marked as `AUTO_INCLUDE`.- Specified by:
retrieveAutoIncludedCategories
in interfaceCatalogProvider<I extends CatalogItem>
- Parameters:
page
- the page informationcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the page of categories
-
retrieveCategoryDetails
public Category retrieveCategoryDetails(String categoryContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProvider
Retrieves the category details for the given category context id.- Specified by:
retrieveCategoryDetails
in interfaceCatalogProvider<I extends CatalogItem>
- Parameters:
categoryContextId
- the category context idcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the category details
-
updateCategoryProducts
public CategoryProductResponse updateCategoryProducts(CategoryProductRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProvider
Updates the category products for the givenCategoryProductRequest
. This will add or remove products from the categories. Any products that are unable to be removed will have their change container ids be returned in theCategoryProductResponse
to be forwarded onto the Sandbox service for reversion.- Specified by:
updateCategoryProducts
in interfaceCatalogProvider<I extends CatalogItem>
- Parameters:
request
- theCategoryProductRequest
to updatecontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the list of products
-
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) -
getAutoIncludedCategoriesUrl
-
getCategoryUrl
-
getUpdateCategoriesUrl
-
getServiceClient
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getProviderUtils
-
getProperties
-