Class BulkUpdate
- java.lang.Object
-
- com.broadleafcommerce.bulk.domain.BulkUpdate
-
- All Implemented Interfaces:
Serializable
public class BulkUpdate extends Object implements Serializable
An entity that holds the basic information required to track the status of a bulk update operation.- Author:
- Samarth Dhruva (samarthd)
- See Also:
BulkUpdateRequest, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BulkUpdate()BulkUpdate(String name)Convenience Constructor to set nameBulkUpdate(String id, String name)Convenience Constructor to set id and name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)StringgetApplicationId()The context ID of the application that this bulk update operation was initiated from.StringgetAuthor()The email address of the author that initiated this bulk update operation.InstantgetCreated()The timestamp at which this operation was first created.List<BulkUpdateError>getErrors()When thestatusis determined to beBulkUpdateStatus.ERROR, this field should be set to contain the reasoning for the failure.List<String>getExclusions()A list of context IDs of the entities which should not receive updates.StringgetFilterString()The (by default, RSQL) filter string that should be used to find the records to update.StringgetId()The unique identifier of the bulk update operation.List<String>getInclusions()A list of (additional) context IDs of specific entities which should receive updates.InstantgetLastUpdated()The timestamp at which this operation last experienced a change.StringgetName()The name of the bulk update operation.longgetNumberOfRecordsProcessed()The number of records that have been successfully processed thus far.StringgetSerializedPayload()The serialized representation of the requested changes to be made.BulkUpdateStatusgetStatus()The overall status of the bulk update.StringgetTarget()The target of the bulk update.StringgetTenantId()The context ID of the tenant that this bulk update operation was initiated from.longgetTotalRecordsToProcess()The total number of records that should be processed.StringgetType()The type of change that this update will be performing.StringgetUpdatingApplicationId()The ID of the application in which the update will be applied.StringgetUpdatingCatalogId()The ID of the catalog in which the update will be applied.StringgetUpdatingCustomerContextId()The ID of the customer context in which the update will be applied.StringgetUpdatingSandboxId()The ID of the sandbox in which the update will be applied.StringgetUpdatingSandboxName()The name of the new sandbox to create in which the update will be applied.inthashCode()booleanisProductionBulkUpdate()Set to true if the bulk update changes should go directly to production.voidsetApplicationId(String applicationId)The context ID of the application that this bulk update operation was initiated from.voidsetAuthor(String author)The email address of the author that initiated this bulk update operation.voidsetCreated(Instant created)The timestamp at which this operation was first created.voidsetErrors(List<BulkUpdateError> errors)When thestatusis determined to beBulkUpdateStatus.ERROR, this field should be set to contain the reasoning for the failure.voidsetExclusions(List<String> exclusions)A list of context IDs of the entities which should not receive updates.voidsetFilterString(String filterString)The (by default, RSQL) filter string that should be used to find the records to update.voidsetId(String id)The unique identifier of the bulk update operation.voidsetInclusions(List<String> inclusions)A list of (additional) context IDs of specific entities which should receive updates.voidsetLastUpdated(Instant lastUpdated)The timestamp at which this operation last experienced a change.voidsetName(String name)The name of the bulk update operation.voidsetNumberOfRecordsProcessed(long numberOfRecordsProcessed)The number of records that have been successfully processed thus far.voidsetProductionBulkUpdate(boolean productionBulkUpdate)Set to true if the bulk update changes should go directly to production.voidsetSerializedPayload(String serializedPayload)The serialized representation of the requested changes to be made.voidsetStatus(BulkUpdateStatus status)The overall status of the bulk update.voidsetTarget(String target)The target of the bulk update.voidsetTenantId(String tenantId)The context ID of the tenant that this bulk update operation was initiated from.voidsetTotalRecordsToProcess(long totalRecordsToProcess)The total number of records that should be processed.voidsetType(String type)The type of change that this update will be performing.voidsetUpdatingApplicationId(String updatingApplicationId)The ID of the application in which the update will be applied.voidsetUpdatingCatalogId(String updatingCatalogId)The ID of the catalog in which the update will be applied.voidsetUpdatingCustomerContextId(String updatingCustomerContextId)The ID of the customer context in which the update will be applied.voidsetUpdatingSandboxId(String updatingSandboxId)The ID of the sandbox in which the update will be applied.voidsetUpdatingSandboxName(String updatingSandboxName)The name of the new sandbox to create in which the update will be applied.StringtoString()
-
-
-
Method Detail
-
getId
public String getId()
The unique identifier of the bulk update operation.- Returns:
- the unique identifier of the bulk update operation
-
getName
public String getName()
The name of the bulk update operation.- Returns:
- the name of the bulk update operation
-
getStatus
public BulkUpdateStatus getStatus()
The overall status of the bulk update. This value should be updated as progress is made.- Returns:
- the overall status of the bulk update
- See Also:
BulkUpdateStatus,errors
-
getErrors
public List<BulkUpdateError> getErrors()
When thestatusis determined to beBulkUpdateStatus.ERROR, this field should be set to contain the reasoning for the failure.- Returns:
- the errors that were encountered when processing the operation (if any)
- See Also:
status
-
getTotalRecordsToProcess
public long getTotalRecordsToProcess()
The total number of records that should be processed. This can be used in conjunction withnumberOfRecordsProcessedto determine progress. This value should be determined before a request is made (ideally by running a count query that determines how many records will be targeted by the update).- Returns:
- the total number of records that should be processed
-
getNumberOfRecordsProcessed
public long getNumberOfRecordsProcessed()
The number of records that have been successfully processed thus far. This value should be updated as progress is made.- Returns:
- the number of records that have been successfully processed thus far
-
getFilterString
public String getFilterString()
The (by default, RSQL) filter string that should be used to find the records to update.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Returns:
- the filter string that should be used to find the records to update
- See Also:
exclusions,inclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
getInclusions
public List<String> getInclusions()
A list of (additional) context IDs of specific entities which should receive updates.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Returns:
- a list of context IDs of specific entities which should receive updates
- See Also:
filterString,exclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
getExclusions
public List<String> getExclusions()
A list of context IDs of the entities which should not receive updates. This would be a filter to exclude any entities that are targeted for updating byfilterString/inclusions.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Returns:
- a list of context IDs of the entities which should not receive updates
- See Also:
filterString,inclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
getCreated
public Instant getCreated()
The timestamp at which this operation was first created.- Returns:
- the timestamp at which this operation was first created
-
getLastUpdated
public Instant getLastUpdated()
The timestamp at which this operation last experienced a change. This is very important, and should be constantly updated by the logic responsible for performing the actual entity updates. The value of this field will be compared against a timeout for operations that are marked asBulkUpdateStatus.REQUESTEDorBulkUpdateStatus.PROCESSINGin order to determine whether an operation is hanging or failed.- Returns:
- the timestamp at which this operation last experienced a change
-
getType
public String getType()
The type of change that this update will be performing. This will be used by the logic that applies the updates to determine what needs to be done withserializedPayload.- Returns:
- the type of change that this update will be performing
-
getSerializedPayload
public String getSerializedPayload()
The serialized representation of the requested changes to be made. This can vary greatly in structure - based on the value oftype, the proper understanding and application of these changes is left to the logic that will actually apply the updates.- Returns:
- the serialized representation of the requested changes to be made
-
getTarget
public String getTarget()
The target of the bulk update. This is some value that can be mapped to a particular domain by the logic performing an update, rather than requiring explicit persistence of the fully qualified classname. An example of a value would be"PRODUCT"or"CATEGORY"- Returns:
- the target of the bulk update
- See Also:
BulkUpdateTarget
-
getApplicationId
public String getApplicationId()
The context ID of the application that this bulk update operation was initiated from.- Returns:
- the context ID of the application that this bulk update operation was initiated from
-
getTenantId
public String getTenantId()
The context ID of the tenant that this bulk update operation was initiated from.- Returns:
- the context ID of the tenant that this bulk update operation was initiated from
-
getAuthor
public String getAuthor()
The email address of the author that initiated this bulk update operation. Derived from the current security principal when receiving aBulkUpdateRequest.- Returns:
- the email address of the author that initiated this bulk update operation
-
getUpdatingApplicationId
public String getUpdatingApplicationId()
The ID of the application in which the update will be applied.- Returns:
- the ID of the application in which the update will be applied
-
getUpdatingCustomerContextId
public String getUpdatingCustomerContextId()
The ID of the customer context in which the update will be applied.- Returns:
- the ID of the customer context in which the update will be applied
-
getUpdatingCatalogId
public String getUpdatingCatalogId()
The ID of the catalog in which the update will be applied.- Returns:
- the ID of the catalog in which the update will be applied
-
isProductionBulkUpdate
public boolean isProductionBulkUpdate()
Set to true if the bulk update changes should go directly to production. This is primarily intended for non-sandboxable entities.- Returns:
- Whether the bulk update changes should go directly to production.
-
getUpdatingSandboxName
public String getUpdatingSandboxName()
The name of the new sandbox to create in which the update will be applied. Ignored ifproductionBulkUpdateis true.- Returns:
- the name of the new sandbox to create and apply the update in
- See Also:
updatingSandboxId
-
getUpdatingSandboxId
public String getUpdatingSandboxId()
The ID of the sandbox in which the update will be applied.- Returns:
- the ID of the sandbox in which the update will be applied
- See Also:
updatingSandboxName
-
setId
public void setId(String id)
The unique identifier of the bulk update operation.- Parameters:
id- the unique identifier of the bulk update operation
-
setName
public void setName(String name)
The name of the bulk update operation.- Parameters:
name- the name of the bulk update operation
-
setStatus
public void setStatus(BulkUpdateStatus status)
The overall status of the bulk update. This value should be updated as progress is made.- Parameters:
status- the overall status of the bulk update- See Also:
BulkUpdateStatus,errors
-
setErrors
public void setErrors(List<BulkUpdateError> errors)
When thestatusis determined to beBulkUpdateStatus.ERROR, this field should be set to contain the reasoning for the failure.- Parameters:
errors- the errors that were encountered when processing the operation (if any)- See Also:
status
-
setTotalRecordsToProcess
public void setTotalRecordsToProcess(long totalRecordsToProcess)
The total number of records that should be processed. This can be used in conjunction withnumberOfRecordsProcessedto determine progress. This value should be determined before a request is made (ideally by running a count query that determines how many records will be targeted by the update).- Parameters:
totalRecordsToProcess- the total number of records that should be processed
-
setNumberOfRecordsProcessed
public void setNumberOfRecordsProcessed(long numberOfRecordsProcessed)
The number of records that have been successfully processed thus far. This value should be updated as progress is made.- Parameters:
numberOfRecordsProcessed- the number of records that have been successfully processed thus far
-
setFilterString
public void setFilterString(String filterString)
The (by default, RSQL) filter string that should be used to find the records to update.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Parameters:
filterString- the filter string that should be used to find the records to update- See Also:
exclusions,inclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
setInclusions
public void setInclusions(List<String> inclusions)
A list of (additional) context IDs of specific entities which should receive updates.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Parameters:
inclusions- a list of context IDs of specific entities which should receive updates- See Also:
filterString,exclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
setExclusions
public void setExclusions(List<String> exclusions)
A list of context IDs of the entities which should not receive updates. This would be a filter to exclude any entities that are targeted for updating byfilterString/inclusions.Note: how to interpret
filterString,inclusions, andexclusionsis entirely left toBulkUpdateProcessorimplementations.- Parameters:
exclusions- a list of context IDs of the entities which should not receive updates- See Also:
filterString,inclusions,BulkUpdateProcessor.readRecordsToProcess(BulkUpdate)
-
setCreated
public void setCreated(Instant created)
The timestamp at which this operation was first created.- Parameters:
created- the timestamp at which this operation was first created
-
setLastUpdated
public void setLastUpdated(Instant lastUpdated)
The timestamp at which this operation last experienced a change. This is very important, and should be constantly updated by the logic responsible for performing the actual entity updates. The value of this field will be compared against a timeout for operations that are marked asBulkUpdateStatus.REQUESTEDorBulkUpdateStatus.PROCESSINGin order to determine whether an operation is hanging or failed.- Parameters:
lastUpdated- the timestamp at which this operation last experienced a change
-
setType
public void setType(String type)
The type of change that this update will be performing. This will be used by the logic that applies the updates to determine what needs to be done withserializedPayload.- Parameters:
type- the type of change that this update will be performing
-
setSerializedPayload
public void setSerializedPayload(String serializedPayload)
The serialized representation of the requested changes to be made. This can vary greatly in structure - based on the value oftype, the proper understanding and application of these changes is left to the logic that will actually apply the updates.- Parameters:
serializedPayload- the serialized representation of the requested changes to be made
-
setTarget
public void setTarget(String target)
The target of the bulk update. This is some value that can be mapped to a particular domain by the logic performing an update, rather than requiring explicit persistence of the fully qualified classname. An example of a value would be"PRODUCT"or"CATEGORY"- Parameters:
target- the target of the bulk update- See Also:
BulkUpdateTarget
-
setApplicationId
public void setApplicationId(String applicationId)
The context ID of the application that this bulk update operation was initiated from.- Parameters:
applicationId- the context ID of the application that this bulk update operation was initiated from
-
setTenantId
public void setTenantId(String tenantId)
The context ID of the tenant that this bulk update operation was initiated from.- Parameters:
tenantId- the context ID of the tenant that this bulk update operation was initiated from
-
setAuthor
public void setAuthor(String author)
The email address of the author that initiated this bulk update operation. Derived from the current security principal when receiving aBulkUpdateRequest.- Parameters:
author- the email address of the author that initiated this bulk update operation
-
setUpdatingApplicationId
public void setUpdatingApplicationId(String updatingApplicationId)
The ID of the application in which the update will be applied.- Parameters:
updatingApplicationId- the ID of the application in which the update will be applied
-
setUpdatingCustomerContextId
public void setUpdatingCustomerContextId(String updatingCustomerContextId)
The ID of the customer context in which the update will be applied.- Parameters:
customerContextId- the ID of the customer context in which the update will be applied
-
setUpdatingCatalogId
public void setUpdatingCatalogId(String updatingCatalogId)
The ID of the catalog in which the update will be applied.- Parameters:
updatingCatalogId- the ID of the catalog in which the update will be applied
-
setProductionBulkUpdate
public void setProductionBulkUpdate(boolean productionBulkUpdate)
Set to true if the bulk update changes should go directly to production. This is primarily intended for non-sandboxable entities.- Parameters:
productionBulkUpdate- Whether the bulk update changes should go directly to production.
-
setUpdatingSandboxName
public void setUpdatingSandboxName(String updatingSandboxName)
The name of the new sandbox to create in which the update will be applied. Ignored ifproductionBulkUpdateis true.- Parameters:
updatingSandboxName- the name of the new sandbox to create and apply the update in- See Also:
updatingSandboxId
-
setUpdatingSandboxId
public void setUpdatingSandboxId(String updatingSandboxId)
The ID of the sandbox in which the update will be applied.- Parameters:
updatingSandboxId- the ID of the sandbox in which the update will be applied- See Also:
updatingSandboxName
-
canEqual
protected boolean canEqual(Object other)
-
-