Class DefaultItemSynchronizationFacade
java.lang.Object
de.hybris.platform.cmsfacades.synchronization.impl.DefaultItemSynchronizationFacade
- All Implemented Interfaces:
ItemSynchronizationFacade
Default implementation of the
ItemSynchronizationFacade facade.
Its main purpose is to coordinate the recursive calls for the ItemSynchronizationService respecting the
maxDepth attribute (either given in the method or using the default value). It makes usage of the
ItemCollectorRegistry and ItemCollector classes to
identify item models that are directly referenced or that are shared by a given item model.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<SyncItemStatusData>collectItemsAndGetSynchronizationItemStatus(SyncRequestData syncRequestData, ItemModel item, SyncItemStatusConfig config, Integer level, ItemCollectorRegistry collectorRegistry) Collects the items that also requires information about the synchronization status details and make more calls togetSynchronizationItemStatus(SyncRequestData, ItemModel, SyncItemStatusConfig, Integer)from individual items that were collected.protected List<SyncItemStatusData>findUnavailableDependencies(SyncRequestData syncRequestData, ItemModel item, Integer level) Find all dependent items which have never been synchronized to the target catalog.protected ItemCollectorRegistryprotected org.springframework.validation.Validatorprotected org.springframework.validation.Validatorprotected ItemCollectorRegistryprotected FacadeValidationServiceprotected ItemModelgetItem(ItemSynchronizationData itemSynchronizationData) Will convert a itemId/itemType pair to a ofItemModelprotected ItemSynchronizationServicegetListOfItems(SynchronizationData synchronizationData) Will convert a list of itemId/itemType pairs to a list ofItemModelprotected SessionSearchRestrictionsDisablerprotected ItemCollectorRegistryprotected SyncConfiggetSynchronizationItemStatus(SyncRequestData syncRequestData, ItemSynchronizationData itemSynchronizationData) Retrieves the synchronization status for a givenItemModel.getSynchronizationItemStatus(SyncRequestData syncRequestData, ItemSynchronizationData itemSynchronizationData, SyncItemStatusConfig config) Retrieves the synchronization status for a givenItemModel.protected SyncItemStatusDatagetSynchronizationItemStatus(SyncRequestData syncRequestData, ItemModel item, SyncItemStatusConfig config, Integer level) Gets the synchronization status by callingItemSynchronizationService.getSynchronizationItemStatus(SyncRequestData, ItemModel).protected SyncItemStatusConfigprotected UniqueItemIdentifierServicevoidperformItemSynchronization(SyncRequestData syncRequestData, SynchronizationData synchronizationData) Performs the synchronization for a list ofItemModel.voidperformItemSynchronization(SyncRequestData syncRequestData, SynchronizationData synchronizationData, SyncConfig config) Performs the synchronization for a list ofItemModel.voidsetBasicItemCollectorRegistry(ItemCollectorRegistry basicItemCollectorRegistry) voidsetCatalogSynchronizationCompositeValidator(org.springframework.validation.Validator catalogSynchronizationCompositeValidator) voidsetCmsItemSynchronizationValidator(org.springframework.validation.Validator cmsItemSynchronizationValidator) voidsetDependentItemCollectorRegistry(ItemCollectorRegistry dependentItemCollectorRegistry) voidsetFacadeValidationService(FacadeValidationService facadeValidationService) voidsetItemSynchronizationService(ItemSynchronizationService itemSynchronizationService) voidsetSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) voidsetSharedItemCollectorRegistry(ItemCollectorRegistry sharedItemCollectorRegistry) voidsetSyncConfig(SyncConfig syncConfig) voidsetSynchronizationCacheService(SynchronizationCacheService synchronizationCacheService) voidsetSyncItemStatusConfig(SyncItemStatusConfig syncItemStatusConfig) voidsetSyncItemStatusConverter(Converter<SynchronizationItemDetailsData, SyncItemStatusData> syncItemStatusConverter) voidsetUniqueItemIdentifierService(UniqueItemIdentifierService uniqueItemIdentifierService)
-
Constructor Details
-
DefaultItemSynchronizationFacade
public DefaultItemSynchronizationFacade()
-
-
Method Details
-
getSynchronizationItemStatus
public SyncItemStatusData getSynchronizationItemStatus(SyncRequestData syncRequestData, ItemSynchronizationData itemSynchronizationData) Description copied from interface:ItemSynchronizationFacadeRetrieves the synchronization status for a givenItemModel. In the method signature the client needs to provide theSyncRequestDatawhich contains the source and target catalog versions. The implementation should provide a default maximum depth property to prevent the mechanism to crawl too many items.- Specified by:
getSynchronizationItemStatusin interfaceItemSynchronizationFacade- Parameters:
syncRequestData- the synchronization request containing the source and target catalog versionsitemSynchronizationData- the pair of identifier/type to retrieve theItemModelof which we want to get the synchronization status- Returns:
- the synchronization status details for a given
ItemModel.
-
getSynchronizationItemStatus
public SyncItemStatusData getSynchronizationItemStatus(SyncRequestData syncRequestData, ItemSynchronizationData itemSynchronizationData, SyncItemStatusConfig config) Description copied from interface:ItemSynchronizationFacadeRetrieves the synchronization status for a givenItemModel. In the method signature the client needs to provide theSyncRequestDatawhich contains the source and target catalog versions. This method lets the client decide what is the maximum depth level to navigate on the item's dependencies.- Specified by:
getSynchronizationItemStatusin interfaceItemSynchronizationFacade- Parameters:
syncRequestData- the synchronization request containing the source and target catalog versionsitemSynchronizationData- the pair of identifier/type to retrieve theItemModelof which we want to get the synchronization statusconfig- the get status configuration. SeeSyncItemStatusConfigfor more details.- Returns:
- the synchronization status details for a given
ItemModel.
-
performItemSynchronization
public void performItemSynchronization(SyncRequestData syncRequestData, SynchronizationData synchronizationData) Description copied from interface:ItemSynchronizationFacadePerforms the synchronization for a list ofItemModel. In the method signature the client needs to provide theSyncRequestDatawhich contains the source and target catalog versions.- Specified by:
performItemSynchronizationin interfaceItemSynchronizationFacade- Parameters:
syncRequestData- the synchronization request containing the source and target catalog versionssynchronizationData- contains the list ofItemSynchronizationDatapairs of itemId/itemType that we want to synchronize
-
performItemSynchronization
public void performItemSynchronization(SyncRequestData syncRequestData, SynchronizationData synchronizationData, SyncConfig config) Description copied from interface:ItemSynchronizationFacadePerforms the synchronization for a list ofItemModel. In the method signature the client needs to provide theSyncRequestDatawhich contains the source and target catalog versions.- Specified by:
performItemSynchronizationin interfaceItemSynchronizationFacade- Parameters:
syncRequestData- the synchronization request containing the source and target catalog versionssynchronizationData- contains the list of pairs ofItemSynchronizationDataitemId/itemType that we want to synchronizeconfig- the synchronization configuration . SeeSyncConfigfor more details.
-
getListOfItems
Will convert a list of itemId/itemType pairs to a list ofItemModel- Parameters:
synchronizationData- the list ofItemSynchronizationDatacandidates on which to perform synchronization- Returns:
- the list of
ItemModelto be synchronized
-
getItem
Will convert a itemId/itemType pair to a ofItemModel- Parameters:
itemSynchronizationData- theItemSynchronizationDatacandidate on which to perform synchronization- Returns:
- the
ItemModelto be synchronized
-
getSynchronizationItemStatus
protected SyncItemStatusData getSynchronizationItemStatus(SyncRequestData syncRequestData, ItemModel item, SyncItemStatusConfig config, Integer level) Gets the synchronization status by callingItemSynchronizationService.getSynchronizationItemStatus(SyncRequestData, ItemModel). It also converts the result into an instance ofSyncItemStatusDatathat will be then post populated by recursive calls to this method.- Parameters:
syncRequestData- the synchronization request data containing the source and target catalog versions.item- the item model currently being inspectedconfig- the configuration for getting the synchronization statuslevel- the current level on the data structure.- Returns:
- the
SyncItemStatusDatainformation about a given item model and all related items collected during execution.
-
collectItemsAndGetSynchronizationItemStatus
protected List<SyncItemStatusData> collectItemsAndGetSynchronizationItemStatus(SyncRequestData syncRequestData, ItemModel item, SyncItemStatusConfig config, Integer level, ItemCollectorRegistry collectorRegistry) Collects the items that also requires information about the synchronization status details and make more calls togetSynchronizationItemStatus(SyncRequestData, ItemModel, SyncItemStatusConfig, Integer)from individual items that were collected.- Parameters:
syncRequestData- the synchronization request data containing the source and target catalog versions.item- the item model currently being inspectedconfig- the configuration for getting the synchronization statuslevel- the current level on the data structure.collectorRegistry- the collector registry to get an instance ofItemCollector- Returns:
- a list of
SyncItemStatusDatabeans collected and converted recursively.
-
getBasicItemCollectorRegistry
-
setBasicItemCollectorRegistry
-
getDependentItemCollectorRegistry
-
setDependentItemCollectorRegistry
-
setItemSynchronizationService
-
getItemSynchronizationService
-
getSyncItemStatusConverter
-
setSyncItemStatusConverter
public void setSyncItemStatusConverter(Converter<SynchronizationItemDetailsData, SyncItemStatusData> syncItemStatusConverter) -
getSyncItemStatusConfig
-
setSyncItemStatusConfig
-
setSyncConfig
-
getSyncConfig
-
setUniqueItemIdentifierService
-
getUniqueItemIdentifierService
-
getCatalogSynchronizationCompositeValidator
protected org.springframework.validation.Validator getCatalogSynchronizationCompositeValidator() -
setCatalogSynchronizationCompositeValidator
public void setCatalogSynchronizationCompositeValidator(org.springframework.validation.Validator catalogSynchronizationCompositeValidator) -
getFacadeValidationService
-
setFacadeValidationService
-
getCmsItemSynchronizationValidator
protected org.springframework.validation.Validator getCmsItemSynchronizationValidator() -
setCmsItemSynchronizationValidator
public void setCmsItemSynchronizationValidator(org.springframework.validation.Validator cmsItemSynchronizationValidator) -
getSessionSearchRestrictionsDisabler
-
setSessionSearchRestrictionsDisabler
public void setSessionSearchRestrictionsDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionsDisabler) -
getSynchronizationCacheService
-
setSynchronizationCacheService
-