Class SynchronizationServiceImpl
java.lang.Object
de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
de.hybris.platform.cockpit.services.sync.impl.SynchronizationServiceImpl
- All Implemented Interfaces:
SynchronizationService
- Direct Known Subclasses:
CMSSynchronizationService
public class SynchronizationServiceImpl
extends AbstractServiceImpl
implements SynchronizationService
Contains all necessary method responsible for synchronization activity
- Spring Bean ID:
- synchronizationService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classNested classes/interfaces inherited from interface de.hybris.platform.cockpit.services.sync.SynchronizationService
SynchronizationService.SyncContext -
Field Summary
FieldsFields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeServiceFields inherited from interface de.hybris.platform.cockpit.services.sync.SynchronizationService
INITIAL_SYNC_IS_NEEDED, SYNCHRONIZATION_NOT_AVAILABLE, SYNCHRONIZATION_NOT_OK, SYNCHRONIZATION_OK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckRootOrSubType(TypedObject item, SyncItemJob syncJob) Retrieves all matching synchronization rules (at first position - all accessible, at second position - all forbidden)Retrieves source catalog version for given itemgetConfiguredReferenceTypes(TypedObject typedObject) Returns configured reference types.getLastTargetProductSyncTimestamp(Item product) Retrieves a time of last executed synchronization on the given productintgetPullSyncStatus(TypedObject product) protected List<TypedObject>getRelatedReferences(TypedObject typedObject) Retrieves all related references according to current configuration.protected intgetSyncContext(TypedObject product) getSyncContext(TypedObject product, boolean pullSync) getSynchronizationStatuses(List<SyncItemJobModel> rules, TypedObject sourceObject) Retrieves synchronization statuses for given itemgetSynchronizationStatusesSimple(List<SyncItemJobModel> rules, TypedObject sourceObject) protected SynchronizationServiceImpl.SyncInfogetSyncInfo(TypedObject object) protected SynchronizationServiceImpl.SyncInfogetSyncInfoSimple(TypedObject object) getSyncJobs(ItemModel source, ObjectType objectType) Methods retrieves all matching catalog version (at first position - all accessible, at second position - all forbidden)getSyncSources(TypedObject object) Gets the all sync source objects.getSyncSourcesAndTargets(TypedObject object) getSyncTargets(TypedObject object) Gets the all sync targets.Methods retrieves all matching catalog version (at first position - all accessible, at second position - all forbidden)booleanhasMultipleRules(Collection items) Check whether some of passed items has ambigous synchronization rulefinal intisObjectSynchronized(TypedObject object) TODO FIXME - Find way to get appropriate synchronization status, condition that is used below is not correct.protected BooleanChecks if the restrictions should be disabled for the internal search operations of the service.booleanChecks whether particular product version was synchronized at least once!voidperformCatalogVersionSynchronization(Collection<CatalogVersionModel> data, List<String> syncRulePkList, CatalogVersionModel targetCatalogVersion, String qualifier) Responsible for catalog version synchronization //TODO should be refactorvoidperformPullSynchronization(List<TypedObject> targetItems) performSynchronization(Collection<? extends Object> items, List<String> syncJobPkList, CatalogVersionModel targetCatalogVersion, String qualifier) Method that runs particular synchronization<E extends TypedObject>
CatalogVersionretrieveCatalogVersion(E item) Retrieves source catalog version for given productvoidsetItemSyncTimestampDao(ItemSyncTimestampDao itemSyncTimestampDao) voidsetRelatedReferencesMaxDepth(int relatedReferencesMaxDepth) voidsetRelatedReferencesTypesMap(Map<String, List<String>> relatedReferencesTypesMap) voidsetSearchRestrictionsDisabled(boolean disabled) voidsetSynchronizationServiceDao(SynchronizationServiceDao synchronizationServiceDao) Sets the synchronization service DAO.voidsetSystemService(SystemService systemService) voidsetValueHandlerRegistry(ObjectValueHandlerRegistry valueHandlerRegistry) Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
Field Details
-
DISABLE_RESTRICTION
- See Also:
-
-
Constructor Details
-
SynchronizationServiceImpl
public SynchronizationServiceImpl()
-
-
Method Details
-
getRelatedReferencesTypesMap
-
setRelatedReferencesTypesMap
-
getRelatedReferencesMaxDepth
protected int getRelatedReferencesMaxDepth() -
setRelatedReferencesMaxDepth
public void setRelatedReferencesMaxDepth(int relatedReferencesMaxDepth) -
getTypeManager
-
getCatalogManager
-
getSyncSources
Description copied from interface:SynchronizationServiceGets the all sync source objects.- Specified by:
getSyncSourcesin interfaceSynchronizationService- Parameters:
object- the object- Returns:
- the sync sources
-
getSyncTargets
Description copied from interface:SynchronizationServiceGets the all sync targets.- Specified by:
getSyncTargetsin interfaceSynchronizationService- Parameters:
object- the object- Returns:
- the sync targets
-
getSyncSourcesAndTargets
- Specified by:
getSyncSourcesAndTargetsin interfaceSynchronizationService
-
performPullSynchronization
- Specified by:
performPullSynchronizationin interfaceSynchronizationService
-
performSynchronization
public Collection<TypedObject> performSynchronization(Collection<? extends Object> items, List<String> syncJobPkList, CatalogVersionModel targetCatalogVersion, String qualifier) Description copied from interface:SynchronizationServiceMethod that runs particular synchronization- Specified by:
performSynchronizationin interfaceSynchronizationService- Parameters:
items- - products passed for synchronizations- Returns:
- the collection of typed objects which were affected by the sync, i.e. which may need to be updated
-
retrieveCatalogVersion
Retrieves source catalog version for given product- Parameters:
item- - passed item
-
getPullSyncStatus
- Specified by:
getPullSyncStatusin interfaceSynchronizationService
-
isObjectSynchronized
TODO FIXME - Find way to get appropriate synchronization status, condition that is used below is not correct. Maybe there are or will be some core mechanisms to achieve that! Checks whether given product is synchronized- Specified by:
isObjectSynchronizedin interfaceSynchronizationService- Parameters:
object- - passed item
-
getSyncInfo
-
getSyncInfoSimple
-
isVersionSynchronizedAtLeastOnce
Checks whether particular product version was synchronized at least once!- Specified by:
isVersionSynchronizedAtLeastOncein interfaceSynchronizationService
-
getLastTargetProductSyncTimestamp
Retrieves a time of last executed synchronization on the given product- Parameters:
product- - passed product- Returns:
- - time in milliseconds
-
isSearchRestrictionDisabled
Checks if the restrictions should be disabled for the internal search operations of the service. By default the method returnsTRUE. You can change this behavior by settingfalsevalue usingsetSearchRestrictionsDisabled(boolean)injection. -
checkRootOrSubType
-
getTargetCatalogVersions
Description copied from interface:SynchronizationServiceMethods retrieves all matching catalog version (at first position - all accessible, at second position - all forbidden)- Specified by:
getTargetCatalogVersionsin interfaceSynchronizationService
-
getSyncJobs
Description copied from interface:SynchronizationServiceMethods retrieves all matching catalog version (at first position - all accessible, at second position - all forbidden)- Specified by:
getSyncJobsin interfaceSynchronizationService
-
getCatalogVersionForItem
Description copied from interface:SynchronizationServiceRetrieves source catalog version for given item- Specified by:
getCatalogVersionForItemin interfaceSynchronizationService- Parameters:
item- - passed item
-
getAllSynchronizationRules
Description copied from interface:SynchronizationServiceRetrieves all matching synchronization rules (at first position - all accessible, at second position - all forbidden)- Specified by:
getAllSynchronizationRulesin interfaceSynchronizationService- See Also:
-
getSynchronizationStatuses
public List<String> getSynchronizationStatuses(List<SyncItemJobModel> rules, TypedObject sourceObject) Description copied from interface:SynchronizationServiceRetrieves synchronization statuses for given item- Specified by:
getSynchronizationStatusesin interfaceSynchronizationService- Parameters:
rules- - accessible synch rulessourceObject- - current checked object- Returns:
- list of primary keys
-
getSynchronizationStatusesSimple
public List<String> getSynchronizationStatusesSimple(List<SyncItemJobModel> rules, TypedObject sourceObject) -
performCatalogVersionSynchronization
public void performCatalogVersionSynchronization(Collection<CatalogVersionModel> data, List<String> syncRulePkList, CatalogVersionModel targetCatalogVersion, String qualifier) Responsible for catalog version synchronization //TODO should be refactor- Specified by:
performCatalogVersionSynchronizationin interfaceSynchronizationService
-
hasMultipleRules
Description copied from interface:SynchronizationServiceCheck whether some of passed items has ambigous synchronization rule- Specified by:
hasMultipleRulesin interfaceSynchronizationService- Parameters:
items- - passed items- See Also:
-
getSyncContext
- Specified by:
getSyncContextin interfaceSynchronizationService
-
getSyncContext
- Specified by:
getSyncContextin interfaceSynchronizationService
-
setSynchronizationServiceDao
Sets the synchronization service DAO.- Parameters:
synchronizationServiceDao- the synchronizationServiceDao to set
-
getRelatedReferences
Retrieves all related references according to current configuration. Note:
This method retrieves all related references that take a part into synch status computation.- Parameters:
typedObject- given object- Returns:
- related references
-
getConfiguredReferenceTypes
Returns configured reference types.- Parameters:
typedObject- given object- Returns:
- configured reference types
-
setSearchRestrictionsDisabled
public void setSearchRestrictionsDisabled(boolean disabled) -
setItemSyncTimestampDao
-
getSystemService
-
setSystemService
-
setValueHandlerRegistry
-