Class Import
- All Implemented Interfaces:
Serializable
- Author:
- Phillip Verheyden (phillipuniverse)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImport()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 booleanbooleanThe application that the import is initialized on.Who is making the changecom.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainerMetadata used to populate anyChangeEventcreated from this request.longThe count of all items that have been processed.longIf 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 stoppedlongThe tenant that the import is initialized on.longgetType()Configurable type of this import, like product, catalog, etcThe reference to the vendor associated with this import.inthashCode()booleanWhether or not this import should go straight to production or into a sandbox.voidsetApplicationId(String applicationId) The application that the import is initialized on.voidWho is making the changevoidsetChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer changeContainer) Metadata used to populate anyChangeEventcreated from this request.voidsetErrorCount(long errorCount) voidsetErrorMessage(String errorMessage) If the import as a whole encountered an error and needed to stop, this field holds a description of the error.voidsetFileLocation(String fileLocation) The location to the file that was uploaded representing this import.voidsetFileType(String fileType) The original file type that this import comes fromvoidThe unique ID of this importvoidsetImportingApplicationId(String importingApplicationId) The application that the import items should go into.voidsetImportingCatalogId(String importingCatalogId) The catalog that the import items should go into.voidsetImportingCustomerContextId(String importingCustomerContextId) The ID of the customer context that the import items should go into.voidsetImportingSandboxId(String importingSandboxId) The sandbox that the import items should go into.voidsetImportingSandboxNameToCreate(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.voidsetIncludedHeaders(Set<String> includedHeaders) Restrictive defined headers to use for the import.voidsetLastUpdated(Instant lastUpdated) When this import was last touchedvoidThe name of this import.voidsetParameters(Map<String, Object> parameters) Additional information passed down to each batch to the resource tier.voidsetParentEntityId(String parentEntityId) Certain imports may be responsible for importing entities under a common 'parent entity'.voidsetProductionImport(boolean productionImport) Whether or not this import should go straight to production or into a sandbox.voidsetSpecificationRef(String specificationRef) Reference to the specification used for this import.voidsetStarted(Instant started) When this import was started, meaning the file was being read and batches createdvoidsetStatus(ImportStatus status) Current status, see state diagram for statuses as they flow through the systemvoidsetStopped(Instant stopped) When this import was last stoppedvoidsetSuccessCount(long successCount) voidsetTenantId(String tenantId) The tenant that the import is initialized on.voidsetTotalItems(long totalItems) voidConfigurable type of this import, like product, catalog, etcvoidsetVendorRef(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
productionImportisfalse. This should always benullifproductionImportistrue.If a new sandbox needs to be created for this import, initially this field's value will be set to
nullbyImportManager.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.importingSandboxIdImportManager.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 seeImportSpecificationServiceandDefaultImportSpecificationServicefor 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 anyChangeEventcreated from this request.- Returns:
- Metadata used to populate any
ChangeEventcreated 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
productionImportisfalse. This should always benullifproductionImportistrue.If a new sandbox needs to be created for this import, initially this field's value will be set to
nullbyImportManager.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.importingSandboxIdImportManager.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 seeImportSpecificationServiceandDefaultImportSpecificationServicefor 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 anyChangeEventcreated from this request.- Parameters:
changeContainer- Metadata used to populate anyChangeEventcreated from this request
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-