Class ItemCopyCreator
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.synchronization.ItemCopyCreator
-
- Direct Known Subclasses:
CatalogItemCopyCreator
public class ItemCopyCreator extends java.lang.ObjectManages the copying process of the assigned item.- Since:
- 3.1-u6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceItemCopyCreator.AfterItemCopiedCallbackprotected static classItemCopyCreator.ReferenceAttributeResult
-
Constructor Summary
Constructors Modifier Constructor Description protectedItemCopyCreator(GenericCatalogCopyContext genericCatalogCopyContext, ItemCopyCreator parent, Item source, Item target, java.util.Collection<java.lang.String> blackList, java.util.Collection<java.lang.String> whiteList, java.util.Map<java.lang.String,java.lang.Object> presetedValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddToStoredValues(java.util.Map<java.lang.String,java.lang.Object> attributes)protected <T> Tcopy()protected Itemcopy(GenericCatalogCopyContext genericCatalogCopyContext)Deprecated.since 5.0.1 usecopy()instead.booleanencounteredOptimisticLockException()booleanequals(java.lang.Object obj)ItemCopyCreator.AfterItemCopiedCallbackgetAfterItemCopiedCallback()protected GenericCatalogCopyContextgetCopyContext()protected ItemCopyCreatorgetEnclosingCreatorFor(Item item)Finds the parent creator which actually copies the given item value.java.util.Set<AttributeCopyCreator>getFailedAttributes()protected java.util.Set<AttributeCopyCreator>getInitialAttributeCreators()java.util.Map<java.lang.String,java.lang.Object>[]getModifiedValues()java.lang.ExceptiongetOptimisticLockException()protected java.util.Set<AttributeCopyCreator>getOtherAttributeCreators()protected ItemCopyCreatorgetParent()protected java.util.Set<AttributeCopyCreator>getPartOfAttributeCreators()java.util.Set<java.lang.String>getPendingAttributeQualifiers()java.util.Set<AttributeCopyCreator>getPendingAttributes()java.lang.StringgetReport()ItemgetSourceItem()java.util.Map<java.lang.String,java.lang.Object>getStoredValues()ItemgetTargetItem()ComposedTypegetTargetType()inthashCode()protected booleanhasPartOfItems()booleanhasPendingAttributes()protected booleanisEmpty(java.lang.Object translatedValue, boolean localized)booleanisPartOf()booleanisTransactionRolledBack()booleanisUpdate()protected voidnotifyCallback()protected voidreadInitialAttributes()protected voidreadNonInitialAttributes()protected voidreadSourceValues(Item targetItem)Reads all copyable attribute values of the source item which are not blocked by the blacklist or already defined by the preset value map.voidresetStoredValues()voidsetAfterItemCopiedCallback(ItemCopyCreator.AfterItemCopiedCallback callback)protected voidsetOtherReferences()protected voidsetPartOfReferences()protected ItemCopyCreator.ReferenceAttributeResultsetReferenceAttribute(AttributeCopyCreator acc)protected voidsetReferenceAttributesWaitingOnDelay(java.util.Set<AttributeCopyCreator> attributeCopyCreators)java.lang.StringtoString()
-
-
-
Constructor Detail
-
ItemCopyCreator
protected ItemCopyCreator(GenericCatalogCopyContext genericCatalogCopyContext, ItemCopyCreator parent, Item source, Item target, java.util.Collection<java.lang.String> blackList, java.util.Collection<java.lang.String> whiteList, java.util.Map<java.lang.String,java.lang.Object> presetedValues) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
copy
protected <T> T copy()
-
notifyCallback
protected void notifyCallback()
-
getAfterItemCopiedCallback
public ItemCopyCreator.AfterItemCopiedCallback getAfterItemCopiedCallback()
- Returns:
- the beforeTxCommitCallback
-
setAfterItemCopiedCallback
public void setAfterItemCopiedCallback(ItemCopyCreator.AfterItemCopiedCallback callback)
- Parameters:
callback- the beforeTxCommitCallback to set
-
copy
@Deprecated protected Item copy(GenericCatalogCopyContext genericCatalogCopyContext)
Deprecated.since 5.0.1 usecopy()instead.- Parameters:
genericCatalogCopyContext-- Returns:
- copied
Item.
-
getStoredValues
public java.util.Map<java.lang.String,java.lang.Object> getStoredValues()
-
getModifiedValues
public java.util.Map<java.lang.String,java.lang.Object>[] getModifiedValues()
- Returns:
- [ {previousValues}, {storedValues} ]
-
resetStoredValues
public void resetStoredValues()
-
addToStoredValues
protected void addToStoredValues(java.util.Map<java.lang.String,java.lang.Object> attributes)
-
getCopyContext
protected GenericCatalogCopyContext getCopyContext()
-
setPartOfReferences
protected void setPartOfReferences()
-
setOtherReferences
protected void setOtherReferences()
-
setReferenceAttributesWaitingOnDelay
protected void setReferenceAttributesWaitingOnDelay(java.util.Set<AttributeCopyCreator> attributeCopyCreators)
-
encounteredOptimisticLockException
public boolean encounteredOptimisticLockException()
-
getOptimisticLockException
public java.lang.Exception getOptimisticLockException()
-
isTransactionRolledBack
public boolean isTransactionRolledBack()
-
setReferenceAttribute
protected ItemCopyCreator.ReferenceAttributeResult setReferenceAttribute(AttributeCopyCreator acc)
-
getSourceItem
public final Item getSourceItem()
-
getTargetItem
public final Item getTargetItem()
-
isUpdate
public final boolean isUpdate()
-
isPartOf
public final boolean isPartOf()
-
getTargetType
public final ComposedType getTargetType()
-
getParent
protected ItemCopyCreator getParent()
-
getEnclosingCreatorFor
protected final ItemCopyCreator getEnclosingCreatorFor(Item item)
Finds the parent creator which actually copies the given item value. This method is used for translating references from partOf items to their enclosing items.- Parameters:
item- the item reference value- Returns:
- the parent copy creator which copies the item, or null no such creator exists
-
readNonInitialAttributes
protected void readNonInitialAttributes()
-
readInitialAttributes
protected void readInitialAttributes()
-
readSourceValues
protected final void readSourceValues(Item targetItem)
Reads all copyable attribute values of the source item which are not blocked by the blacklist or already defined by the preset value map.
-
isEmpty
protected boolean isEmpty(java.lang.Object translatedValue, boolean localized)
-
hasPartOfItems
protected final boolean hasPartOfItems()
-
hasPendingAttributes
public final boolean hasPendingAttributes()
-
getPartOfAttributeCreators
protected final java.util.Set<AttributeCopyCreator> getPartOfAttributeCreators()
-
getInitialAttributeCreators
protected final java.util.Set<AttributeCopyCreator> getInitialAttributeCreators()
-
getOtherAttributeCreators
protected final java.util.Set<AttributeCopyCreator> getOtherAttributeCreators()
-
getPendingAttributes
public final java.util.Set<AttributeCopyCreator> getPendingAttributes()
-
getFailedAttributes
public final java.util.Set<AttributeCopyCreator> getFailedAttributes()
-
getPendingAttributeQualifiers
public final java.util.Set<java.lang.String> getPendingAttributeQualifiers()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getReport
public java.lang.String getReport()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-