Class GetAllAddressesServiceImpl

java.lang.Object
com.skava.service.impl.GetAllAddressesServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<UserAddressRequest,AddressesResponse>, GetAllAddressesService

@Service @Transactional public class GetAllAddressesServiceImpl extends Object implements GetAllAddressesService
This service class implements GetAllAddressesService and handles the get all address service request, process it and save the details in DB. It also implements business logic required to retrieve all addresses for a user.
Author:
Infosys Equinox
  • Constructor Details

    • GetAllAddressesServiceImpl

      public GetAllAddressesServiceImpl()
      Default Constructor.
  • Method Details

    • 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 all the address for the registered user.
      Specified by:
      process in interface com.skava.core.EcommService<UserAddressRequest,AddressesResponse>
      Parameters:
      request - Holds UserAddressRequest object which holds user address request for loading all the address.
      Returns:
      The AddressesResponse object which returns the success response code and message and if any validations fails, throws an validate exception.
    • getSearchQueryCondition

      public jakarta.persistence.criteria.Predicate getSearchQueryCondition(List<SearchCriteria> params, jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Predicate searchPredicate, jakarta.persistence.criteria.Root<AddressesEntity> root, String locale)
      This method used to get search query condition
      Parameters:
      params - Holds the List of SearchCriteria object which contains the list of search criteria objects.
      builder - Holds CriteriaBuilder object used to form predicate.
      searchPredicate - Holds Predicate object used to filter
      root - Holds Root of UsersEntity object which contains query for root entity.
      locale - the locale
      Returns:
      The Predicate which returns predicate object.
    • methodFallback

      public AddressesResponse methodFallback(UserAddressRequest 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 UserAddressRequest object.
      Returns:
      The UsersResponse object.
    • getValidator

      public List<com.skava.core.validation.ValidatorComponent> getValidator()
      This method is used to get the respective validator class for this get all address service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<UserAddressRequest,AddressesResponse>
      Returns:
      The list of ValidatorComponent object.