public class LegacySynchronizationPersistenceAdapter extends java.lang.Object implements SynchronizationPersistenceAdapter<Item,ComposedType>
| Constructor and Description |
|---|
LegacySynchronizationPersistenceAdapter(GenericCatalogCopyContext copyContext) |
| Modifier and Type | Method and 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 attributes
|
void |
disableTransactions() |
protected GenericCatalogCopyContext |
getCopyContext() |
protected void |
handleRemovalException(Item itemToRemove,
java.lang.Throwable exception)
Override this method in order to rethrow a
SynchronizationPersistenceException or
RecoverableSynchronizationPersistenceException 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 entity
|
java.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 entity
|
void |
remove(Item entity)
Removes a given entity
|
void |
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 attribute
|
void |
update(Item entity,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Updates a given entity with map of attribute at once
|
public LegacySynchronizationPersistenceAdapter(GenericCatalogCopyContext copyContext)
public Item create(ComposedType expectedType, java.util.Map<java.lang.String,java.lang.Object> attributes) throws SynchronizationPersistenceException
SynchronizationPersistenceAdaptercreate in interface SynchronizationPersistenceAdapter<Item,ComposedType>SynchronizationPersistenceExceptionpublic java.util.Map<java.lang.String,java.lang.Object> read(Item item, java.util.Set<java.lang.String> attributes) throws SynchronizationPersistenceException
SynchronizationPersistenceAdapterread in interface SynchronizationPersistenceAdapter<Item,ComposedType>attributes - of a given entitySynchronizationPersistenceExceptionpublic 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
SynchronizationPersistenceAdapterreadLocalized in interface SynchronizationPersistenceAdapter<Item,ComposedType>attributes - of a given entitylanguages - for which values should be readSynchronizationPersistenceExceptionpublic void remove(Item entity) throws SynchronizationPersistenceException, RecoverableDataAccessException
SynchronizationPersistenceAdapterremove in interface SynchronizationPersistenceAdapter<Item,ComposedType>SynchronizationPersistenceExceptionRecoverableDataAccessExceptionprotected void handleRemovalException(Item itemToRemove, java.lang.Throwable exception) throws SynchronizationPersistenceException, RecoverableDataAccessException
SynchronizationPersistenceException or
RecoverableSynchronizationPersistenceException in certain situation so upper layer can abort or recover
during removal.itemToRemove - exception - SynchronizationPersistenceExceptionRecoverableDataAccessExceptionprotected boolean shouldRetry(java.lang.Throwable exception)
exception - protected boolean canIgnoreItemRemovedException(Item itemToRemove, java.lang.Throwable exception)
public void update(Item entity, java.util.Map.Entry<java.lang.String,java.lang.Object> attribute) throws SynchronizationPersistenceException
SynchronizationPersistenceAdapterupdate in interface SynchronizationPersistenceAdapter<Item,ComposedType>SynchronizationPersistenceExceptionpublic void update(Item entity, java.util.Map<java.lang.String,java.lang.Object> attributes) throws SynchronizationPersistenceException
SynchronizationPersistenceAdapterupdate in interface SynchronizationPersistenceAdapter<Item,ComposedType>SynchronizationPersistenceExceptionpublic void resetUnitOfWork()
resetUnitOfWork in interface SynchronizationPersistenceAdapter<Item,ComposedType>public void disableTransactions()
disableTransactions in interface SynchronizationPersistenceAdapter<Item,ComposedType>public void clearTransactionsSettings()
clearTransactionsSettings in interface SynchronizationPersistenceAdapter<Item,ComposedType>protected GenericCatalogCopyContext getCopyContext()
Copyright © 2018 SAP SE. All Rights Reserved.