Class DefaultSAPCustomerAddressConsistencyInterceptor
- java.lang.Object
-
- com.sap.hybris.sapcustomerb2b.inbound.DefaultSAPCustomerAddressConsistencyInterceptor
-
- All Implemented Interfaces:
Interceptor,PrepareInterceptor
- Direct Known Subclasses:
SapCpiB2BUnitAddressInterceptor
public class DefaultSAPCustomerAddressConsistencyInterceptor extends java.lang.Object implements PrepareInterceptor
PrepareInterceptor for the handling of SAP addresses insure that the address for all which are related to a SAP ERP Customer are in sync
-
-
Constructor Summary
Constructors Constructor Description DefaultSAPCustomerAddressConsistencyInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancompareAddress(AddressModel source, AddressModel target)Compares two addresses to determine is they are different based on selected fieldsprotected java.util.List<AddressModel>getRelatedAddresses(java.lang.String sapCustomerId)Retrieves addresses which are related to sapCustomerIdvoidonPrepare(java.lang.Object model, InterceptorContext context)Called in themodelService.saveAll()method.voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)protected voidupdateAddress(InterceptorContext context, AddressModel source, AddressModel target)Updates an address to match a source
-
-
-
Method Detail
-
onPrepare
public void onPrepare(java.lang.Object model, InterceptorContext context) throws InterceptorExceptionDescription copied from interface:PrepareInterceptorCalled in themodelService.saveAll()method. Prepares the values of the given model.- Specified by:
onPreparein interfacePrepareInterceptor- Parameters:
model- the model which values has to be preparedcontext- theInterceptorContext- Throws:
InterceptorException- if an error occured during the preparation
-
getRelatedAddresses
protected java.util.List<AddressModel> getRelatedAddresses(java.lang.String sapCustomerId)
Retrieves addresses which are related to sapCustomerId- Parameters:
sapCustomerId-- Returns:
-
updateAddress
protected void updateAddress(InterceptorContext context, AddressModel source, AddressModel target)
Updates an address to match a source- Parameters:
context-source- Source addresstarget- target (related) address
-
compareAddress
protected boolean compareAddress(AddressModel source, AddressModel target)
Compares two addresses to determine is they are different based on selected fields- Parameters:
source-target-- Returns:
- true if one or more fields are different, false is they are identical or it's the same PK
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
-