Class DefaultSapC4cAddressInterceptor
- java.lang.Object
-
- com.sap.hybris.c4c.customer.interceptor.DefaultSapC4cAddressInterceptor
-
- All Implemented Interfaces:
Interceptor,RemoveInterceptor<AddressModel>,ValidateInterceptor<AddressModel>
public class DefaultSapC4cAddressInterceptor extends java.lang.Object implements ValidateInterceptor<AddressModel>, RemoveInterceptor<AddressModel>
Intercepts any changes in address and creates customer update event if any replicated relavant fields are changed
-
-
Constructor Summary
Constructors Constructor Description DefaultSapC4cAddressInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getAddressAttributeList()SapC4cCustomerUtilsgetCustomerUtil()EventServicegetEventService()voidonRemove(AddressModel addressModel, InterceptorContext ctx)Called in themodelService.removeAll()method.voidonValidate(AddressModel addressModel, InterceptorContext ctx)Called in themodelService.saveAll()method.voidsetAddressAttributeList(java.util.List<java.lang.String> addressAttributeList)voidsetCustomerUtil(SapC4cCustomerUtils customerUtil)voidsetEventService(EventService eventService)protected booleanshouldReplicate(AddressModel addressModel, InterceptorContext ctx)Checks if any replicated relevant fields are modified and returns a boolean
-
-
-
Method Detail
-
onValidate
public void onValidate(AddressModel addressModel, InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<AddressModel>- Parameters:
addressModel- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
onRemove
public void onRemove(AddressModel addressModel, InterceptorContext ctx) throws InterceptorException
Description copied from interface:RemoveInterceptorCalled in themodelService.removeAll()method.- Specified by:
onRemovein interfaceRemoveInterceptor<AddressModel>- Parameters:
addressModel- the model which should be removedctx- theInterceptorContext- Throws:
InterceptorException- if the remove reports an error
-
shouldReplicate
protected boolean shouldReplicate(AddressModel addressModel, InterceptorContext ctx)
Checks if any replicated relevant 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
-
getAddressAttributeList
public java.util.List<java.lang.String> getAddressAttributeList()
- Returns:
- list of address attributes
-
setAddressAttributeList
public void setAddressAttributeList(java.util.List<java.lang.String> addressAttributeList)
- Parameters:
addressAttributeList- list of address attributes
-
-