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 booleancanIgnoreItemRemovedException(Item itemToRemove, java.lang.Throwable exception)voidclearTransactionsSettings()Itemcreate(ComposedType expectedType, java.util.Map<java.lang.String,java.lang.Object> attributes)Creates an entity of given type, with set of initial attributesvoiddisableTransactions()protected GenericCatalogCopyContextgetCopyContext()protected voidhandleRemovalException(Item itemToRemove, java.lang.Throwable exception)Override this method in order to rethrow aSynchronizationPersistenceExceptionorRecoverableSynchronizationPersistenceExceptionin 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 entityvoidremove(Item entity)Removes a given entityvoidresetUnitOfWork()protected booleanshouldRetry(java.lang.Throwable exception)Determines which exception should we consider as recoverable so upper layer (worker) can react accordingly.voidupdate(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 attributevoidupdate(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:SynchronizationPersistenceAdapterCreates an entity of given type, with set of initial attributes- Specified by:
createin 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:SynchronizationPersistenceAdapterReads attributes of a given entity- Specified by:
readin 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:SynchronizationPersistenceAdapterReads localized attributes of a given entity- Specified by:
readLocalizedin 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:SynchronizationPersistenceAdapterRemoves a given entity- Specified by:
removein interfaceSynchronizationPersistenceAdapter<Item,ComposedType>- Throws:
SynchronizationPersistenceExceptionorg.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 aSynchronizationPersistenceExceptionorRecoverableSynchronizationPersistenceExceptionin certain situation so upper layer can abort or recover during removal.- Parameters:
itemToRemove-exception-- Throws:
SynchronizationPersistenceExceptionorg.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:SynchronizationPersistenceAdapterUpdates a given entity with attribute value pair as its part of or other attribute- Specified by:
updatein 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:SynchronizationPersistenceAdapterUpdates a given entity with map of attribute at once- Specified by:
updatein interfaceSynchronizationPersistenceAdapter<Item,ComposedType>- Throws:
SynchronizationPersistenceException
-
resetUnitOfWork
public void resetUnitOfWork()
- Specified by:
resetUnitOfWorkin interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
disableTransactions
public void disableTransactions()
- Specified by:
disableTransactionsin interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
clearTransactionsSettings
public void clearTransactionsSettings()
- Specified by:
clearTransactionsSettingsin interfaceSynchronizationPersistenceAdapter<Item,ComposedType>
-
getCopyContext
protected GenericCatalogCopyContext getCopyContext()
-
-