Class CatalogBulkOperationHandler
java.lang.Object
com.broadleafcommerce.bulkoperations.service.handler.CatalogBulkOperationHandler
- All Implemented Interfaces:
BulkOperationHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCatalogBulkOperationHandler
(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 TypeMethodDescriptionboolean
Determines if this handler can handle the bulk operation request.protected void
createSandboxForBulkOperation
(String sandboxId, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Sends theCreateSandboxRequest
message to create a sandbox to contain the catalog changes from this bulk operation.protected String
protected com.broadleafcommerce.bulk.v2.messaging.BulkOpsInitializeItemsRequestProducer
protected CatalogProvider<? extends CatalogItem>
protected com.broadleafcommerce.bulk.v2.messaging.sandbox.CreateSandboxRequestProducer
protected org.springframework.context.MessageSource
protected BulkOperationsProviderProperties
protected String
getSandboxDescription
(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected String
getSandboxName
(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.messaging.notification.DetachedDurableMessageSender
protected com.broadleafcommerce.common.extension.TypeFactory
com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse
handle
(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 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 theBulkOpsInitializeItemsRequest
message to initialize bulk operation items.
-
Field Details
-
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:BulkOperationHandler
Determines if this handler can handle the bulk operation request.- Specified by:
canHandle
in 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:BulkOperationHandler
Handles this bulk operation request for the specified entity or operation type.- Specified by:
handle
in 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 theCreateSandboxRequest
message 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 theBulkOpsInitializeItemsRequest
message 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()
-