Class BulkUpdate
java.lang.Object
com.broadleafcommerce.bulk.domain.BulkUpdate
- All Implemented Interfaces:
Serializable
An entity that holds the basic information required to track the status of a bulk update
operation.
- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBulkUpdate
(String name) Convenience Constructor to set nameBulkUpdate
(String id, String name) Convenience Constructor to set id and name -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The context ID of the application that this bulk update operation was initiated from.The email address of the author that initiated this bulk update operation.The timestamp at which this operation was first created.When thestatus
is determined to beBulkUpdateStatus.ERROR
, this field should be set to contain the reasoning for the failure.A list of context IDs of the entities which should not receive updates.The (by default, RSQL) filter string that should be used to find the records to update.getId()
The unique identifier of the bulk update operation.A list of (additional) context IDs of specific entities which should receive updates.The timestamp at which this operation last experienced a change.getName()
The name of the bulk update operation.long
The number of records that have been successfully processed thus far.The serialized representation of the requested changes to be made.The overall status of the bulk update.The target of the bulk update.The context ID of the tenant that this bulk update operation was initiated from.long
The total number of records that should be processed.getType()
The type of change that this update will be performing.The ID of the application in which the update will be applied.The ID of the catalog in which the update will be applied.The ID of the customer context in which the update will be applied.The ID of the sandbox in which the update will be applied.The name of the new sandbox to create in which the update will be applied.int
hashCode()
boolean
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
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
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
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
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
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.toString()
-
Constructor Details
-
BulkUpdate
Convenience Constructor to set id and name- Parameters:
id
-name
-
-
BulkUpdate
Convenience Constructor to set name- Parameters:
name
-
-
BulkUpdate
public BulkUpdate()
-
-
Method Details
-
getId
The unique identifier of the bulk update operation.- Returns:
- the unique identifier of the bulk update operation
-
getName
The name of the bulk update operation.- Returns:
- the name of the bulk update operation
-
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
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
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
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
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
The timestamp at which this operation was first created.- Returns:
- the timestamp at which this operation was first created
-
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
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
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
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:
-
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
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
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
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
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
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
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
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
The unique identifier of the bulk update operation.- Parameters:
id
- the unique identifier of the bulk update operation
-
setName
The name of the bulk update operation.- Parameters:
name
- the name of the bulk update operation
-
setStatus
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
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
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
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
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
The timestamp at which this operation was first created.- Parameters:
created
- the timestamp at which this operation was first created
-
setLastUpdated
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
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
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
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:
-
setApplicationId
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
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
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
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
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
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
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
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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-