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
-
public class CatalogVersionSyncCopyContext extends GenericCatalogCopyContext
- 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_ALLOWED
-
Fields inherited from class de.hybris.platform.catalog.jalo.synchronization.AbstractItemCopyContext
ctx
-
-
Constructor Summary
Constructors Constructor Description CatalogVersionSyncCopyContext(CatalogVersionSyncJob job, CatalogVersionSyncCronJob cronjob, CatalogVersionSyncWorker worker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.voiddelete(Item original)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 vanishprotected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntrygetCopy(Item source)Overwritten to use limited item cache besides super type logic.protected java.util.SetgetCopyCreatorBlacklist(Item original, Item toUpdate)protected java.util.MapgetCopyCreatorPresetValues(Item original, Item copyToupdate)protected java.util.Set<java.lang.String>getCopyCreatorWhitelist(Item original, Item toUpdate)Builds a white list based upon the SyncItemJob.attributeDescriptors set.protected SyncSchedulegetCurrentSchedule()protected intgetCurrentTurn()protected java.util.Set<java.lang.String>getNonCopyableOneToManyAttributes(Item original, ComposedType composedType, boolean forUpdate)protected SyncAttributeDescriptorDatagetSyncAttributeDescriptorData(AttributeCopyCreator attributeCopyCreator)protected CatalogVersiongetTargetVersionForQueryCatalogItemCopy(Item sourceItem)protected CatalogVersionSyncWorkergetWorker()protected booleanhasSchedule(CatalogItemCopyCreator icc)protected 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 booleanmustDump(CatalogItemCopyCreator icc)protected voidwriteDumpRecord(CatalogItemCopyCreator icc)protected voidwriteDumpRecord(PK srcPK, PK tgtPK, PK timestampPK, java.util.Set<java.lang.String> pendingAttributes, java.util.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, updateSyncTimestamp
-
Methods 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 Detail
-
CatalogVersionSyncCopyContext
public CatalogVersionSyncCopyContext(CatalogVersionSyncJob job, CatalogVersionSyncCronJob cronjob, CatalogVersionSyncWorker worker)
-
-
Method Detail
-
getWorker
protected CatalogVersionSyncWorker getWorker()
-
getCurrentSchedule
protected SyncSchedule getCurrentSchedule()
-
hasSchedule
protected boolean hasSchedule(CatalogItemCopyCreator icc)
-
hasSchedule
protected boolean hasSchedule(PK srcPK)
-
getCurrentTurn
protected int getCurrentTurn()
- Specified by:
getCurrentTurnin classGenericCatalogCopyContext
-
afterCopying
protected void afterCopying(Item copy, CatalogItemCopyCreator icc)
- Overrides:
afterCopyingin classGenericCatalogCopyContext
-
mustDump
protected boolean mustDump(CatalogItemCopyCreator icc)
-
writeDumpRecord
protected void writeDumpRecord(CatalogItemCopyCreator icc)
-
writeDumpRecord
protected void writeDumpRecord(PK srcPK, PK tgtPK, PK timestampPK, java.util.Set<java.lang.String> pendingAttributes, java.util.Map<PK,PK> parentMappings, boolean isDeadlockVictim)
-
getCopyCreatorWhitelist
protected java.util.Set<java.lang.String> getCopyCreatorWhitelist(Item original, Item toUpdate)
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
protected java.util.Set getCopyCreatorBlacklist(Item original, Item toUpdate)
- Overrides:
getCopyCreatorBlacklistin classGenericCatalogCopyContext
-
getNonCopyableOneToManyAttributes
protected java.util.Set<java.lang.String> getNonCopyableOneToManyAttributes(Item original, ComposedType composedType, boolean forUpdate)
-
isPotentiallyNonCopyableOneToManyAttribute
protected boolean isPotentiallyNonCopyableOneToManyAttribute(AttributeDescriptor attributeDescriptor, boolean forUpdate)
-
getCopyCreatorPresetValues
protected java.util.Map getCopyCreatorPresetValues(Item original, Item copyToupdate)
Description copied from class:GenericCatalogCopyContext- Overrides:
getCopyCreatorPresetValuesin classGenericCatalogCopyContext
-
isUntranslatablePartOfItem
protected boolean isUntranslatablePartOfItem(AttributeCopyCreator acc, Item original)
Overwritten to switch off translation if configured so inSyncAttributeDescriptorConfig.- Overrides:
isUntranslatablePartOfItemin classGenericCatalogCopyContext
-
mustBeTranslated
protected boolean mustBeTranslated(AttributeCopyCreator acc, Item original)
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
protected boolean canBeTranslatedPartially(AttributeCopyCreator attributeCopyCreator)
- Overrides:
canBeTranslatedPartiallyin classGenericCatalogCopyContext
-
isPartOf
protected boolean isPartOf(AttributeDescriptor attributeDescriptor)
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
public boolean isFromSourceVersion(Item item) throws JaloInvalidParameterException
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
protected CatalogVersion getTargetVersionForQueryCatalogItemCopy(Item sourceItem)
- Overrides:
getTargetVersionForQueryCatalogItemCopyin classGenericCatalogCopyContext
-
-