Class LegacySynchronizationPersistenceAdapter
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.synchronization.LegacySynchronizationPersistenceAdapter
-
- All Implemented Interfaces:
SynchronizationPersistenceAdapter<Item,ComposedType>
- Direct Known Subclasses:
ServiceLayerSynchronizationPersistenceAdapter
public class LegacySynchronizationPersistenceAdapter extends java.lang.Object implements SynchronizationPersistenceAdapter<Item,ComposedType>
-
-
Constructor Summary
Constructors Constructor Description LegacySynchronizationPersistenceAdapter(GenericCatalogCopyContext copyContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canIgnoreItemRemovedException(Item itemToRemove, java.lang.Throwable exception)
void
clearTransactionsSettings()
Item
create(ComposedType expectedType, java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates an entity of given type, with set of initial attributesvoid
disableTransactions()
protected GenericCatalogCopyContext
getCopyContext()
protected void
handleRemovalException(Item itemToRemove, java.lang.Throwable exception)
Override this method in order to rethrow aSynchronizationPersistenceException
orRecoverableSynchronizationPersistenceException
in certain situation so upper layer can abort or recover during removal.java.util.Map<java.lang.String,java.lang.Object>
read(Item item, java.util.Set<java.lang.String> attributes)
Reads attributes of a given entityjava.util.Map<java.lang.String,java.lang.Object>
readLocalized(Item item, java.util.Set<java.lang.String> attributes, java.util.Set<Language> languages)
Reads localized attributes of a given entityvoid
remove(Item entity)
Removes a given entityvoid
resetUnitOfWork()
protected boolean
shouldRetry(java.lang.Throwable exception)
Determines which exception should we consider as recoverable so upper layer (worker) can react accordingly.void
update(Item entity, java.util.Map.Entry<java.lang.String,java.lang.Object> attribute)
Updates a given entity with attribute value pair as its part of or other attributevoid
update(Item entity, java.util.Map<java.lang.String,java.lang.Object> attributes)
Updates a given entity with map of attribute at once
-
-
-
Constructor Detail
-
LegacySynchronizationPersistenceAdapter
public LegacySynchronizationPersistenceAdapter(GenericCatalogCopyContext copyContext)
-
-
Method Detail
-
create
public Item create(ComposedType expectedType, java.util.Map<java.lang.String,java.lang.Object> attributes) throws SynchronizationPersistenceException
Description copied from interface:SynchronizationPersistenceAdapter
Creates an entity of given type, with set of initial attributes- Specified by:
create
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
- Returns:
- an entity of given type.
- Throws:
SynchronizationPersistenceException
-
read
public java.util.Map<java.lang.String,java.lang.Object> read(Item item, java.util.Set<java.lang.String> attributes) throws SynchronizationPersistenceException
Description copied from interface:SynchronizationPersistenceAdapter
Reads attributes of a given entity- Specified by:
read
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
attributes
- of a given entity- Returns:
- attributes of a given entity and theirs values
- Throws:
SynchronizationPersistenceException
-
readLocalized
public java.util.Map<java.lang.String,java.lang.Object> readLocalized(Item item, java.util.Set<java.lang.String> attributes, java.util.Set<Language> languages) throws SynchronizationPersistenceException
Description copied from interface:SynchronizationPersistenceAdapter
Reads localized attributes of a given entity- Specified by:
readLocalized
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
attributes
- of a given entitylanguages
- for which values should be read- Returns:
- attributes of a given entity and theirs values
- Throws:
SynchronizationPersistenceException
-
remove
public void remove(Item entity) throws SynchronizationPersistenceException, org.springframework.dao.RecoverableDataAccessException
Description copied from interface:SynchronizationPersistenceAdapter
Removes a given entity- Specified by:
remove
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
- Throws:
SynchronizationPersistenceException
org.springframework.dao.RecoverableDataAccessException
-
handleRemovalException
protected void handleRemovalException(Item itemToRemove, java.lang.Throwable exception) throws SynchronizationPersistenceException, org.springframework.dao.RecoverableDataAccessException
Override this method in order to rethrow aSynchronizationPersistenceException
orRecoverableSynchronizationPersistenceException
in certain situation so upper layer can abort or recover during removal.- Parameters:
itemToRemove
-exception
-- Throws:
SynchronizationPersistenceException
org.springframework.dao.RecoverableDataAccessException
-
shouldRetry
protected boolean shouldRetry(java.lang.Throwable exception)
Determines which exception should we consider as recoverable so upper layer (worker) can react accordingly.- Parameters:
exception
-- Returns:
- true if exception is recoverable, otherwise returns false.
-
canIgnoreItemRemovedException
protected boolean canIgnoreItemRemovedException(Item itemToRemove, java.lang.Throwable exception)
-
update
public void update(Item entity, java.util.Map.Entry<java.lang.String,java.lang.Object> attribute) throws SynchronizationPersistenceException
Description copied from interface:SynchronizationPersistenceAdapter
Updates a given entity with attribute value pair as its part of or other attribute- Specified by:
update
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
- Throws:
SynchronizationPersistenceException
-
update
public void update(Item entity, java.util.Map<java.lang.String,java.lang.Object> attributes) throws SynchronizationPersistenceException
Description copied from interface:SynchronizationPersistenceAdapter
Updates a given entity with map of attribute at once- Specified by:
update
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
- Throws:
SynchronizationPersistenceException
-
resetUnitOfWork
public void resetUnitOfWork()
- Specified by:
resetUnitOfWork
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
disableTransactions
public void disableTransactions()
- Specified by:
disableTransactions
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
clearTransactionsSettings
public void clearTransactionsSettings()
- Specified by:
clearTransactionsSettings
in interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
getCopyContext
protected GenericCatalogCopyContext getCopyContext()
-
-