Class PartOfModelRegisterForRemoveInterceptor
- java.lang.Object
-
- de.hybris.platform.servicelayer.interceptor.impl.PartOfModelRegisterForRemoveInterceptor
-
- All Implemented Interfaces:
Interceptor,RemoveInterceptor
- Direct Known Subclasses:
ProductPriceRegisterForRemoveInterceptor
public class PartOfModelRegisterForRemoveInterceptor extends java.lang.Object implements RemoveInterceptor
This PartOfModelRegisterForRemoveInterceptor checks for the given (to be remove)ItemModelthe partOf attributes of this model and add the attribute value (if this is anItemModel) to theInterceptorContext. This interceptor is invoked byModelService.removeAll(Collection)and there will be the additionally registered models deleted. For dealing with special part-of attributes (like ProductModel.europe1prices) extend this class and overwriteregisterForRemoval(InterceptorContext, ItemModel, ItemModel, String)to implement special behaviour for a given attribute.
-
-
Constructor Summary
Constructors Constructor Description PartOfModelRegisterForRemoveInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Set<java.lang.String>excludeIgnoredFromPartOfAttributes(java.util.Set<java.lang.String> partOfSet, java.util.Set<java.lang.String> ignoreSet)protected voidextractAndRegisterForRemoval(InterceptorContext ctx, ItemModel parentModel, java.lang.Object attrValue, java.lang.String partOfAttrQualifier)Goes through theattrValuecontent and calls for each foundItemModelthe methodregisterForRemoval(InterceptorContext, ItemModel, ItemModel, String).voidonRemove(java.lang.Object model, InterceptorContext ctx)Called in themodelService.removeAll()method.protected voidregisterForRemoval(InterceptorContext ctx, ItemModel parentModel, ItemModel subModel, java.lang.String partOfAttrQualifier)Hook-in method for special attribute dealing.voidsetIgnoreAttributes(java.util.Set<java.lang.String> ignoreAttributes)voidsetTypeService(TypeService typeService)
-
-
-
Method Detail
-
setTypeService
public void setTypeService(TypeService typeService)
-
onRemove
public void onRemove(java.lang.Object model, InterceptorContext ctx) throws InterceptorExceptionDescription copied from interface:RemoveInterceptorCalled in themodelService.removeAll()method.- Specified by:
onRemovein interfaceRemoveInterceptor- Parameters:
model- the model which should be removedctx- theInterceptorContext- Throws:
InterceptorException- if the remove reports an error
-
registerForRemoval
protected void registerForRemoval(InterceptorContext ctx, ItemModel parentModel, ItemModel subModel, java.lang.String partOfAttrQualifier)
Hook-in method for special attribute dealing. This method here callsInterceptorContext.registerElement(Object, Object)with the parameters:submodel, null. Overwrite this method to execute your own logic for a given partOf attribute.- Parameters:
ctx- the Interceptor context. Thesubmodelwill be registered to it.parentModel- this is the model which has the part-of attributesubModel- the content of the part-of attribute from theparentModelpartOfAttrQualifier- the attribute qualifier of the part-of attribute
-
extractAndRegisterForRemoval
protected void extractAndRegisterForRemoval(InterceptorContext ctx, ItemModel parentModel, java.lang.Object attrValue, java.lang.String partOfAttrQualifier)
Goes through theattrValuecontent and calls for each foundItemModelthe methodregisterForRemoval(InterceptorContext, ItemModel, ItemModel, String).
-
excludeIgnoredFromPartOfAttributes
protected java.util.Set<java.lang.String> excludeIgnoredFromPartOfAttributes(java.util.Set<java.lang.String> partOfSet, java.util.Set<java.lang.String> ignoreSet)
-
setIgnoreAttributes
public void setIgnoreAttributes(java.util.Set<java.lang.String> ignoreAttributes)
-
-