Class UserManagementService

java.lang.Object
es.kukenan.smartfi.microservice.communication.service.UserManagementService

@Service public class UserManagementService extends Object
This service provides method to manage local users.
  • Field Details

    • log

      private final es.kukenan.smartfi.logger.WalletLogger log
      Kukenbank logger.
    • appName

      @Value("${spring.application.name}") private String appName
      Spring application name.
    • whiteListDestinationRepository

      @Autowired private WhiteListDestinationRepository whiteListDestinationRepository
      Users repository.
    • usersRepository

      @Autowired private UsersRepository usersRepository
      Users repository.
    • contextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManager
      Kukenbank request context manager.
    • messagingController

      @Autowired private MessagingController messagingController
      AMQP controller.
    • kafkaController

      @Autowired private KafkaController kafkaController
      Kafka Controller.
  • Constructor Details

    • UserManagementService

      public UserManagementService()
  • Method Details

    • findUser

      public User findUser(String userId)
      Find the user with the given identifier.
      Parameters:
      userId - the user identifier.
      Returns:
      the user entity if found, null if not found.
    • createUser

      public void createUser(User user, es.kukenan.smartfi.microservice.clients.events.created.UserCreatedEvent userCreatedEvent)
      Create the given user.
      Parameters:
      user - the user entity.
      userCreatedEvent - if the user is created due the given event.
    • handlingInvalidUser

      private void handlingInvalidUser(String errMsg, User user, String msgId, String code)
      handling invalid user, sending user Creation Error event.
      Parameters:
      errMsg - error message.
      user - user information.
      msgId - message id.
      code - error code.
    • userDomainValidator

      private Set<javax.validation.ConstraintViolation<UserDomain>> userDomainValidator(UserDomain userDomain)
      handling invalid user, sending user Creation Error event.
      Parameters:
      userDomain - user Domain.
      Returns:
      set of errors.
    • updateUser

      public void updateUser(User user)
      Update the given user, that should exist.
      Parameters:
      user - the user entity.
    • publishUserCreationErrorEvent

      private void publishUserCreationErrorEvent(String userId, String sourceEventId, String errorCode, String errorDescription)
      Publish a user creation error event.
      Parameters:
      userId - the user whose creation has failed.
      sourceEventId - event received that caused the failure.
      errorCode - Error code.
      errorDescription - Error description.
    • updateUserSmsByEmail

      public void updateUserSmsByEmail(String userId, Boolean smsByEmail)
      Change sms by email for user.
      Parameters:
      userId - user identification.
      smsByEmail - activated/deactivated sms by email.
    • getSmsByEmail

      public es.kukenan.smartfi.microservice.communications.api.smsbyemail.SmsByEmailResponseDto getSmsByEmail(String userId)
      Get sms by email for user info.
      Parameters:
      userId - user identification.
      Returns:
      sms for email
    • checkUserIdForEmail

      private User checkUserIdForEmail(String userId)
    • saveWhiteListDestination

      private void saveWhiteListDestination(User user)
      Save user whitelist destination.
      Parameters:
      user - user information.