Class ValidateSecurityAnswerServiceImpl

java.lang.Object
com.skava.service.impl.ValidateSecurityAnswerServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<UserCredentialsRequest,UsersResponse>, ValidateSecurityAnswerService

@Service @Transactional(noRollbackFor=java.lang.Exception.class) public class ValidateSecurityAnswerServiceImpl extends Object implements ValidateSecurityAnswerService
This service class implements ValidateSecurityAnswerService and handles the validate security answer service request, process it and save the details in DB. It also implements business logic required for validating security answers.
Author:
Infosys Equinox
  • Constructor Details

    • ValidateSecurityAnswerServiceImpl

      public ValidateSecurityAnswerServiceImpl()
      Default Constructor.
  • Method Details

    • process

      @SendEvent(eventType="userservice/securityquestion/create", identifier="response_users.id") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public UsersResponse process(@Valid @Valid UserCredentialsRequest request)
      This method will validate the user security question and answer from Database and user provided. Once after validating the user security questions, the users password will be reseted.
      Specified by:
      process in interface com.skava.core.EcommService<UserCredentialsRequest,UsersResponse>
      Parameters:
      request - Holds UserCredentialsRequest which is used to update the user password by validating the security questions and answers.
      Returns:
      The UsersResponse which returns the success response code and message and if anythings fails, throws an validate exception.
    • getValidator

      public List<com.skava.core.validation.ValidatorComponent> getValidator()
      This method is used to get the respective validator class for this validate security answer service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<UserCredentialsRequest,UsersResponse>
      Returns:
      The list of ValidatorComponent
    • methodFallback

      public UsersResponse methodFallback(UserCredentialsRequest request)
      Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly.
      Parameters:
      request - Holds UserCredentialsRequest object.
      Returns:
      The UsersResponse object.