Class UpdateConsentServiceImpl

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

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

    • UpdateConsentServiceImpl

      public UpdateConsentServiceImpl()
      Default Constructor
  • Method Details

    • process

      @SendEvent(eventType="userservice/consents/patch", identifier="response_consents.id") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public ConsentResponse process(ConsentRequest request)
      This method is used to update specific consent in the system. Consent is similar to user preferences, where user can opt in or opt out of certain things like Opt in for monthly news letter. This will accept a consent request model with modified/updated consent and on success validation save the changes in database respectively.
      Specified by:
      process in interface com.skava.core.EcommService<ConsentRequest,ConsentResponse>
      Parameters:
      request - Holds ConsentRequest holds the consent request which is used for updating a existing consent
      Returns:
      The ConsentResponse which returns the success response code and response message on successful updation 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 update consent service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<ConsentRequest,ConsentResponse>
      Returns:
      The list of ValidatorComponent
    • 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
      Returns:
      The ConsentResponse