Class DefaultSapC4cCustomerInterceptor
- java.lang.Object
-
- com.sap.hybris.c4c.customer.interceptor.DefaultSapC4cCustomerInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<CustomerModel>
public class DefaultSapC4cCustomerInterceptor extends java.lang.Object implements ValidateInterceptor<CustomerModel>
Intercepts any changes in customer and creates customer update event if any replicated relavant fields are changed
-
-
Constructor Summary
Constructors Constructor Description DefaultSapC4cCustomerInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SapC4cCustomerUtilsgetCustomerUtil()EventServicegetEventService()voidonValidate(CustomerModel customerModel, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetCustomerUtil(SapC4cCustomerUtils customerUtil)voidsetEventService(EventService eventService)protected booleanshouldReplicate(CustomerModel customerModel, InterceptorContext ctx)Checks if any replicated relavant fields are modified and returns a boolean
-
-
-
Method Detail
-
onValidate
public void onValidate(CustomerModel customerModel, InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<CustomerModel>- Parameters:
customerModel- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
shouldReplicate
protected boolean shouldReplicate(CustomerModel customerModel, InterceptorContext ctx)
Checks if any replicated relavant fields are modified and returns a boolean
-
getEventService
public EventService getEventService()
- Returns:
- the eventService
-
setEventService
public void setEventService(EventService eventService)
- Parameters:
eventService- the eventService to set
-
getCustomerUtil
public SapC4cCustomerUtils getCustomerUtil()
- Returns:
- the customerUtil
-
setCustomerUtil
public void setCustomerUtil(SapC4cCustomerUtils customerUtil)
- Parameters:
customerUtil- the customerUtil to set
-
-