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 boolean
canEqual(Object other)
boolean
equals(Object o)
String
getApplicationId()
The context ID of the application that this bulk update operation was initiated from.String
getAuthor()
The email address of the author that initiated this bulk update operation.Instant
getCreated()
The timestamp at which this operation was first created.List<BulkUpdateError>
getErrors()
When thestatus
is 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.String
getFilterString()
The (by default, RSQL) filter string that should be used to find the records to update.String
getId()
The unique identifier of the bulk update operation.List<String>
getInclusions()
A list of (additional) context IDs of specific entities which should receive updates.Instant
getLastUpdated()
The timestamp at which this operation last experienced a change.String
getName()
The name of the bulk update operation.long
getNumberOfRecordsProcessed()
The number of records that have been successfully processed thus far.String
getSerializedPayload()
The serialized representation of the requested changes to be made.BulkUpdateStatus
getStatus()
The overall status of the bulk update.String
getTarget()
The target of the bulk update.String
getTenantId()
The context ID of the tenant that this bulk update operation was initiated from.long
getTotalRecordsToProcess()
The total number of records that should be processed.String
getType()
The type of change that this update will be performing.String
getUpdatingApplicationId()
The ID of the application in which the update will be applied.String
getUpdatingCatalogId()
The ID of the catalog in which the update will be applied.String
getUpdatingCustomerContextId()
The ID of the customer context in which the update will be applied.String
getUpdatingSandboxId()
The ID of the sandbox in which the update will be applied.String
getUpdatingSandboxName()
The name of the new sandbox to create in which the update will be applied.int
hashCode()
boolean
isProductionBulkUpdate()
Set to true if the bulk update changes should go directly to production.void
setApplicationId(String applicationId)
The context ID of the application that this bulk update operation was initiated from.void
setAuthor(String author)
The email address of the author that initiated this bulk update operation.void
setCreated(Instant created)
The timestamp at which this operation was first created.void
setErrors(List<BulkUpdateError> errors)
When thestatus
is determined to beBulkUpdateStatus.ERROR
, this field should be set to contain the reasoning for the failure.void
setExclusions(List<String> exclusions)
A list of context IDs of the entities which should not receive updates.void
setFilterString(String filterString)
The (by default, RSQL) filter string that should be used to find the records to update.void
setId(String id)
The unique identifier of the bulk update operation.void
setInclusions(List<String> inclusions)
A list of (additional) context IDs of specific entities which should receive updates.void
setLastUpdated(Instant lastUpdated)
The timestamp at which this operation last experienced a change.void
setName(String name)
The name of the bulk update operation.void
setNumberOfRecordsProcessed(long numberOfRecordsProcessed)
The number of records that have been successfully processed thus far.void
setProductionBulkUpdate(boolean productionBulkUpdate)
Set to true if the bulk update changes should go directly to production.void
setSerializedPayload(String serializedPayload)
The serialized representation of the requested changes to be made.void
setStatus(BulkUpdateStatus status)
The overall status of the bulk update.void
setTarget(String target)
The target of the bulk update.void
setTenantId(String tenantId)
The context ID of the tenant that this bulk update operation was initiated from.void
setTotalRecordsToProcess(long totalRecordsToProcess)
The total number of records that should be processed.void
setType(String type)
The type of change that this update will be performing.void
setUpdatingApplicationId(String updatingApplicationId)
The ID of the application in which the update will be applied.void
setUpdatingCatalogId(String updatingCatalogId)
The ID of the catalog in which the update will be applied.void
setUpdatingCustomerContextId(String updatingCustomerContextId)
The ID of the customer context in which the update will be applied.void
setUpdatingSandboxId(String updatingSandboxId)
The ID of the sandbox in which the update will be applied.void
setUpdatingSandboxName(String updatingSandboxName)
The name of the new sandbox to create in which the update will be applied.String
toString()
-
-
-
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 thestatus
is 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 withnumberOfRecordsProcessed
to 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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.REQUESTED
orBulkUpdateStatus.PROCESSING
in 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 ifproductionBulkUpdate
is 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 thestatus
is 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 withnumberOfRecordsProcessed
to 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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
, andexclusions
is entirely left toBulkUpdateProcessor
implementations.- 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.REQUESTED
orBulkUpdateStatus.PROCESSING
in 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 ifproductionBulkUpdate
is 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)
-
-