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:
  • Constructor Details

    • Export

      public Export()
  • Method Details

    • 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:
    • 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:
    • getErrorMessage

      public String getErrorMessage()
      When the status is determined to be ExportStatus.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 with numberOfRecordsProcessed 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, and exclusions is entirely left to ExportProcessor implementations.

      Returns:
      the filter string that should be used to find the records to export
      See Also:
    • getInclusions

      public List<String> getInclusions()
      A list of (additional) context IDs of specific entities which should be exported.

      Note: how to interpret filterString, inclusions, and exclusions is entirely left to ExportProcessor implementations.

      Returns:
      a list of context IDs of specific entities which should be exported
      See Also:
    • 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 by filterString/inclusions.

      Note: how to interpret filterString, inclusions, and exclusions is entirely left to ExportProcessor implementations.

      Returns:
      a list of context IDs of the entities which should not be exported
      See Also:
    • 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 as ExportStatus.REQUESTED or ExportStatus.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 the exportingApplicationId.
      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 an ExportRequest.
      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. If null, will default to UTC.
      Returns:
      the time-zone ID used to format any date fields in the exported file
      See Also:
    • 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:
    • 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:
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      When the status is determined to be ExportStatus.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 with numberOfRecordsProcessed 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, and exclusions is entirely left to ExportProcessor implementations.

      Parameters:
      filterString - the filter string that should be used to find the records to export
      See Also:
    • 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, and exclusions is entirely left to ExportProcessor implementations.

      Parameters:
      inclusions - a list of context IDs of specific entities which should be exported
      See Also:
    • 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 by filterString/inclusions.

      Note: how to interpret filterString, inclusions, and exclusions is entirely left to ExportProcessor implementations.

      Parameters:
      exclusions - a list of context IDs of the entities which should not be exported
      See Also:
    • 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 as ExportStatus.REQUESTED or ExportStatus.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 the exportingApplicationId.
      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 an ExportRequest.
      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. If null, will default to UTC.
      Parameters:
      timeZoneId - the time-zone ID used to format any date fields in the exported file
      See Also:
    • setParameters

      public void setParameters(Map<String,Object> parameters)
      Additional parameters for this export.
      Parameters:
      parameters - the map of the additional parameters for this request
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object