Class DeleteAddressServiceImpl

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

@Service @Transactional(propagation=REQUIRED, readOnly=false) public class DeleteAddressServiceImpl extends Object implements DeleteAddressService
This service class implements DeleteAddressService and handles the delete address service request, process it and save the details in DB. It also implements business logic required to delete a user address.
Author:
Infosys Equinox
  • Constructor Details

    • DeleteAddressServiceImpl

      public DeleteAddressServiceImpl()
      Default Constructor
  • Method Details

    • process

      @SendEvent(eventType="userservice/address/delete", identifier="request_userId") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public AddressesResponse process(UserAddressRequest request)
      This method is used to delete an address for registered user. Only one address can be deleted at a time
      Specified by:
      process in interface com.skava.core.EcommService<UserAddressRequest,AddressesResponse>
      Parameters:
      request - Holds UserAddressRequest object which holds user address request for deleting an address for an user.
      Returns:
      The UsersResponse object which returns the success response code and message 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 delete address service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<UserAddressRequest,AddressesResponse>
      Returns:
      The list of ValidatorComponent 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.