Class GetConsentServiceImpl

java.lang.Object
com.skava.service.impl.GetConsentServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<ConsentRequest,ConsentResponse>, GetConsentService

@Service @Transactional public class GetConsentServiceImpl extends Object implements GetConsentService
This service class implements GetConsentService and handles the get consent service request, process it and save the details in DB. It also implements business logic required to retrieve requested consent.
Author:
Infosys Equinox
  • Constructor Details

    • GetConsentServiceImpl

      public GetConsentServiceImpl()
      Default Constructor
  • Method Details

    • process

      @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public ConsentResponse process(ConsentRequest request)
      This service is used to load the consent based on the given consent identifier. Consent is similar to user preferences, where user can opt in or opt out of certain things like, Opt in for monthly news letter
      Specified by:
      process in interface com.skava.core.EcommService<ConsentRequest,ConsentResponse>
      Parameters:
      request - Holds ConsentRequest object which holds consent request for loading a particular consent.
      Returns:
      The ConsentResponse object which returns the success response code and response message on successful creation 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 consent service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<ConsentRequest,ConsentResponse>
      Returns:
      The list of ValidatorComponent object.
    • methodFallback

      public ConsentResponse methodFallback(ConsentRequest 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 ConsentRequest object.
      Returns:
      The ConsentResponse object.