Interceptors in SAP Commerce(Hybris)

Types of interceptors in Hybris

How can we disable Interceptors?

final Map<String, Object> params = ImmutableMap.of(InterceptorExecutionPolicy.DISABLED_INTERCEPTOR_BEANS,
ImmutableSet.of("B2BUnitModelValidateInterceptor"));

getSessionService().executeInLocalViewWithParams(params, new SessionExecutionBody()
{
@Override
public void executeWithoutResult()
{
getModelService().save(newUnit);
}
});jj
final Map<String, Object> params = ImmutableMap.of(InterceptorExecutionPolicy.DISABLED_INTERCEPTOR_TYPES,
ImmutableSet.of(InterceptorExecutionPolicy.InterceptorType.VALIDATE));

getSessionService().executeInLocalViewWithParams(params, new SessionExecutionBody()
{
@Override
public void executeWithoutResult()
{
getModelService().save(newUnit);
}
});jj

INSERT_UPDATE B2BUnit[disable.interceptor.types=validate];name[unique=true];uid
;Custom Retail;0001010512_1010_10_00
INSERT_UPDATE B2BUnit[disable.interceptor.beans='B2BUnitModelValidateInterceptor'];name[unique=true];uid
;Custom Retail;0001010512_1010_10_00

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store