Class ImportRequest

java.lang.Object
com.broadleafcommerce.dataimport.domain.ImportRequest

public class ImportRequest extends Object
Author:
Phillip Verheyden (phillipuniverse)
  • Constructor Details

    • ImportRequest

      public ImportRequest(DefaultImportType type)
      Convenience constructor to initialize with a DefaultImportType
      Parameters:
      type -
      See Also:
    • ImportRequest

      public ImportRequest()
  • Method Details

    • getName

      @Nullable public String getName()
      The name of this import. If this is left null, a name will be generated with the following format:

      $type + " - " + $timestamp

      Returns:
      the name of this import
    • getSpecificationRef

      @Nullable public String getSpecificationRef()
      The name or reference to the specification to use, if applicable. Please see ImportSpecificationService and DefaultImportSpecificationService for how this is used.
      Returns:
      name or reference to the specification to use, if applicable
      See Also:
    • getType

      public String getType()
      The resource-tier conceptual mapping of what type of data this import should create
      See Also:
    • getFileType

      public String getFileType()
      The type of data that is being imported
      See Also:
    • getIncludedHeaders

      @Nullable public Set<String> getIncludedHeaders()
      Restrictive defined headers to use for the import. If null or empty, this assumes that all headers in the import will be used
    • isProductionImport

      public boolean isProductionImport()
      Whether or not this import should go straight to production or into a sandbox.
      See Also:
      • importingSandboxId
    • getImportingSandboxId

      @Nullable public String getImportingSandboxId()
      The sandbox that the import items should go into.

      This field only has any meaning if productionImport is false. This should always be null if productionImport is true.

      In the event that a new sandbox needs to be created for this import, productionImport should be false and this value should be null. ImportManager.processImport(String) will generate a new sandbox ID and request its creation in that case.

      In the event that an existing sandbox should be used for this import, productionImport should be false and this value should be set to a valid sandbox ID.

      Returns:
      the sandbox that the import items should go into
      See Also:
    • getImportingSandboxNameToCreate

      @Nullable public String getImportingSandboxNameToCreate()
      If and only if a new sandbox needs to be created for the current import (determined using the logic described in importingSandboxId), this field can be used to supply the name of the sandbox that should be created.

      If not supplied, the name of the import will be used (will be the generated name if the import name had to be generated as described on name).

      Returns:
      the name of the sandbox that should be created for this import
    • getImportingCatalogId

      @Nullable public String getImportingCatalogId()
      The catalog that the import items should go into. Required when importing items that are catalog-discriminated as determined by type.

      In the case of hierarchical catalogs, this is most-derived catalog id.

      If not supplied, the value will be sourced from the request's ContextInfo.

      Returns:
      the catalog that the import items should go into
      See Also:
    • getImportingApplicationId

      @Nullable public String getImportingApplicationId()
      The application that the import items should go into.

      If not supplied, the value will be sourced from the request's ContextInfo.

      See Also:
    • getImportingCustomerContextId

      @Nullable public String getImportingCustomerContextId()
      The ID of the customer context that the import items should go into.

      If not supplied, the value will be sourced from the request's ContextInfo.

      Returns:
      the customer context that the import items should go into
      See Also:
    • getParentEntityId

      @Nullable public String getParentEntityId()
      See the Javadocs of Import.getParentEntityId() for details about this field.
      Returns:
      the parent entity id common to all imported entities (if applicable)
      See Also:
    • getVendorRef

      @Nullable public String getVendorRef()
      The reference to the vendor associated with this import. This value can be null, in which case, no vendor is associated.
      Returns:
      the reference to the vendor associated with this import
    • getChangeContainer

      @Nullable public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getChangeContainer()
      Metadata used to populate any ChangeEvent created from this request.
      Returns:
      Metadata used to populate any ChangeEvent created from this request
    • setName

      public void setName(@Nullable String name)
      The name of this import. If this is left null, a name will be generated with the following format:

      $type + " - " + $timestamp

      Parameters:
      name - the name of this import
    • setSpecificationRef

      public void setSpecificationRef(@Nullable String specificationRef)
      The name or reference to the specification to use, if applicable. Please see ImportSpecificationService and DefaultImportSpecificationService for how this is used.
      Parameters:
      specificationRef - name or reference to the specification to use, if applicable
      See Also:
    • setType

      public void setType(String type)
      The resource-tier conceptual mapping of what type of data this import should create
      See Also:
    • setFileType

      public void setFileType(String fileType)
      The type of data that is being imported
      See Also:
    • setIncludedHeaders

      public void setIncludedHeaders(@Nullable Set<String> includedHeaders)
      Restrictive defined headers to use for the import. If null or empty, this assumes that all headers in the import will be used
    • setProductionImport

      public void setProductionImport(boolean productionImport)
      Whether or not this import should go straight to production or into a sandbox.
      See Also:
      • importingSandboxId
    • setImportingSandboxId

      public void setImportingSandboxId(@Nullable String importingSandboxId)
      The sandbox that the import items should go into.

      This field only has any meaning if productionImport is false. This should always be null if productionImport is true.

      In the event that a new sandbox needs to be created for this import, productionImport should be false and this value should be null. ImportManager.processImport(String) will generate a new sandbox ID and request its creation in that case.

      In the event that an existing sandbox should be used for this import, productionImport should be false and this value should be set to a valid sandbox ID.

      Parameters:
      importingSandboxId - the sandbox that the import items should go into
      See Also:
    • setImportingSandboxNameToCreate

      public void setImportingSandboxNameToCreate(@Nullable String importingSandboxNameToCreate)
      If and only if a new sandbox needs to be created for the current import (determined using the logic described in importingSandboxId), this field can be used to supply the name of the sandbox that should be created.

      If not supplied, the name of the import will be used (will be the generated name if the import name had to be generated as described on name).

      Parameters:
      importingSandboxNameToCreate - the name of the sandbox that should be created for this import
    • setImportingCatalogId

      public void setImportingCatalogId(@Nullable String importingCatalogId)
      The catalog that the import items should go into. Required when importing items that are catalog-discriminated as determined by type.

      In the case of hierarchical catalogs, this is most-derived catalog id.

      If not supplied, the value will be sourced from the request's ContextInfo.

      Parameters:
      importingCatalogId - the catalog that the import items should go into
      See Also:
    • setImportingApplicationId

      public void setImportingApplicationId(@Nullable String importingApplicationId)
      The application that the import items should go into.

      If not supplied, the value will be sourced from the request's ContextInfo.

      Parameters:
      importingApplicationId - the application that the import items should go into
      See Also:
    • setImportingCustomerContextId

      public void setImportingCustomerContextId(@Nullable String importingCustomerContextId)
      The ID of the customer context that the import items should go into.

      If not supplied, the value will be sourced from the request's ContextInfo.

      Parameters:
      importingCustomerContextId - the customer context that the import items should go into
      See Also:
    • setParentEntityId

      public void setParentEntityId(@Nullable String parentEntityId)
      See the Javadocs of Import.getParentEntityId() for details about this field.
      Parameters:
      parentEntityId - id of the parent entity common to all imported entities (if applicable)
      See Also:
    • setVendorRef

      public void setVendorRef(@Nullable String vendorRef)
      The reference to the vendor associated with this import. This value can be null, in which case, no vendor is associated.
      Parameters:
      vendorRef - the reference to the vendor associated with this import
    • setChangeContainer

      public void setChangeContainer(@Nullable com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer changeContainer)
      Metadata used to populate any ChangeEvent created from this request.
      Parameters:
      changeContainer - Metadata used to populate any ChangeEvent created from 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