Class UserMergeUtil

java.lang.Object
com.skava.util.UserMergeUtil

public final class UserMergeUtil extends Object
This is a Utility class for User model which contains validator and helper methods used in merging the user details in this service.
Author:
Infosys Equinox
  • Method Details

    • mergeUserProperties

      public static UsersEntity mergeUserProperties(UsersEntity winner, UsersEntity fakeUser)
      This method is used to merge winner user with fakeuser and vice versa based on the given requests
      Parameters:
      winner - Holds UsersEntity object which contains winner user object used for user merge.
      fakeUser - Holds UsersEntity object which contains fake user object used for user merge.
      Returns:
      The UsersEntity object of the winner user.
    • triggerUserMergeEvent

      public static void triggerUserMergeEvent(com.skava.core.event.EventClientComponent eventClientComponent, UsersMergePayLoad userMergePayload, String routingKey, Collection collection, UserEventCommonPayLoad userEventCommonPayLoad)
      This method is used to trigger an user merge event.
      Parameters:
      eventClientComponent - Holds EventClientComponent object which is used trigger an event to topic.
      userMergePayload - Holds UsersEventPayLoad object which contains payload details.
      routingKey - Indicates the routing key of the event triggered.
      collection - Holds Collection object which is used to get collection id and business id for events.
      userEventCommonPayLoad - Holds UserEventCommonPayLoad object used to get store id and locale value.
    • mergeUsers

      public static UsersEntity mergeUsers(UsersEntity winner, UsersEntity fakeUser, com.skava.core.event.EventClientComponent eventClientComponent, Collection collection, UserCommonServices userCommonServices, UserEventCommonPayLoad userEventCommonPayLoad)
      This method is used to merge fake user and winner user and trigger an usr event for this user merge.
      Parameters:
      winner - Indicates the winner user used for merging and triggering event.
      fakeUser - Indicates the fake user used for merging and triggering event.
      eventClientComponent - Holds EventClientComponent object which is used to publish messages.
      collection - Indicates the collection object for events headers which is passed to get business id and collection id.
      userCommonServices - Holds UserCommonServices object.
      userEventCommonPayLoad - Holds UserEventCommonPayLoad object to get storeid and locale.
      Returns:
      The winner UsersEntity object.