Class ItemCopyCreator
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.synchronization.ItemCopyCreator
-
- Direct Known Subclasses:
CatalogItemCopyCreator
public class ItemCopyCreator extends java.lang.Object
Manages the copying process of the assigned item.- Since:
- 3.1-u6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ItemCopyCreator.AfterItemCopiedCallback
protected static class
ItemCopyCreator.ReferenceAttributeResult
-
Constructor Summary
Constructors Modifier Constructor Description 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addToStoredValues(java.util.Map<java.lang.String,java.lang.Object> attributes)
protected <T> T
copy()
protected Item
copy(GenericCatalogCopyContext genericCatalogCopyContext)
Deprecated.since 5.0.1 usecopy()
instead.boolean
encounteredOptimisticLockException()
boolean
equals(java.lang.Object obj)
ItemCopyCreator.AfterItemCopiedCallback
getAfterItemCopiedCallback()
protected GenericCatalogCopyContext
getCopyContext()
protected ItemCopyCreator
getEnclosingCreatorFor(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.Exception
getOptimisticLockException()
protected java.util.Set<AttributeCopyCreator>
getOtherAttributeCreators()
protected ItemCopyCreator
getParent()
protected java.util.Set<AttributeCopyCreator>
getPartOfAttributeCreators()
java.util.Set<java.lang.String>
getPendingAttributeQualifiers()
java.util.Set<AttributeCopyCreator>
getPendingAttributes()
java.lang.String
getReport()
Item
getSourceItem()
java.util.Map<java.lang.String,java.lang.Object>
getStoredValues()
Item
getTargetItem()
ComposedType
getTargetType()
int
hashCode()
protected boolean
hasPartOfItems()
boolean
hasPendingAttributes()
protected boolean
isEmpty(java.lang.Object translatedValue, boolean localized)
boolean
isPartOf()
boolean
isTransactionRolledBack()
boolean
isUpdate()
protected void
notifyCallback()
protected void
readInitialAttributes()
protected void
readNonInitialAttributes()
protected 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.void
resetStoredValues()
void
setAfterItemCopiedCallback(ItemCopyCreator.AfterItemCopiedCallback callback)
protected void
setOtherReferences()
protected void
setPartOfReferences()
protected ItemCopyCreator.ReferenceAttributeResult
setReferenceAttribute(AttributeCopyCreator acc)
protected void
setReferenceAttributesWaitingOnDelay(java.util.Set<AttributeCopyCreator> attributeCopyCreators)
java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
getReport
public java.lang.String getReport()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-