Package com.skava.service.impl
Class CreateUserConsentServiceImpl
java.lang.Object
com.skava.service.impl.CreateUserConsentServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<UserConsentRequest,
,UserConsentCreateResponse> CreateUserConsentService
@Service
@Transactional
public class CreateUserConsentServiceImpl
extends Object
implements CreateUserConsentService
This service class implements CreateUserConsentService and handles the create user consent service request,
process it and save the details in DB. It also implements business logic required to create user consent 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 create user consent service.methodFallback
(UserConsentRequest 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.process
(UserConsentRequest request) This method is used to create a user consent which are captured for a 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
-
CreateUserConsentServiceImpl
public CreateUserConsentServiceImpl()Default Constructor
-
-
Method Details
-
process
@SendEvent(eventType="userservice/userconsent/create", identifier="response_createdUserConsent.id") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public UserConsentCreateResponse process(UserConsentRequest request) This method is used to create a user consent which are captured for a user. Consent is similar to user preferences, where user can opt in or opt out of certain things like , Opt in for monthly news letter, News subscription,etc. User Consent will have the consent information and the user identifier who have captured that consent.- Specified by:
process
in interfacecom.skava.core.EcommService<UserConsentRequest,
UserConsentCreateResponse> - Parameters:
request
- HoldsUserConsentRequest
object for creating an user consent.- Returns:
- The
UserConsentCreateResponse
object which returns the success response code and message on successful creation.
-
getValidator
This method is used to get the respective validator class for this create user consent service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<UserConsentRequest,
UserConsentCreateResponse> - Returns:
- The list of
ValidatorComponent
object.
-
methodFallback
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
- HoldsUserConsentRequest
object.- Returns:
- The
UserConsentCreateResponse
object.
-