Class CreateUserServiceImpl

java.lang.Object
com.skava.service.impl.CreateUserServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<UserRequest,UserCreateResponse>, CreateUserService

@Service @Transactional(propagation=REQUIRED, readOnly=false) public class CreateUserServiceImpl extends Object implements CreateUserService
This service class implements CreateUserService and handles the create user service request, process it and save the details in DB. It also implements business logic required to create user in a collection.
Author:
Infosys Equinox
  • Constructor Details

    • CreateUserServiceImpl

      public CreateUserServiceImpl()
      Default Constructor
  • Method Details

    • process

      @SendEvent(eventType="userservice/user/create", identifier="response_users.id") public UserCreateResponse process(@Valid @Valid UserRequest request)
      This method is used to create a new registered user or guest user. User is created based on the provided identity information and properties. User's identity are email and phone by default which are validated and uniqueness of the user is maintained within a collection. The user creation happens in two ways, one is direct user creation via registered process where use will be created in ACTIVE status. Another one is through invite user done by administrators where user will be created in NOT ACTIVATED status. User activation communication goes through email/phone, post successful validation user will be activated. Registered and Guest users are distinguished with the help of GUEST flag. Guest user will be created without having any profile information in the system with TYPE 2.
      Specified by:
      process in interface com.skava.core.EcommService<UserRequest,UserCreateResponse>
      Parameters:
      request - Holds UserRequest object for creating an register user or guest user.
      Returns:
      The UserCreateResponse object which returns the success response code and message and if any validations fails, throws an validate exception.
    • getValidator

      @ValidatorEvent(serviceName="customer", webhookName="userservice/validator/user", actionType="create") public List<com.skava.core.validation.ValidatorComponent> getValidator()
      This method is used to get the respective validator class for this create user service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<UserRequest,UserCreateResponse>
      Returns:
      The list of ValidatorComponent object.
    • checkMFAEnabledForUserCreate

      public UserCreateResponse checkMFAEnabledForUserCreate(UserRequest request, Collection collection, Users user, com.skava.core.event.EventClientComponent eventClientComponent, com.skava.core.auth.AuthTokenHandler authTokenHandler)
      This method is used to check whether MFA and merge enabled or not and send response based on the given request.
      Parameters:
      request - Holds UserRequest to get request.
      collection - Holds Collection to load collection properties from DB.
      user - Holds Users to load userid.
      eventClientComponent - Holds EventClientComponent to trigger an event for MFA login.
      authTokenHandler - Holds AuthTokenHandler to check auth token userid with authenticated user id.
      Returns:
      The UsersResponse response object.