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 void
afterCopying(Item copy, CatalogItemCopyCreator icc)
protected boolean
canBeTranslatedPartially(AttributeCopyCreator attributeCopyCreator)
protected Item
copy(ItemCopyCreator parent, Item original, Item copyToUpdate, ItemSyncTimestamp itemSyncTimestamp)
Overwritten to lock item to copy.protected ItemSyncTimestamp
createSyncTimestamp(CatalogVersionSyncCronJob owningCronJob, int currentTurn, Item source, ItemCopyCreator icc)
Creates a new ItemSyncTimestamp based on the current context and parameters.void
delete(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.ItemCopyCacheEntry
getCopy(Item source)
Overwritten to use limited item cache besides super type logic.protected java.util.Set
getCopyCreatorBlacklist(Item original, Item toUpdate)
protected java.util.Map
getCopyCreatorPresetValues(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 SyncSchedule
getCurrentSchedule()
protected int
getCurrentTurn()
protected java.util.Set<java.lang.String>
getNonCopyableOneToManyAttributes(Item original, ComposedType composedType, boolean forUpdate)
protected SyncAttributeDescriptorData
getSyncAttributeDescriptorData(AttributeCopyCreator attributeCopyCreator)
protected CatalogVersion
getTargetVersionForQueryCatalogItemCopy(Item sourceItem)
protected CatalogVersionSyncWorker
getWorker()
protected boolean
hasSchedule(CatalogItemCopyCreator icc)
protected boolean
hasSchedule(PK srcPK)
boolean
isFromSourceVersion(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 boolean
isPartOf(AttributeDescriptor attributeDescriptor)
Used byAbstractItemCopyContext.splitDescriptors(TypeCopyDescriptor, ComposedType)
to determine whether an attribute holds partOf values.protected boolean
isPotentiallyNonCopyableOneToManyAttribute(AttributeDescriptor attributeDescriptor, boolean forUpdate)
protected boolean
isUntranslatablePartOfItem(AttributeCopyCreator acc, Item original)
Overwritten to switch off translation if configured so inSyncAttributeDescriptorConfig
.protected boolean
mustBeTranslated(AttributeCopyCreator acc, Item original)
Makes sure each catalog items must always be translated.protected boolean
mustDump(CatalogItemCopyCreator icc)
protected void
writeDumpRecord(CatalogItemCopyCreator icc)
protected void
writeDumpRecord(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, 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:
getCurrentTurn
in classGenericCatalogCopyContext
-
afterCopying
protected void afterCopying(Item copy, CatalogItemCopyCreator icc)
- Overrides:
afterCopying
in 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:
getCopyCreatorWhitelist
in classGenericCatalogCopyContext
-
getCopyCreatorBlacklist
protected java.util.Set getCopyCreatorBlacklist(Item original, Item toUpdate)
- Overrides:
getCopyCreatorBlacklist
in 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:
getCopyCreatorPresetValues
in classGenericCatalogCopyContext
-
isUntranslatablePartOfItem
protected boolean isUntranslatablePartOfItem(AttributeCopyCreator acc, Item original)
Overwritten to switch off translation if configured so inSyncAttributeDescriptorConfig
.- Overrides:
isUntranslatablePartOfItem
in classGenericCatalogCopyContext
-
mustBeTranslated
protected boolean mustBeTranslated(AttributeCopyCreator acc, Item original)
Description copied from class:GenericCatalogCopyContext
Makes 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:
canBeTranslatedPartially
in classGenericCatalogCopyContext
-
isPartOf
protected boolean isPartOf(AttributeDescriptor attributeDescriptor)
Description copied from class:AbstractItemCopyContext
Used 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:
isPartOf
in 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:
getCopy
in classGenericCatalogCopyContext
-
createSyncTimestamp
protected ItemSyncTimestamp createSyncTimestamp(CatalogVersionSyncCronJob owningCronJob, int currentTurn, Item source, ItemCopyCreator icc)
Description copied from class:GenericCatalogCopyContext
Creates a new ItemSyncTimestamp based on the current context and parameters.- Overrides:
createSyncTimestamp
in 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:
copy
in 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:
isFromSourceVersion
in classGenericCatalogCopyContext
- Parameters:
item
- the item to check- Throws:
JaloInvalidParameterException
- if the item is no catalog item
-
getTargetVersionForQueryCatalogItemCopy
protected CatalogVersion getTargetVersionForQueryCatalogItemCopy(Item sourceItem)
- Overrides:
getTargetVersionForQueryCatalogItemCopy
in classGenericCatalogCopyContext
-
-