Class 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 a BulkUpdateError instance with its BulkUpdateError.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 populated BulkUpdateError instance with the supplied parameters
      <T> T deserializePayload​(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate, Class<T> clazz)
      Converts the JSON string contained in BulkUpdate.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()  
    • Constructor Detail

      • BulkProcessUtil

        public BulkProcessUtil​(com.broadleafcommerce.data.tracking.core.web.ContextRequestConverter contextRequestConverter,
                               com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                               com.broadleafcommerce.common.extension.TypeFactory typeFactory)
    • Method Detail

      • deserializePayload

        public <T> T deserializePayload​(com.broadleafcommerce.bulk.domain.BulkUpdate bulkUpdate,
                                        Class<T> clazz)
        Converts the JSON string contained in BulkUpdate.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 a BulkUpdateError instance with its BulkUpdateError.description set as the exception cause, and the stack trace populated.
        Parameters:
        type - The BulkUpdateErrorType
        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 populated BulkUpdateError instance with the supplied parameters
        Parameters:
        type - The BulkUpdateErrorType
        description - A description of the error that occurred.
        recordType - The record type
        e - 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()