Class Export
- java.lang.Object
-
- com.broadleafcommerce.common.dataexport.domain.Export
-
- All Implemented Interfaces:
Serializable
public class Export extends Object implements Serializable
An entity that holds the basic information required to track the status of an export operation.- Author:
- Samarth Dhruva (samarthd)
- See Also:
ExportRequest
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Export()
-
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 application that the export is initialized on.String
getAuthor()
The email address of the author that initiated this export operation.Instant
getCreated()
The timestamp at which this operation was first created.String
getErrorMessage()
When thestatus
is determined to beExportStatus.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 be exported.String
getExportingApplicationId()
The ID of the application that that the export's data will be sourced from.String
getExportingCatalogId()
The ID of the catalog that that the export's data will be sourced from.String
getExportingCustomerContextId()
The ID of the customer context that the export's data will be sourced from.String
getExportingSandboxId()
The ID of the sandbox that the export's data will be sourced from.String
getFileLocation()
After the export file is created, this holds its location in the storage provider.String
getFileType()
The type of file that the export should ultimately produce for download by the user.String
getFilterString()
The (by default, RSQL) filter string that should be used to find the records to export.String
getId()
The unique identifier of the export operation.List<String>
getInclusions()
A list of (additional) context IDs of specific entities which should be exported.Instant
getLastUpdated()
The timestamp at which this operation last experienced a change.String
getName()
The name of the export operation.long
getNumberOfRecordsProcessed()
The number of records that have been successfully processed thus far.Map<String,Object>
getParameters()
Additional parameters for this export.String
getParentId()
The parent id of the entities to export.ExportStatus
getStatus()
The overall status of the export.String
getTarget()
The target of the export.String
getTenantId()
The tenant that the export is initialized on.String
getTimeZoneId()
The ID of the time zone that will be used to format any date fields in the exported file.long
getTotalRecordsToProcess()
The total number of records that should be processed.int
hashCode()
void
setApplicationId(String applicationId)
The application that the export is initialized on.void
setAuthor(String author)
The email address of the author that initiated this export operation.void
setCreated(Instant created)
The timestamp at which this operation was first created.void
setErrorMessage(String errorMessage)
When thestatus
is determined to beExportStatus.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 be exported.void
setExportingApplicationId(String exportingApplicationId)
The ID of the application that that the export's data will be sourced from.void
setExportingCatalogId(String exportingCatalogId)
The ID of the catalog that that the export's data will be sourced from.void
setExportingCustomerContextId(String exportingCustomerContextId)
The ID of the customer context that the export's data will be sourced from.void
setExportingSandboxId(String exportingSandboxId)
The ID of the sandbox that the export's data will be sourced from.void
setFileLocation(String fileLocation)
After the export file is created, this holds its location in the storage provider.void
setFileType(String fileType)
The type of file that the export should ultimately produce for download by the user.void
setFilterString(String filterString)
The (by default, RSQL) filter string that should be used to find the records to export.void
setId(String id)
The unique identifier of the export operation.void
setInclusions(List<String> inclusions)
A list of (additional) context IDs of specific entities which should be exported.void
setLastUpdated(Instant lastUpdated)
The timestamp at which this operation last experienced a change.void
setName(String name)
The name of the export operation.void
setNumberOfRecordsProcessed(long numberOfRecordsProcessed)
The number of records that have been successfully processed thus far.void
setParameters(Map<String,Object> parameters)
Additional parameters for this export.void
setParentId(String parentId)
The parent id of the entities to export.void
setStatus(ExportStatus status)
The overall status of the export.void
setTarget(String target)
The target of the export.void
setTenantId(String tenantId)
The tenant that the export is initialized on.void
setTimeZoneId(String timeZoneId)
The ID of the time zone that will be used to format any date fields in the exported file.void
setTotalRecordsToProcess(long totalRecordsToProcess)
The total number of records that should be processed.String
toString()
-
-
-
Method Detail
-
getId
public String getId()
The unique identifier of the export operation.- Returns:
- the unique identifier of the export operation
-
getName
public String getName()
The name of the export operation.- Returns:
- the name of the export operation
-
getFileType
public String getFileType()
The type of file that the export should ultimately produce for download by the user.- Returns:
- the type of file that the export should ultimately produce
- See Also:
DefaultExportFileType
-
getFileLocation
public String getFileLocation()
After the export file is created, this holds its location in the storage provider.- Returns:
- the location of the exported file in the storage provider
-
getStatus
public ExportStatus getStatus()
The overall status of the export. This value should be updated as progress is made.- Returns:
- the overall status of the export
- See Also:
ExportStatus
,errorMessage
-
getErrorMessage
public String getErrorMessage()
When thestatus
is determined to beExportStatus.ERROR
, this field should be set to contain the reasoning for the failure.- Returns:
- a description of the error 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 export).- 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 export.Note: how to interpret
filterString
,inclusions
, andexclusions
is entirely left toExportProcessor
implementations.- Returns:
- the filter string that should be used to find the records to export
- See Also:
exclusions
,inclusions
,ExportProcessor.readRecordsToProcess(Export)
-
getInclusions
public List<String> getInclusions()
A list of (additional) context IDs of specific entities which should be exported.Note: how to interpret
filterString
,inclusions
, andexclusions
is entirely left toExportProcessor
implementations.- Returns:
- a list of context IDs of specific entities which should be exported
- See Also:
filterString
,exclusions
,ExportProcessor.readRecordsToProcess(Export)
-
getExclusions
public List<String> getExclusions()
A list of context IDs of the entities which should not be exported. 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 toExportProcessor
implementations.- Returns:
- a list of context IDs of the entities which should not be exported
- See Also:
filterString
,inclusions
,ExportProcessor.readRecordsToProcess(Export)
-
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 exports. The value of this field will be compared against a timeout for operations that are marked asExportStatus.REQUESTED
orExportStatus.PROCESSING
in order to determine whether an operation is hanging or failed.- Returns:
- the timestamp at which this operation last experienced a change
-
getTarget
public String getTarget()
The target of the export. This is some value that can be mapped to a particular domain by the logic performing the export, 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 export
-
getParentId
@Nullable public String getParentId()
The parent id of the entities to export. This should be specified if the entities to export belong to some parent entity.- Returns:
- the parent id of the entities to export
-
getApplicationId
@Nullable public String getApplicationId()
The application that the export is initialized on. This can be different than theexportingApplicationId
.- Returns:
- the application that the export is initialized on
-
getTenantId
@Nullable public String getTenantId()
The tenant that the export is initialized on.- Returns:
- the tenant that the export is initialized on
-
getExportingSandboxId
@Nullable public String getExportingSandboxId()
The ID of the sandbox that the export's data will be sourced from.- Returns:
- the ID of the sandbox that the export's data will be sourced from
-
getExportingApplicationId
@Nullable public String getExportingApplicationId()
The ID of the application that that the export's data will be sourced from.- Returns:
- the ID of the application that that the export's data will be sourced from
-
getExportingCatalogId
@Nullable public String getExportingCatalogId()
The ID of the catalog that that the export's data will be sourced from.- Returns:
- the ID of the catalog that that the export's data will be sourced from
-
getExportingCustomerContextId
@Nullable public String getExportingCustomerContextId()
The ID of the customer context that the export's data will be sourced from.- Returns:
- the ID of the customer context that the export's data will be sourced from
-
getAuthor
public String getAuthor()
The email address of the author that initiated this export operation. Derived from the current security principal when receiving anExportRequest
.- Returns:
- the email address of the author that initiated this export operation
-
getTimeZoneId
@Nullable public String getTimeZoneId()
The ID of the time zone that will be used to format any date fields in the exported file. Ifnull
, will default to UTC.- Returns:
- the time-zone ID used to format any date fields in the exported file
- See Also:
TimeZoneDataNormalizer
-
getParameters
public Map<String,Object> getParameters()
Additional parameters for this export.- Returns:
- the map of the additional parameters for this request
-
setId
public void setId(String id)
The unique identifier of the export operation.- Parameters:
id
- the unique identifier of the export operation
-
setName
public void setName(String name)
The name of the export operation.- Parameters:
name
- the name of the export operation
-
setFileType
public void setFileType(String fileType)
The type of file that the export should ultimately produce for download by the user.- Parameters:
fileType
- the type of file that the export should ultimately produce- See Also:
DefaultExportFileType
-
setFileLocation
public void setFileLocation(String fileLocation)
After the export file is created, this holds its location in the storage provider.- Parameters:
fileLocation
- the location of the exported file in the storage provider
-
setStatus
public void setStatus(ExportStatus status)
The overall status of the export. This value should be updated as progress is made.- Parameters:
status
- the overall status of the export- See Also:
ExportStatus
,errorMessage
-
setErrorMessage
public void setErrorMessage(String errorMessage)
When thestatus
is determined to beExportStatus.ERROR
, this field should be set to contain the reasoning for the failure.- Parameters:
errorMessage
- a description of the error 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 export).- 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 export.Note: how to interpret
filterString
,inclusions
, andexclusions
is entirely left toExportProcessor
implementations.- Parameters:
filterString
- the filter string that should be used to find the records to export- See Also:
exclusions
,inclusions
,ExportProcessor.readRecordsToProcess(Export)
-
setInclusions
public void setInclusions(List<String> inclusions)
A list of (additional) context IDs of specific entities which should be exported.Note: how to interpret
filterString
,inclusions
, andexclusions
is entirely left toExportProcessor
implementations.- Parameters:
inclusions
- a list of context IDs of specific entities which should be exported- See Also:
filterString
,exclusions
,ExportProcessor.readRecordsToProcess(Export)
-
setExclusions
public void setExclusions(List<String> exclusions)
A list of context IDs of the entities which should not be exported. 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 toExportProcessor
implementations.- Parameters:
exclusions
- a list of context IDs of the entities which should not be exported- See Also:
filterString
,inclusions
,ExportProcessor.readRecordsToProcess(Export)
-
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 exports. The value of this field will be compared against a timeout for operations that are marked asExportStatus.REQUESTED
orExportStatus.PROCESSING
in order to determine whether an operation is hanging or failed.- Parameters:
lastUpdated
- the timestamp at which this operation last experienced a change
-
setTarget
public void setTarget(String target)
The target of the export. This is some value that can be mapped to a particular domain by the logic performing the export, 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 export
-
setParentId
public void setParentId(@Nullable String parentId)
The parent id of the entities to export. This should be specified if the entities to export belong to some parent entity.- Parameters:
parentId
- the parent id of the entities to export
-
setApplicationId
public void setApplicationId(@Nullable String applicationId)
The application that the export is initialized on. This can be different than theexportingApplicationId
.- Parameters:
applicationId
- the application that the export is initialized on
-
setTenantId
public void setTenantId(@Nullable String tenantId)
The tenant that the export is initialized on.- Parameters:
tenantId
- the tenant that the export is initialized on
-
setExportingSandboxId
public void setExportingSandboxId(@Nullable String exportingSandboxId)
The ID of the sandbox that the export's data will be sourced from.- Parameters:
exportingSandboxId
- the ID of the sandbox that the export's data will be sourced from
-
setExportingApplicationId
public void setExportingApplicationId(@Nullable String exportingApplicationId)
The ID of the application that that the export's data will be sourced from.- Parameters:
exportingApplicationId
- the ID of the application that that the export's data will be sourced from
-
setExportingCatalogId
public void setExportingCatalogId(@Nullable String exportingCatalogId)
The ID of the catalog that that the export's data will be sourced from.- Parameters:
exportingCatalogId
- the ID of the catalog that that the export's data will be sourced from
-
setExportingCustomerContextId
public void setExportingCustomerContextId(@Nullable String exportingCustomerContextId)
The ID of the customer context that the export's data will be sourced from.- Parameters:
exportingCustomerContextId
- the ID of the customer context that the export's data will be sourced from
-
setAuthor
public void setAuthor(String author)
The email address of the author that initiated this export operation. Derived from the current security principal when receiving anExportRequest
.- Parameters:
author
- the email address of the author that initiated this export operation
-
setTimeZoneId
public void setTimeZoneId(@Nullable String timeZoneId)
The ID of the time zone that will be used to format any date fields in the exported file. Ifnull
, will default to UTC.- Parameters:
timeZoneId
- the time-zone ID used to format any date fields in the exported file- See Also:
TimeZoneDataNormalizer
-
setParameters
public void setParameters(Map<String,Object> parameters)
Additional parameters for this export.- Parameters:
parameters
- the map of the additional parameters for this request
-
canEqual
protected boolean canEqual(Object other)
-
-