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 void
assignDependentSyncJobs(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.String
catalogVersionSyncJobsToString(java.util.Collection<CatalogVersionSyncJobModel> catalogVersionSyncJobs)
void
createContentCatalogSyncJob(java.lang.String catalogId)
Ensure that a cms content catalog sync job exists for the specified catalog id.protected java.lang.String
createJobIdentifier(java.lang.String catalogId)
void
createProductCatalogSyncJob(java.lang.String catalogId)
Ensure that a product catalog sync job exists for the specified catalog id.PerformResult
executeCatalogSyncJob(java.lang.String catalogId)
Run the catalog sync for the specified catalog.protected CatalogService
getCatalogService()
protected CatalogSynchronizationService
getCatalogSynchronizationService()
protected SyncItemJobModel
getCatalogSyncJob(java.lang.String catalogId)
protected CatalogVersionModel
getCatalogVersion(java.lang.String catalogId, java.lang.String version)
protected CatalogVersionService
getCatalogVersionService()
protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>>
getContentCatalogEditSyncDescriptors()
protected java.util.List<java.lang.String>
getContentCatalogRootTypeCodes()
protected CronJobService
getCronJobService()
protected FlexibleSearchService
getFlexibleSearchService()
protected SyncItemCronJobModel
getLastFailedSyncCronJob(SyncItemJobModel syncItemJob)
Returns the last cronjob if exists and failed or the new one otherwiseprotected ModelService
getModelService()
protected java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>>
getProductCatalogEditSyncDescriptors()
protected java.util.List<java.lang.String>
getProductCatalogRootTypeCodes()
protected SyncAttributeDescriptorConfigModel
getSyncAttrDescConfig(SyncItemJobModel syncJob, AttributeDescriptorModel attributeDesc)
protected SyncItemJobModel
getSyncJobForCatalog(java.lang.String catalogId)
protected SyncItemJobModel
getSyncJobForCatalogAndQualifier(java.lang.String catalogId, java.lang.String qualifier)
protected TypeService
getTypeService()
protected void
processEditSyncAttributeDescriptor(SyncItemJobModel syncJob, java.lang.Class<?> clazz, EditSyncAttributeDescriptorData descriptor)
Configures sync attributes of aComposedTypeModel
.protected void
processEditSyncAttributeDescriptors(SyncItemJobModel job, java.lang.String catalogId, java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> editSyncDescriptors)
protected void
processRootTypes(SyncItemJobModel job, java.lang.String catalogId, java.util.List<java.lang.String> rootTypes)
void
setCatalogService(CatalogService catalogService)
void
setCatalogSynchronizationService(CatalogSynchronizationService catalogSynchronizationService)
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setContentCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> contentCatalogEditSyncDescriptors)
void
setContentCatalogRootTypeCodes(java.util.List<java.lang.String> contentCatalogRootTypeCodes)
void
setCronJobService(CronJobService cronJobService)
void
setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
void
setModelService(ModelService modelService)
void
setProductCatalogEditSyncDescriptors(java.util.Map<java.lang.Class<?>,java.util.List<EditSyncAttributeDescriptorData>> productCatalogEditSyncDescriptors)
void
setProductCatalogRootTypeCodes(java.util.List<java.lang.String> productCatalogRootTypeCodes)
void
setTypeService(TypeService typeService)
protected AttributeDescriptorModel
tryGetAttributeDescriptor(ComposedTypeModel composedType, java.lang.String attributeName)
protected ComposedTypeModel
tryGetComposedType(java.lang.Class<?> clazz)
protected ComposedTypeModel
tryGetComposedType(java.lang.String typeCode)
-
-
-
Method Detail
-
createProductCatalogSyncJob
public void createProductCatalogSyncJob(java.lang.String catalogId)
Description copied from interface:SetupSyncJobService
Ensure 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:
createProductCatalogSyncJob
in 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:SetupSyncJobService
Sets up a dependency relationship between the CatalogVersionSyncJob for a catalog and the CatalogVersionSyncJobs for a set of dependant catalogs.- Specified by:
assignDependentSyncJobs
in 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:SetupSyncJobService
Ensure 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:
createContentCatalogSyncJob
in 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:SetupSyncJobService
Run the catalog sync for the specified catalog.- Specified by:
executeCatalogSyncJob
in interfaceSetupSyncJobService
- Parameters:
catalogId
- the catalog id- Returns:
- an instance of
PerformResult
containing 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 ofComposedTypeModel
descriptor
- 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)
-
-