Class DefaultImportSpecificationService
java.lang.Object
com.broadleafcommerce.dataimport.service.DefaultImportSpecificationService
- All Implemented Interfaces:
ImportSpecificationService
@DataRouteByExample(Import.class)
public class DefaultImportSpecificationService
extends Object
implements ImportSpecificationService
Default service to fetch
ImportSpecification
and GlobalImportSpecification
instances.
NOTE: Specifications are static at this time. They are pre-configured and not context-discriminated. Those who wish to support context-specific specifications should override this class and its methods to filter to such instances accordingly. TODO: Eventually, Broadleaf plans to introduce dynamic specifications and more robust mechanisms for different specifications on a per-tenant or per-application basis.
- Author:
- Kelly Tisdell (ktisdell)
-
Constructor Summary
ConstructorDescriptionDefaultImportSpecificationService
(List<ImportSpecification> importSpecifications) -
Method Summary
Modifier and TypeMethodDescriptionfindAllGlobalImportSpecifications
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) By default, this just finds allGlobalImportSpecification
, with no regard forcontextInfo
.protected ImportSpecification
findDefaultImportSpecification
(String importType, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findImportSpecification
(String type, String specificationRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) By default, this just finds the first specification that can handle the given import type, with no regard forcontextInfo
orspecificationRef
.
-
Constructor Details
-
DefaultImportSpecificationService
-
-
Method Details
-
findImportSpecification
public ImportSpecification findImportSpecification(String type, @Nullable String specificationRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) By default, this just finds the first specification that can handle the given import type, with no regard forcontextInfo
orspecificationRef
.- Specified by:
findImportSpecification
in interfaceImportSpecificationService
- Parameters:
type
- the import type for which to find the specification forspecificationRef
- theImportRequest.getSpecificationRef()
andImport.getSpecificationRef()
to find the specification forcontextInfo
- the 'importing' context info, which should match the context the import will actually be performed in- Returns:
- the first specification that matches the requested type, else a generic
DefaultSpecification
- See Also:
-
findDefaultImportSpecification
protected ImportSpecification findDefaultImportSpecification(String importType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
findAllGlobalImportSpecifications
public List<GlobalImportSpecification> findAllGlobalImportSpecifications(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) By default, this just finds allGlobalImportSpecification
, with no regard forcontextInfo
.- Specified by:
findAllGlobalImportSpecifications
in interfaceImportSpecificationService
- Parameters:
contextInfo
- the 'importing' context info, which should match the context the import will actually be performed in- Returns:
- all global import specifications
-