Class OrphanedPartOfCleanupPrepareInterceptor
- java.lang.Object
-
- de.hybris.platform.servicelayer.interceptor.impl.OrphanedPartOfCleanupPrepareInterceptor
-
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
public class OrphanedPartOfCleanupPrepareInterceptor extends java.lang.Object implements PrepareInterceptor
Registers orphaned partOf members for removal. Fixes a performance issue in the original interceptor. The original loads the value of every partof attribute even if the value has not been changed.
-
-
Constructor Summary
Constructors Constructor Description OrphanedPartOfCleanupPrepareInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.CollectioncollectItemsToRemove(java.lang.Object originalValue, java.lang.Object currentValue)protected java.lang.ObjectgetAttributeValue(InterceptorContext ctx, AbstractItemModel model, java.lang.String qualifier)protected java.lang.ObjectgetAttributeValue(InterceptorContext ctx, AbstractItemModel model, java.lang.String qualifier, java.util.Locale loc)protected java.lang.ObjectgetOriginalValue(AbstractItemModel model, java.lang.String partOfQualifier)protected java.lang.ObjectgetOriginalValue(AbstractItemModel model, java.lang.String partOfQualifier, java.util.Locale loc)protected java.util.Set<java.lang.String>getWritablePartOfAttributes(InterceptorContext ctx, java.lang.String itemType)protected booleanisModifiedItemUsingSLD(java.lang.Object object, InterceptorContext ctx)voidonPrepare(java.lang.Object object, InterceptorContext ctx)Called in themodelService.saveAll()method.protected voidregisterForRemoval(java.util.Collection items, InterceptorContext ctx)protected voidregisterForRemovalIfNecessary(InterceptorContext ctx, java.lang.Object currentValue, java.lang.Object originalValue)voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
onPrepare
public void onPrepare(java.lang.Object object, InterceptorContext ctx) throws InterceptorExceptionDescription copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Parameters:
object- the model which values has to be preparedctx- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getWritablePartOfAttributes
protected java.util.Set<java.lang.String> getWritablePartOfAttributes(InterceptorContext ctx, java.lang.String itemType)
-
registerForRemovalIfNecessary
protected void registerForRemovalIfNecessary(InterceptorContext ctx, java.lang.Object currentValue, java.lang.Object originalValue)
-
isModifiedItemUsingSLD
protected boolean isModifiedItemUsingSLD(java.lang.Object object, InterceptorContext ctx)
-
registerForRemoval
protected void registerForRemoval(java.util.Collection items, InterceptorContext ctx)
-
collectItemsToRemove
protected java.util.Collection collectItemsToRemove(java.lang.Object originalValue, java.lang.Object currentValue)
-
getOriginalValue
protected java.lang.Object getOriginalValue(AbstractItemModel model, java.lang.String partOfQualifier)
-
getOriginalValue
protected java.lang.Object getOriginalValue(AbstractItemModel model, java.lang.String partOfQualifier, java.util.Locale loc)
-
getAttributeValue
protected java.lang.Object getAttributeValue(InterceptorContext ctx, AbstractItemModel model, java.lang.String qualifier)
-
getAttributeValue
protected java.lang.Object getAttributeValue(InterceptorContext ctx, AbstractItemModel model, java.lang.String qualifier, java.util.Locale loc)
-
setTypeService
public void setTypeService(TypeService typeService)
-
-