Class Import
- All Implemented Interfaces:
Serializable
- Author:
- Phillip Verheyden (phillipuniverse)
- See Also:
-
Constructor Summary
ConstructorDescriptionImport()
Import
(DefaultImportType type) Convenience constructor with import type.Import
(String id, ImportStatus status) Convenience constructor, primarily for testing with id and status. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The application that the import is initialized on.Who is making the changecom.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer
Metadata used to populate anyChangeEvent
created from this request.long
The count of all items that have been processed.long
If the import as a whole encountered an error and needed to stop, this field holds a description of the error.The location to the file that was uploaded representing this import.The original file type that this import comes fromgetId()
The unique ID of this importThe application that the import items should go into.The catalog that the import items should go into.The ID of the customer context that the import items should go into.The sandbox that the import items should go into.If and only if a new sandbox needs to be created for the current import (determined using the logic described inimportingSandboxId
), this field will hold the name of the sandbox that will be created.Restrictive defined headers to use for the import.When this import was last touchedgetName()
The name of this import.Additional information passed down to each batch to the resource tier.Certain imports may be responsible for importing entities under a common 'parent entity'.Reference to the specification used for this import.When this import was started, meaning the file was being read and batches createdCurrent status, see state diagram for statuses as they flow through the systemWhen this import was last stoppedlong
The tenant that the import is initialized on.long
getType()
Configurable type of this import, like product, catalog, etcThe reference to the vendor associated with this import.int
hashCode()
boolean
Whether or not this import should go straight to production or into a sandbox.void
setApplicationId
(String applicationId) The application that the import is initialized on.void
Who is making the changevoid
setChangeContainer
(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer changeContainer) Metadata used to populate anyChangeEvent
created from this request.void
setErrorCount
(long errorCount) void
setErrorMessage
(String errorMessage) If the import as a whole encountered an error and needed to stop, this field holds a description of the error.void
setFileLocation
(String fileLocation) The location to the file that was uploaded representing this import.void
setFileType
(String fileType) The original file type that this import comes fromvoid
The unique ID of this importvoid
setImportingApplicationId
(String importingApplicationId) The application that the import items should go into.void
setImportingCatalogId
(String importingCatalogId) The catalog that the import items should go into.void
setImportingCustomerContextId
(String importingCustomerContextId) The ID of the customer context that the import items should go into.void
setImportingSandboxId
(String importingSandboxId) The sandbox that the import items should go into.void
setImportingSandboxNameToCreate
(String importingSandboxNameToCreate) If and only if a new sandbox needs to be created for the current import (determined using the logic described inimportingSandboxId
), this field will hold the name of the sandbox that will be created.void
setIncludedHeaders
(Set<String> includedHeaders) Restrictive defined headers to use for the import.void
setLastUpdated
(Instant lastUpdated) When this import was last touchedvoid
The name of this import.void
setParameters
(Map<String, Object> parameters) Additional information passed down to each batch to the resource tier.void
setParentEntityId
(String parentEntityId) Certain imports may be responsible for importing entities under a common 'parent entity'.void
setProductionImport
(boolean productionImport) Whether or not this import should go straight to production or into a sandbox.void
setSpecificationRef
(String specificationRef) Reference to the specification used for this import.void
setStarted
(Instant started) When this import was started, meaning the file was being read and batches createdvoid
setStatus
(ImportStatus status) Current status, see state diagram for statuses as they flow through the systemvoid
setStopped
(Instant stopped) When this import was last stoppedvoid
setSuccessCount
(long successCount) void
setTenantId
(String tenantId) The tenant that the import is initialized on.void
setTotalItems
(long totalItems) void
Configurable type of this import, like product, catalog, etcvoid
setVendorRef
(String vendorRef) The reference to the vendor associated with this import.toString()
-
Constructor Details
-
Import
Convenience constructor with import type.- Parameters:
type
-
-
Import
Convenience constructor, primarily for testing with id and status.- Parameters:
id
-status
-
-
Import
public Import()
-
-
Method Details
-
getCompleteCount
public long getCompleteCount()The count of all items that have been processed. Can be used in conjunction withgetTotalItems()
to determine total completion- Returns:
- the count of all of the items that we have processed
-
getId
The unique ID of this import -
getName
The name of this import.- Returns:
- the name of this import
-
getType
Configurable type of this import, like product, catalog, etc- See Also:
-
getFileType
The original file type that this import comes from- See Also:
-
getIncludedHeaders
Restrictive defined headers to use for the import. If null or empty, this assumes that all headers in the import will be used -
getParameters
Additional information passed down to each batch to the resource tier. These are attached to eachBatchRequest
-
getStatus
Current status, see state diagram for statuses as they flow through the system -
getErrorMessage
If the import as a whole encountered an error and needed to stop, this field holds a description of the error.- Returns:
- a description of the error (if any) that caused the import to fail
-
getFileLocation
The location to the file that was uploaded representing this import. The binary data from this path can be looked up using theStorageService
. -
getStarted
When this import was started, meaning the file was being read and batches created -
getStopped
When this import was last stopped -
getLastUpdated
When this import was last touched -
getTotalItems
public long getTotalItems() -
getSuccessCount
public long getSuccessCount() -
getErrorCount
public long getErrorCount() -
getAuthor
Who is making the change -
getApplicationId
The application that the import is initialized on. This can be different than theimportingApplicationId
.- Returns:
- the application that the import is initialized on
-
getTenantId
The tenant that the import is initialized on.- Returns:
- the tenant that the import is initialized on
-
isProductionImport
public boolean isProductionImport()Whether or not this import should go straight to production or into a sandbox.- See Also:
-
importingSandboxId
-
getImportingCatalogId
The catalog that the import items should go into. Required when importing items that are catalog-discriminated as determined bytype
.In the case of hierarchical catalogs, this is most-derived catalog id.
- Returns:
- the catalog that the import items should go into
-
getImportingApplicationId
The application that the import items should go into.- Returns:
- the application that the import items should go into
-
getImportingSandboxId
The sandbox that the import items should go into.This field only has any meaning if
productionImport
isfalse
. This should always benull
ifproductionImport
istrue
.If a new sandbox needs to be created for this import, initially this field's value will be set to
null
byImportManager.initiateImport(ImportRequest, InputStreamSource, ContextInfo)
, but thenImportManager.processImport(String)
will generate and initialize a value for it.As a result, ultimately every non-production import will have a non-null value for this field.
- Returns:
- the sandbox that the import items should go into
- See Also:
-
ImportRequest.importingSandboxId
ImportManager.processImport(String)
ImportService.createSandbox(String, String)
-
getImportingSandboxNameToCreate
If and only if a new sandbox needs to be created for the current import (determined using the logic described inimportingSandboxId
), this field will hold the name of the sandbox that will be created.If not supplied in the
ImportRequest.importingSandboxNameToCreate
, the name of the import will be used (will be the generated name if the import name had to be generated as described onImportRequest.name
).- Returns:
- the name of the sandbox that should be created for this import
-
getImportingCustomerContextId
The ID of the customer context that the import items should go into.- Returns:
- the customer context that the import items should go into
-
getParentEntityId
Certain imports may be responsible for importing entities under a common 'parent entity'. For example, an import of price data should place all the price data entities in the import under the same parent price list.To make it easier to support such use-cases without requiring the parent entity information to be supplied in the imported file itself, this first-class field is accepted in
ImportRequest.getParentEntityId()
and eventually passed to the resource-tier batch handler throughBatchRequest.BatchContext.getParentEntityId()
.Ultimately, the usage of this value is entirely determined by the resource tier handler implementation.
- Returns:
- the parent entity id common to all imported entities (if applicable)
- See Also:
-
ImportRequest.getParentEntityId()
BatchRequest.BatchContext.getParentEntityId()
-
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
-
getSpecificationRef
Reference to the specification used for this import. Please seeImportSpecificationService
andDefaultImportSpecificationService
for how this is used.- Returns:
- reference to the specification used for this import
-
getChangeContainer
@Nullable public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getChangeContainer()Metadata used to populate anyChangeEvent
created from this request.- Returns:
- Metadata used to populate any
ChangeEvent
created from this request
-
setId
The unique ID of this import -
setName
The name of this import.- Parameters:
name
- the name of this import
-
setType
Configurable type of this import, like product, catalog, etc- See Also:
-
setFileType
The original file type that this import comes from- See Also:
-
setIncludedHeaders
Restrictive defined headers to use for the import. If null or empty, this assumes that all headers in the import will be used -
setParameters
Additional information passed down to each batch to the resource tier. These are attached to eachBatchRequest
-
setStatus
Current status, see state diagram for statuses as they flow through the system -
setErrorMessage
If the import as a whole encountered an error and needed to stop, this field holds a description of the error.- Parameters:
errorMessage
- a description of the error (if any) that caused the import to fail
-
setFileLocation
The location to the file that was uploaded representing this import. The binary data from this path can be looked up using theStorageService
. -
setStarted
When this import was started, meaning the file was being read and batches created -
setStopped
When this import was last stopped -
setLastUpdated
When this import was last touched -
setTotalItems
public void setTotalItems(long totalItems) -
setSuccessCount
public void setSuccessCount(long successCount) -
setErrorCount
public void setErrorCount(long errorCount) -
setAuthor
Who is making the change -
setApplicationId
The application that the import is initialized on. This can be different than theimportingApplicationId
.- Parameters:
applicationId
- the application that the import is initialized on
-
setTenantId
The tenant that the import is initialized on.- Parameters:
tenantId
- the tenant that the import is initialized on
-
setProductionImport
public void setProductionImport(boolean productionImport) Whether or not this import should go straight to production or into a sandbox.- See Also:
-
importingSandboxId
-
setImportingCatalogId
The catalog that the import items should go into. Required when importing items that are catalog-discriminated as determined bytype
.In the case of hierarchical catalogs, this is most-derived catalog id.
- Parameters:
importingCatalogId
- the catalog that the import items should go into
-
setImportingApplicationId
The application that the import items should go into.- Parameters:
importingApplicationId
- the application that the import items should go into
-
setImportingSandboxId
The sandbox that the import items should go into.This field only has any meaning if
productionImport
isfalse
. This should always benull
ifproductionImport
istrue
.If a new sandbox needs to be created for this import, initially this field's value will be set to
null
byImportManager.initiateImport(ImportRequest, InputStreamSource, ContextInfo)
, but thenImportManager.processImport(String)
will generate and initialize a value for it.As a result, ultimately every non-production import will have a non-null value for this field.
- Parameters:
importingSandboxId
- the sandbox that the import items should go into- See Also:
-
ImportRequest.importingSandboxId
ImportManager.processImport(String)
ImportService.createSandbox(String, String)
-
setImportingSandboxNameToCreate
If and only if a new sandbox needs to be created for the current import (determined using the logic described inimportingSandboxId
), this field will hold the name of the sandbox that will be created.If not supplied in the
ImportRequest.importingSandboxNameToCreate
, the name of the import will be used (will be the generated name if the import name had to be generated as described onImportRequest.name
).- Parameters:
importingSandboxNameToCreate
- the name of the sandbox that should be created for this import
-
setImportingCustomerContextId
The ID of the customer context that the import items should go into.- Parameters:
importingCustomerContextId
- the customer context that the import items should go into
-
setParentEntityId
Certain imports may be responsible for importing entities under a common 'parent entity'. For example, an import of price data should place all the price data entities in the import under the same parent price list.To make it easier to support such use-cases without requiring the parent entity information to be supplied in the imported file itself, this first-class field is accepted in
ImportRequest.getParentEntityId()
and eventually passed to the resource-tier batch handler throughBatchRequest.BatchContext.getParentEntityId()
.Ultimately, the usage of this value is entirely determined by the resource tier handler implementation.
- Parameters:
parentEntityId
- id of the parent entity common to all imported entities (if applicable)- See Also:
-
ImportRequest.getParentEntityId()
BatchRequest.BatchContext.getParentEntityId()
-
setVendorRef
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
-
setSpecificationRef
Reference to the specification used for this import. Please seeImportSpecificationService
andDefaultImportSpecificationService
for how this is used.- Parameters:
specificationRef
- reference to the specification used for this import
-
setChangeContainer
public void setChangeContainer(@Nullable com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer changeContainer) Metadata used to populate anyChangeEvent
created from this request.- Parameters:
changeContainer
- Metadata used to populate anyChangeEvent
created from this request
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-