Class BulkProcessUtil
- java.lang.Object
-
- com.broadleafcommerce.customer.service.bulk.BulkProcessUtil
-
public class BulkProcessUtil extends Object
Convenience methods for use when performing bulk update operations.
-
-
Constructor Summary
Constructors Constructor Description BulkProcessUtil(com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter contextRequestConverter, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, com.broadleafcommerce.data.tracking.core.type.OperationType operationType)
protected com.broadleafcommerce.data.tracking.core.context.ContextRequest
buildContextRequest(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate)
com.broadleafcommerce.bulk.domain.BulkUpdateError
buildError(@NonNull com.broadleafcommerce.bulk.domain.BulkUpdateErrorType type, @NonNull Exception e)
Returns aBulkUpdateError
instance with itsBulkUpdateError.description
set as the exception cause, and the stack trace populated.com.broadleafcommerce.bulk.domain.BulkUpdateError
buildError(@NonNull com.broadleafcommerce.bulk.domain.BulkUpdateErrorType type, @NonNull String description, String recordType, String recordId, Exception e)
Returns a populatedBulkUpdateError
instance with the supplied parameters<T> T
deserializePayload(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, Class<T> clazz)
Converts the JSON string contained inBulkUpdate.getSerializedPayload()
()} into a concrete object.protected com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter
getContextRequestConverter()
protected com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
-
-
-
Method Detail
-
deserializePayload
public <T> T deserializePayload(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, Class<T> clazz)
Converts the JSON string contained inBulkUpdate.getSerializedPayload()
()} into a concrete object.
-
buildError
public com.broadleafcommerce.bulk.domain.BulkUpdateError buildError(@NonNull @NonNull com.broadleafcommerce.bulk.domain.BulkUpdateErrorType type, @NonNull @NonNull Exception e)
Returns aBulkUpdateError
instance with itsBulkUpdateError.description
set as the exception cause, and the stack trace populated.- Parameters:
type
- TheBulkUpdateErrorType
e
- The exception- Returns:
- A populated error object
- See Also:
BulkUpdateError
,BulkUpdateErrorType
-
buildError
public com.broadleafcommerce.bulk.domain.BulkUpdateError buildError(@NonNull @NonNull com.broadleafcommerce.bulk.domain.BulkUpdateErrorType type, @NonNull @NonNull String description, @Nullable String recordType, @Nullable String recordId, @Nullable Exception e)
Returns a populatedBulkUpdateError
instance with the supplied parameters- Parameters:
type
- TheBulkUpdateErrorType
description
- A description of the error that occurred.recordType
- The record typee
- The exception that occurred- Returns:
- A populated error object
- See Also:
BulkUpdateError
,BulkUpdateErrorType
,BulkUpdateTarget
-
buildContextInfo
public com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, com.broadleafcommerce.data.tracking.core.type.OperationType operationType)
-
buildContextRequest
protected com.broadleafcommerce.data.tracking.core.context.ContextRequest buildContextRequest(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate)
-
getContextRequestConverter
protected com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter getContextRequestConverter()
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
-