Class DefaultProfileTransactionService
- java.lang.Object
-
- com.hybris.yprofile.services.impl.DefaultProfileTransactionService
-
- All Implemented Interfaces:
ProfileTransactionService
public class DefaultProfileTransactionService extends java.lang.Object implements ProfileTransactionService
Implementation forProfileTransactionService. Communication service to send transactions to Profile
-
-
Constructor Summary
Constructors Constructor Description DefaultProfileTransactionService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ProfileClientgetClient()protected java.lang.StringgetConsentReference(OrderModel orderModel)protected static java.lang.StringgetDebugFlagValue(UserModel userModel)ProfileConfigurationServicegetProfileConfigurationService()Converter<ConsignmentModel,Order>getProfileConsignmentEventConverter()Converter<OrderModel,Order>getProfileOrderEventConverter()Converter<ReturnRequestModel,Order>getProfileReturnEventConverter()Converter<ChangeUIDEvent,UID>getProfileUIDConverter()Converter<UserModel,User>getProfileUserEventConverter()RetrieveRestClientStrategygetRetrieveRestClientStrategy()protected static booleanisValidConsentReference(java.lang.String consentReferenceId)protected static voidlogError(java.lang.Throwable error, java.lang.Object obj)protected static voidlogSuccess(java.util.Optional<com.hybris.charon.RawResponse> rawResponse, java.lang.Object obj, java.lang.String consentReferenceId)voidsendAddressDeletedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)Sends address deleted event to Profile.voidsendAddressSavedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)Sends address saved event to Profile.voidsendConsignmentEvent(ConsignmentModel consignmentModel)Send consignment to yprofile.voidsendLoginEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId)Send user login event to yprofile.protected voidsendOrder(java.lang.String consentReference, Order order, java.lang.String eventType, java.lang.String debugEnabled)voidsendPersonalDetailsChangedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)Sends personal details updated event to Profile.voidsendReturnOrderEvent(ReturnRequestModel returnRequestModel)Send return to yprofile.voidsendSubmitOrderEvent(OrderModel orderModel)Send order to yprofile.voidsendUidChangedEvent(ChangeUIDEvent event, java.lang.String consentReferenceId)Send changed UID event to yprofile.protected voidsendUserEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId, java.lang.String eventType)voidsendUserRegistrationEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId)Send user registration event to yprofile.voidsetProfileConfigurationService(ProfileConfigurationService profileConfigurationService)voidsetProfileConsignmentEventConverter(Converter<ConsignmentModel,Order> profileConsignmentEventConverter)voidsetProfileOrderEventConverter(Converter<OrderModel,Order> profileOrderEventConverter)voidsetProfileReturnEventConverter(Converter<ReturnRequestModel,Order> profileReturnEventConverter)voidsetProfileUIDConverter(Converter<ChangeUIDEvent,UID> profileUIDConverter)voidsetProfileUserEventConverter(Converter<UserModel,User> profileUserEventConverter)voidsetRetrieveRestClientStrategy(RetrieveRestClientStrategy retrieveRestClientStrategy)protected booleanshouldSendEvent(java.lang.String consentReference, java.lang.String baseSiteId)
-
-
-
Method Detail
-
sendSubmitOrderEvent
public void sendSubmitOrderEvent(OrderModel orderModel)
Send order to yprofile.- Specified by:
sendSubmitOrderEventin interfaceProfileTransactionService- Parameters:
orderModel- the order model
-
sendConsignmentEvent
public void sendConsignmentEvent(ConsignmentModel consignmentModel)
Send consignment to yprofile.- Specified by:
sendConsignmentEventin interfaceProfileTransactionService- Parameters:
consignmentModel- the consignment model
-
sendReturnOrderEvent
public void sendReturnOrderEvent(ReturnRequestModel returnRequestModel)
Send return to yprofile.- Specified by:
sendReturnOrderEventin interfaceProfileTransactionService- Parameters:
returnRequestModel- the return request
-
sendOrder
protected void sendOrder(java.lang.String consentReference, Order order, java.lang.String eventType, java.lang.String debugEnabled)
-
shouldSendEvent
protected boolean shouldSendEvent(java.lang.String consentReference, java.lang.String baseSiteId)
-
sendUserRegistrationEvent
public void sendUserRegistrationEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId)
Send user registration event to yprofile.- Specified by:
sendUserRegistrationEventin interfaceProfileTransactionService- Parameters:
userModel- the user modelconsentReferenceId- consent refrencesessionId- ec session idbaseSiteId- storefront name like 'electronics'
-
sendUidChangedEvent
public void sendUidChangedEvent(ChangeUIDEvent event, java.lang.String consentReferenceId)
Send changed UID event to yprofile.- Specified by:
sendUidChangedEventin interfaceProfileTransactionService- Parameters:
event- the changeUIDEvent. The populator knows how to extract the appropriate informationconsentReferenceId- consent refrence
-
sendAddressSavedEvent
public void sendAddressSavedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)
Sends address saved event to Profile.- Specified by:
sendAddressSavedEventin interfaceProfileTransactionService- Parameters:
userModel- the user modelconsentReferenceId- the consent referencebaseSiteId- site id from the event
-
sendAddressDeletedEvent
public void sendAddressDeletedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)
Sends address deleted event to Profile.- Specified by:
sendAddressDeletedEventin interfaceProfileTransactionService- Parameters:
userModel- the user modelconsentReferenceId- the consent referencebaseSiteId- site id from the event
-
sendPersonalDetailsChangedEvent
public void sendPersonalDetailsChangedEvent(UserModel userModel, java.lang.String baseSiteId, java.lang.String consentReferenceId)
Sends personal details updated event to Profile.- Specified by:
sendPersonalDetailsChangedEventin interfaceProfileTransactionService- Parameters:
userModel- the user modelconsentReferenceId- the consent referencebaseSiteId- site id from the event
-
sendLoginEvent
public void sendLoginEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId)
Send user login event to yprofile.- Specified by:
sendLoginEventin interfaceProfileTransactionService- Parameters:
userModel- the user modelconsentReferenceId- consent refrencesessionId- ec session idbaseSiteId- storefront name like 'electronics'
-
sendUserEvent
protected void sendUserEvent(UserModel userModel, java.lang.String consentReferenceId, java.lang.String sessionId, java.lang.String baseSiteId, java.lang.String eventType)
-
getDebugFlagValue
protected static java.lang.String getDebugFlagValue(UserModel userModel)
-
isValidConsentReference
protected static boolean isValidConsentReference(java.lang.String consentReferenceId)
-
logSuccess
protected static void logSuccess(java.util.Optional<com.hybris.charon.RawResponse> rawResponse, java.lang.Object obj, java.lang.String consentReferenceId)
-
logError
protected static void logError(java.lang.Throwable error, java.lang.Object obj)
-
getConsentReference
protected java.lang.String getConsentReference(OrderModel orderModel)
-
getClient
protected ProfileClient getClient()
-
getRetrieveRestClientStrategy
public RetrieveRestClientStrategy getRetrieveRestClientStrategy()
-
setRetrieveRestClientStrategy
public void setRetrieveRestClientStrategy(RetrieveRestClientStrategy retrieveRestClientStrategy)
-
getProfileConfigurationService
public ProfileConfigurationService getProfileConfigurationService()
-
setProfileConfigurationService
public void setProfileConfigurationService(ProfileConfigurationService profileConfigurationService)
-
getProfileOrderEventConverter
public Converter<OrderModel,Order> getProfileOrderEventConverter()
-
setProfileOrderEventConverter
public void setProfileOrderEventConverter(Converter<OrderModel,Order> profileOrderEventConverter)
-
getProfileConsignmentEventConverter
public Converter<ConsignmentModel,Order> getProfileConsignmentEventConverter()
-
setProfileConsignmentEventConverter
public void setProfileConsignmentEventConverter(Converter<ConsignmentModel,Order> profileConsignmentEventConverter)
-
getProfileReturnEventConverter
public Converter<ReturnRequestModel,Order> getProfileReturnEventConverter()
-
setProfileReturnEventConverter
public void setProfileReturnEventConverter(Converter<ReturnRequestModel,Order> profileReturnEventConverter)
-
setProfileUserEventConverter
public void setProfileUserEventConverter(Converter<UserModel,User> profileUserEventConverter)
-
getProfileUIDConverter
public Converter<ChangeUIDEvent,UID> getProfileUIDConverter()
-
setProfileUIDConverter
public void setProfileUIDConverter(Converter<ChangeUIDEvent,UID> profileUIDConverter)
-
-