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)ItemModel
the 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 void
extractAndRegisterForRemoval(InterceptorContext ctx, ItemModel parentModel, java.lang.Object attrValue, java.lang.String partOfAttrQualifier)
Goes through theattrValue
content and calls for each foundItemModel
the methodregisterForRemoval(InterceptorContext, ItemModel, ItemModel, String)
.void
onRemove(java.lang.Object model, InterceptorContext ctx)
Called in themodelService.removeAll()
method.protected void
registerForRemoval(InterceptorContext ctx, ItemModel parentModel, ItemModel subModel, java.lang.String partOfAttrQualifier)
Hook-in method for special attribute dealing.void
setIgnoreAttributes(java.util.Set<java.lang.String> ignoreAttributes)
void
setTypeService(TypeService typeService)
-
-
-
Method Detail
-
setTypeService
public void setTypeService(TypeService typeService)
-
onRemove
public void onRemove(java.lang.Object model, InterceptorContext ctx) throws InterceptorException
Description copied from interface:RemoveInterceptor
Called in themodelService.removeAll()
method.- Specified by:
onRemove
in 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. Thesubmodel
will be registered to it.parentModel
- this is the model which has the part-of attributesubModel
- the content of the part-of attribute from theparentModel
partOfAttrQualifier
- 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 theattrValue
content and calls for each foundItemModel
the 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)
-
-