Class GetUserServiceImpl

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

@Service @Transactional(propagation=REQUIRED, readOnly=true, noRollbackFor=java.lang.Exception.class) public class GetUserServiceImpl extends Object implements GetUserService
This service class implements GetUserService and handles the get user service request, process it and save the details in DB. It also implements business logic required to retrieve requested user.
Author:
Infosys Equinox
  • Constructor Details

    • GetUserServiceImpl

      public GetUserServiceImpl()
      Default Constructor .
  • Method Details

    • process

      @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public UsersResponse process(UserRequest request)
      This service is used to load a user profile information for the requested user in a particular collection. User Profile information includes personal information, address information, custom properties, credentials and identity information. Full or partial profile information can be loaded based on the fullProfile parameter.
      Specified by:
      process in interface com.skava.core.EcommService<UserRequest,UsersResponse>
      Parameters:
      request - Holds UserRequest object which is used for loading the user details from database.
      Returns:
      UsersResponse The UserResponse object which returns the success. response code and message on successful fetching of user details and if any validations 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 get user service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<UserRequest,UsersResponse>
      Returns:
      The list of ValidatorComponent object.
    • methodFallback

      public UsersResponse methodFallback(UserRequest request)
      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:
      request - Holds UserRequest object.
      Returns:
      The UsersResponse object.
    • checkPrivilege

      public void checkPrivilege(Users user, UserRequest request)
      Parameters:
      user - holds user details
      request - holds user request details