Class DefaultSetupSyncJobService
- java.lang.Object
-
- de.hybris.platform.commerceservices.setup.impl.DefaultSetupSyncJobService
-
- All Implemented Interfaces:
SetupSyncJobService
- Direct Known Subclasses:
MarketplaceSetupSyncJobService
public class DefaultSetupSyncJobService extends java.lang.Object implements SetupSyncJobService
Default implementation forSetupSyncJobService
-
-
Constructor Summary
Constructors Constructor Description DefaultSetupSyncJobService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignDependentSyncJobs(java.lang.String catalogId, java.util.Set<java.lang.String> dependentCatalogIds)Sets up a dependency relationship between the CatalogVersionSyncJob for a catalog and the CatalogVersionSyncJobs for a set of dependant catalogs.protected java.lang.StringcatalogVersionSyncJobsToString(java.util.Collection<CatalogVersionSyncJobModel> catalogVersionSyncJobs)voidcreateContentCatalogSyncJob(java.lang.String catalogId)Ensure that a cms content catalog sync job exists for the specified catalog id.protected java.lang.StringcreateJobIdentifier(java.lang.String catalogId)voidcreateProductCatalogSyncJob(java.lang.String catalogId)Ensure that a product catalog sync job exists for the specified catalog id.PerformResultexecuteCatalogSyncJob(java.lang.String catalogId)Run the catalog sync for the specified catalog.protected CatalogServicegetCatalogService()protected CatalogSynchronizationServicegetCatalogSynchronizationService()protected SyncItemJobModelgetCatalogSyncJob(java.lang.String catalogId)protected CatalogVersionModelgetCatalogVersion(java.lang.String catalogId, java.lang.String version)protected CatalogVersionServicegetCatalogVersionService()protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>>getContentCatalogEditSyncDescriptors()protected java.util.List<java.lang.String>getContentCatalogRootTypeCodes()protected CronJobServicegetCronJobService()protected FlexibleSearchServicegetFlexibleSearchService()protected SyncItemCronJobModelgetLastFailedSyncCronJob(SyncItemJobModel syncItemJob)Returns the last cronjob if exists and failed or the new one otherwiseprotected ModelServicegetModelService()protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>>getProductCatalogEditSyncDescriptors()protected java.util.List<java.lang.String>getProductCatalogRootTypeCodes()protected SyncAttributeDescriptorConfigModelgetSyncAttrDescConfig(SyncItemJobModel syncJob, AttributeDescriptorModel attributeDesc)protected SyncItemJobModelgetSyncJobForCatalog(java.lang.String catalogId)protected SyncItemJobModelgetSyncJobForCatalogAndQualifier(java.lang.String catalogId, java.lang.String qualifier)protected TypeServicegetTypeService()protected voidprocessEditSyncAttributeDescriptor(SyncItemJobModel syncJob, java.lang.Class<?> clazz, EditSyncAttributeDescriptorData descriptor)Configures sync attributes of aComposedTypeModel.protected voidprocessEditSyncAttributeDescriptors(SyncItemJobModel job, java.lang.String catalogId, java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> editSyncDescriptors)protected voidprocessRootTypes(SyncItemJobModel job, java.lang.String catalogId, java.util.List<java.lang.String> rootTypes)voidsetCatalogService(CatalogService catalogService)voidsetCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)voidsetCatalogVersionService(CatalogVersionService catalogVersionService)voidsetContentCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> contentCatalogEditSyncDescriptors)voidsetContentCatalogRootTypeCodes(java.util.List<java.lang.String> contentCatalogRootTypeCodes)voidsetCronJobService(CronJobService cronJobService)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetModelService(ModelService modelService)voidsetProductCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> productCatalogEditSyncDescriptors)voidsetProductCatalogRootTypeCodes(java.util.List<java.lang.String> productCatalogRootTypeCodes)voidsetTypeService(TypeService typeService)protected AttributeDescriptorModeltryGetAttributeDescriptor(ComposedTypeModel composedType, java.lang.String attributeName)protected ComposedTypeModeltryGetComposedType(java.lang.Class<?> clazz)protected ComposedTypeModeltryGetComposedType(java.lang.String typeCode)
-
-
-
Method Detail
-
createProductCatalogSyncJob
public void createProductCatalogSyncJob(java.lang.String catalogId)
Description copied from interface:SetupSyncJobServiceEnsure that a product catalog sync job exists for the specified catalog id. The sync job is created between the Staged and Online catalog versions only if there is no existing sync job.- Specified by:
createProductCatalogSyncJobin interfaceSetupSyncJobService- Parameters:
catalogId- the catalog id to search sync job for.
-
getCatalogVersion
protected CatalogVersionModel getCatalogVersion(java.lang.String catalogId, java.lang.String version)
-
assignDependentSyncJobs
public void assignDependentSyncJobs(java.lang.String catalogId, java.util.Set<java.lang.String> dependentCatalogIds)Description copied from interface:SetupSyncJobServiceSets up a dependency relationship between the CatalogVersionSyncJob for a catalog and the CatalogVersionSyncJobs for a set of dependant catalogs.- Specified by:
assignDependentSyncJobsin interfaceSetupSyncJobService- Parameters:
catalogId- the catalog iddependentCatalogIds- the dependant catalog ids
-
catalogVersionSyncJobsToString
protected java.lang.String catalogVersionSyncJobsToString(java.util.Collection<CatalogVersionSyncJobModel> catalogVersionSyncJobs)
-
createContentCatalogSyncJob
public void createContentCatalogSyncJob(java.lang.String catalogId)
Description copied from interface:SetupSyncJobServiceEnsure that a cms content catalog sync job exists for the specified catalog id. The sync job is created between the Staged and Online catalog versions only if there is no existing sync job.- Specified by:
createContentCatalogSyncJobin interfaceSetupSyncJobService- Parameters:
catalogId- the catalog id
-
createJobIdentifier
protected java.lang.String createJobIdentifier(java.lang.String catalogId)
-
executeCatalogSyncJob
public PerformResult executeCatalogSyncJob(java.lang.String catalogId)
Description copied from interface:SetupSyncJobServiceRun the catalog sync for the specified catalog.- Specified by:
executeCatalogSyncJobin interfaceSetupSyncJobService- Parameters:
catalogId- the catalog id- Returns:
- an instance of
PerformResultcontaining the sync job result and status
-
getLastFailedSyncCronJob
protected SyncItemCronJobModel getLastFailedSyncCronJob(SyncItemJobModel syncItemJob)
Returns the last cronjob if exists and failed or the new one otherwise- Parameters:
syncItemJob-- Returns:
- synchronization cronjob - new one or the last one if failed
-
processEditSyncAttributeDescriptors
protected void processEditSyncAttributeDescriptors(SyncItemJobModel job, java.lang.String catalogId, java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> editSyncDescriptors)
-
processEditSyncAttributeDescriptor
protected void processEditSyncAttributeDescriptor(SyncItemJobModel syncJob, java.lang.Class<?> clazz, EditSyncAttributeDescriptorData descriptor)
Configures sync attributes of aComposedTypeModel. The following attributes can be configured: IncludeInSync, CopyByValue, Untranslatable- Parameters:
syncJob- the synchronization jobclazz- The class ofComposedTypeModeldescriptor- Holds values for attributes to be modified for a givenSyncItemJobModel
-
getSyncAttrDescConfig
protected SyncAttributeDescriptorConfigModel getSyncAttrDescConfig(SyncItemJobModel syncJob, AttributeDescriptorModel attributeDesc)
-
getCatalogSyncJob
protected SyncItemJobModel getCatalogSyncJob(java.lang.String catalogId)
-
getSyncJobForCatalog
protected SyncItemJobModel getSyncJobForCatalog(java.lang.String catalogId)
-
getSyncJobForCatalogAndQualifier
protected SyncItemJobModel getSyncJobForCatalogAndQualifier(java.lang.String catalogId, java.lang.String qualifier)
-
processRootTypes
protected void processRootTypes(SyncItemJobModel job, java.lang.String catalogId, java.util.List<java.lang.String> rootTypes)
-
tryGetComposedType
protected ComposedTypeModel tryGetComposedType(java.lang.Class<?> clazz)
-
tryGetComposedType
protected ComposedTypeModel tryGetComposedType(java.lang.String typeCode)
-
tryGetAttributeDescriptor
protected AttributeDescriptorModel tryGetAttributeDescriptor(ComposedTypeModel composedType, java.lang.String attributeName)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getContentCatalogRootTypeCodes
protected java.util.List<java.lang.String> getContentCatalogRootTypeCodes()
-
setContentCatalogRootTypeCodes
public void setContentCatalogRootTypeCodes(java.util.List<java.lang.String> contentCatalogRootTypeCodes)
-
getProductCatalogRootTypeCodes
protected java.util.List<java.lang.String> getProductCatalogRootTypeCodes()
-
setProductCatalogRootTypeCodes
public void setProductCatalogRootTypeCodes(java.util.List<java.lang.String> productCatalogRootTypeCodes)
-
getContentCatalogEditSyncDescriptors
protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> getContentCatalogEditSyncDescriptors()
-
setContentCatalogEditSyncDescriptors
public void setContentCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> contentCatalogEditSyncDescriptors)
-
getProductCatalogEditSyncDescriptors
protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> getProductCatalogEditSyncDescriptors()
-
setProductCatalogEditSyncDescriptors
public void setProductCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> productCatalogEditSyncDescriptors)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getCatalogSynchronizationService
protected CatalogSynchronizationService getCatalogSynchronizationService()
-
setCatalogSynchronizationService
public void setCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)
-
getCatalogService
protected CatalogService getCatalogService()
-
setCatalogService
public void setCatalogService(CatalogService catalogService)
-
getCronJobService
protected CronJobService getCronJobService()
-
setCronJobService
public void setCronJobService(CronJobService cronJobService)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
-