Class CatalogBulkOperationHandler
java.lang.Object
com.broadleafcommerce.bulkoperations.service.handler.CatalogBulkOperationHandler
- All Implemented Interfaces:
BulkOperationHandler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCatalogBulkOperationHandler(CatalogProvider<? extends CatalogItem> catalogProvider, com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender sender, BulkOperationsProviderProperties properties, com.broadleafcommerce.bulk.v2.messaging.sandbox.CreateSandboxRequestProducer createSandboxRequestProducer, com.broadleafcommerce.bulk.v2.messaging.BulkOpsInitializeItemsRequestProducer bulkOpsInitializeItemsRequestProducer, org.springframework.context.MessageSource messageSource, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this handler can handle the bulk operation request.protected voidcreateSandboxForBulkOperation(String sandboxId, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends theCreateSandboxRequestmessage to create a sandbox to contain the catalog changes from this bulk operation.protected Stringprotected com.broadleafcommerce.bulk.v2.messaging.BulkOpsInitializeItemsRequestProducerprotected CatalogProvider<? extends CatalogItem>protected com.broadleafcommerce.bulk.v2.messaging.sandbox.CreateSandboxRequestProducerprotected org.springframework.context.MessageSourceprotected BulkOperationsProviderPropertiesprotected StringgetSandboxDescription(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StringgetSandboxName(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSenderprotected com.broadleafcommerce.common.extension.TypeFactorycom.broadleafcommerce.bulk.v2.domain.BulkOperationResponsehandle(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Handles this bulk operation request for the specified entity or operation type.protected voidinitializeItems(com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends theBulkOpsInitializeItemsRequestmessage to initialize bulk operation items.
-
Field Details
-
NEW_SANDBOX
- See Also:
-
SECURE_RANDOM
-
-
Constructor Details
-
CatalogBulkOperationHandler
public CatalogBulkOperationHandler(CatalogProvider<? extends CatalogItem> catalogProvider, com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender sender, BulkOperationsProviderProperties properties, com.broadleafcommerce.bulk.v2.messaging.sandbox.CreateSandboxRequestProducer createSandboxRequestProducer, com.broadleafcommerce.bulk.v2.messaging.BulkOpsInitializeItemsRequestProducer bulkOpsInitializeItemsRequestProducer, org.springframework.context.MessageSource messageSource, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
canHandle
Description copied from interface:BulkOperationHandlerDetermines if this handler can handle the bulk operation request.- Specified by:
canHandlein interfaceBulkOperationHandler- Parameters:
operationType- the operation type of the bulk operation requestentityType- the entity type being updated by the bulk operation request- Returns:
- true, if this handler is able to handle the bulk operation
-
handle
public com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse handle(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:BulkOperationHandlerHandles this bulk operation request for the specified entity or operation type.- Specified by:
handlein interfaceBulkOperationHandler- Parameters:
bulkOperationRequest- the bulk operation request DTOcontextInfo- context information surrounding sandboxing/multitenant state- Returns:
- the bulk operation response DTO for the created bulk operation
-
createSandboxForBulkOperation
protected void createSandboxForBulkOperation(String sandboxId, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends theCreateSandboxRequestmessage to create a sandbox to contain the catalog changes from this bulk operation.- Parameters:
sandboxId- the ID of the sandbox to createbulkOperationRequest- the bulk operation request DTOcontextInfo- context information surrounding sandboxing/multitenant state
-
generateRandomHexColor
-
getSandboxName
protected String getSandboxName(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getSandboxDescription
protected String getSandboxDescription(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
initializeItems
protected void initializeItems(com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends theBulkOpsInitializeItemsRequestmessage to initialize bulk operation items.- Parameters:
bulkOperationResponse- the response DTO for the bulk operation creationbulkOperationRequest- the request DTO containing search and operation informationcontextInfo- context information surrounding sandboxing/multitenant state
-
getCatalogProvider
-
getSender
protected com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender getSender() -
getProperties
-
getCreateSandboxRequestProducer
protected com.broadleafcommerce.bulk.v2.messaging.sandbox.CreateSandboxRequestProducer getCreateSandboxRequestProducer() -
getBulkOpsInitializeItemsRequestProducer
protected com.broadleafcommerce.bulk.v2.messaging.BulkOpsInitializeItemsRequestProducer getBulkOpsInitializeItemsRequestProducer() -
getMessageSource
protected org.springframework.context.MessageSource getMessageSource() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-