Class CatalogVersionSyncCopyContext
java.lang.Object
de.hybris.platform.catalog.jalo.synchronization.AbstractItemCopyContext
de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext
de.hybris.platform.catalog.jalo.synchronization.CatalogVersionSyncCopyContext
- Since:
- 3.1-u6
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext
GenericCatalogCopyContext.AbstractParentResolver, GenericCatalogCopyContext.ReferenceParentResolver -
Field Summary
Fields inherited from class de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext
LEGACY_MODE_FLAG, PARTIAL_COLLECTION_TRANSLATION_ALLOWEDFields inherited from class de.hybris.platform.catalog.jalo.synchronization.AbstractItemCopyContext
ctx -
Constructor Summary
ConstructorsConstructorDescriptionCatalogVersionSyncCopyContext(CatalogVersionSyncJob job, CatalogVersionSyncCronJob cronjob, CatalogVersionSyncWorker worker) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterCopying(Item copy, CatalogItemCopyCreator icc) protected booleancanBeTranslatedPartially(AttributeCopyCreator attributeCopyCreator) protected Itemcopy(ItemCopyCreator parent, Item original, Item copyToUpdate, ItemSyncTimestamp itemSyncTimestamp) Overwritten to lock item to copy.protected ItemSyncTimestampcreateSyncTimestamp(CatalogVersionSyncCronJob owningCronJob, int currentTurn, Item source, ItemCopyCreator icc) Creates a new ItemSyncTimestamp based on the current context and parameters.voidDelegates delete toSynchronizationPersistenceAdapter.remove(Object)Throws two kind of exceptions SynchronizationPersistenceException - which is unrecoverable and it is propagated to upper layer RecoverableSynchronizationPersistenceException - which can be temporary issue and after rerun can vanishprotected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntryOverwritten to use limited item cache besides super type logic.protected SetgetCopyCreatorBlacklist(Item original, Item toUpdate) protected MapgetCopyCreatorPresetValues(Item original, Item copyToupdate) getCopyCreatorWhitelist(Item original, Item toUpdate) Builds a white list based upon the SyncItemJob.attributeDescriptors set.protected SyncScheduleprotected intgetNonCopyableOneToManyAttributes(Item original, ComposedType composedType, boolean forUpdate) protected SyncAttributeDescriptorDatagetSyncAttributeDescriptorData(AttributeCopyCreator attributeCopyCreator) protected CatalogVersiongetTargetVersionForQueryCatalogItemCopy(Item sourceItem) protected CatalogVersionSyncWorkerprotected booleanprotected booleanhasSchedule(PK srcPK) booleanisFromSourceVersion(Item item) Returns true if the item is from *this* source version or it is a source version item of a dependantJob (or dependsOnJob)protected booleanisPartOf(AttributeDescriptor attributeDescriptor) Used byAbstractItemCopyContext.splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf values.protected booleanisPotentiallyNonCopyableOneToManyAttribute(AttributeDescriptor attributeDescriptor, boolean forUpdate) protected booleanisUntranslatablePartOfItem(AttributeCopyCreator acc, Item original) Overwritten to switch off translation if configured so inSyncAttributeDescriptorConfig.protected booleanmustBeTranslated(AttributeCopyCreator acc, Item original) Makes sure each catalog items must always be translated.protected booleanprotected voidprotected voidwriteDumpRecord(PK srcPK, PK tgtPK, PK timestampPK, Set<String> pendingAttributes, Map<PK, PK> parentMappings, boolean isDeadlockVictim) Methods inherited from class de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext
addCreationAttribute, afterCreate, beforeCopying, cleanup, collectPartOfItemsToCopy, computeDependentItemResolvers, computeIsCopyOnDemand, computeParentResolvers, copy, copy, copy, copyMediaData, copyPartOfValues, createAttributeCopyCreator, createCreator, finishedCopying, forceCopy, getCatalogKeyAttributesCache, getCatalogVersion, getCatalogVersionAttribute, getCatalogVersionAttributeCache, getContainedCatalogItemTypes, getCopiedItemCache, getCopyCacheHits, getCopyCacheMisses, getCopyCacheSize, getCopyOnDemandCache, getCounterpartItem, getCreationAttributes, getCronjob, getCurrentlyCopying, getDependentItemResolverCache, getDependentItemTypes, getIsCatalogTypeCache, getJob, getNonCatalogItemUniqueAttributes, getNonCatalogKeyAttributesCache, getRootCatalogType, getRootCatalogTypeCache, getRootUniqueItemType, getSourceVersion, getTargetLanguages, getTargetVersion, getUniqueKeyAttributes, handleStale, initPersistenceAdapter, isCatalogItem, isCatalogItemType, isCopyOnDemand, isCopyOnDemandCatalogItemType, isCurrentlyCopying, isDependentFromSourceVersion, isExclusiveMode, isForceUpdate, isPartialCollectionTranslationEnabledGlobally, isRequiredForCreation, isSavePrevousValues, isStarted, isUntranslatableProductFeature, logSavedValues, mayBeCatalogItemDependent, mayBeCatalogItemDependent, mustBeTranslated, popCurrentlyCopying, processQueryResult, pushCurrentlyCopying, queryCatalogItemCopy, queryCopy, queryExistingSyncTimestamp, queryNonCatalogItemCopy, registerCopy, setCategoryOptions, setCopyCacheHits, setCopyCacheMisses, setCopyCacheSize, setSavePrevousValues, setTargetLanguages, setTimestamp, translate, translateAD, translateItemValue, translateValue, updateSyncTimestampMethods inherited from class de.hybris.platform.catalog.jalo.synchronization.AbstractItemCopyContext
allItems, createCopyDescriptor, createSession, debug, debug, error, error, getCatalogManager, getCtx, getFlexibleSearch, getSession, getTypeCopyDescriptor, ignoreAttribute, info, info, isAtomic, isAtomic, isDebugEnabled, isErrorEnabled, isInfoEnabled, isWarnEnabled, log, log, safeToString, splitDescriptors, toItem, toItems, toString, valuesToString, warn, warn
-
Constructor Details
-
CatalogVersionSyncCopyContext
public CatalogVersionSyncCopyContext(CatalogVersionSyncJob job, CatalogVersionSyncCronJob cronjob, CatalogVersionSyncWorker worker)
-
-
Method Details
-
getWorker
-
getCurrentSchedule
-
hasSchedule
-
hasSchedule
-
getCurrentTurn
protected int getCurrentTurn()- Specified by:
getCurrentTurnin classGenericCatalogCopyContext
-
afterCopying
- Overrides:
afterCopyingin classGenericCatalogCopyContext
-
mustDump
-
writeDumpRecord
-
writeDumpRecord
-
getCopyCreatorWhitelist
Builds a white list based upon the SyncItemJob.attributeDescriptors set. Only attributes which belong to this set are copied to the target item.This applies to catalog items only. Any other item which is copied as partOf value is copied completely.
- Overrides:
getCopyCreatorWhitelistin classGenericCatalogCopyContext
-
getCopyCreatorBlacklist
- Overrides:
getCopyCreatorBlacklistin classGenericCatalogCopyContext
-
getNonCopyableOneToManyAttributes
protected Set<String> getNonCopyableOneToManyAttributes(Item original, ComposedType composedType, boolean forUpdate) -
isPotentiallyNonCopyableOneToManyAttribute
protected boolean isPotentiallyNonCopyableOneToManyAttribute(AttributeDescriptor attributeDescriptor, boolean forUpdate) -
getCopyCreatorPresetValues
Description copied from class:GenericCatalogCopyContext- Overrides:
getCopyCreatorPresetValuesin classGenericCatalogCopyContext
-
isUntranslatablePartOfItem
Overwritten to switch off translation if configured so inSyncAttributeDescriptorConfig.- Overrides:
isUntranslatablePartOfItemin classGenericCatalogCopyContext
-
mustBeTranslated
Description copied from class:GenericCatalogCopyContextMakes sure each catalog items must always be translated. This way all references to catalog items which do not exist in the target catalog are delayed until they become copied or the copy process ends. -
canBeTranslatedPartially
- Overrides:
canBeTranslatedPartiallyin classGenericCatalogCopyContext
-
isPartOf
Description copied from class:AbstractItemCopyContextUsed byAbstractItemCopyContext.splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf values. These values are always copied (created or translated if already existing) when the original item is being copied.- Overrides:
isPartOfin classAbstractItemCopyContext
-
getSyncAttributeDescriptorData
protected SyncAttributeDescriptorData getSyncAttributeDescriptorData(AttributeCopyCreator attributeCopyCreator) -
getCopy
protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry getCopy(Item source) Overwritten to use limited item cache besides super type logic.- Overrides:
getCopyin classGenericCatalogCopyContext
-
createSyncTimestamp
protected ItemSyncTimestamp createSyncTimestamp(CatalogVersionSyncCronJob owningCronJob, int currentTurn, Item source, ItemCopyCreator icc) Description copied from class:GenericCatalogCopyContextCreates a new ItemSyncTimestamp based on the current context and parameters.- Overrides:
createSyncTimestampin classGenericCatalogCopyContext
-
delete
public void delete(Item original) throws SynchronizationPersistenceException, RecoverableSynchronizationPersistenceException Delegates delete toSynchronizationPersistenceAdapter.remove(Object)Throws two kind of exceptions- SynchronizationPersistenceException - which is unrecoverable and it is propagated to upper layer
- RecoverableSynchronizationPersistenceException - which can be temporary issue and after rerun can vanish
-
copy
protected Item copy(ItemCopyCreator parent, Item original, Item copyToUpdate, ItemSyncTimestamp itemSyncTimestamp) Overwritten to lock item to copy. We don't want multiple workers to copy the same item!- Overrides:
copyin classGenericCatalogCopyContext
-
isFromSourceVersion
Returns true if the item is from *this* source version or it is a source version item of a dependantJob (or dependsOnJob)- Overrides:
isFromSourceVersionin classGenericCatalogCopyContext- Parameters:
item- the item to check- Throws:
JaloInvalidParameterException- if the item is no catalog item
-
getTargetVersionForQueryCatalogItemCopy
- Overrides:
getTargetVersionForQueryCatalogItemCopyin classGenericCatalogCopyContext
-