Class DeleteUserServiceImpl

java.lang.Object
com.skava.service.impl.DeleteUserServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<UserRequest,UsersResponse>, DeleteUserService

@Service @Transactional(propagation=REQUIRED, readOnly=false) public class DeleteUserServiceImpl extends Object implements DeleteUserService
This service class implements DeactivateUserService and handles the deactivate user service request, process it and save the details in DB. It also implements business logic required to deactivate user.
Author:
Infosys Equinox
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    List<com.skava.core.validation.ValidatorComponent>
    This method is used to get the respective validator class for this delete user service.
    Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly - Method fallback.
    This method is used to deactivate the requested user whose status will be changed to INACTIVE.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.skava.core.EcommService

    getValidateException, getValidator
  • Constructor Details

    • DeleteUserServiceImpl

      public DeleteUserServiceImpl()
      Default Constructor
  • Method Details

    • getValidator

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

      @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) @SendEvent(eventType="userservice/user/delete", identifier="request_id") public UsersResponse process(UserRequest request)
      This method is used to deactivate the requested user whose status will be changed to INACTIVE. Deactivated user cannot login to the system and cannot do any other actions.
      Specified by:
      process in interface com.skava.core.EcommService<UserRequest,UsersResponse>
      Parameters:
      request - Holds UserRequest object which is used for deactivating the user.
      Returns:
      The UsersResponse object which returns the success response code and message on successful deactivation and if any validations fails, throws an validate exception.
    • methodFallback

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