Package com.skava.service.impl
Class GetAddressServiceImpl
java.lang.Object
com.skava.service.impl.GetAddressServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<UserAddressRequest,
,AddressesResponse> GetAddressService
@Service
@Transactional
public class GetAddressServiceImpl
extends Object
implements GetAddressService
This service class implements GetAddressService and handles the get address service request, process it and
save the details in DB. It also implements business logic required to retrieve address entity for a user.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.skava.core.validation.ValidatorComponent>
This method is used to get the respective validator class for this get address service.methodFallback
(UserAddressRequest request) Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly.process
(UserAddressRequest request) This method is used to load the address for the registered user.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
-
GetAddressServiceImpl
public GetAddressServiceImpl()Default Constructor.
-
-
Method Details
-
getValidator
This method is used to get the respective validator class for this get address service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<UserAddressRequest,
AddressesResponse> - Returns:
- The list of
ValidatorComponent
object.
-
process
@HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public AddressesResponse process(UserAddressRequest request) This method is used to load the address for the registered user. Only one address can be loaded at a time.- Specified by:
process
in interfacecom.skava.core.EcommService<UserAddressRequest,
AddressesResponse> - Parameters:
request
- HoldsUserAddressRequest
object which holds user address request for loading the address for an user.- Returns:
- The
UserResponse
object which returns the success response code and message and if any validations fails, throws an validate exception.
-
methodFallback
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
- HoldsUserAddressRequest
object which is used in circuit breaker.- Returns:
- The
UsersResponse
object which returns while circuit breaker.
-