Package com.skava.service.impl
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPrivilege
(Users user, UserRequest request) List<com.skava.core.validation.ValidatorComponent>
This method is used to get the respective validator class for this get user service.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.process
(UserRequest request) This service is used to load a user profile information for the requested user in a particular collection.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
-
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 interfacecom.skava.core.EcommService<UserRequest,
UsersResponse> - Parameters:
request
- HoldsUserRequest
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
This method is used to get the respective validator class for this get user service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<UserRequest,
UsersResponse> - Returns:
- The list of
ValidatorComponent
object.
-
methodFallback
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
- HoldsUserRequest
object.- Returns:
- The
UsersResponse
object.
-
checkPrivilege
- Parameters:
user
- holds user detailsrequest
- holds user request details
-